Compare commits
11 Commits
v0.1.11
...
v0.2.3-test7
| Author | SHA1 | Date | |
|---|---|---|---|
| 1385b3ace0 | |||
| 66a028880c | |||
| 365b12b0eb | |||
| 5ef6747e4d | |||
| 7ce23309f6 | |||
| 6c4b5f4adf | |||
| b8b7b3860b | |||
| 35b19cf140 | |||
| 0b3c8e8a02 | |||
| d890c6e15d | |||
| ccbb3549d1 |
@@ -30,14 +30,101 @@ jobs:
|
||||
- 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: Locate APK
|
||||
id: locate_apk
|
||||
run: |
|
||||
set -e
|
||||
APK_PATH=$(ls app/build/outputs/apk/release/*.apk | head -n1 || true)
|
||||
if [ -z "$APK_PATH" ]; then
|
||||
echo "No APK found in app/build/outputs/apk/release" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
|
||||
echo "Found $APK_PATH"
|
||||
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: app-release
|
||||
path: app/build/outputs/apk/release/app-release.apk
|
||||
# Note: uploading artifacts with actions/upload-artifact@v4 is not supported
|
||||
# on some self-hosted/enterprise runners (GHES). We skip storing artifacts
|
||||
# via that action and instead upload the APK directly to the Gitea release
|
||||
# in the steps below.
|
||||
|
||||
- name: Create Gitea release
|
||||
id: create_release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
GITEA_SERVER: ${{ secrets.GIT_SERVER }}
|
||||
run: |
|
||||
set -e
|
||||
|
||||
API_BASE="${GITEA_SERVER}/api/v1"
|
||||
|
||||
REMOTE_URL=$(git config --get remote.origin.url)
|
||||
echo "Remote URL: $REMOTE_URL"
|
||||
|
||||
REPO_FULL=$(echo "$REMOTE_URL" \
|
||||
| sed -E 's#https?://[^/]+/##' \
|
||||
| sed 's/\.git$//')
|
||||
|
||||
OWNER=$(echo "$REPO_FULL" | cut -d/ -f1)
|
||||
REPO_NAME=$(echo "$REPO_FULL" | cut -d/ -f2)
|
||||
|
||||
echo "OWNER=$OWNER"
|
||||
echo "REPO_NAME=$REPO_NAME"
|
||||
|
||||
TAG="${GITEA_REF_NAME}"
|
||||
|
||||
echo "Creating release $TAG for $OWNER/$REPO_NAME"
|
||||
|
||||
CREATE_RESPONSE=$(curl -s \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-X POST \
|
||||
-d "{
|
||||
\"tag_name\": \"$TAG\",
|
||||
\"name\": \"$TAG\",
|
||||
\"body\": \"Automated release for $TAG\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}" \
|
||||
"$API_BASE/repos/$OWNER/$REPO_NAME/releases")
|
||||
|
||||
echo "$CREATE_RESPONSE"
|
||||
|
||||
RELEASE_ID=$(echo "$CREATE_RESPONSE" \
|
||||
| grep -o '"id":[0-9]*' \
|
||||
| head -n1 \
|
||||
| cut -d: -f2)
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "RELEASE_ID=$RELEASE_ID" >> $GITEA_ENV
|
||||
- name: Upload APK to Gitea release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
GITEA_SERVER: ${{ secrets.GIT_SERVER }}
|
||||
run: |
|
||||
set -e
|
||||
API_BASE=${GITEA_SERVER:+$GITEA_SERVER/api/v1}
|
||||
API_BASE=${API_BASE:-https://gitea.com/api/v1}
|
||||
REMOTE_URL=$(git config --get remote.origin.url || true)
|
||||
REPO_FULL=$(echo "$REMOTE_URL" | sed -E 's#.*[:/](.+/.+)\.git$#\1#')
|
||||
OWNER=$(echo "$REPO_FULL" | cut -d/ -f1)
|
||||
REPO_NAME=$(echo "$REPO_FULL" | cut -d/ -f2)
|
||||
APK_PATH=${APK_PATH:-$APK_PATH}
|
||||
if [ -z "$APK_PATH" ]; then
|
||||
echo "APK_PATH not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
RELEASE_ID=${RELEASE_ID}
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "RELEASE_ID not set" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
UPLOAD_URL="$API_BASE/repos/$OWNER/$REPO_NAME/releases/$RELEASE_ID/assets?name=$(basename $APK_PATH)"
|
||||
echo "Uploading $APK_PATH to $UPLOAD_URL"
|
||||
|
||||
curl --fail -H "Authorization: token $GITEA_TOKEN" -H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"$APK_PATH" "$UPLOAD_URL"
|
||||
|
||||
+36
-1
@@ -1,3 +1,38 @@
|
||||
.DS_Store
|
||||
./QuizzyTemplate
|
||||
./QuizzyTemplate/*
|
||||
/.QuizzyTemplate
|
||||
|
||||
# Android/Gradle
|
||||
/.gradle/
|
||||
/build/
|
||||
/app/build/
|
||||
/**/build/
|
||||
|
||||
# Gradle wrapper
|
||||
/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Local configuration
|
||||
/local.properties
|
||||
|
||||
# Keystore
|
||||
*.jks
|
||||
|
||||
# Generated APKs/outputs
|
||||
**/outputs/
|
||||
**/apk/**
|
||||
*.apk
|
||||
*.ap_
|
||||
|
||||
# IntelliJ / Android Studio
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
|
||||
# NPM / Node
|
||||
node_modules/
|
||||
|
||||
# Misc
|
||||
*.log
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Generated
+65
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="NONE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="51538617-7e5b-4e71-9f47-7bda274cf4cc" name="Changes" comment="" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ClangdSettings">
|
||||
<option name="formatViaClangd" value="false" />
|
||||
</component>
|
||||
<component name="ExternalProjectsManager">
|
||||
<system id="GRADLE">
|
||||
<state>
|
||||
<projects_view>
|
||||
<tree_state>
|
||||
<expand />
|
||||
<select />
|
||||
</tree_state>
|
||||
</projects_view>
|
||||
</state>
|
||||
</system>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 2,
|
||||
"fromUser": false
|
||||
}</component>
|
||||
<component name="ProjectId" id="3EHNE822z12n2x6rUf57MsHEkbE" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"RunOnceActivity.readMode.enableVisualFormatting": "true",
|
||||
"android.gradle.sync.needed": "true",
|
||||
"cf.first.check.clang-format": "false",
|
||||
"cidr.known.project.marker": "true",
|
||||
"git-widget-placeholder": "master",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "/Users/aln/Work/Matma"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="51538617-7e5b-4e71-9f47-7bda274cf4cc" name="Changes" comment="" />
|
||||
<created>1779831422173</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1779831422173</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
||||
+16
-3
@@ -1,9 +1,12 @@
|
||||
package com.example.app
|
||||
|
||||
import android.os.Bundle
|
||||
import android.webkit.WebResourceRequest
|
||||
import android.webkit.WebResourceResponse
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebViewClient
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.webkit.WebViewAssetLoader
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
@@ -13,12 +16,22 @@ class MainActivity : AppCompatActivity() {
|
||||
val webView = WebView(this)
|
||||
|
||||
webView.settings.javaScriptEnabled = true
|
||||
webView.settings.allowFileAccess = true
|
||||
webView.settings.domStorageEnabled = true
|
||||
|
||||
webView.webViewClient = WebViewClient()
|
||||
// Use WebViewAssetLoader to serve files from /assets/ over a secure origin.
|
||||
val assetLoader = WebViewAssetLoader.Builder()
|
||||
.addPathHandler("/assets/", WebViewAssetLoader.AssetsPathHandler(this))
|
||||
.build()
|
||||
|
||||
webView.loadUrl("file:///android_asset/index.html")
|
||||
webView.webViewClient = object : WebViewClient() {
|
||||
override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? {
|
||||
if (request == null) return null
|
||||
return assetLoader.shouldInterceptRequest(request.url)
|
||||
}
|
||||
}
|
||||
|
||||
// Load the app via the mapped secure origin so fetch() requests are allowed
|
||||
webView.loadUrl("https://appassets.androidplatform.net/assets/index.html")
|
||||
|
||||
setContentView(webView)
|
||||
}
|
||||
|
||||
@@ -13,3 +13,33 @@ Pliki
|
||||
Jak uruchomić
|
||||
|
||||
Otwórz plik `index.html` w przeglądarce (najlepiej na urządzeniu mobilnym lub w trybie responsywnym).
|
||||
|
||||
Signing a release APK/AAB
|
||||
------------------------
|
||||
|
||||
Aby uniknąć ostrzeżeń "nieznany deweloper" lub instalatora na Androidzie, zbuduj podpisany pakiet APK lub AAB i zainstaluj go zamiast debugowego APK.
|
||||
|
||||
1. Utwórz magazyn kluczy (jeśli go nie masz):
|
||||
|
||||
```bash
|
||||
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my_key_alias
|
||||
```
|
||||
|
||||
2. Skopiuj `gradle.properties.example` do swojego osobistego pliku `~/.gradle/gradle.properties` i uzupełnij wartości (nie commituj prawdziwych haseł do kontroli wersji).
|
||||
|
||||
3. Zbuduj podpisany pakiet APK lub AAB:
|
||||
|
||||
```bash
|
||||
./gradlew assembleRelease # podpisany APK (jeśli podpisywanie jest skonfigurowane)
|
||||
./gradlew bundleRelease # AAB do Sklepu Play
|
||||
```
|
||||
|
||||
4. Zainstaluj APK za pomocą adb:
|
||||
|
||||
```bash
|
||||
adb install -r app/build/outputs/apk/release/app-release.apk
|
||||
```
|
||||
|
||||
Lub przesłać AAB do Google Play (testowanie wewnętrzne) — zalecane w celu najłatwiejszej dystrybucji.
|
||||
|
||||
Jeśli chcesz tylko przetestować lokalnie i zobaczyć ostrzeżenie "Nieznane źródła", możesz tymczasowo włączyć instalowanie z nieznanych źródeł na urządzeniu, ale dystrybucja podpisanego wydania jest bezpieczniejszym podejściem.
|
||||
|
||||
+32
-2
@@ -3,21 +3,50 @@ apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
namespace 'com.example.app'
|
||||
compileSdk 33
|
||||
compileSdk 34
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.example.app"
|
||||
minSdk 21
|
||||
targetSdk 33
|
||||
targetSdk 34
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
// Signing configuration for release builds.
|
||||
// Configure the following properties in either your
|
||||
// - ~/.gradle/gradle.properties (recommended for secrets), or
|
||||
// - <project root>/gradle.properties (do NOT commit passwords)
|
||||
//
|
||||
// Example properties:
|
||||
// MYAPP_STORE_FILE=keystores/my-release-key.jks
|
||||
// MYAPP_STORE_PASSWORD=your_store_password
|
||||
// MYAPP_KEY_ALIAS=my_key_alias
|
||||
// MYAPP_KEY_PASSWORD=your_key_password
|
||||
signingConfigs {
|
||||
release {
|
||||
// Only configure signing when the properties are provided.
|
||||
if (project.hasProperty('MYAPP_STORE_FILE')) {
|
||||
storeFile file(MYAPP_STORE_FILE)
|
||||
storePassword MYAPP_STORE_PASSWORD
|
||||
keyAlias MYAPP_KEY_ALIAS
|
||||
keyPassword MYAPP_KEY_PASSWORD
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
// Apply signing config if available. This keeps debug and CI builds
|
||||
// working even when signing properties are absent locally.
|
||||
if (project.hasProperty('MYAPP_STORE_FILE')) {
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
// Ensure release builds are not debuggable.
|
||||
debuggable false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,4 +64,5 @@ dependencies {
|
||||
implementation 'androidx.core:core-ktx:1.9.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.22"
|
||||
implementation 'androidx.webkit:webkit:1.8.0'
|
||||
}
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#- File Locator -
|
||||
listingFile=../../../outputs/apk/debug/output-metadata.json
|
||||
@@ -1,2 +0,0 @@
|
||||
#- File Locator -
|
||||
listingFile=../../../outputs/apk/release/output-metadata.json
|
||||
+23
-23
@@ -55,19 +55,19 @@ const statusEl = document.getElementById('status');
|
||||
// load settings from localStorage
|
||||
function loadSettings(){
|
||||
try{
|
||||
let progressInner = null
|
||||
const raw = (typeof localStorage !== 'undefined') ? localStorage.getItem('matma:settings') : null
|
||||
if (raw) {
|
||||
const s = JSON.parse(raw)
|
||||
state.settings = Object.assign(state.settings, s)
|
||||
}
|
||||
}catch(e){ console.warn('settings load failed', e) }
|
||||
// reflect to inputs
|
||||
settingTimed.value = state.settings.timedSeconds
|
||||
settingMaxResult.value = state.settings.maxResult
|
||||
settingMaxOperand.value = state.settings.maxOperand
|
||||
settingSessionProblems.value = state.settings.sessionProblems
|
||||
settingAllowNegative.checked = !!state.settings.allowNegative
|
||||
settingAllowFraction.checked = !!state.settings.allowFraction
|
||||
// reflect to inputs (guard in case some inputs are missing)
|
||||
if (settingTimed) settingTimed.value = state.settings.timedSeconds
|
||||
if (settingMaxResult) settingMaxResult.value = state.settings.maxResult
|
||||
if (settingMaxOperand) settingMaxOperand.value = state.settings.maxOperand
|
||||
if (settingSessionProblems) settingSessionProblems.value = state.settings.sessionProblems
|
||||
if (settingAllowNegative) settingAllowNegative.checked = !!state.settings.allowNegative
|
||||
if (settingAllowFraction) settingAllowFraction.checked = !!state.settings.allowFraction
|
||||
}
|
||||
|
||||
function saveSettings(){
|
||||
@@ -145,16 +145,16 @@ function startPlay(){
|
||||
renderProblem()
|
||||
|
||||
if (state.mode === 'timed'){
|
||||
progressInner.style.width = '0%'
|
||||
startTimer(state.settings.timedSeconds)
|
||||
statusEl.textContent = 'Na czas';
|
||||
timerEl.classList.remove('hidden');
|
||||
if (progressInner) progressInner.style.width = '0%'
|
||||
startTimer(state.settings.timedSeconds)
|
||||
if (statusEl) statusEl.textContent = 'Na czas';
|
||||
if (timerEl) timerEl.classList.remove('hidden');
|
||||
} else {
|
||||
progressInner.style.width = '0%'
|
||||
state.sessionSolved = 0
|
||||
state.sessionTarget = Math.max(1, state.settings.sessionProblems)
|
||||
updateProgress()
|
||||
timerEl.classList.add('hidden');
|
||||
if (progressInner) progressInner.style.width = '0%'
|
||||
state.sessionSolved = 0
|
||||
state.sessionTarget = Math.max(1, state.settings.sessionProblems)
|
||||
updateProgress()
|
||||
if (timerEl) timerEl.classList.add('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,14 +311,14 @@ backspaceBtn.addEventListener('click', ()=>{
|
||||
|
||||
function startTimer(seconds){
|
||||
state.timeLeft = seconds
|
||||
timerEl.textContent = state.timeLeft
|
||||
if (timerEl) timerEl.textContent = state.timeLeft
|
||||
|
||||
stopTimer();
|
||||
state.timerId = setInterval(()=>{
|
||||
state.timeLeft -= 1
|
||||
timerEl.textContent = state.timeLeft
|
||||
if (timerEl) timerEl.textContent = state.timeLeft
|
||||
const pct = Math.max(0, (state.timeLeft / seconds) * 100)
|
||||
progressInner.style.width = pct + '%'
|
||||
if (progressInner) progressInner.style.width = pct + '%'
|
||||
if (state.timeLeft <= 0) {
|
||||
stopTimer()
|
||||
endSession()
|
||||
@@ -357,9 +357,9 @@ summaryBack.addEventListener('click', ()=>{
|
||||
|
||||
function updateProgress(){
|
||||
if (state.mode === 'training'){
|
||||
const pct = Math.min(100, Math.round((state.sessionSolved/state.sessionTarget)*100))
|
||||
progressInner.style.width = pct + '%'
|
||||
statusEl.textContent = `${state.sessionSolved}/${state.sessionTarget}`
|
||||
const pct = Math.min(100, Math.round((state.sessionSolved/state.sessionTarget)*100))
|
||||
if (progressInner) progressInner.style.width = pct + '%'
|
||||
if (statusEl) statusEl.textContent = `${state.sessionSolved}/${state.sessionTarget}`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// Komponenty HTML loader
|
||||
function loadComponent(path, replaceMap = {}) {
|
||||
// If path is a full mapped origin used by WebViewAssetLoader, strip it to a relative path.
|
||||
const mappedOrigin = 'https://appassets.androidplatform.net/assets/';
|
||||
if (path.startsWith(mappedOrigin)) {
|
||||
path = path.slice(mappedOrigin.length);
|
||||
}
|
||||
|
||||
// If an absolute path starting with '/' is provided, remove leading slash to make it
|
||||
// relative to the current document (works under local http server and WebViewAssetLoader).
|
||||
if (path.startsWith('/')) path = path.slice(1);
|
||||
|
||||
return fetch(path)
|
||||
.then(r => {
|
||||
if (!r.ok) throw new Error('Failed to load component: ' + path);
|
||||
return r.text();
|
||||
})
|
||||
.then(html => {
|
||||
Object.entries(replaceMap).forEach(([key, val]) => {
|
||||
html = html.replaceAll(key, val);
|
||||
});
|
||||
return html;
|
||||
});
|
||||
}
|
||||
|
||||
// Przykład użycia:
|
||||
// loadComponent('components/header.html', {'{TITLE}': 'Tytuł', '{SUBTITLE}': 'Podtytuł'}).then(html => ...)
|
||||
+11
-7
@@ -52,11 +52,16 @@
|
||||
clearInterval(autoTimer)
|
||||
autoTimer = null
|
||||
|
||||
readTitleEl.textContent = title
|
||||
readTextEl.textContent = text
|
||||
readTextEl.style.transform = 'translateY(0)'
|
||||
speedBtn.textContent = SPEED_LABELS[0]
|
||||
progressBar.style.width = '0%'
|
||||
if (!readTitleEl || !readTextEl || !speedBtn || !readWrap || !listWrap) {
|
||||
console.warn('czytanie: missing DOM elements', { readTitleEl, readTextEl, speedBtn, readWrap, listWrap })
|
||||
}
|
||||
|
||||
if (readTitleEl) readTitleEl.textContent = title
|
||||
if (readTextEl) readTextEl.textContent = text
|
||||
if (readTextEl) readTextEl.style.transform = 'translateY(0)'
|
||||
if (speedBtn) speedBtn.textContent = SPEED_LABELS[0]
|
||||
if (!progressBar) progressBar = document.getElementById('read-progress-bar-inner')
|
||||
if (progressBar) progressBar.style.width = '0%'
|
||||
|
||||
listWrap.classList.add('hidden')
|
||||
readWrap.classList.remove('hidden')
|
||||
@@ -78,9 +83,8 @@
|
||||
}
|
||||
|
||||
// ── Back to list ──────────────────────────────────────────────────────────
|
||||
// Zakończ button: natychmiast wróć do listy bez potwierdzenia
|
||||
readBackBtn.addEventListener('click', () => {
|
||||
const active = yOffset > 0 || autoTimer !== null
|
||||
if (active && !confirm('Wrócić do listy tekstów?')) return
|
||||
clearInterval(autoTimer)
|
||||
autoTimer = null
|
||||
readWrap.classList.add('hidden')
|
||||
+1
-2
@@ -296,9 +296,8 @@
|
||||
}
|
||||
|
||||
// ── Navigation ────────────────────────────────────────────────────────────
|
||||
// Zakończ button: natychmiast wracamy do listy bez potwierdzenia
|
||||
playBackBtn.addEventListener('click', () => {
|
||||
const inProgress = blanks.length > 0 && current < blanks.length
|
||||
if (inProgress && !confirm('Przerwać dyktando i wrócić do listy?')) return
|
||||
goToList()
|
||||
})
|
||||
|
||||
+2
-1
@@ -136,7 +136,8 @@
|
||||
let sha = (window.COMMIT_SHA || '').toString().trim()
|
||||
if (!sha) {
|
||||
try {
|
||||
const res = await fetch('/version.sha', { cache: 'no-cache' })
|
||||
// use relative path so the request works under WebViewAssetLoader or a local server
|
||||
const res = await fetch('version.sha', { cache: 'no-cache' })
|
||||
if (res.ok) {
|
||||
const txt = await res.text()
|
||||
const first = txt.split(/\r?\n/).find(l => l.trim().length > 0)
|
||||
+2
-1
@@ -136,7 +136,8 @@
|
||||
let sha = (window.COMMIT_SHA || '').toString().trim()
|
||||
if (!sha) {
|
||||
try {
|
||||
const res = await fetch('/version.sha', { cache: 'no-cache' })
|
||||
// use relative path so the request works under WebViewAssetLoader or a local server
|
||||
const res = await fetch('version.sha', { cache: 'no-cache' })
|
||||
if (res.ok) {
|
||||
const txt = await res.text()
|
||||
const first = txt.split(/\r?\n/).find(l => l.trim().length > 0)
|
||||
@@ -0,0 +1,13 @@
|
||||
// Back-to-hub button with active-task confirmation
|
||||
(function () {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const backBtn = document.getElementById('back-to-hub')
|
||||
if (!backBtn) return
|
||||
|
||||
// Immediately navigate back to hub/menu without confirmation
|
||||
backBtn.addEventListener('click', (e) => {
|
||||
const href = backBtn.getAttribute('href')
|
||||
if (href) window.location.href = href
|
||||
})
|
||||
})
|
||||
})()
|
||||
@@ -1,14 +0,0 @@
|
||||
// Komponenty HTML loader
|
||||
function loadComponent(path, replaceMap = {}) {
|
||||
return fetch(path)
|
||||
.then(r => r.text())
|
||||
.then(html => {
|
||||
Object.entries(replaceMap).forEach(([key, val]) => {
|
||||
html = html.replaceAll(key, val);
|
||||
});
|
||||
return html;
|
||||
});
|
||||
}
|
||||
|
||||
// Przykład użycia:
|
||||
// loadComponent('components/header.html', {'{TITLE}': 'Tytuł', '{SUBTITLE}': 'Podtytuł'}).then(html => ...)
|
||||
@@ -1,17 +0,0 @@
|
||||
// Back-to-hub button with active-task confirmation
|
||||
(function () {
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const backBtn = document.getElementById('back-to-hub')
|
||||
if (!backBtn) return
|
||||
|
||||
backBtn.addEventListener('click', (e) => {
|
||||
const playScreen = document.getElementById('play-screen')
|
||||
const taskActive = playScreen && !playScreen.classList.contains('hidden')
|
||||
if (taskActive) {
|
||||
e.preventDefault()
|
||||
const ok = confirm('Masz aktywne zadanie. Czy na pewno chcesz wyjść do menu?')
|
||||
if (ok) window.location.href = backBtn.getAttribute('href')
|
||||
}
|
||||
})
|
||||
})
|
||||
})()
|
||||
Binary file not shown.
Binary file not shown.
+1
-1
@@ -5,6 +5,6 @@
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.example.app",
|
||||
"variantName": "release",
|
||||
"variantName": "debug",
|
||||
"elements": []
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-117
@@ -1,117 +0,0 @@
|
||||
# This is a configuration file for ProGuard.
|
||||
# http://proguard.sourceforge.net/index.html#manual/usage.html
|
||||
#
|
||||
# Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
|
||||
# the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
|
||||
# will be ignored by new version of the Android plugin for Gradle.
|
||||
|
||||
# Optimizations: If you don't want to optimize, use the proguard-android.txt configuration file
|
||||
# instead of this one, which turns off the optimization flags.
|
||||
# Adding optimization introduces certain risks, since for example not all optimizations performed by
|
||||
# ProGuard works on all versions of Dalvik. The following flags turn off various optimizations
|
||||
# known to have issues, but the list may not be complete or up to date. (The "arithmetic"
|
||||
# optimization can be used if you are only targeting Android 2.0 or later.) Make sure you test
|
||||
# thoroughly if you go this route.
|
||||
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*
|
||||
-optimizationpasses 5
|
||||
-allowaccessmodification
|
||||
|
||||
-dontusemixedcaseclassnames
|
||||
-dontskipnonpubliclibraryclasses
|
||||
-verbose
|
||||
|
||||
# Preserve some attributes that may be required for reflection.
|
||||
-keepattributes AnnotationDefault,
|
||||
EnclosingMethod,
|
||||
InnerClasses,
|
||||
RuntimeVisibleAnnotations,
|
||||
RuntimeVisibleParameterAnnotations,
|
||||
RuntimeVisibleTypeAnnotations,
|
||||
Signature
|
||||
|
||||
-keep public class com.google.vending.licensing.ILicensingService
|
||||
-keep public class com.android.vending.licensing.ILicensingService
|
||||
-keep public class com.google.android.vending.licensing.ILicensingService
|
||||
-dontnote com.android.vending.licensing.ILicensingService
|
||||
-dontnote com.google.vending.licensing.ILicensingService
|
||||
-dontnote com.google.android.vending.licensing.ILicensingService
|
||||
|
||||
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
||||
-keepclasseswithmembernames,includedescriptorclasses class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# Keep setters in Views so that animations can still work.
|
||||
-keepclassmembers public class * extends android.view.View {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
|
||||
# We want to keep methods in Activity that could be used in the XML attribute onClick.
|
||||
-keepclassmembers class * extends android.app.Activity {
|
||||
public void *(android.view.View);
|
||||
}
|
||||
|
||||
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
public static final ** CREATOR;
|
||||
}
|
||||
|
||||
# Preserve annotated Javascript interface methods.
|
||||
-keepclassmembers class * {
|
||||
@android.webkit.JavascriptInterface <methods>;
|
||||
}
|
||||
|
||||
# The support libraries contains references to newer platform versions.
|
||||
# Don't warn about those in case this app is linking against an older
|
||||
# platform version. We know about them, and they are safe.
|
||||
-dontnote android.support.**
|
||||
-dontnote androidx.**
|
||||
-dontwarn android.support.**
|
||||
-dontwarn androidx.**
|
||||
|
||||
# This class is deprecated, but remains for backward compatibility.
|
||||
-dontwarn android.util.FloatMath
|
||||
|
||||
# Understand the @Keep support annotation.
|
||||
-keep class android.support.annotation.Keep
|
||||
-keep class androidx.annotation.Keep
|
||||
|
||||
-keep @android.support.annotation.Keep class * {*;}
|
||||
-keep @androidx.annotation.Keep class * {*;}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <fields>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <fields>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <init>(...);
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <init>(...);
|
||||
}
|
||||
|
||||
# These classes are duplicated between android.jar and org.apache.http.legacy.jar.
|
||||
-dontnote org.apache.http.**
|
||||
-dontnote android.net.http.**
|
||||
|
||||
# These classes are duplicated between android.jar and core-lambda-stubs.jar.
|
||||
-dontnote java.lang.invoke.**
|
||||
@@ -1,116 +0,0 @@
|
||||
# This is a configuration file for ProGuard.
|
||||
# http://proguard.sourceforge.net/index.html#manual/usage.html
|
||||
#
|
||||
# Starting with version 2.2 of the Android plugin for Gradle, this file is distributed together with
|
||||
# the plugin and unpacked at build-time. The files in $ANDROID_HOME are no longer maintained and
|
||||
# will be ignored by new version of the Android plugin for Gradle.
|
||||
|
||||
# Optimization is turned off by default. Dex does not like code run
|
||||
# through the ProGuard optimize steps (and performs some
|
||||
# of these optimizations on its own).
|
||||
# Note that if you want to enable optimization, you cannot just
|
||||
# include optimization flags in your own project configuration file;
|
||||
# instead you will need to point to the
|
||||
# "proguard-android-optimize.txt" file instead of this one from your
|
||||
# project.properties file.
|
||||
-dontoptimize
|
||||
|
||||
-dontusemixedcaseclassnames
|
||||
-dontskipnonpubliclibraryclasses
|
||||
-verbose
|
||||
|
||||
# Preserve some attributes that may be required for reflection.
|
||||
-keepattributes AnnotationDefault,
|
||||
EnclosingMethod,
|
||||
InnerClasses,
|
||||
RuntimeVisibleAnnotations,
|
||||
RuntimeVisibleParameterAnnotations,
|
||||
RuntimeVisibleTypeAnnotations,
|
||||
Signature
|
||||
|
||||
-keep public class com.google.vending.licensing.ILicensingService
|
||||
-keep public class com.android.vending.licensing.ILicensingService
|
||||
-keep public class com.google.android.vending.licensing.ILicensingService
|
||||
-dontnote com.android.vending.licensing.ILicensingService
|
||||
-dontnote com.google.vending.licensing.ILicensingService
|
||||
-dontnote com.google.android.vending.licensing.ILicensingService
|
||||
|
||||
# For native methods, see http://proguard.sourceforge.net/manual/examples.html#native
|
||||
-keepclasseswithmembernames,includedescriptorclasses class * {
|
||||
native <methods>;
|
||||
}
|
||||
|
||||
# Keep setters in Views so that animations can still work.
|
||||
-keepclassmembers public class * extends android.view.View {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
|
||||
# We want to keep methods in Activity that could be used in the XML attribute onClick.
|
||||
-keepclassmembers class * extends android.app.Activity {
|
||||
public void *(android.view.View);
|
||||
}
|
||||
|
||||
# For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
-keepclassmembers class * implements android.os.Parcelable {
|
||||
public static final ** CREATOR;
|
||||
}
|
||||
|
||||
# Preserve annotated Javascript interface methods.
|
||||
-keepclassmembers class * {
|
||||
@android.webkit.JavascriptInterface <methods>;
|
||||
}
|
||||
|
||||
# The support libraries contains references to newer platform versions.
|
||||
# Don't warn about those in case this app is linking against an older
|
||||
# platform version. We know about them, and they are safe.
|
||||
-dontnote android.support.**
|
||||
-dontnote androidx.**
|
||||
-dontwarn android.support.**
|
||||
-dontwarn androidx.**
|
||||
|
||||
# This class is deprecated, but remains for backward compatibility.
|
||||
-dontwarn android.util.FloatMath
|
||||
|
||||
# Understand the @Keep support annotation.
|
||||
-keep class android.support.annotation.Keep
|
||||
-keep class androidx.annotation.Keep
|
||||
|
||||
-keep @android.support.annotation.Keep class * {*;}
|
||||
-keep @androidx.annotation.Keep class * {*;}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <fields>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <fields>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@android.support.annotation.Keep <init>(...);
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@androidx.annotation.Keep <init>(...);
|
||||
}
|
||||
|
||||
# These classes are duplicated between android.jar and org.apache.http.legacy.jar.
|
||||
-dontnote org.apache.http.**
|
||||
-dontnote android.net.http.**
|
||||
|
||||
# These classes are duplicated between android.jar and core-lambda-stubs.jar.
|
||||
-dontnote java.lang.invoke.**
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user