Compare commits
42 Commits
7bab05fb24
...
v1.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 6944480d13 | |||
| f8a38a94e8 | |||
| ecacaf7b60 | |||
| 36757d1fb9 | |||
| a99f5167a9 | |||
| 2ea8e9c58e | |||
| 40b013b2d6 | |||
| 67a9d5b024 | |||
| eb6890a603 | |||
| 5f0074ed37 | |||
| 5399b64cd5 | |||
| e4db4bb31e | |||
| 332fef0fd3 | |||
| 244aa8457a | |||
| 03bcb465cf | |||
| b2721c2ec3 | |||
| 1385b3ace0 | |||
| 66a028880c | |||
| 365b12b0eb | |||
| 5ef6747e4d | |||
| 7ce23309f6 | |||
| 6c4b5f4adf | |||
| b8b7b3860b | |||
| 35b19cf140 | |||
| 0b3c8e8a02 | |||
| d890c6e15d | |||
| ccbb3549d1 | |||
| 145c148bbc | |||
| 3402bb1c13 | |||
| 92b66f5b8b | |||
| cd5d92feff | |||
| d3ef35f9ce | |||
| 367402e777 | |||
| f59f0f19c8 | |||
| 44338d1502 | |||
| d9885a2d17 | |||
| 8dd8ccd5f7 | |||
| d3407057f2 | |||
| 0386b615b1 | |||
| ea84777b97 | |||
| 3bcf995c10 | |||
| 202562878a |
@@ -0,0 +1,174 @@
|
|||||||
|
name: Build APK
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: cimg/android:2024.01
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install Node.js
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y curl
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Grant execute permission
|
||||||
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
|
- name: Verify Gradle wrapper
|
||||||
|
run: |
|
||||||
|
echo "Wrapper file details:"; ls -l ./gradlew || true
|
||||||
|
echo "Running wrapper --version to ensure CI uses project wrapper:";
|
||||||
|
./gradlew --version
|
||||||
|
|
||||||
|
- name: Package and upload webapp
|
||||||
|
env:
|
||||||
|
UPLOAD_WEBAPP_URL: ${{ secrets.UPLOAD_WEBAPP_URL }}
|
||||||
|
UPLOAD_WEBAPP_TOKEN: ${{ secrets.UPLOAD_WEBAPP_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
# create webapp zip and upload to configured URL (if provided)
|
||||||
|
./gradlew zipWebApp uploadWebApp
|
||||||
|
|
||||||
|
- name: Update version in assets
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
TAG="${{ github.ref_name }}"
|
||||||
|
# Jeśli tag jest pusty (np. push nie na tag), użyjemy skróconego SHA
|
||||||
|
if [ -z "$TAG" ] || [ "$TAG" = "main" ]; then
|
||||||
|
TAG=$(git rev-parse --short HEAD)
|
||||||
|
fi
|
||||||
|
echo "Setting version to: $TAG"
|
||||||
|
# Aktualizacja pliku js/version.js
|
||||||
|
echo "const APP_VERSION = '$TAG';" > app/src/main/assets/js/version.js
|
||||||
|
echo "document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const el = document.getElementById('app-version') || document.getElementById('commit-sha');
|
||||||
|
if (el) el.textContent = '$TAG';
|
||||||
|
});" >> app/src/main/assets/js/version.js
|
||||||
|
|
||||||
|
- name: Build APK
|
||||||
|
run: ./gradlew assembleRelease
|
||||||
|
|
||||||
|
- 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"
|
||||||
|
|
||||||
|
# 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
|
||||||
|
SERVER_CLEAN=$(echo "$GITEA_SERVER" | sed 's#/$##')
|
||||||
|
API_BASE="${SERVER_CLEAN}/api/v1"
|
||||||
|
|
||||||
|
OWNER="${{ github.repository_owner }}"
|
||||||
|
REPO_NAME=$(echo "${{ github.repository }}" | cut -d/ -f2)
|
||||||
|
TAG="${{ github.ref_name }}"
|
||||||
|
|
||||||
|
echo "Debug Info:"
|
||||||
|
echo "- API URL: $API_BASE/repos/$OWNER/$REPO_NAME/releases"
|
||||||
|
echo "- OWNER: $OWNER"
|
||||||
|
echo "- REPO: $REPO_NAME"
|
||||||
|
echo "- TAG: $TAG"
|
||||||
|
|
||||||
|
# Próba utworzenia release z przechwyceniem statusu HTTP
|
||||||
|
RESPONSE_FILE=$(mktemp)
|
||||||
|
HTTP_STATUS=$(curl -s -o "$RESPONSE_FILE" -w "%{http_code}" \
|
||||||
|
-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")
|
||||||
|
|
||||||
|
RESPONSE_BODY=$(cat "$RESPONSE_FILE")
|
||||||
|
echo "HTTP Status: $HTTP_STATUS"
|
||||||
|
echo "Response: $RESPONSE_BODY"
|
||||||
|
|
||||||
|
if [ "$HTTP_STATUS" -eq 409 ]; then
|
||||||
|
echo "Release already exists, fetching existing ID..."
|
||||||
|
RESPONSE_BODY=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API_BASE/repos/$OWNER/$REPO_NAME/releases/tags/$TAG")
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE_BODY" | sed -n 's/.*"id":\([0-9]*\),.*/\1/p' | head -n1)
|
||||||
|
elif [ "$HTTP_STATUS" -eq 201 ]; then
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE_BODY" | sed -n 's/.*"id":\([0-9]*\),.*/\1/p' | head -n1)
|
||||||
|
else
|
||||||
|
echo "Failed to create release. Expected 201 or 409, got $HTTP_STATUS"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Failed to extract RELEASE_ID from response"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
|
||||||
|
echo "Successfully processed release ID: $RELEASE_ID"
|
||||||
|
|
||||||
|
- name: Upload APK to Gitea release
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||||
|
GITEA_SERVER: ${{ secrets.GIT_SERVER }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
SERVER_CLEAN=$(echo "$GITEA_SERVER" | sed 's#/$##')
|
||||||
|
API_BASE="${SERVER_CLEAN}/api/v1"
|
||||||
|
|
||||||
|
OWNER="${{ github.repository_owner }}"
|
||||||
|
REPO_NAME=$(echo "${{ github.repository }}" | cut -d/ -f2)
|
||||||
|
TAG="${{ github.ref_name }}"
|
||||||
|
|
||||||
|
if [ -z "$APK_PATH" ]; then
|
||||||
|
echo "APK_PATH not set" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "RELEASE_ID not set" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Tworzymy ładną nazwę dla pliku
|
||||||
|
FRIENDLY_NAME="Matma-${TAG}.apk"
|
||||||
|
cp "$APK_PATH" "./$FRIENDLY_NAME"
|
||||||
|
|
||||||
|
UPLOAD_URL="$API_BASE/repos/$OWNER/$REPO_NAME/releases/$RELEASE_ID/assets?name=$FRIENDLY_NAME"
|
||||||
|
echo "Uploading $FRIENDLY_NAME to $UPLOAD_URL"
|
||||||
|
|
||||||
|
curl --fail -s -H "Authorization: token $GITEA_TOKEN" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary @"./$FRIENDLY_NAME" \
|
||||||
|
"$UPLOAD_URL"
|
||||||
|
|
||||||
|
# Dodanie bezpośredniego linku do podsumowania buildu w Gitea
|
||||||
|
DOWNLOAD_URL="${SERVER_CLEAN}/${OWNER}/${REPO_NAME}/releases/download/${TAG}/${FRIENDLY_NAME}"
|
||||||
|
echo "### ✅ APK gotowy do pobrania!" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "[Pobierz plik $FRIENDLY_NAME]($DOWNLOAD_URL)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Adres: $DOWNLOAD_URL" >> $GITHUB_STEP_SUMMARY
|
||||||
@@ -19,12 +19,34 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${{ env.GITHUB_SHA }}" > version.sha
|
echo "${{ env.GITHUB_SHA }}" > version.sha
|
||||||
|
|
||||||
|
- name: Create latest.zip
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
# ensure a small staging dir for upload (absolute path so later cd won't affect it)
|
||||||
|
mkdir -p "$GITHUB_WORKSPACE/dist/"
|
||||||
|
# install zip utility (container may not have it)
|
||||||
|
apt-get update && apt-get install -y zip
|
||||||
|
# create latest.zip containing the assets directory (so zip root contains 'assets/')
|
||||||
|
cd app/src/main
|
||||||
|
zip -r "$GITHUB_WORKSPACE/latest.zip" assets
|
||||||
|
# move zip into the workspace dist so the FTP action can upload just that file
|
||||||
|
mv "$GITHUB_WORKSPACE/latest.zip" "$GITHUB_WORKSPACE/dist/"
|
||||||
|
|
||||||
|
- name: Upload latest.zip via FTP to releases
|
||||||
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
||||||
|
with:
|
||||||
|
server: ${{ secrets.FTP_HOST }}
|
||||||
|
username: ${{ secrets.FTP_USER }}
|
||||||
|
password: ${{ secrets.FTP_PASS }}
|
||||||
|
local-dir: dist/
|
||||||
|
server-dir: /releases/
|
||||||
|
|
||||||
- name: Upload via FTP
|
- name: Upload via FTP
|
||||||
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.4
|
||||||
with:
|
with:
|
||||||
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: /
|
||||||
|
|
||||||
|
|||||||
+36
-1
@@ -1,3 +1,38 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
./QuizzyTemplate
|
./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.
@@ -0,0 +1,2 @@
|
|||||||
|
#Sat Jun 13 15:33:08 CEST 2026
|
||||||
|
gradle.version=9.4.1
|
||||||
Binary file not shown.
Binary file not shown.
Generated
+141
@@ -0,0 +1,141 @@
|
|||||||
|
<?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="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[LocalEmulator::path=/Users/aln/.android/avd/Pixel_10.avd]" />
|
||||||
|
<component name="ExternalProjectsData">
|
||||||
|
<projectState path="$PROJECT_DIR$">
|
||||||
|
<ProjectState />
|
||||||
|
</projectState>
|
||||||
|
</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": {
|
||||||
|
"Android App.app.executor": "Run",
|
||||||
|
"Gradle.Configure Daemon JVM Criteria.executor": "Run",
|
||||||
|
"GradleDaemonJvmCriteriaMigrationNotification.isNotificationDisabled": "true",
|
||||||
|
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||||
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
|
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||||
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
|
"RunOnceActivity.readMode.enableVisualFormatting": "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="RunManager">
|
||||||
|
<configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App" activateToolWindowBeforeRun="false">
|
||||||
|
<module name="Matma.app" />
|
||||||
|
<option name="ANDROID_RUN_CONFIGURATION_SCHEMA_VERSION" value="1" />
|
||||||
|
<option name="DEPLOY" value="true" />
|
||||||
|
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||||
|
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||||
|
<option name="ARTIFACT_NAME" value="" />
|
||||||
|
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||||
|
<option name="ALL_USERS" value="false" />
|
||||||
|
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||||
|
<option name="ALLOW_ASSUME_VERIFIED" value="false" />
|
||||||
|
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||||
|
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="" />
|
||||||
|
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||||
|
<option name="MODE" value="default_activity" />
|
||||||
|
<option name="RESTORE_ENABLED" value="false" />
|
||||||
|
<option name="RESTORE_FILE" value="" />
|
||||||
|
<option name="RESTORE_FRESH_INSTALL_ONLY" value="false" />
|
||||||
|
<option name="CLEAR_LOGCAT" value="false" />
|
||||||
|
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||||
|
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
|
||||||
|
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||||
|
<Auto>
|
||||||
|
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||||
|
<option name="SHOW_STATIC_VARS" value="true" />
|
||||||
|
<option name="WORKING_DIR" value="" />
|
||||||
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
</Auto>
|
||||||
|
<Hybrid>
|
||||||
|
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||||
|
<option name="SHOW_STATIC_VARS" value="true" />
|
||||||
|
<option name="WORKING_DIR" value="" />
|
||||||
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
</Hybrid>
|
||||||
|
<Java>
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
</Java>
|
||||||
|
<Native>
|
||||||
|
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||||
|
<option name="SHOW_STATIC_VARS" value="true" />
|
||||||
|
<option name="WORKING_DIR" value="" />
|
||||||
|
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||||
|
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||||
|
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||||
|
</Native>
|
||||||
|
<Profilers>
|
||||||
|
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||||
|
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||||
|
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||||
|
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||||
|
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||||
|
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||||
|
</Profilers>
|
||||||
|
<option name="DEEP_LINK" value="" />
|
||||||
|
<option name="ACTIVITY" value="" />
|
||||||
|
<option name="ACTIVITY_CLASS" value="" />
|
||||||
|
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||||
|
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</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>
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
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() {
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
val webView = WebView(this)
|
||||||
|
|
||||||
|
webView.settings.javaScriptEnabled = true
|
||||||
|
webView.settings.domStorageEnabled = true
|
||||||
|
|
||||||
|
// Use WebViewAssetLoader to serve files from /assets/ over a secure origin.
|
||||||
|
val assetLoader = WebViewAssetLoader.Builder()
|
||||||
|
.addPathHandler("/assets/", WebViewAssetLoader.AssetsPathHandler(this))
|
||||||
|
.build()
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$" isTestSource="false" packagePrefix="com.example.app" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
@@ -13,3 +13,33 @@ Pliki
|
|||||||
Jak uruchomić
|
Jak uruchomić
|
||||||
|
|
||||||
Otwórz plik `index.html` w przeglądarce (najlepiej na urządzeniu mobilnym lub w trybie responsywnym).
|
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.
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace 'com.example.app'
|
||||||
|
compileSdk 34
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.example.app"
|
||||||
|
minSdk 21
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
|
targetCompatibility JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = "17"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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'
|
||||||
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
|
||||||
|
// JSONObject is provided by Android SDK (org.json)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Task: package webapp assets into a zip for release and optionally upload
|
||||||
|
def webappSrc = file("src/main/assets")
|
||||||
|
def webappZip = file("${buildDir}/outputs/webapp/webapp.zip")
|
||||||
|
|
||||||
|
tasks.register("zipWebApp") {
|
||||||
|
group = "release"
|
||||||
|
description = "Create zip of web assets (app/src/main/assets -> webapp.zip)"
|
||||||
|
inputs.dir(webappSrc)
|
||||||
|
outputs.file(webappZip)
|
||||||
|
doLast {
|
||||||
|
webappZip.parentFile.mkdirs()
|
||||||
|
ant.zip(destfile: webappZip) {
|
||||||
|
fileset(dir: webappSrc)
|
||||||
|
}
|
||||||
|
println "Created webapp zip: ${webappZip.absolutePath}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("uploadWebApp") {
|
||||||
|
group = "release"
|
||||||
|
description = "Upload webapp zip to remote server if UPLOAD_WEBAPP_URL is set"
|
||||||
|
dependsOn "zipWebApp"
|
||||||
|
doLast {
|
||||||
|
def uploadUrl = System.getenv('UPLOAD_WEBAPP_URL')
|
||||||
|
def token = System.getenv('UPLOAD_WEBAPP_TOKEN')
|
||||||
|
if (!uploadUrl) {
|
||||||
|
println "UPLOAD_WEBAPP_URL not set, skipping upload"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!webappZip.exists()) {
|
||||||
|
throw new GradleException("webapp zip not found: ${webappZip}")
|
||||||
|
}
|
||||||
|
println "Uploading webapp to ${uploadUrl}"
|
||||||
|
def cmd = ["curl", "--fail", "-X", "PUT", "-H", "Content-Type: application/zip"]
|
||||||
|
if (token) {
|
||||||
|
cmd += ["-H", "Authorization: Bearer ${token}"]
|
||||||
|
}
|
||||||
|
cmd += ["--data-binary", "@${webappZip.absolutePath}", uploadUrl]
|
||||||
|
def process = cmd.execute()
|
||||||
|
process.in.eachLine { println it }
|
||||||
|
process.err.eachLine { System.err.println it }
|
||||||
|
def rc = process.waitFor()
|
||||||
|
if (rc != 0) throw new GradleException("Upload failed with exit code ${rc}")
|
||||||
|
println "Upload successful"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#- File Locator -
|
||||||
|
listingFile=../../../outputs/apk/debug/output-metadata.json
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
appMetadataVersion=1.1
|
||||||
|
androidGradlePluginVersion=8.2.2
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -55,19 +55,19 @@ 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')
|
const raw = (typeof localStorage !== 'undefined') ? localStorage.getItem('matma:settings') : 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)
|
||||||
}
|
}
|
||||||
}catch(e){ console.warn('settings load failed', e) }
|
}catch(e){ console.warn('settings load failed', e) }
|
||||||
// reflect to inputs
|
// reflect to inputs (guard in case some inputs are missing)
|
||||||
settingTimed.value = state.settings.timedSeconds
|
if (settingTimed) settingTimed.value = state.settings.timedSeconds
|
||||||
settingMaxResult.value = state.settings.maxResult
|
if (settingMaxResult) settingMaxResult.value = state.settings.maxResult
|
||||||
settingMaxOperand.value = state.settings.maxOperand
|
if (settingMaxOperand) settingMaxOperand.value = state.settings.maxOperand
|
||||||
settingSessionProblems.value = state.settings.sessionProblems
|
if (settingSessionProblems) settingSessionProblems.value = state.settings.sessionProblems
|
||||||
settingAllowNegative.checked = !!state.settings.allowNegative
|
if (settingAllowNegative) settingAllowNegative.checked = !!state.settings.allowNegative
|
||||||
settingAllowFraction.checked = !!state.settings.allowFraction
|
if (settingAllowFraction) settingAllowFraction.checked = !!state.settings.allowFraction
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveSettings(){
|
function saveSettings(){
|
||||||
@@ -145,16 +145,16 @@ function startPlay(){
|
|||||||
renderProblem()
|
renderProblem()
|
||||||
|
|
||||||
if (state.mode === 'timed'){
|
if (state.mode === 'timed'){
|
||||||
progressInner.style.width = '0%'
|
if (progressInner) progressInner.style.width = '0%'
|
||||||
startTimer(state.settings.timedSeconds)
|
startTimer(state.settings.timedSeconds)
|
||||||
statusEl.textContent = 'Na czas';
|
if (statusEl) statusEl.textContent = 'Na czas';
|
||||||
timerEl.classList.remove('hidden');
|
if (timerEl) timerEl.classList.remove('hidden');
|
||||||
} else {
|
} else {
|
||||||
progressInner.style.width = '0%'
|
if (progressInner) progressInner.style.width = '0%'
|
||||||
state.sessionSolved = 0
|
state.sessionSolved = 0
|
||||||
state.sessionTarget = Math.max(1, state.settings.sessionProblems)
|
state.sessionTarget = Math.max(1, state.settings.sessionProblems)
|
||||||
updateProgress()
|
updateProgress()
|
||||||
timerEl.classList.add('hidden');
|
if (timerEl) timerEl.classList.add('hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,14 +311,14 @@ backspaceBtn.addEventListener('click', ()=>{
|
|||||||
|
|
||||||
function startTimer(seconds){
|
function startTimer(seconds){
|
||||||
state.timeLeft = seconds
|
state.timeLeft = seconds
|
||||||
timerEl.textContent = state.timeLeft
|
if (timerEl) timerEl.textContent = state.timeLeft
|
||||||
|
|
||||||
stopTimer();
|
stopTimer();
|
||||||
state.timerId = setInterval(()=>{
|
state.timerId = setInterval(()=>{
|
||||||
state.timeLeft -= 1
|
state.timeLeft -= 1
|
||||||
timerEl.textContent = state.timeLeft
|
if (timerEl) timerEl.textContent = state.timeLeft
|
||||||
const pct = Math.max(0, (state.timeLeft / seconds) * 100)
|
const pct = Math.max(0, (state.timeLeft / seconds) * 100)
|
||||||
progressInner.style.width = pct + '%'
|
if (progressInner) progressInner.style.width = pct + '%'
|
||||||
if (state.timeLeft <= 0) {
|
if (state.timeLeft <= 0) {
|
||||||
stopTimer()
|
stopTimer()
|
||||||
endSession()
|
endSession()
|
||||||
@@ -357,9 +357,9 @@ summaryBack.addEventListener('click', ()=>{
|
|||||||
|
|
||||||
function updateProgress(){
|
function updateProgress(){
|
||||||
if (state.mode === 'training'){
|
if (state.mode === 'training'){
|
||||||
const pct = Math.min(100, Math.round((state.sessionSolved/state.sessionTarget)*100))
|
const pct = Math.min(100, Math.round((state.sessionSolved/state.sessionTarget)*100))
|
||||||
progressInner.style.width = pct + '%'
|
if (progressInner) progressInner.style.width = pct + '%'
|
||||||
statusEl.textContent = `${state.sessionSolved}/${state.sessionTarget}`
|
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 => ...)
|
||||||
@@ -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')
|
||||||
@@ -52,11 +52,16 @@
|
|||||||
clearInterval(autoTimer)
|
clearInterval(autoTimer)
|
||||||
autoTimer = null
|
autoTimer = null
|
||||||
|
|
||||||
readTitleEl.textContent = title
|
if (!readTitleEl || !readTextEl || !speedBtn || !readWrap || !listWrap) {
|
||||||
readTextEl.textContent = text
|
console.warn('czytanie: missing DOM elements', { readTitleEl, readTextEl, speedBtn, readWrap, listWrap })
|
||||||
readTextEl.style.transform = 'translateY(0)'
|
}
|
||||||
speedBtn.textContent = SPEED_LABELS[0]
|
|
||||||
progressBar.style.width = '0%'
|
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')
|
listWrap.classList.add('hidden')
|
||||||
readWrap.classList.remove('hidden')
|
readWrap.classList.remove('hidden')
|
||||||
@@ -78,9 +83,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Back to list ──────────────────────────────────────────────────────────
|
// ── Back to list ──────────────────────────────────────────────────────────
|
||||||
|
// Zakończ button: natychmiast wróć do listy bez potwierdzenia
|
||||||
readBackBtn.addEventListener('click', () => {
|
readBackBtn.addEventListener('click', () => {
|
||||||
const active = yOffset > 0 || autoTimer !== null
|
|
||||||
if (active && !confirm('Wrócić do listy tekstów?')) return
|
|
||||||
clearInterval(autoTimer)
|
clearInterval(autoTimer)
|
||||||
autoTimer = null
|
autoTimer = null
|
||||||
readWrap.classList.add('hidden')
|
readWrap.classList.add('hidden')
|
||||||
@@ -132,6 +136,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')
|
||||||
@@ -282,9 +296,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ── Navigation ────────────────────────────────────────────────────────────
|
// ── Navigation ────────────────────────────────────────────────────────────
|
||||||
|
// Zakończ button: natychmiast wracamy do listy bez potwierdzenia
|
||||||
playBackBtn.addEventListener('click', () => {
|
playBackBtn.addEventListener('click', () => {
|
||||||
const inProgress = blanks.length > 0 && current < blanks.length
|
|
||||||
if (inProgress && !confirm('Przerwać dyktando i wrócić do listy?')) return
|
|
||||||
goToList()
|
goToList()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -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}`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,7 +136,8 @@
|
|||||||
let sha = (window.COMMIT_SHA || '').toString().trim()
|
let sha = (window.COMMIT_SHA || '').toString().trim()
|
||||||
if (!sha) {
|
if (!sha) {
|
||||||
try {
|
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) {
|
if (res.ok) {
|
||||||
const txt = await res.text()
|
const txt = await res.text()
|
||||||
const first = txt.split(/\r?\n/).find(l => l.trim().length > 0)
|
const first = txt.split(/\r?\n/).find(l => l.trim().length > 0)
|
||||||
@@ -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}`
|
||||||
@@ -135,7 +136,8 @@
|
|||||||
let sha = (window.COMMIT_SHA || '').toString().trim()
|
let sha = (window.COMMIT_SHA || '').toString().trim()
|
||||||
if (!sha) {
|
if (!sha) {
|
||||||
try {
|
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) {
|
if (res.ok) {
|
||||||
const txt = await res.text()
|
const txt = await res.text()
|
||||||
const first = txt.split(/\r?\n/).find(l => l.trim().length > 0)
|
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
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})()
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "COMPATIBLE_SCREEN_MANIFEST",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.example.app",
|
||||||
|
"variantName": "debug",
|
||||||
|
"elements": []
|
||||||
|
}
|
||||||
Binary file not shown.
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.
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.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
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.
@@ -0,0 +1 @@
|
|||||||
|
7
|
||||||
Binary file not shown.
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#Sat Jun 13 17:10:52 CEST 2026
|
||||||
|
com.example.app-main-23\:/drawable/ic_launcher_foreground.xml=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/drawable_ic_launcher_foreground.xml.flat
|
||||||
|
com.example.app-main-23\:/layout/activity_splash.xml=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/layout_activity_splash.xml.flat
|
||||||
|
com.example.app-main-23\:/mipmap-anydpi-v26/ic_launcher.xml=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-anydpi-v26_ic_launcher.xml.flat
|
||||||
|
com.example.app-main-23\:/mipmap-hdpi/ic_launcher.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-hdpi_ic_launcher.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-hdpi/ic_launcher_foreground.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-hdpi_ic_launcher_foreground.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-mdpi/ic_launcher.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-mdpi_ic_launcher.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-mdpi/ic_launcher_foreground.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-mdpi_ic_launcher_foreground.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xhdpi/ic_launcher.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xhdpi_ic_launcher.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xhdpi/ic_launcher_foreground.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xhdpi_ic_launcher_foreground.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xxhdpi/ic_launcher.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xxhdpi_ic_launcher.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xxhdpi/ic_launcher_foreground.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xxhdpi_ic_launcher_foreground.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xxxhdpi/ic_launcher.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xxxhdpi_ic_launcher.png.flat
|
||||||
|
com.example.app-main-23\:/mipmap-xxxhdpi/ic_launcher_foreground.png=/Users/aln/Work/Matma/app/build/intermediates/merged_res/debug/mergeDebugResources/mipmap-xxxhdpi_ic_launcher_foreground.png.flat
|
||||||
+32
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
|
<string msgid="5976598919945601918" name="abc_action_bar_home_description">"Gaan na tuisskerm"</string>
|
||||||
|
<string msgid="8388173803310557296" name="abc_action_bar_up_description">"Gaan op"</string>
|
||||||
|
<string msgid="3937310113216875497" name="abc_action_menu_overflow_description">"Nog opsies"</string>
|
||||||
|
<string msgid="4692188335987374352" name="abc_action_mode_done">"Klaar"</string>
|
||||||
|
<string msgid="1189761859438369441" name="abc_activity_chooser_view_see_all">"Sien alles"</string>
|
||||||
|
<string msgid="2165779757652331008" name="abc_activitychooserview_choose_application">"Kies \'n program"</string>
|
||||||
|
<string msgid="4215997306490295099" name="abc_capital_off">"AF"</string>
|
||||||
|
<string msgid="884982626291842264" name="abc_capital_on">"AAN"</string>
|
||||||
|
<string msgid="8833365367933412986" name="abc_menu_alt_shortcut_label">"Alt+"</string>
|
||||||
|
<string msgid="2223301931652355242" name="abc_menu_ctrl_shortcut_label">"Ctrl+"</string>
|
||||||
|
<string msgid="838001238306846836" name="abc_menu_delete_shortcut_label">"delete"</string>
|
||||||
|
<string msgid="7986526966204849475" name="abc_menu_enter_shortcut_label">"enter"</string>
|
||||||
|
<string msgid="375214403600139847" name="abc_menu_function_shortcut_label">"Funksie+"</string>
|
||||||
|
<string msgid="4192209724446364286" name="abc_menu_meta_shortcut_label">"Meta+"</string>
|
||||||
|
<string msgid="4741552369836443843" name="abc_menu_shift_shortcut_label">"Shift+"</string>
|
||||||
|
<string msgid="5473865519181928982" name="abc_menu_space_shortcut_label">"spasiebalk"</string>
|
||||||
|
<string msgid="6180552449598693998" name="abc_menu_sym_shortcut_label">"Simbool+"</string>
|
||||||
|
<string msgid="5520303668377388990" name="abc_prepend_shortcut_label">"Kieslys+"</string>
|
||||||
|
<string msgid="7208076849092622260" name="abc_search_hint">"Soek …"</string>
|
||||||
|
<string msgid="3741173234950517107" name="abc_searchview_description_clear">"Vee navraag uit"</string>
|
||||||
|
<string msgid="693312494995508443" name="abc_searchview_description_query">"Soektognavraag"</string>
|
||||||
|
<string msgid="3417662926640357176" name="abc_searchview_description_search">"Soek"</string>
|
||||||
|
<string msgid="1486535517437947103" name="abc_searchview_description_submit">"Dien navraag in"</string>
|
||||||
|
<string msgid="2293578557972875415" name="abc_searchview_description_voice">"Stemsoektog"</string>
|
||||||
|
<string msgid="8875138169939072951" name="abc_shareactionprovider_share_with">"Deel met"</string>
|
||||||
|
<string msgid="9055268688411532828" name="abc_shareactionprovider_share_with_application">"Deel met <ns1:g id="APPLICATION_NAME">%s</ns1:g>"</string>
|
||||||
|
<string msgid="1656852541809559762" name="abc_toolbar_collapse_description">"Vou in"</string>
|
||||||
|
<string msgid="6264217191555673260" name="search_menu_title">"Soek"</string>
|
||||||
|
<string msgid="6277540029070332960" name="status_bar_notification_info_overflow">"999+"</string>
|
||||||
|
</resources>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user