Compare commits
10 Commits
7bab05fb24
...
v0.1.6
| Author | SHA1 | Date | |
|---|---|---|---|
| 367402e777 | |||
| f59f0f19c8 | |||
| 44338d1502 | |||
| d9885a2d17 | |||
| 8dd8ccd5f7 | |||
| d3407057f2 | |||
| 0386b615b1 | |||
| ea84777b97 | |||
| 3bcf995c10 | |||
| 202562878a |
@@ -0,0 +1,34 @@
|
|||||||
|
name: Build APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: cimg/android:2024.01
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Grant execute permission
|
||||||
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
run: ./gradlew assembleRelease
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: app-release
|
||||||
|
path: app/build/outputs/apk/release/app-release.apk
|
||||||
|
|
||||||
|
- name: Upload APK
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: app-release
|
||||||
|
path: app/build/outputs/apk/release/app-release.apk
|
||||||
@@ -25,6 +25,6 @@ jobs:
|
|||||||
server: ${{ secrets.FTP_HOST }}
|
server: ${{ secrets.FTP_HOST }}
|
||||||
username: ${{ secrets.FTP_USER }}
|
username: ${{ secrets.FTP_USER }}
|
||||||
password: ${{ secrets.FTP_PASS }}
|
password: ${{ secrets.FTP_PASS }}
|
||||||
local-dir: ./
|
local-dir: app/src/main/assets/
|
||||||
server-dir: /
|
server-dir: /
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.example.app
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.webkit.WebView
|
||||||
|
import android.webkit.WebViewClient
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
|
||||||
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
val webView = WebView(this)
|
||||||
|
|
||||||
|
webView.settings.javaScriptEnabled = true
|
||||||
|
webView.settings.allowFileAccess = true
|
||||||
|
webView.settings.domStorageEnabled = true
|
||||||
|
|
||||||
|
webView.webViewClient = WebViewClient()
|
||||||
|
|
||||||
|
webView.loadUrl("file:///android_asset/index.html")
|
||||||
|
|
||||||
|
setContentView(webView)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -265,7 +265,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.progress-bar {
|
.progress-bar {
|
||||||
width: 120px;
|
width: 100%;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
background-color: #e2e8f0;
|
background-color: #e2e8f0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@@ -55,7 +55,7 @@ const statusEl = document.getElementById('status');
|
|||||||
// load settings from localStorage
|
// load settings from localStorage
|
||||||
function loadSettings(){
|
function loadSettings(){
|
||||||
try{
|
try{
|
||||||
const raw = localStorage.getItem('matma:settings')
|
let progressInner = null
|
||||||
if (raw) {
|
if (raw) {
|
||||||
const s = JSON.parse(raw)
|
const s = JSON.parse(raw)
|
||||||
state.settings = Object.assign(state.settings, s)
|
state.settings = Object.assign(state.settings, s)
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
const readViewport = document.getElementById('read-viewport')
|
const readViewport = document.getElementById('read-viewport')
|
||||||
const readTextEl = document.getElementById('read-text')
|
const readTextEl = document.getElementById('read-text')
|
||||||
const nextLineBtn = document.getElementById('next-line-btn')
|
const nextLineBtn = document.getElementById('next-line-btn')
|
||||||
const progressBar = document.getElementById('read-progress-bar-inner')
|
let progressBar = null
|
||||||
|
|
||||||
// ── Load text list from dyktanda.json ────────────────────────────────────
|
// ── Load text list from dyktanda.json ────────────────────────────────────
|
||||||
fetch('json/dyktanda.json')
|
fetch('json/dyktanda.json')
|
||||||
@@ -132,6 +132,7 @@
|
|||||||
|
|
||||||
function updateProgressBar() {
|
function updateProgressBar() {
|
||||||
const progress = maxOffset > 0 ? (yOffset / maxOffset) * 100 : 100
|
const progress = maxOffset > 0 ? (yOffset / maxOffset) * 100 : 100
|
||||||
progressBar.style.width = `${progress}%`
|
if (!progressBar) progressBar = document.getElementById('read-progress-bar-inner')
|
||||||
|
if (progressBar) progressBar.style.width = `${progress}%`
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
const summaryScore = document.getElementById('summary-score')
|
const summaryScore = document.getElementById('summary-score')
|
||||||
const summaryBackBtn = document.getElementById('summary-back-btn')
|
const summaryBackBtn = document.getElementById('summary-back-btn')
|
||||||
const dykScroll = document.getElementById('dyk-scroll')
|
const dykScroll = document.getElementById('dyk-scroll')
|
||||||
const progressBar = document.getElementById('dyk-progress-bar-inner')
|
let progressBar = null
|
||||||
|
|
||||||
// ── Load texts ────────────────────────────────────────────────────────────
|
// ── Load texts ────────────────────────────────────────────────────────────
|
||||||
fetch('json/dyktanda.json')
|
fetch('json/dyktanda.json')
|
||||||
@@ -53,6 +53,20 @@
|
|||||||
textList.innerHTML = '<p style="color:var(--muted)">Nie udało się wczytać tekstów.</p>'
|
textList.innerHTML = '<p style="color:var(--muted)">Nie udało się wczytać tekstów.</p>'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Poczekaj na dynamiczne załadowanie progress bara
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
// progress bar jest ładowany przez loadComponent w dyktando.html
|
||||||
|
const checkProgressBar = () => {
|
||||||
|
const el = document.getElementById('dyk-progress-bar-inner')
|
||||||
|
if (el) {
|
||||||
|
progressBar = el
|
||||||
|
} else {
|
||||||
|
setTimeout(checkProgressBar, 50)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkProgressBar()
|
||||||
|
})
|
||||||
|
|
||||||
customStartBtn.addEventListener('click', () => {
|
customStartBtn.addEventListener('click', () => {
|
||||||
const txt = customInput.value.trim()
|
const txt = customInput.value.trim()
|
||||||
if (!txt) return
|
if (!txt) return
|
||||||
@@ -98,7 +112,7 @@
|
|||||||
textDisplay.classList.remove('hidden')
|
textDisplay.classList.remove('hidden')
|
||||||
choicesEl.classList.remove('hidden')
|
choicesEl.classList.remove('hidden')
|
||||||
progressEl.textContent = ''
|
progressEl.textContent = ''
|
||||||
progressBar.style.width = '0%'
|
if (progressBar) progressBar.style.width = '0%'
|
||||||
|
|
||||||
listWrap.classList.add('hidden')
|
listWrap.classList.add('hidden')
|
||||||
playWrap.classList.remove('hidden')
|
playWrap.classList.remove('hidden')
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
const problemEl = document.getElementById('problem')
|
const problemEl = document.getElementById('problem')
|
||||||
const answerEl = document.getElementById('answer')
|
const answerEl = document.getElementById('answer')
|
||||||
const feedbackEl = document.getElementById('feedback')
|
const feedbackEl = document.getElementById('feedback')
|
||||||
const progressInner = document.getElementById('progress-inner')
|
let progressInner = null
|
||||||
const progressLabel = document.getElementById('progress-label')
|
const progressLabel = document.getElementById('progress-label')
|
||||||
const summaryText = document.getElementById('summary-text')
|
const summaryText = document.getElementById('summary-text')
|
||||||
const totalInput = document.getElementById('total-input')
|
const totalInput = document.getElementById('total-input')
|
||||||
@@ -99,7 +99,10 @@
|
|||||||
|
|
||||||
function updateBar() {
|
function updateBar() {
|
||||||
const pct = st.total > 0 ? Math.round((st.solved / st.total) * 100) : 0
|
const pct = st.total > 0 ? Math.round((st.solved / st.total) * 100) : 0
|
||||||
progressInner.style.width = pct + '%'
|
if (!progressInner) {
|
||||||
|
progressInner = document.getElementById('progress-inner')
|
||||||
|
}
|
||||||
|
if (progressInner) progressInner.style.width = pct + '%'
|
||||||
progressLabel.textContent = `${st.solved}/${st.total}`
|
progressLabel.textContent = `${st.solved}/${st.total}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
const problemEl = document.getElementById('problem')
|
const problemEl = document.getElementById('problem')
|
||||||
const answerEl = document.getElementById('answer')
|
const answerEl = document.getElementById('answer')
|
||||||
const feedbackEl = document.getElementById('feedback')
|
const feedbackEl = document.getElementById('feedback')
|
||||||
const progressInner = document.getElementById('progress-inner')
|
let progressInner = null
|
||||||
const progressLabel = document.getElementById('progress-label')
|
const progressLabel = document.getElementById('progress-label')
|
||||||
const scoreLabel = document.getElementById('score-label') // This element is removed, but we might re-purpose the logic
|
const scoreLabel = document.getElementById('score-label') // This element is removed, but we might re-purpose the logic
|
||||||
const summaryText = document.getElementById('summary-text')
|
const summaryText = document.getElementById('summary-text')
|
||||||
@@ -99,7 +99,8 @@
|
|||||||
|
|
||||||
function updateBar() {
|
function updateBar() {
|
||||||
const pct = st.total > 0 ? Math.round((st.solved / st.total) * 100) : 0
|
const pct = st.total > 0 ? Math.round((st.solved / st.total) * 100) : 0
|
||||||
progressInner.style.width = pct + '%'
|
if (!progressInner) progressInner = document.getElementById('progress-inner')
|
||||||
|
if (progressInner) progressInner.style.width = pct + '%'
|
||||||
progressLabel.textContent = `${st.solved}/${st.total}`
|
progressLabel.textContent = `${st.solved}/${st.total}`
|
||||||
// scoreLabel is removed, so we comment this out
|
// scoreLabel is removed, so we comment this out
|
||||||
// scoreLabel.textContent = `✔ ${st.score}`
|
// scoreLabel.textContent = `✔ ${st.score}`
|
||||||
Reference in New Issue
Block a user