Compare commits
275 Commits
backup/dev
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c08119ebc | |||
| 945d698f4c | |||
| f19d8cd387 | |||
| bc605dde0d | |||
| f2317c1fe5 | |||
| b41fc7ec08 | |||
| 368545dc24 | |||
| b933e1e7b8 | |||
| fd909ade1d | |||
| dceeed25a3 | |||
| 9c06a87001 | |||
| 02b2043b5c | |||
| 77af5acba3 | |||
| 85dbc6d373 | |||
|
|
e008325e53 | ||
|
|
facb3326de | ||
| eb196e9f60 | |||
|
|
744fcbf233 | ||
| 4334ed095e | |||
|
|
ed55ed6226 | ||
| 8645e7d4c7 | |||
| 6a058f5166 | |||
| 76fa644ccd | |||
| 74064054e1 | |||
| 1373fef4af | |||
| 2082bdbdbc | |||
| c1d677b4df | |||
| 34d386c033 | |||
| 69ec627762 | |||
| 6cb461654e | |||
| fdf350c2c6 | |||
| 857fa5e230 | |||
| 5a15894833 | |||
| 609f79c3b9 | |||
| e42298d32a | |||
| de4e8339a1 | |||
| 62d6a829bf | |||
| 9dcf04e32d | |||
|
|
5e757d9afd | ||
|
|
fff41d95d7 | ||
|
|
93b1d78fd2 | ||
|
|
717b4b27aa | ||
| a097c80516 | |||
| ec2b22c825 | |||
| d8ee1d8073 | |||
| 280b5142a5 | |||
| 31b9d86ed9 | |||
| ff297bf4b8 | |||
| 0f0b7c0c8b | |||
| 394b7bfd70 | |||
| 95b6af52c2 | |||
| fcf6a08e79 | |||
| 705d1fee4e | |||
| 6290c27a7e | |||
| a3a036440a | |||
| 062f1afe67 | |||
| 6d30767cb0 | |||
| 0e3c3c421f | |||
| b6d1b221b8 | |||
| e79c489de6 | |||
| c9a034c0f8 | |||
| 4dbe0b71e6 | |||
| eddfe52a51 | |||
| 1f2f7e9d4e | |||
|
|
5766eb6675 | ||
| b28bebcce1 | |||
|
|
8fb5d5c89b | ||
|
|
f22ab629bc | ||
|
|
09ac4b7f61 | ||
|
|
5320625d83 | ||
|
|
eccdf90fd8 | ||
|
|
b4ccd52321 | ||
|
|
4658366fd4 | ||
|
|
aa77e25fe4 | ||
|
|
8984f8a915 | ||
|
|
4c28999d10 | ||
|
|
50274575f6 | ||
|
|
fb8fad142a | ||
|
|
2dccb59f7f | ||
|
|
7c9ade35f0 | ||
|
|
ca9e6c3efa | ||
| a4af924653 | |||
| 8bc52aadcb | |||
| 6101513a43 | |||
| 16e7ca49ca | |||
| dd05320346 | |||
| 1f9512d03a | |||
| d36992c7bc | |||
| fd57184f99 | |||
| fa31c0d7a3 | |||
| 47e9047873 | |||
| 7319878cb8 | |||
| 3dc902b4cf | |||
| 71e1250932 | |||
| 39651c2ab7 | |||
| bffd1d66d9 | |||
| 3480fb2ac0 | |||
| f5a16da72d | |||
| 04a441cd08 | |||
| 80856d1e8d | |||
| 9a74bd5178 | |||
| 05c1cce469 | |||
| 0b1313d0be | |||
| 5a79c48e6d | |||
| 7bf9351b22 | |||
|
|
368ad86f71 | ||
|
|
46a508cc33 | ||
|
|
2923d868e6 | ||
|
|
7f33b50822 | ||
|
|
54d792eb01 | ||
|
|
c8b402118c | ||
|
|
c0f3e61b90 | ||
|
|
9aaf43892f | ||
|
|
a64a7f7509 | ||
|
|
1225e6763f | ||
|
|
b159530de9 | ||
|
|
5fb1f6cc30 | ||
|
|
670968247a | ||
| 5847301e70 | |||
|
|
6342f16d80 | ||
|
|
7167bf8da4 | ||
|
|
7747e5d90b | ||
|
|
49ec23c18e | ||
| 37e7cac61e | |||
| d64ea1d2d6 | |||
| d010544ff2 | |||
| 20d0cf9736 | |||
| c8c299ba36 | |||
| f3414499a7 | |||
| 4b1d113918 | |||
| 0e965a87b9 | |||
| ead4dcd7b6 | |||
| 155d42d4d9 | |||
| caa4db3254 | |||
| 4e64dd9959 | |||
| 07f6a5c562 | |||
| f74ddb4c88 | |||
| 97b06044a4 | |||
| 2311556309 | |||
| 7a2bfb2cd8 | |||
| 39f683a0bf | |||
| 3576a3ab1e | |||
| 04af2c0402 | |||
| 70ff3ae8b9 | |||
| 5a42884d20 | |||
| 3fb0fd55de | |||
| 4c06daf02f | |||
| 3d07b2b2ce | |||
| 9a45c5c456 | |||
|
|
858d558cc3 | ||
|
|
76f345cd6b | ||
|
|
e211d64ffb | ||
|
|
c67ce7472a | ||
|
|
2b9ac14d6e | ||
|
|
eea10a4878 | ||
|
|
1ef6ae6e87 | ||
|
|
141431f378 | ||
|
|
f0114e3976 | ||
|
|
414a1ad254 | ||
|
|
d858c38bb1 | ||
|
|
87e3331428 | ||
|
|
1d912abc7d | ||
| 3a2cdfce05 | |||
| c5ba318c3b | |||
| fe9a2b36f1 | |||
| 80b05c1500 | |||
| 2ed6a04bf5 | |||
| 2d5ff89cad | |||
| 16b11564cc | |||
| 1ca975f0bd | |||
| 7985a11f99 | |||
| 2cf95375cb | |||
| 163b3a3135 | |||
| e839b8fa70 | |||
| c6378c9d46 | |||
| 51456b3b6e | |||
|
|
28f8f1d6f8 | ||
| d51c9d6411 | |||
| 4ef2f479d6 | |||
| d81d261c52 | |||
| 5baec2e65f | |||
| 48ea97ecef | |||
|
|
1154997531 | ||
|
|
dde05ce1db | ||
| 99ab6c07f7 | |||
|
|
40c6b83627 | ||
|
|
f4f6ddac72 | ||
|
|
938f2a56c6 | ||
|
|
e1b571afa0 | ||
|
|
729c281f1e | ||
|
|
a61a41e677 | ||
|
|
e8f1f18725 | ||
|
|
613b66bc22 | ||
|
|
1807d96895 | ||
|
|
e06d2168c0 | ||
|
|
91603923bc | ||
|
|
67e9ded2ed | ||
|
|
e9aaa26e26 | ||
|
|
56f15a681c | ||
|
|
178ebf7271 | ||
|
|
70c1397262 | ||
|
|
a334901f84 | ||
|
|
ddba6ad888 | ||
|
|
780aaee1dd | ||
|
|
09c408a6be | ||
|
|
7847878551 | ||
|
|
09ef386eab | ||
|
|
c19dd2f7eb | ||
|
|
39d4f49e99 | ||
|
|
bbdbf406d4 | ||
|
|
b17509f9db | ||
|
|
9ec164daac | ||
|
|
08f691d559 | ||
|
|
ad9e2c6676 | ||
|
|
55dbf12a2f | ||
|
|
4fc13efc52 | ||
|
|
5f16128bb0 | ||
|
|
4c8d73aa06 | ||
|
|
e4629d8489 | ||
|
|
f806dd8143 | ||
|
|
f653dc9fb4 | ||
|
|
06249bfc3d | ||
|
|
607f49bafc | ||
|
|
251e8de446 | ||
|
|
21845f89a8 | ||
|
|
25b1d06c06 | ||
|
|
dd20aa6138 | ||
|
|
9aa84c6fa1 | ||
|
|
6c75acad66 | ||
|
|
6311cafd51 | ||
|
|
1de32a35a4 | ||
|
|
f8a69a7561 | ||
|
|
f73c1127e7 | ||
|
|
a369e4ab14 | ||
|
|
8b04b77327 | ||
|
|
d56db4fe3a | ||
|
|
e7c0a95638 | ||
|
|
fa66d9af14 | ||
|
|
90c334d859 | ||
|
|
cc9ebcf6b0 | ||
|
|
ac914aa02e | ||
|
|
061f803f93 | ||
|
|
57c5e17b1c | ||
|
|
fa6f5390b1 | ||
|
|
21ff8f082f | ||
|
|
3b09d072f0 | ||
|
|
84f8e75694 | ||
|
|
1a05cce49b | ||
|
|
e732168a1b | ||
|
|
68035140b9 | ||
|
|
e004b7ee35 | ||
|
|
34718ed8ae | ||
|
|
03a5b5e767 | ||
|
|
d30dc67626 | ||
|
|
d0a517ae1e | ||
| 32a6452c1b | |||
| 579bf6bcad | |||
| 4ecf0d1a3f | |||
| 0675a5109a | |||
| bfb06d3e5f | |||
| 71b4b6aec7 | |||
| be6d28cfe3 | |||
| 8cfca13d1a | |||
| 632bb81408 | |||
|
|
f953dbd49f | ||
|
|
01e7e559ba | ||
| b6bfef7715 | |||
| bf75f72bcd | |||
|
|
b0cb020d76 | ||
|
|
4239ffa00c | ||
|
|
427b6f8086 | ||
|
|
fbd2351073 | ||
|
|
150e90d19b | ||
|
|
a6cf8b13c6 | ||
|
|
d8ae8471ab |
4
.gitignore
vendored
@@ -100,8 +100,12 @@ firka/debug-info/
|
|||||||
**/.env*
|
**/.env*
|
||||||
**/*.dart.js
|
**/*.dart.js
|
||||||
**/*.info.json
|
**/*.info.json
|
||||||
|
**/*.g.dart
|
||||||
|
**/.codegen-cache.yaml
|
||||||
|
|
||||||
# tools.py logs
|
# tools.py logs
|
||||||
tool_logs/build/*.log
|
tool_logs/build/*.log
|
||||||
tool_logs/d8dx_fix/*.log
|
tool_logs/d8dx_fix/*.log
|
||||||
tool_logs/pub_fix/*.log
|
tool_logs/pub_fix/*.log
|
||||||
|
secrets/upload_certificate.pem
|
||||||
|
secrets (2)/upload_certificate.pem
|
||||||
|
|||||||
6
.gitmodules
vendored
@@ -1,6 +0,0 @@
|
|||||||
[submodule "firka/lib/l10n"]
|
|
||||||
path = firka/lib/l10n
|
|
||||||
url = https://github.com/QwIT-Development/firka-localization
|
|
||||||
[submodule "firka_wear/lib/l10n"]
|
|
||||||
path = firka_wear/lib/l10n
|
|
||||||
url = https://github.com/qwit-development/firka-localization
|
|
||||||
|
|||||||
232
.woodpecker.yml
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
when:
|
||||||
|
- event: [push, pull_request]
|
||||||
|
- event: manual
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: submodules
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
commands:
|
||||||
|
- git submodule update --init --recursive
|
||||||
|
|
||||||
|
- name: secrets
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
environment:
|
||||||
|
UPLOAD_KEYSTORE_B64:
|
||||||
|
from_secret: upload_keystore_b64
|
||||||
|
KEYSTORE_PROPERTIES_B64:
|
||||||
|
from_secret: keystore_properties_b64
|
||||||
|
commands:
|
||||||
|
- echo "$UPLOAD_KEYSTORE_B64" | base64 -d > secrets/upload-keystore.jks
|
||||||
|
- echo "$KEYSTORE_PROPERTIES_B64" | base64 -d > secrets/keystore.properties
|
||||||
|
|
||||||
|
# Each step runs in a fresh container from the builder image -- only the
|
||||||
|
# workspace volume is shared between them. Pointing PUB_CACHE at a
|
||||||
|
# workspace-local dir (instead of the image's default /root/.pub-cache)
|
||||||
|
# is what lets `flutter pub get`'s downloads survive into later steps.
|
||||||
|
- name: dependencies
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- cd firka
|
||||||
|
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
|
||||||
|
- flutter pub get
|
||||||
|
|
||||||
|
- name: codegen
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- cd firka
|
||||||
|
- dart run scripts/codegen.dart
|
||||||
|
|
||||||
|
- name: clone-mock-kreta-server
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
environment:
|
||||||
|
GITEA_USERNAME:
|
||||||
|
from_secret: gitea_username
|
||||||
|
GITEA_TOKEN:
|
||||||
|
from_secret: gitea_token
|
||||||
|
commands:
|
||||||
|
- pwd
|
||||||
|
# The heredoc uses a quoted delimiter so $GITEA_USERNAME/$GITEA_TOKEN
|
||||||
|
# are written to the script literally, not expanded here -- keeps the
|
||||||
|
# secret values out of this (traced) command's expanded output.
|
||||||
|
- |
|
||||||
|
cat > /tmp/write_netrc.sh <<'NETRC_SCRIPT'
|
||||||
|
printf 'machine git.firka.app\nlogin %s\npassword %s\n' "$GITEA_USERNAME" "$GITEA_TOKEN" > "$HOME/.netrc"
|
||||||
|
chmod 600 "$HOME/.netrc"
|
||||||
|
NETRC_SCRIPT
|
||||||
|
# Runs as an untraced child shell, so the expansion above never hits the log.
|
||||||
|
- sh /tmp/write_netrc.sh
|
||||||
|
- git clone --depth 1 https://git.firka.app/firka/mock_kreta_server.git mock_kreta_server
|
||||||
|
- rm -f /tmp/write_netrc.sh "$HOME/.netrc"
|
||||||
|
|
||||||
|
- name: build-mock-kreta-server
|
||||||
|
image: golang:1.26
|
||||||
|
commands:
|
||||||
|
- cd mock_kreta_server
|
||||||
|
- go build -o ../mock_kreta_server_bin .
|
||||||
|
|
||||||
|
# Runs the mock server in the background and exercises kreta_api's DTOs
|
||||||
|
# against its real wire format, catching drift between the two repos.
|
||||||
|
- name: kreta-api-mock-server-tests
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
|
||||||
|
- sleep 1
|
||||||
|
- cd kreta_api
|
||||||
|
- dart pub get
|
||||||
|
- MOCK_KRETA_SERVER_URL=http://127.0.0.1:8090 dart test
|
||||||
|
|
||||||
|
- name: firka-e2e-tests
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
|
||||||
|
- sleep 1
|
||||||
|
- cd firka
|
||||||
|
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
|
||||||
|
- cp $(find "$PUB_CACHE" -name libisar.so | grep linux | head -n 1) libisar.so 2>/dev/null || true
|
||||||
|
- flutter test test/data/widget_test.dart test/e2e/screenshot_widget_test.dart test/e2e/notification_diff_test.dart
|
||||||
|
|
||||||
|
- name: firka-integration-tests
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- /dev/kvm:/dev/kvm
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- 'grep -q "::1" /etc/hosts || echo "::1 localhost ip6-localhost ip6-loopback" >> /etc/hosts 2>/dev/null || true'
|
||||||
|
- sysctl -w net.ipv6.conf.all.disable_ipv6=0 2>/dev/null || true
|
||||||
|
- sed -i 's/TIMEOUT=60/TIMEOUT=300/' /opt/bin/start-emulator.sh
|
||||||
|
- sed -i 's/-snapshot default_boot/-no-snapshot-load/' /opt/bin/start-emulator.sh
|
||||||
|
- ./mock_kreta_server_bin -addr :8090 -data mock_kreta_server/data.json &
|
||||||
|
- sleep 1
|
||||||
|
- /opt/bin/start-emulator.sh
|
||||||
|
- adb reverse tcp:8090 tcp:8090
|
||||||
|
- cd firka
|
||||||
|
- '[ -f .env ] || cp .env.example .env 2>/dev/null || touch .env'
|
||||||
|
- flutter test integration_test/widget_e2e_test.dart
|
||||||
|
|
||||||
|
- name: build-release
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
when:
|
||||||
|
- branch: [main, staging]
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- cd firka
|
||||||
|
- '[ -f "$(git rev-parse --git-dir)/shallow" ] && git fetch --unshallow 2>/dev/null || true'
|
||||||
|
- SHA=$(git rev-parse --short HEAD)
|
||||||
|
- COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
- 'BASE_VERSION=$(grep "^version:" pubspec.yaml | cut -d: -f2 | cut -d+ -f1 | tr -d " ")'
|
||||||
|
- BUILD_NAME="$BASE_VERSION-$SHA"
|
||||||
|
- VERSION_CODE=$((2000 + COMMIT_COUNT))
|
||||||
|
- flutter build appbundle --release --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
|
||||||
|
# universal apk for the website's download button, the .aab is for stores
|
||||||
|
- flutter build apk --release --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
|
||||||
|
|
||||||
|
- name: build-debug
|
||||||
|
image: git.firka.app/firka/firka-builder:latest
|
||||||
|
when:
|
||||||
|
- branch:
|
||||||
|
exclude: [main, staging]
|
||||||
|
commands:
|
||||||
|
- export PUB_CACHE="$CI_WORKSPACE/.pub-cache"
|
||||||
|
- cd firka
|
||||||
|
- '[ -f "$(git rev-parse --git-dir)/shallow" ] && git fetch --unshallow 2>/dev/null || true'
|
||||||
|
- SHA=$(git rev-parse --short HEAD)
|
||||||
|
- COMMIT_COUNT=$(git rev-list --count HEAD)
|
||||||
|
- 'BASE_VERSION=$(grep "^version:" pubspec.yaml | cut -d: -f2 | cut -d+ -f1 | tr -d " ")'
|
||||||
|
- BUILD_NAME="$BASE_VERSION-$SHA"
|
||||||
|
- VERSION_CODE=$((2000 + COMMIT_COUNT))
|
||||||
|
- flutter build apk --debug --split-per-abi --build-name="$BUILD_NAME" --build-number="$VERSION_CODE"
|
||||||
|
|
||||||
|
|
||||||
|
- name: publish-release
|
||||||
|
image: woodpeckercommunity/plugin-gitea-package:latest
|
||||||
|
pull: true
|
||||||
|
when:
|
||||||
|
- branch: [main, staging]
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_token
|
||||||
|
owner: firka
|
||||||
|
package_name: firka
|
||||||
|
package_version: ${CI_COMMIT_SHA}
|
||||||
|
file_source: ./firka/build/app/outputs/bundle/release/app-release.aab
|
||||||
|
file_name: app-release.aab
|
||||||
|
update: 'true'
|
||||||
|
|
||||||
|
- name: publish-release-apk
|
||||||
|
image: woodpeckercommunity/plugin-gitea-package:latest
|
||||||
|
pull: true
|
||||||
|
when:
|
||||||
|
- branch: [main, staging]
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_token
|
||||||
|
owner: firka
|
||||||
|
package_name: firka
|
||||||
|
package_version: ${CI_COMMIT_SHA}
|
||||||
|
file_source: ./firka/build/app/outputs/flutter-apk/app-release.apk
|
||||||
|
file_name: app-release.apk
|
||||||
|
update: 'true'
|
||||||
|
|
||||||
|
- name: publish-debug-arm64-v8a
|
||||||
|
image: woodpeckercommunity/plugin-gitea-package:latest
|
||||||
|
pull: true
|
||||||
|
when:
|
||||||
|
- branch:
|
||||||
|
exclude: [main, staging]
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_token
|
||||||
|
owner: firka
|
||||||
|
package_name: firka
|
||||||
|
package_version: ${CI_COMMIT_SHA}
|
||||||
|
file_source: ./firka/build/app/outputs/flutter-apk/app-arm64-v8a-debug.apk
|
||||||
|
file_name: app-arm64-v8a-debug.apk
|
||||||
|
update: 'true'
|
||||||
|
|
||||||
|
- name: publish-debug-armeabi-v7a
|
||||||
|
image: woodpeckercommunity/plugin-gitea-package:latest
|
||||||
|
pull: true
|
||||||
|
when:
|
||||||
|
- branch:
|
||||||
|
exclude: [main, staging]
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_token
|
||||||
|
owner: firka
|
||||||
|
package_name: firka
|
||||||
|
package_version: ${CI_COMMIT_SHA}
|
||||||
|
file_source: ./firka/build/app/outputs/flutter-apk/app-armeabi-v7a-debug.apk
|
||||||
|
file_name: app-armeabi-v7a-debug.apk
|
||||||
|
update: 'true'
|
||||||
|
|
||||||
|
- name: publish-debug-x86_64
|
||||||
|
image: woodpeckercommunity/plugin-gitea-package:latest
|
||||||
|
pull: true
|
||||||
|
when:
|
||||||
|
- branch:
|
||||||
|
exclude: [main, staging]
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: gitea_username
|
||||||
|
password:
|
||||||
|
from_secret: gitea_token
|
||||||
|
owner: firka
|
||||||
|
package_name: firka
|
||||||
|
package_version: ${CI_COMMIT_SHA}
|
||||||
|
file_source: ./firka/build/app/outputs/flutter-apk/app-x86_64-debug.apk
|
||||||
|
file_name: app-x86_64-debug.apk
|
||||||
|
update: 'true'
|
||||||
|
|
||||||
10
CLAUDE.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Firka
|
||||||
|
|
||||||
|
Before you change code, write a comment or make a commit in this repo, get the Firka style guide and follow it. It is in a separate repo so it stays the same across all Firka projects.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
[ -d ../style-guide ] && git -C ../style-guide pull --ff-only \
|
||||||
|
|| git clone https://git.firka.app/firka/style-guide.git ../style-guide
|
||||||
|
```
|
||||||
|
|
||||||
|
Then read `../style-guide/CLAUDE.md` and do what it says. It lists the skills to install and which style skill belongs to this repo.
|
||||||
@@ -1,35 +1,19 @@
|
|||||||
# Flutter telepítése
|
# Flutter telepítése
|
||||||
|
|
||||||
A firka androidra való lebuildeléséhez kötelező a saját Flutter fork használata, illetve minden más fajta --release buildhez is.
|
|
||||||
|
|
||||||
A Flutter telepítéséhez a dokumentáció [itt](https://docs.flutter.dev/get-started/install) található.
|
A Flutter telepítéséhez a dokumentáció [itt](https://docs.flutter.dev/get-started/install) található.
|
||||||
|
A projekt jelenleg a 3.41.2-es Flutter SDK-t használja.
|
||||||
A Flutter zip letöltése helyett a custom engine-t cloneold le ([https://git.firka.app/firka/flutter/](https://git.firka.app/firka/flutter/))
|
|
||||||
|
|
||||||
# Brotli
|
|
||||||
|
|
||||||
A firka brotlival compresseli a libflutter-t buildelés közben ezért szükséges a projekt
|
|
||||||
buildeléséhez hogy a brotli a PATH-ben legyen
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
- Töltsd le a `brotli-x64-windows-static.zip`-et a [google/brotli github repoból](https://github.com/google/brotli/releases/latest)
|
|
||||||
- Csomagold ki valahol (pl. C:\Users\\<username>\dev\brotli)
|
|
||||||
- Add hozzá a mappát ahova kicsomagoltad (C:\Users\\<username>\dev\brotli) a PATH-hez
|
|
||||||
- Ne felejtsd el újraindítani az IDE-det illetve parancssorodat utánna hogy frissüljön a PATH
|
|
||||||
|
|
||||||
## Linux/MacOS
|
|
||||||
Telepítsd fel a brotli packaget a distro-d package managerével
|
|
||||||
|
|
||||||
# Keystore
|
# Keystore
|
||||||
|
|
||||||
[Secrets dokumentáció](secrets/README.md)
|
[Secrets dokumentáció](secrets/README.md)
|
||||||
|
|
||||||
# Flutter l10n
|
# Fileok generálása
|
||||||
|
|
||||||
Flutter l10n fileok generálása
|
Flutter l10n és egyéb fileok generálása
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
Flutter gen-l10n --template-arb-file app_hu.arb
|
$ cd firka # vagy firka_wear
|
||||||
|
$ dart run scripts/codegen.dart
|
||||||
```
|
```
|
||||||
|
|
||||||
# Android debug build
|
# Android debug build
|
||||||
@@ -42,20 +26,10 @@ $ Flutter build apk --debug --target-platform android-arm,android-arm64,android-
|
|||||||
|
|
||||||
# Android release build
|
# Android release build
|
||||||
|
|
||||||
A release buildhez közelező egy keystore használata, illetve a saját Flutter engineünk használata.
|
A release buildhez közelező egy keystore használata.
|
||||||
|
|
||||||
## Custom Flutter engine setupolása
|
## Release appbundle buildelése (firka és firka_wear)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ git clone https://git.firka.app/firka/flutter
|
$ ./build.sh
|
||||||
$ cd flutter
|
|
||||||
$ . dev/tools/envsetup.sh
|
|
||||||
$ gclient sync -D
|
|
||||||
$ ./dev/tools/build_release.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Release apk buildelése
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ ./tools/linux/build_apk.sh main
|
|
||||||
```
|
```
|
||||||
35
CONTRIBUTING_de.md
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
# Flutter installieren
|
||||||
|
|
||||||
|
Die Dokumentation zur Installation von Flutter findest du [hier](https://docs.flutter.dev/get-started/install).
|
||||||
|
Das Projekt verwendet derzeit das Flutter SDK 3.41.2.
|
||||||
|
|
||||||
|
# Keystore
|
||||||
|
|
||||||
|
[Dokumentation zu Secrets](secrets/README.md)
|
||||||
|
|
||||||
|
# Dateien generieren
|
||||||
|
|
||||||
|
Flutter-L10N-Dateien und andere Dateien generieren
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ cd firka # oder firka_wear
|
||||||
|
$ dart run scripts/codegen.dart
|
||||||
|
```
|
||||||
|
|
||||||
|
# Android-Debug-Build
|
||||||
|
|
||||||
|
Für den Dev-Build ist kein Keystore erforderlich
|
||||||
|
```shell
|
||||||
|
$ cd firka
|
||||||
|
$ flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
|
||||||
|
```
|
||||||
|
|
||||||
|
# Android-Release-Build
|
||||||
|
|
||||||
|
Der Release-Build erfordert die Verwendung eines Keystores.
|
||||||
|
|
||||||
|
## Erstellen des Release-Appbundles (firka und firka_wear)
|
||||||
|
|
||||||
|
```shell
|
||||||
|
$ ./build.sh
|
||||||
|
```
|
||||||
@@ -1,41 +1,24 @@
|
|||||||
# Installing flutter
|
# Installing Flutter
|
||||||
|
|
||||||
To build firka you will have to use our custom Flutter fork,
|
Flutter installation documentation can be found [here](https://docs.flutter.dev/get-started/install).
|
||||||
and to make a release build you will have to use our custom
|
The project currently uses Flutter SDK 3.41.2.
|
||||||
flutter engine.
|
|
||||||
The documentation for installing flutter can be found [here](https://docs.flutter.dev/get-started/install).
|
|
||||||
|
|
||||||
Instead of downloading the regular flutter zip, clone it from ([https://git.firka.app/firka/flutter/](https://git.firka.app/firka/flutter/)).
|
|
||||||
|
|
||||||
# Brotli
|
|
||||||
|
|
||||||
Firka uses brotli to compress libflutter during the build process to make the app smaller,
|
|
||||||
so building Firka requires you to have brotli in your path
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
- Download `brotli-x64-windows-static.zip` from [google/brotli](https://github.com/google/brotli/releases/latest)
|
|
||||||
- Extract it to somewhere like C:\Users\\<username>\dev\brotli
|
|
||||||
- Add the directory (ex. C:\Users\\<username>\dev\brotli) to your PATH
|
|
||||||
- Don't forget to restart your IDE or terminal sessions for the PATH variable to update
|
|
||||||
|
|
||||||
## Linux/MacOS
|
|
||||||
Install it using your distro's package manager
|
|
||||||
|
|
||||||
# Keystore
|
# Keystore
|
||||||
|
|
||||||
[Secrets docs](secrets/README_en.md)
|
[Secrets documentation](secrets/README.md)
|
||||||
|
|
||||||
# Flutter l10n
|
# Generating files
|
||||||
|
|
||||||
Generating flutter l10n files
|
Generating Flutter l10n and other files
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
flutter gen-l10n --template-arb-file app_hu.arb
|
$ cd firka # or firka_wear
|
||||||
|
$ dart run scripts/codegen.dart
|
||||||
```
|
```
|
||||||
|
|
||||||
# Android debug build
|
# Android debug build
|
||||||
|
|
||||||
The dev build doesn't require using a custom keystore
|
The dev build does not require using a keystore
|
||||||
```shell
|
```shell
|
||||||
$ cd firka
|
$ cd firka
|
||||||
$ flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
|
$ flutter build apk --debug --target-platform android-arm,android-arm64,android-x64
|
||||||
@@ -43,20 +26,10 @@ $ flutter build apk --debug --target-platform android-arm,android-arm64,android-
|
|||||||
|
|
||||||
# Android release build
|
# Android release build
|
||||||
|
|
||||||
The release build requires using a custom keystore and our custom flutter fork
|
The release build requires using a keystore.
|
||||||
|
|
||||||
## Setting up our flutter engine fork
|
## Building the release appbundle (firka and firka_wear)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ git clone https://git.firka.app/firka/flutter
|
$ ./build.sh
|
||||||
$ cd flutter
|
|
||||||
$ . dev/tools/envsetup.sh
|
|
||||||
$ gclient sync -D
|
|
||||||
$ ./dev/tools/build_release.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building the release apk
|
|
||||||
|
|
||||||
```shell
|
|
||||||
$ ./tools/linux/build_apk.sh main
|
|
||||||
```
|
|
||||||
167
Jenkinsfile
vendored
@@ -1,167 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
label 'ubuntu'
|
|
||||||
}
|
|
||||||
environment {
|
|
||||||
PATH = "/home/jenkins/development/flutter/bin:${env.PATH}"
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Pre-build Cleanup') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh '''#!/bin/sh
|
|
||||||
set -x
|
|
||||||
fusermount -u secrets || true
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Decrypt main keys') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
def userInput = input(
|
|
||||||
id: 'signaturePassword',
|
|
||||||
message: 'Please enter the signing key password:',
|
|
||||||
parameters: [
|
|
||||||
password(
|
|
||||||
defaultValue: '',
|
|
||||||
description: 'Enter the signing key password',
|
|
||||||
name: 'password'
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
env.PASSWORD = userInput.toString()
|
|
||||||
}
|
|
||||||
sh '''#!/bin/sh
|
|
||||||
echo \$PASSWORD | gocryptfs $HOME/android_secrets secrets/ -nonempty
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Clone submodules') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh 'git submodule update --init --recursive'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Build firka') {
|
|
||||||
steps {
|
|
||||||
sh 'bash -c "./tools/linux/build_apk.sh ' + env.BRANCH_NAME + '"'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Rename Release APKs') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh '''#!/bin/sh
|
|
||||||
set -e
|
|
||||||
|
|
||||||
APK_DIR="firka/build/app/outputs/flutter-apk"
|
|
||||||
|
|
||||||
# Find all release APKs and rename them
|
|
||||||
for apk_file in $APK_DIR/app-*-release.apk; do
|
|
||||||
if [ -f "$apk_file" ]; then
|
|
||||||
# Extract ABI from filename (e.g., app-arm64-v8a-release.apk -> arm64-v8a)
|
|
||||||
basename_file=$(basename "$apk_file")
|
|
||||||
abi=$(echo "$basename_file" | sed 's/app-//; s/-release.apk//')
|
|
||||||
|
|
||||||
# Create new filename
|
|
||||||
new_name="app.firka.naplo_${abi}.apk"
|
|
||||||
new_path="$APK_DIR/$new_name"
|
|
||||||
|
|
||||||
echo "Renaming $apk_file to $new_path"
|
|
||||||
mv "$apk_file" "$new_path"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
ls -la $APK_DIR/app.firka.naplo_*.apk || echo "APK files not found"
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Calculate Version Code') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh '''#!/bin/sh
|
|
||||||
set -e
|
|
||||||
cd firka
|
|
||||||
|
|
||||||
# Calculate version code based on git commits (same logic as build script)
|
|
||||||
COMMIT_COUNT=$(git rev-list --count HEAD)
|
|
||||||
BASE_BUILD_NUMBER=$((1300 + COMMIT_COUNT))
|
|
||||||
|
|
||||||
if [ "$BRANCH_NAME" = "main" ]; then
|
|
||||||
# For main branch, highest version code is BASE + 3000 (x64 build)
|
|
||||||
VERSION_CODE=$((BASE_BUILD_NUMBER + 3000))
|
|
||||||
else
|
|
||||||
# For debug builds, version code is BASE + 0
|
|
||||||
VERSION_CODE=$BASE_BUILD_NUMBER
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Calculated version code: $VERSION_CODE"
|
|
||||||
echo "$VERSION_CODE" > ../version_code.txt
|
|
||||||
'''
|
|
||||||
|
|
||||||
env.VERSION_CODE = readFile('version_code.txt').trim()
|
|
||||||
echo "Setting VERSION_CODE environment variable to: ${env.VERSION_CODE}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish debug artifacts') {
|
|
||||||
when {
|
|
||||||
not {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
archiveArtifacts artifacts: 'firka/build/app/outputs/flutter-apk/app-debug.apk', fingerprint: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish release AABs artifacts') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
archiveArtifacts artifacts: 'firka/build/app/outputs/bundle/release/*.aab', fingerprint: true
|
|
||||||
sh 'rm firka/build/app/outputs/bundle/release/*.aab'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Publish release APKs artifacts') {
|
|
||||||
when {
|
|
||||||
branch 'main'
|
|
||||||
}
|
|
||||||
steps {
|
|
||||||
archiveArtifacts artifacts: 'firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk', fingerprint: true
|
|
||||||
sh 'rm firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Post Cleanup') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh '''
|
|
||||||
rm firka/build/app/outputs/bundle/release/*.aab || true
|
|
||||||
rm firka/build/app/outputs/flutter-apk/app.firka.naplo_*.apk || true
|
|
||||||
rm firka/build/app/outputs/flutter-apk/app-debug.apk || true
|
|
||||||
rm version_code.txt || true
|
|
||||||
git checkout -- firka/pubspec.yaml || true
|
|
||||||
git checkout -- firka/lib/helpers/firka_bundle.dart || true
|
|
||||||
'''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
52
README.md
@@ -1,13 +1,49 @@
|
|||||||
# Firka Napló
|
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
|
||||||
|
|
||||||
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) |
|
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|
||||||
|-----------------------------------|---------------------------------------|
|
|-----------------------------------|---------------------------------------|---------------------------------------|
|
||||||
|
|
||||||
[](https://crowdin.com/project/firka)
|
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Fordítás állapota"></a>
|
||||||
|
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Üzemidő&suffix=%" alt="Üzemidő"></a>
|
||||||
|
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build állapota"></a>
|
||||||
|
|
||||||
## A projektről
|
### Azért kezdtünk neki ennek a projektnek, mert úgy véltük, hogy a hivatalos alkalmazás nem volt elég jó. A Firka egy teljesen nyílt forráskódú, közösség által karbantartott alternatíva, és ez még csak a kezdet. Minden verzióval gyorsabb, testreszabhatóbb és felhasználóbarátabb lesz.
|
||||||
|
|
||||||
Firka egy alternatív [megnevezetlen naplóra] egy kliens alkalmazás. Az alkalmazás célja
|
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
|
||||||
egy modern, felhasználóbarát felület biztosítása a(z) [megnevezetlen napló] rendszerhez.
|
|
||||||
|
|
||||||
A [fejlesztői környezet beállítsa](CONTRIBUTING.md)
|
<br />
|
||||||
|
|
||||||
|
## Mik egyáltalán az alkalmazás funkciói?
|
||||||
|
### Lásd előre, mi vár rád
|
||||||
|
|
||||||
|
A főképernyő megmutatja a közelgő óráidat, hogy soha ne érjen meglepetés. Szűrj tantárgy, dolgozatok, vagy bármi más alapján, ami számodra fontos. Az alsó sáv teljesen testreszabható – tedd oda, amit használsz, és rejtsd el, amit nem.
|
||||||
|
|
||||||
|
|
||||||
|
### Jegyek, a te feltételeid szerint
|
||||||
|
|
||||||
|
Nem vagy felkészülve a jegyeidre? Ez a beállítás elrejti őket, amíg egyesével meg nem nyitod őket, így kényelmes tempóban dolgozhatod fel minden kudarcodat.
|
||||||
|
|
||||||
|
|
||||||
|
### Pontosan mennyire vagy rossz matekból?
|
||||||
|
|
||||||
|
A jegyek oldalon grafikon mutatja az összesített átlagodat, így végig követheted, ahogyan lassan süllyed a félév során. Minden tantárgyhoz külön grafikon is tartozik, ha pontosan tudni akarod melyik a tettes.
|
||||||
|
|
||||||
|
|
||||||
|
### Szabj testre mindent
|
||||||
|
|
||||||
|
A beállítások képernyőn olyan lehetőségek is vannak, amelyekről nem is tudtad, hogy szükséged van rájuk. Állítsd be a csengő eltolását, hogy másodpercre pontosan tudd, mikor ér véget az óra.
|
||||||
|
Balkezes mód is van, mert úgy tűnik, van, aki nem volt szerencsés az életben.
|
||||||
|
|
||||||
|
|
||||||
|
## Mit támogattok?
|
||||||
|
|
||||||
|
Jelenleg **Androidot** támogatunk (Wear OS-es okosóra-kísérőalkalmazással).
|
||||||
|
<br />
|
||||||
|
Tervezzük a böngészős támogatást is!
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
Az első lépéseket a [közreműködési útmutatóban](CONTRIBUTING_en.md) találod.
|
||||||
|
|
||||||
|
## Közösség
|
||||||
|
|
||||||
|
[Discord](https://discord.gg/xTspd3zzRZ)
|
||||||
51
README_de.md
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
|
||||||
|
|
||||||
|
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|
||||||
|
|-----------------------------------|---------------------------------------|---------------------------------------|
|
||||||
|
|
||||||
|
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Translation status"></a>
|
||||||
|
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Uptime&suffix=%" alt="Uptime"></a>
|
||||||
|
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build status"></a>
|
||||||
|
|
||||||
|
### Wir haben diese App entwickelt, weil die offizielle App viel zu wünschen übrig ließ. Firka ist eine vollständig open-source, von der Community gepflegte Alternative, und wir stehen erst am Anfang. Mit jedem Release wird sie schneller, anpassbarer und benutzerfreundlicher.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
## Was sind überhaupt die Funktionen der App?
|
||||||
|
### Sieh, was ansteht
|
||||||
|
|
||||||
|
Der Startbildschirm zeigt deine anstehenden Lektionen an, damit du nie unvorbereitet bist. Filtere nach Fach, Prüfungen oder was auch immer dir gerade wichtig ist. Die untere Leiste ist vollständig anpassbar: Zeige an was du nutzt und verstecke was du nicht brauchst.
|
||||||
|
|
||||||
|
|
||||||
|
### Noten, ganz nach deinen Vorstellungen
|
||||||
|
|
||||||
|
Emotional nicht bereit für deine eigenen Noten? Diese Einstellung hält sie verborgen, bis du jede einzelne antippst, damit du deine Misserfolge in einem angenehmen Tempo verarbeiten kannst.
|
||||||
|
|
||||||
|
|
||||||
|
### Wie schlecht bist du eigentlich in Mathe?
|
||||||
|
|
||||||
|
Die Noten-Seite enthält ein Diagramm deines Gesamtdurchschnitts, sodass du beobachten kannst, wie er im Laufe des Semesters langsam sinkt. Jedes Fach hat zudem ein eigenes Diagramm, falls du genau wissen möchtest, welches dafür verantwortlich ist.
|
||||||
|
|
||||||
|
|
||||||
|
### Alles anpassen
|
||||||
|
|
||||||
|
Der Einstellungsbildschirm bietet Optionen, von denen du nicht wusstest, dass du sie brauchst. Passe die Glockenverzögerung an, damit du auf die Sekunde genau weißt, wann der Unterricht endet. Es gibt auch einen Linkshänder-Modus, denn anscheinend benutzen manche Leute ihr Handy falsch.
|
||||||
|
|
||||||
|
|
||||||
|
## Was wird unterstützt?
|
||||||
|
|
||||||
|
Derzeit unterstützen wir **Android** (mit einer Wear OS Smartwatch-Begleit-App).
|
||||||
|
<br />
|
||||||
|
Wir planen, auch deinen Browser zu unterstützen!
|
||||||
|
|
||||||
|
## Mitwirken
|
||||||
|
Wir würden uns sehr über deine Hilfe freuen.
|
||||||
|
Du kannst im [Leitfaden zum unterstützen](CONTRIBUTING_de.md) loslegen.
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
[Discord](https://discord.gg/xTspd3zzRZ)
|
||||||
54
README_en.md
@@ -1,13 +1,51 @@
|
|||||||
# Firka
|
# <img src="https://git.firka.app/firka/readme-files/raw/branch/main/dave.png" height="40" /> Firka
|
||||||
|
|
||||||
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) |
|
| <sub>HU</sub> [Magyar](README.md) | <sub>EN</sub> [English](README_en.md) | <sub>DE</sub> [Deutsch](README_de.md) |
|
||||||
|-----------------------------------|---------------------------------------|
|
|-----------------------------------|---------------------------------------|---------------------------------------|
|
||||||
|
|
||||||
[](https://crowdin.com/project/firka)
|
<a href="https://translate.firka.app/engage/firka-naplo/"><img src="https://translate.firka.app/widget/firka-naplo/firka-app/en/svg-badge.svg" alt="Translation status"></a>
|
||||||
|
<a href="https://status.firka.app/"><img src="https://status.firka.app/api/badge/1/uptime/24?label=Uptime&suffix=%" alt="Uptime"></a>
|
||||||
|
<a href="https://builds.firka.app/job/Firka%20Beta/"><img src="https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fbuilds.firka.app%2Fjob%2FFirka%2520Beta%2F&label=Build" alt="Build status"></a>
|
||||||
|
|
||||||
## The project
|
### We built this because the official app left a lot to be desired. Firka is a fully open source, community maintained alternative and we're just getting started. Faster, more customizable, and more user friendly with every release.
|
||||||
|
|
||||||
Firka is an alternative client for [an application to be named]. The app's goal is to be a modern
|
|
||||||
user friendly app for the [to be named] system.
|
|
||||||
|
|
||||||
[Contribution guide](CONTRIBUTING_en.md)
|
|
||||||
|
<img src="https://git.firka.app/firka/readme-files/raw/branch/main/firka_features.png" width="100%" />
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
## What even are the app's features?
|
||||||
|
### See what's coming
|
||||||
|
|
||||||
|
The home screen shows your upcoming lessons so you're never caught off guard. Filter by subject, exams, or whatever you actually care about. The bottom bar is fully customizable, put what you use, hide what you don't.
|
||||||
|
|
||||||
|
|
||||||
|
### Grades, on your terms
|
||||||
|
|
||||||
|
Emotionally unprepared for your own grades? This setting keeps them hidden until you tap each one open, so you can process your failures at a comfortable pace.
|
||||||
|
|
||||||
|
|
||||||
|
### How bad are you at maths, exactly?
|
||||||
|
|
||||||
|
The grades page has a graph of your overall average, so you can watch it slowly decline over the semester. Each subject also gets its own graph, in case you wanted to know exactly which one is responsible.
|
||||||
|
|
||||||
|
|
||||||
|
### Customize everything
|
||||||
|
|
||||||
|
The settings screen has options you didn't know you needed. Adjust the bell offset so you know exactly when class ends down to the second. Left-handed mode exists too, because apparently some people use their phones wrong.
|
||||||
|
|
||||||
|
|
||||||
|
## What do you support?
|
||||||
|
|
||||||
|
Currently, we support **Android** (with a Wear OS smartwatch companion app).
|
||||||
|
<br />
|
||||||
|
We're planning on supporting your browser also!
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
We would really appriciate your help.
|
||||||
|
You can get started at the [contribution guide](CONTRIBUTING_en.md).
|
||||||
|
|
||||||
|
## Community
|
||||||
|
|
||||||
|
[Discord](https://discord.gg/xTspd3zzRZ)
|
||||||
48
cache.md
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
# Cache
|
||||||
|
|
||||||
|
Entry:
|
||||||
|
|
||||||
|
név|típus|
|
||||||
|
-|-|
|
||||||
|
latestElement|idő|
|
||||||
|
createdAt|idő|
|
||||||
|
response|Json|
|
||||||
|
|
||||||
|
Legutóbbi = Legutóbbi sikeres adatlekérdezés listájának legfrissebb elemének ideje.
|
||||||
|
|
||||||
|
## Timetable
|
||||||
|
|
||||||
|
TimetableDay entry.
|
||||||
|
|
||||||
|
Frissíteni|Korábbi|Múlt hét|Jelenlegi hét|Jövő hét|Későbbi|
|
||||||
|
-|-|-|-|-|-|
|
||||||
|
belépéskor?|✖️|✖️|✔️|✔️|✖️|
|
||||||
|
kijelzéskor?|✖️|✖️|✖️|✖️|✔️|
|
||||||
|
|
||||||
|
Új mulasztáskor a mulasztás napját MINDIG frissíti.
|
||||||
|
|
||||||
|
## Értékelések/Tesztek/Faliújság/Feljegyzések/Házi feladatok
|
||||||
|
|
||||||
|
Frissíteni|Korábbi|Legutóbbi létrehozástól|
|
||||||
|
-|-|-|
|
||||||
|
belépéskor?|✖️|✔️|
|
||||||
|
kijelzéskor?|✖️|✖️|
|
||||||
|
|
||||||
|
## Mulasztások
|
||||||
|
|
||||||
|
Összes
|
||||||
|
|
||||||
|
## Egyéb
|
||||||
|
|
||||||
|
Belépéskor
|
||||||
|
|
||||||
|
--------
|
||||||
|
# IMPL
|
||||||
|
|
||||||
|
### GenericCache
|
||||||
|
Entry:
|
||||||
|
név|típus|
|
||||||
|
-|-|
|
||||||
|
userId|id|
|
||||||
|
createdAt|idő|
|
||||||
|
response|Json|
|
||||||
3
firka/.gitignore
vendored
@@ -52,4 +52,5 @@ app.*.map.json
|
|||||||
coverage
|
coverage
|
||||||
|
|
||||||
# Generated files
|
# Generated files
|
||||||
*.g.dart
|
*.g.dart
|
||||||
|
libisar.so
|
||||||
@@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
# The following line activates a set of recommended lints for Flutter apps,
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
# packages, and plugins designed to encourage good coding practices.
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
analyzer:
|
||||||
|
exclude:
|
||||||
|
- build/**
|
||||||
|
- android/**
|
||||||
include: package:flutter_lints/flutter.yaml
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
linter:
|
linter:
|
||||||
|
|||||||
@@ -1,32 +1,27 @@
|
|||||||
import java.io.FileInputStream
|
import java.io.FileInputStream
|
||||||
import java.util.Properties
|
import java.util.Properties
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("kotlin-android")
|
// START: FlutterFire Configuration
|
||||||
|
id("com.google.gms.google-services")
|
||||||
|
// END: FlutterFire Configuration
|
||||||
id("org.jetbrains.kotlin.plugin.compose")
|
id("org.jetbrains.kotlin.plugin.compose")
|
||||||
|
id("org.jetbrains.kotlin.android")
|
||||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||||
id("dev.flutter.flutter-gradle-plugin")
|
id("dev.flutter.flutter-gradle-plugin")
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "app.firka.naplo"
|
namespace = "app.firka.naplo"
|
||||||
compileSdk = flutter.compileSdkVersion
|
compileSdk = 37
|
||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
isCoreLibraryDesugaringEnabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
compose = true
|
compose = true
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
|
||||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "app.firka.naplo"
|
applicationId = "app.firka.naplo"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
@@ -36,14 +31,11 @@ android {
|
|||||||
versionCode = flutter.versionCode
|
versionCode = flutter.versionCode
|
||||||
versionName = flutter.versionName
|
versionName = flutter.versionName
|
||||||
}
|
}
|
||||||
|
|
||||||
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
|
val secretsDir = File(projectDir.absolutePath, "../../../secrets/")
|
||||||
val propsFile = File(secretsDir, "keystore.properties")
|
val propsFile = File(secretsDir, "keystore.properties")
|
||||||
|
|
||||||
if (propsFile.exists()) {
|
if (propsFile.exists()) {
|
||||||
val props = Properties().apply { FileInputStream(propsFile).use { load(it) } }
|
val props = Properties().apply { FileInputStream(propsFile).use { load(it) } }
|
||||||
val store = File(secretsDir, props["storeFile"].toString())
|
val store = File(secretsDir, props["storeFile"].toString())
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
create("release") {
|
create("release") {
|
||||||
storeFile = store
|
storeFile = store
|
||||||
@@ -57,7 +49,6 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
getByName("debug") {
|
getByName("debug") {
|
||||||
applicationIdSuffix = ".debug"
|
applicationIdSuffix = ".debug"
|
||||||
@@ -65,20 +56,30 @@ android {
|
|||||||
}
|
}
|
||||||
release {
|
release {
|
||||||
val config = signingConfigs.findByName("release")
|
val config = signingConfigs.findByName("release")
|
||||||
|
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
signingConfig = config
|
signingConfig = config
|
||||||
}
|
}
|
||||||
|
proguardFiles("proguard-rules.pro")
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
|
||||||
|
compilerOptions {
|
||||||
|
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
configurations.all {
|
||||||
|
resolutionStrategy {
|
||||||
|
force("androidx.test.espresso:espresso-core:3.6.1")
|
||||||
|
force("androidx.test.espresso:espresso-idling-resource:3.6.1")
|
||||||
|
}
|
||||||
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("androidx.glance:glance-appwidget:1.1.1")
|
implementation("androidx.glance:glance-appwidget:1.1.1")
|
||||||
implementation("com.google.android.gms:play-services-wearable:18.1.0")
|
implementation("com.google.android.gms:play-services-wearable:18.1.0")
|
||||||
|
implementation("com.google.android.gms:play-services-base:18.5.0")
|
||||||
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure .env exists before Flutter bundles assets (copy from .env.example if missing)
|
// Ensure .env exists before Flutter bundles assets (copy from .env.example if missing)
|
||||||
val envFile = file("${project.projectDir}/../../.env")
|
val envFile = file("${project.projectDir}/../../.env")
|
||||||
val envExampleFile = file("${project.projectDir}/../../.env.example")
|
val envExampleFile = file("${project.projectDir}/../../.env.example")
|
||||||
@@ -94,6 +95,25 @@ tasks.matching { it.name.startsWith("compileFlutterBuild") }.configureEach {
|
|||||||
dependsOn("ensureEnv")
|
dependsOn("ensureEnv")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ensure default ProGuard files exist at the projectDir location expected by AGP/R8 when build directory is relocated
|
||||||
|
val defaultProguardDir = file("${project.projectDir}/build/intermediates/default_proguard_files/global")
|
||||||
|
defaultProguardDir.mkdirs()
|
||||||
|
val defaultProguardOptimize = File(defaultProguardDir, "proguard-android-optimize.txt-9.2.0")
|
||||||
|
if (!defaultProguardOptimize.exists()) {
|
||||||
|
defaultProguardOptimize.writeText("-allowaccessmodification\n")
|
||||||
|
}
|
||||||
|
tasks.register("ensureProguardFiles") {
|
||||||
|
doLast {
|
||||||
|
defaultProguardDir.mkdirs()
|
||||||
|
if (!defaultProguardOptimize.exists()) {
|
||||||
|
defaultProguardOptimize.writeText("-allowaccessmodification\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tasks.matching { it.name.startsWith("compile") || it.name.contains("minify", ignoreCase = true) || it.name.contains("r8", ignoreCase = true) }.configureEach {
|
||||||
|
dependsOn("ensureProguardFiles")
|
||||||
|
}
|
||||||
|
|
||||||
flutter {
|
flutter {
|
||||||
source = "../.."
|
source = "../.."
|
||||||
}
|
}
|
||||||
29
firka/android/app/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "219357380322",
|
||||||
|
"project_id": "firka-4633b",
|
||||||
|
"storage_bucket": "firka-4633b.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:219357380322:android:5b776732799faa5c08a8bb",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "app.firka.naplo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyD-3VE9--eKRDGm1UW_P9JLaM2Hyd2Wfx4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
76
firka/android/app/proguard-rules.pro
vendored
@@ -1 +1,75 @@
|
|||||||
-keep class app.firka.naplo.glance.** { *; }
|
# Firka custom keep rules
|
||||||
|
-keep class app.firka.naplo.glance.** { *; }
|
||||||
|
|
||||||
|
# Android optimize rules (-allowaccessmodification)
|
||||||
|
-allowaccessmodification
|
||||||
|
|
||||||
|
# Android common keep rules
|
||||||
|
-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
|
||||||
|
|
||||||
|
# Native methods
|
||||||
|
-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
|
||||||
|
-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.
|
||||||
|
-dontnote android.support.**
|
||||||
|
-dontnote androidx.**
|
||||||
|
-dontwarn android.support.**
|
||||||
|
-dontwarn androidx.**
|
||||||
|
|
||||||
|
# Understand the @Keep support annotation.
|
||||||
|
-keep class android.support.annotation.Keep
|
||||||
|
-keep @android.support.annotation.Keep class * {*;}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@android.support.annotation.Keep <methods>;
|
||||||
|
}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@android.support.annotation.Keep <fields>;
|
||||||
|
}
|
||||||
|
-keepclasseswithmembers class * {
|
||||||
|
@android.support.annotation.Keep <init>(...);
|
||||||
|
}
|
||||||
|
|
||||||
|
-dontnote org.apache.http.**
|
||||||
|
-dontnote android.net.http.**
|
||||||
|
-dontnote java.lang.invoke.**
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
to allow setting breakpoints, to provide hot reload, etc.
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
-->
|
-->
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<application android:label="Firka Debug"
|
<application android:name="app.firka.naplo.AppMain"
|
||||||
|
android:label="Firka Debug"
|
||||||
android:usesCleartextTraffic="true" />
|
android:usesCleartextTraffic="true" />
|
||||||
</manifest>
|
</manifest>
|
||||||
29
firka/android/app/src/debug/google-services.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "219357380322",
|
||||||
|
"project_id": "firka-4633b",
|
||||||
|
"storage_bucket": "firka-4633b.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:219357380322:android:5b776732799faa5c08a8bb",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "app.firka.naplo.debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyD-3VE9--eKRDGm1UW_P9JLaM2Hyd2Wfx4"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
@@ -3,9 +3,16 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
||||||
|
<uses-permission android:name="android.permission.POST_PROMOTED_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
|
||||||
|
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".AppMain"
|
android:name=".AppMain"
|
||||||
@@ -16,6 +23,24 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:foregroundServiceType="dataSync" />
|
android:foregroundServiceType="dataSync" />
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".ProgressNotificationForegroundService"
|
||||||
|
android:exported="false"
|
||||||
|
android:foregroundServiceType="specialUse">
|
||||||
|
<property
|
||||||
|
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
||||||
|
android:value="Displays ongoing school day lesson and break progress updates." />
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<receiver
|
||||||
|
android:name=".ProgressAlarmReceiver"
|
||||||
|
android:exported="false">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="app.firka.naplo.ACTION_PROGRESS_6AM_ALARM" />
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
@@ -669,6 +694,7 @@
|
|||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
|
<action android:name="app.firka.naplo.ACTION_REFRESH_WIDGET" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.appwidget.provider"
|
android:name="android.appwidget.provider"
|
||||||
@@ -684,6 +710,13 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="com.google.android.wearable.standalone"
|
android:name="com.google.android.wearable.standalone"
|
||||||
android:value="true" />
|
android:value="true" />
|
||||||
|
|
||||||
|
<!-- Small status-bar icon for FCM notification-payload messages that
|
||||||
|
Android displays automatically (data-only wakeups instead go
|
||||||
|
through LocalNotificationService, which sets its own icon). -->
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.firebase.messaging.default_notification_icon"
|
||||||
|
android:resource="@drawable/ic_notification" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
<!-- Required to query activities that can process text, see:
|
<!-- Required to query activities that can process text, see:
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ import org.json.JSONObject
|
|||||||
|
|
||||||
fun JSONObject.getStringOrNull(key: String): String? {
|
fun JSONObject.getStringOrNull(key: String): String? {
|
||||||
return try {
|
return try {
|
||||||
if (has(key)) {
|
if (has(key) && !isNull(key)) {
|
||||||
getString(key)
|
val v = getString(key)
|
||||||
|
if (v == "null" || v.isBlank()) null else v
|
||||||
} else {
|
} else {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package app.firka.naplo
|
package app.firka.naplo
|
||||||
|
|
||||||
|
import android.app.NotificationManager
|
||||||
import android.appwidget.AppWidgetManager
|
import android.appwidget.AppWidgetManager
|
||||||
import android.content.ComponentName
|
import android.content.ComponentName
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -10,6 +11,8 @@ import android.util.Log
|
|||||||
import androidx.glance.appwidget.updateAll
|
import androidx.glance.appwidget.updateAll
|
||||||
import app.firka.naplo.glance.TimetableWidget
|
import app.firka.naplo.glance.TimetableWidget
|
||||||
import app.firka.naplo.glance.TimetableWidgetReceiver
|
import app.firka.naplo.glance.TimetableWidgetReceiver
|
||||||
|
import com.google.android.gms.common.ConnectionResult
|
||||||
|
import com.google.android.gms.common.GoogleApiAvailability
|
||||||
import io.flutter.embedding.android.FlutterActivity
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
import io.flutter.embedding.engine.FlutterEngine
|
import io.flutter.embedding.engine.FlutterEngine
|
||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
@@ -23,6 +26,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
|
|
||||||
private val channel = "firka.app/main"
|
private val channel = "firka.app/main"
|
||||||
private val wearSyncChannel = "app.firka/wear_sync"
|
private val wearSyncChannel = "app.firka/wear_sync"
|
||||||
|
private val progressNotificationChannel = "app.firka/progress_notification"
|
||||||
|
|
||||||
private fun forceIconUpdate() {
|
private fun forceIconUpdate() {
|
||||||
try {
|
try {
|
||||||
@@ -90,6 +94,67 @@ class MainActivity : FlutterActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, progressNotificationChannel).setMethodCallHandler { call, result ->
|
||||||
|
when (call.method) {
|
||||||
|
"startProgressService" -> {
|
||||||
|
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
|
||||||
|
action = ProgressNotificationForegroundService.ACTION_START
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
startForegroundService(intent)
|
||||||
|
} else {
|
||||||
|
startService(intent)
|
||||||
|
}
|
||||||
|
result.success(true)
|
||||||
|
}
|
||||||
|
"stopProgressService" -> {
|
||||||
|
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
|
||||||
|
action = ProgressNotificationForegroundService.ACTION_STOP
|
||||||
|
}
|
||||||
|
startService(intent)
|
||||||
|
result.success(true)
|
||||||
|
}
|
||||||
|
"isProgressServiceRunning" -> {
|
||||||
|
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
val isNotifActive = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
try {
|
||||||
|
nm.activeNotifications?.any { it.id == 4002 } ?: false
|
||||||
|
} catch (e: Exception) {
|
||||||
|
ProgressNotificationForegroundService.isRunning
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ProgressNotificationForegroundService.isRunning
|
||||||
|
}
|
||||||
|
result.success(ProgressNotificationForegroundService.isRunning && isNotifActive)
|
||||||
|
}
|
||||||
|
"updateProgressStrings" -> {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
val strings = call.arguments as? Map<String, String>
|
||||||
|
if (strings != null) {
|
||||||
|
ProgressNotificationForegroundService.saveStrings(this, strings)
|
||||||
|
if (ProgressNotificationForegroundService.isRunning) {
|
||||||
|
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
|
||||||
|
action = ProgressNotificationForegroundService.ACTION_UPDATE
|
||||||
|
}
|
||||||
|
startService(intent)
|
||||||
|
}
|
||||||
|
result.success(true)
|
||||||
|
} else {
|
||||||
|
result.error("INVALID_ARGS", "strings map required", null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"schedule6AmAlarm" -> {
|
||||||
|
ProgressAlarmReceiver.scheduleNext6AmAlarm(this)
|
||||||
|
result.success(true)
|
||||||
|
}
|
||||||
|
"cancel6AmAlarm" -> {
|
||||||
|
ProgressAlarmReceiver.cancel6AmAlarm(this)
|
||||||
|
result.success(true)
|
||||||
|
}
|
||||||
|
else -> result.notImplemented()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channel).setMethodCallHandler {
|
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, channel).setMethodCallHandler {
|
||||||
call, result ->
|
call, result ->
|
||||||
when (call.method) {
|
when (call.method) {
|
||||||
@@ -163,17 +228,10 @@ class MainActivity : FlutterActivity() {
|
|||||||
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
||||||
try {
|
try {
|
||||||
val appContext = context.applicationContext
|
val appContext = context.applicationContext
|
||||||
val appWidgetManager = AppWidgetManager.getInstance(appContext)
|
val intent = Intent(appContext, TimetableWidgetReceiver::class.java).apply {
|
||||||
val componentName = ComponentName(appContext, TimetableWidgetReceiver::class.java)
|
action = TimetableWidgetReceiver.ACTION_REFRESH_WIDGET
|
||||||
val ids = appWidgetManager.getAppWidgetIds(componentName)
|
|
||||||
if (ids.isNotEmpty()) {
|
|
||||||
val intent = Intent(appContext, TimetableWidgetReceiver::class.java).apply {
|
|
||||||
action = AppWidgetManager.ACTION_APPWIDGET_UPDATE
|
|
||||||
putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids)
|
|
||||||
addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
|
|
||||||
}
|
|
||||||
appContext.sendBroadcast(intent)
|
|
||||||
}
|
}
|
||||||
|
appContext.sendBroadcast(intent)
|
||||||
TimetableWidget().updateAll(appContext)
|
TimetableWidget().updateAll(appContext)
|
||||||
result.success(true)
|
result.success(true)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -181,6 +239,15 @@ class MainActivity : FlutterActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
"isGmsAvailable" -> {
|
||||||
|
try {
|
||||||
|
val availability = GoogleApiAvailability.getInstance()
|
||||||
|
val resultCode = availability.isGooglePlayServicesAvailable(context)
|
||||||
|
result.success(resultCode == ConnectionResult.SUCCESS)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
result.success(false)
|
||||||
|
}
|
||||||
|
}
|
||||||
else -> {
|
else -> {
|
||||||
result.notImplemented()
|
result.notImplemented()
|
||||||
}
|
}
|
||||||
@@ -190,6 +257,29 @@ class MainActivity : FlutterActivity() {
|
|||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_SECURE)
|
window.clearFlags(android.view.WindowManager.LayoutParams.FLAG_SECURE)
|
||||||
|
handleIntent(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onNewIntent(intent: Intent) {
|
||||||
|
super.onNewIntent(intent)
|
||||||
|
setIntent(intent)
|
||||||
|
handleIntent(intent)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handleIntent(intent: Intent?) {
|
||||||
|
val action = intent?.getStringExtra("action")
|
||||||
|
if (action == "pin_widget") {
|
||||||
|
val appWidgetManager = AppWidgetManager.getInstance(this)
|
||||||
|
val myProvider = ComponentName(this, TimetableWidgetReceiver::class.java)
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && appWidgetManager.isRequestPinAppWidgetSupported) {
|
||||||
|
appWidgetManager.requestPinAppWidget(myProvider, null, null)
|
||||||
|
}
|
||||||
|
} else if (action == "refresh_widget") {
|
||||||
|
val appContext = applicationContext
|
||||||
|
val refreshIntent = Intent(appContext, TimetableWidgetReceiver::class.java).apply {
|
||||||
|
this.action = TimetableWidgetReceiver.ACTION_REFRESH_WIDGET
|
||||||
|
}
|
||||||
|
appContext.sendBroadcast(refreshIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package app.firka.naplo
|
||||||
|
|
||||||
|
import android.app.AlarmManager
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Build
|
||||||
|
import android.util.Log
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import java.time.ZoneId
|
||||||
|
|
||||||
|
class ProgressAlarmReceiver : BroadcastReceiver() {
|
||||||
|
|
||||||
|
override fun onReceive(context: Context, intent: Intent?) {
|
||||||
|
Log.d(TAG, "onReceive action: ${intent?.action}")
|
||||||
|
|
||||||
|
scheduleNext6AmAlarm(context)
|
||||||
|
|
||||||
|
val data = ProgressNotificationForegroundService.loadTodayTimetable(context)
|
||||||
|
if (data == null || data.lessons.isEmpty()) {
|
||||||
|
Log.d(TAG, "No timetable for today at 6 AM wakeup; skipping service start")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val sorted = data.lessons.sortedBy { it.start }
|
||||||
|
val lastLesson = sorted.last()
|
||||||
|
val now = LocalDateTime.now()
|
||||||
|
|
||||||
|
if (now.isBefore(lastLesson.end)) {
|
||||||
|
Log.d(TAG, "Starting ProgressNotificationForegroundService from 6 AM alarm")
|
||||||
|
val serviceIntent = Intent(context, ProgressNotificationForegroundService::class.java).apply {
|
||||||
|
action = ProgressNotificationForegroundService.ACTION_START
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
context.startForegroundService(serviceIntent)
|
||||||
|
} else {
|
||||||
|
context.startService(serviceIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "ProgressAlarmReceiver"
|
||||||
|
const val ACTION_PROGRESS_6AM_ALARM = "app.firka.naplo.ACTION_PROGRESS_6AM_ALARM"
|
||||||
|
const val ALARM_REQUEST_CODE = 400201
|
||||||
|
|
||||||
|
fun scheduleNext6AmAlarm(context: Context) {
|
||||||
|
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as? AlarmManager ?: return
|
||||||
|
val intent = Intent(context, ProgressAlarmReceiver::class.java).apply {
|
||||||
|
action = ACTION_PROGRESS_6AM_ALARM
|
||||||
|
}
|
||||||
|
val pendingIntent = PendingIntent.getBroadcast(
|
||||||
|
context,
|
||||||
|
ALARM_REQUEST_CODE,
|
||||||
|
intent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
val now = LocalDateTime.now()
|
||||||
|
var target = now.toLocalDate().atTime(6, 0)
|
||||||
|
if (!target.isAfter(now)) {
|
||||||
|
target = target.plusDays(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
val epochMillis = target.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()
|
||||||
|
Log.d(TAG, "Scheduling next 6 AM alarm for $target ($epochMillis)")
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
|
||||||
|
} else {
|
||||||
|
alarmManager.setExact(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
|
||||||
|
}
|
||||||
|
} catch (e: SecurityException) {
|
||||||
|
Log.w(TAG, "SecurityException while scheduling exact 6 AM alarm, falling back to setWindow", e)
|
||||||
|
alarmManager.set(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun cancel6AmAlarm(context: Context) {
|
||||||
|
val alarmManager = context.getSystemService(Context.ALARM_SERVICE) as? AlarmManager ?: return
|
||||||
|
val intent = Intent(context, ProgressAlarmReceiver::class.java).apply {
|
||||||
|
action = ACTION_PROGRESS_6AM_ALARM
|
||||||
|
}
|
||||||
|
val pendingIntent = PendingIntent.getBroadcast(
|
||||||
|
context,
|
||||||
|
ALARM_REQUEST_CODE,
|
||||||
|
intent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
)
|
||||||
|
alarmManager.cancel(pendingIntent)
|
||||||
|
Log.d(TAG, "Cancelled 6 AM progress alarm")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,649 @@
|
|||||||
|
package app.firka.naplo
|
||||||
|
|
||||||
|
import android.app.AlarmManager
|
||||||
|
import android.app.Notification
|
||||||
|
import android.app.NotificationChannel
|
||||||
|
import android.app.NotificationManager
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.app.Service
|
||||||
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
|
import android.content.pm.ServiceInfo
|
||||||
|
import android.graphics.drawable.Icon
|
||||||
|
import android.os.Build
|
||||||
|
import android.os.IBinder
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.core.app.NotificationCompat
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import app.firka.naplo.glance.WidgetLesson
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.Job
|
||||||
|
import kotlinx.coroutines.SupervisorJob
|
||||||
|
import kotlinx.coroutines.cancel
|
||||||
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.isActive
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
|
import org.json.JSONObject
|
||||||
|
import java.io.File
|
||||||
|
import java.time.Duration
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.LocalDateTime
|
||||||
|
import java.time.ZoneId
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
|
|
||||||
|
class ProgressNotificationForegroundService : Service() {
|
||||||
|
|
||||||
|
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
|
||||||
|
private var tickerJob: Job? = null
|
||||||
|
private var isForegroundStarted = false
|
||||||
|
private var transitionPendingIntent: PendingIntent? = null
|
||||||
|
|
||||||
|
private val timeReceiver = object : BroadcastReceiver() {
|
||||||
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
|
when (intent?.action) {
|
||||||
|
Intent.ACTION_TIME_TICK,
|
||||||
|
Intent.ACTION_SCREEN_ON,
|
||||||
|
Intent.ACTION_USER_PRESENT -> {
|
||||||
|
refreshAndPostNotification()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private val channelId = "firka_progress_notification_v3"
|
||||||
|
private val notificationId = 4002
|
||||||
|
|
||||||
|
private val hhmm = DateTimeFormatter.ofPattern("HH:mm")
|
||||||
|
|
||||||
|
private fun formatTemplate(template: String, vararg replacements: Pair<String, String>): String {
|
||||||
|
var res = template
|
||||||
|
for ((key, value) in replacements) {
|
||||||
|
res = res.replace("{$key}", value)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
isRunning = true
|
||||||
|
createNotificationChannel()
|
||||||
|
val filter = IntentFilter().apply {
|
||||||
|
addAction(Intent.ACTION_TIME_TICK)
|
||||||
|
addAction(Intent.ACTION_SCREEN_ON)
|
||||||
|
addAction(Intent.ACTION_USER_PRESENT)
|
||||||
|
}
|
||||||
|
ContextCompat.registerReceiver(
|
||||||
|
this,
|
||||||
|
timeReceiver,
|
||||||
|
filter,
|
||||||
|
ContextCompat.RECEIVER_NOT_EXPORTED
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
|
createNotificationChannel()
|
||||||
|
when (intent?.action) {
|
||||||
|
ACTION_START, ACTION_UPDATE -> {
|
||||||
|
isRunning = true
|
||||||
|
refreshAndPostNotification()
|
||||||
|
startTicker()
|
||||||
|
}
|
||||||
|
ACTION_STOP -> {
|
||||||
|
isRunning = false
|
||||||
|
stopForegroundService()
|
||||||
|
return START_NOT_STICKY
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
isRunning = true
|
||||||
|
refreshAndPostNotification()
|
||||||
|
startTicker()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return START_STICKY
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBind(intent: Intent?): IBinder? = null
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
isRunning = false
|
||||||
|
cancelTransitionAlarm()
|
||||||
|
try {
|
||||||
|
unregisterReceiver(timeReceiver)
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
tickerJob?.cancel()
|
||||||
|
scope.cancel()
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startTicker() {
|
||||||
|
tickerJob?.cancel()
|
||||||
|
tickerJob = scope.launch {
|
||||||
|
while (isActive) {
|
||||||
|
val currentMillis = System.currentTimeMillis()
|
||||||
|
val millisIntoMinute = currentMillis % 60_000
|
||||||
|
// Target next :00 or :30 second boundary
|
||||||
|
val delayMillis = if (millisIntoMinute < 30_000) {
|
||||||
|
30_000 - millisIntoMinute
|
||||||
|
} else {
|
||||||
|
60_000 - millisIntoMinute
|
||||||
|
}.coerceIn(1_000, 30_000)
|
||||||
|
|
||||||
|
delay(delayMillis)
|
||||||
|
refreshAndPostNotification()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun refreshAndPostNotification() {
|
||||||
|
val widgetData = loadTodayTimetable(applicationContext)
|
||||||
|
|
||||||
|
if (widgetData == null || widgetData.lessons.isEmpty()) {
|
||||||
|
Log.d(TAG, "No lessons for today; stopping progress service")
|
||||||
|
stopForegroundService()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val lessons = widgetData.lessons.sortedBy { it.start }
|
||||||
|
val now = LocalDateTime.now()
|
||||||
|
val lastLesson = lessons.last()
|
||||||
|
|
||||||
|
// If today's last lesson has ended, stop notification & foreground service
|
||||||
|
if (now.isAfter(lastLesson.end) || now.isEqual(lastLesson.end)) {
|
||||||
|
Log.d(TAG, "Last lesson of the day ended (${lastLesson.end}); stopping progress service")
|
||||||
|
stopForegroundService()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val notification = buildProgressNotification(widgetData, now)
|
||||||
|
if (notification == null) {
|
||||||
|
stopForegroundService()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isForegroundStarted) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
startForeground(
|
||||||
|
notificationId,
|
||||||
|
notification,
|
||||||
|
ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
startForeground(notificationId, notification)
|
||||||
|
}
|
||||||
|
isForegroundStarted = true
|
||||||
|
}
|
||||||
|
|
||||||
|
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
nm.notify(notificationId, notification)
|
||||||
|
|
||||||
|
// Schedule exact alarm for next transition (lesson start/end or break end)
|
||||||
|
val firstLesson = lessons.first()
|
||||||
|
val targetTransitionTime: LocalDateTime? = when {
|
||||||
|
now.isBefore(firstLesson.start) -> firstLesson.start
|
||||||
|
else -> {
|
||||||
|
val currentLesson = lessons.find { !now.isBefore(it.start) && now.isBefore(it.end) }
|
||||||
|
if (currentLesson != null) {
|
||||||
|
currentLesson.end
|
||||||
|
} else {
|
||||||
|
val nextLesson = lessons.firstOrNull { it.start.isAfter(now) }
|
||||||
|
nextLesson?.start
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (targetTransitionTime != null) {
|
||||||
|
scheduleNextTransitionAlarm(targetTransitionTime)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun buildProgressNotification(data: TimetableProgressData, now: LocalDateTime): Notification? {
|
||||||
|
val strings = getStrings(this)
|
||||||
|
val lessons = data.lessons.sortedBy { it.start }
|
||||||
|
val firstLesson = lessons.first()
|
||||||
|
val lastLesson = lessons.last()
|
||||||
|
|
||||||
|
val pendingIntent = PendingIntent.getActivity(
|
||||||
|
this,
|
||||||
|
0,
|
||||||
|
packageManager.getLaunchIntentForPackage(packageName),
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
val accentColor = data.accentColor
|
||||||
|
val breakColor = data.breakColor
|
||||||
|
|
||||||
|
val remainingLessonsCount = lessons.count { !now.isAfter(it.end) }
|
||||||
|
val remainingSuffix = if (remainingLessonsCount == 1) {
|
||||||
|
strings["progress_notif_remaining_lessons_one"] ?: ""
|
||||||
|
} else {
|
||||||
|
val template = strings["progress_notif_remaining_lessons_other"] ?: ""
|
||||||
|
formatTemplate(template, "count" to remainingLessonsCount.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (now.isBefore(firstLesson.start)) {
|
||||||
|
val minutesLeft = minutesRemaining(now, firstLesson.start)
|
||||||
|
val firstLessonIconRes = resolveSubjectIcon(firstLesson)
|
||||||
|
|
||||||
|
val title = if (firstLesson.lessonNumber != null) {
|
||||||
|
val template = strings["progress_notif_lesson_title"] ?: ""
|
||||||
|
if (template.isNotEmpty()) {
|
||||||
|
formatTemplate(template, "number" to firstLesson.lessonNumber.toString(), "name" to firstLesson.name)
|
||||||
|
} else {
|
||||||
|
firstLesson.name
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
firstLesson.name
|
||||||
|
}
|
||||||
|
|
||||||
|
val room = firstLesson.roomName?.trim()
|
||||||
|
val roomSuffix = if (!room.isNullOrBlank() && room != "null") "\n$room" else ""
|
||||||
|
val subSuffix = if (!firstLesson.substituteTeacher.isNullOrBlank() && firstLesson.substituteTeacher != "null" && firstLesson.substituteTeacher != "-") {
|
||||||
|
strings["progress_notif_substitution"] ?: ""
|
||||||
|
} else ""
|
||||||
|
val timeRange = "${firstLesson.start.format(hhmm)}-${firstLesson.end.format(hhmm)}"
|
||||||
|
val templateCase1 = strings["progress_notif_case1_text"] ?: ""
|
||||||
|
val text = formatTemplate(
|
||||||
|
templateCase1,
|
||||||
|
"minutes" to minutesLeft.toString(),
|
||||||
|
"timeRange" to timeRange,
|
||||||
|
"room" to roomSuffix,
|
||||||
|
"substitution" to subSuffix,
|
||||||
|
"remaining" to remainingSuffix
|
||||||
|
)
|
||||||
|
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
|
||||||
|
val criticalText = formatTemplate(criticalTemplate, "minutes" to minutesLeft.toString())
|
||||||
|
|
||||||
|
val morningStart = firstLesson.start.toLocalDate().atTime(6, 0)
|
||||||
|
val baseStart = if (now.isBefore(morningStart)) now else morningStart
|
||||||
|
val totalMinutes = Duration.between(baseStart, firstLesson.start).toMinutes().coerceAtLeast(15)
|
||||||
|
val elapsed = Duration.between(baseStart, now).toMinutes().coerceIn(0, totalMinutes)
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 36) {
|
||||||
|
val progressStyle = Notification.ProgressStyle()
|
||||||
|
.setProgress(elapsed.toInt())
|
||||||
|
.setProgressSegments(listOf(
|
||||||
|
Notification.ProgressStyle.Segment(totalMinutes.toInt()).setColor(accentColor)
|
||||||
|
))
|
||||||
|
.setProgressEndIcon(Icon.createWithResource(this, firstLessonIconRes))
|
||||||
|
.setProgressTrackerIcon(Icon.createWithResource(this, R.drawable.ic_subject_break))
|
||||||
|
|
||||||
|
val builder = Notification.Builder(this, channelId)
|
||||||
|
.setStyle(progressStyle)
|
||||||
|
.setContentTitle(title)
|
||||||
|
.setContentText(text)
|
||||||
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
|
.setLargeIcon(Icon.createWithResource(this, firstLessonIconRes))
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setOngoing(true)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
|
.setRequestPromotedOngoing(true)
|
||||||
|
.setShortCriticalText(criticalText.take(7))
|
||||||
|
|
||||||
|
return builder.build()
|
||||||
|
} else {
|
||||||
|
return NotificationCompat.Builder(this, channelId)
|
||||||
|
.setContentTitle(title)
|
||||||
|
.setContentText(text)
|
||||||
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setProgress(totalMinutes.toInt(), elapsed.toInt(), false)
|
||||||
|
.setOngoing(true)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val currentLesson = lessons.find { !now.isBefore(it.start) && now.isBefore(it.end) }
|
||||||
|
|
||||||
|
val title: String
|
||||||
|
val text: String
|
||||||
|
val criticalText: String
|
||||||
|
val trackerIconRes: Int
|
||||||
|
val largeIconRes: Int
|
||||||
|
val endIconRes: Int
|
||||||
|
val itemDuration: Int
|
||||||
|
val itemElapsed: Int
|
||||||
|
val itemColor: Int
|
||||||
|
|
||||||
|
if (currentLesson != null) {
|
||||||
|
val lessonDuration = Duration.between(currentLesson.start, currentLesson.end).toMinutes().coerceAtLeast(1).toInt()
|
||||||
|
val elapsed = Duration.between(currentLesson.start, now).toMinutes().coerceIn(0, lessonDuration.toLong()).toInt()
|
||||||
|
val timeLeft = minutesRemaining(now, currentLesson.end)
|
||||||
|
|
||||||
|
itemDuration = lessonDuration
|
||||||
|
itemElapsed = elapsed
|
||||||
|
itemColor = accentColor
|
||||||
|
|
||||||
|
trackerIconRes = resolveSubjectIcon(currentLesson)
|
||||||
|
largeIconRes = trackerIconRes
|
||||||
|
endIconRes = R.drawable.ic_subject_break
|
||||||
|
|
||||||
|
val prefix = if (currentLesson.lessonNumber != null) {
|
||||||
|
val template = strings["progress_notif_lesson_title"] ?: ""
|
||||||
|
if (template.isNotEmpty()) {
|
||||||
|
formatTemplate(template, "number" to currentLesson.lessonNumber.toString(), "name" to currentLesson.name)
|
||||||
|
} else {
|
||||||
|
currentLesson.name
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentLesson.name
|
||||||
|
}
|
||||||
|
title = prefix
|
||||||
|
val room = currentLesson.roomName?.trim()
|
||||||
|
val roomSuffix = if (!room.isNullOrBlank() && room != "null") "\n$room" else ""
|
||||||
|
val subSuffix = if (!currentLesson.substituteTeacher.isNullOrBlank() && currentLesson.substituteTeacher != "null" && currentLesson.substituteTeacher != "-") {
|
||||||
|
strings["progress_notif_substitution"] ?: ""
|
||||||
|
} else ""
|
||||||
|
val timeRange = "${currentLesson.start.format(hhmm)}-${currentLesson.end.format(hhmm)}"
|
||||||
|
val templateLesson = strings["progress_notif_case2_lesson_text"] ?: ""
|
||||||
|
text = formatTemplate(
|
||||||
|
templateLesson,
|
||||||
|
"minutes" to timeLeft.toString(),
|
||||||
|
"timeRange" to timeRange,
|
||||||
|
"room" to roomSuffix,
|
||||||
|
"substitution" to subSuffix,
|
||||||
|
"remaining" to remainingSuffix
|
||||||
|
)
|
||||||
|
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
|
||||||
|
criticalText = formatTemplate(criticalTemplate, "minutes" to timeLeft.toString())
|
||||||
|
} else {
|
||||||
|
val previousLesson = lessons.lastOrNull { !now.isBefore(it.end) }
|
||||||
|
val nextLesson = lessons.firstOrNull { it.start.isAfter(now) }
|
||||||
|
val breakStart = previousLesson?.end ?: now
|
||||||
|
val breakEnd = nextLesson?.start ?: lastLesson.end
|
||||||
|
|
||||||
|
val breakDuration = Duration.between(breakStart, breakEnd).toMinutes().coerceAtLeast(1).toInt()
|
||||||
|
val elapsed = Duration.between(breakStart, now).toMinutes().coerceIn(0, breakDuration.toLong()).toInt()
|
||||||
|
val timeLeft = minutesRemaining(now, breakEnd)
|
||||||
|
|
||||||
|
itemDuration = breakDuration
|
||||||
|
itemElapsed = elapsed
|
||||||
|
itemColor = breakColor
|
||||||
|
|
||||||
|
trackerIconRes = R.drawable.ic_subject_break
|
||||||
|
largeIconRes = if (nextLesson != null) resolveSubjectIcon(nextLesson) else trackerIconRes
|
||||||
|
endIconRes = if (nextLesson != null) resolveSubjectIcon(nextLesson) else trackerIconRes
|
||||||
|
|
||||||
|
title = strings["progress_notif_case2_break_title"] ?: ""
|
||||||
|
val templateBreak = strings["progress_notif_case2_break_text"] ?: ""
|
||||||
|
text = formatTemplate(
|
||||||
|
templateBreak,
|
||||||
|
"minutes" to timeLeft.toString(),
|
||||||
|
"remaining" to remainingSuffix
|
||||||
|
)
|
||||||
|
val criticalTemplate = strings["progress_notif_critical_text"] ?: ""
|
||||||
|
criticalText = formatTemplate(criticalTemplate, "minutes" to timeLeft.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= 36) {
|
||||||
|
val progressStyle = Notification.ProgressStyle()
|
||||||
|
.setProgress(itemElapsed)
|
||||||
|
.setProgressSegments(listOf(
|
||||||
|
Notification.ProgressStyle.Segment(itemDuration).setColor(itemColor)
|
||||||
|
))
|
||||||
|
.setProgressTrackerIcon(Icon.createWithResource(this, trackerIconRes))
|
||||||
|
.setProgressEndIcon(Icon.createWithResource(this, endIconRes))
|
||||||
|
|
||||||
|
val builder = Notification.Builder(this, channelId)
|
||||||
|
.setStyle(progressStyle)
|
||||||
|
.setContentTitle(title)
|
||||||
|
.setContentText(text)
|
||||||
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
|
.setLargeIcon(Icon.createWithResource(this, largeIconRes))
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setOngoing(true)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
|
.setRequestPromotedOngoing(true)
|
||||||
|
.setShortCriticalText(criticalText.take(7))
|
||||||
|
|
||||||
|
return builder.build()
|
||||||
|
} else {
|
||||||
|
return NotificationCompat.Builder(this, channelId)
|
||||||
|
.setContentTitle(title)
|
||||||
|
.setContentText(text)
|
||||||
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
|
.setContentIntent(pendingIntent)
|
||||||
|
.setProgress(itemDuration, itemElapsed, false)
|
||||||
|
.setOngoing(true)
|
||||||
|
.setOnlyAlertOnce(true)
|
||||||
|
.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun resolveSubjectIcon(lesson: WidgetLesson): Int {
|
||||||
|
if (!lesson.icon.isNullOrEmpty()) {
|
||||||
|
val res = getSubjectIconRes(lesson.icon)
|
||||||
|
if (res != R.drawable.ic_notification) return res
|
||||||
|
}
|
||||||
|
val name = lesson.name.lowercase()
|
||||||
|
return when {
|
||||||
|
Regex("mate(k|matika)").containsMatchIn(name) -> R.drawable.ic_subject_mathematics
|
||||||
|
Regex("magyar nyelv|nyelvtan").containsMatchIn(name) -> R.drawable.ic_subject_grammar
|
||||||
|
Regex("irodalom").containsMatchIn(name) -> R.drawable.ic_subject_literature
|
||||||
|
Regex("tor(i|tenelem)").containsMatchIn(name) -> R.drawable.ic_subject_history
|
||||||
|
Regex("foldrajz").containsMatchIn(name) -> R.drawable.ic_subject_geography
|
||||||
|
Regex("rajz|muvtori|muveszet|vizualis").containsMatchIn(name) -> R.drawable.ic_subject_art
|
||||||
|
Regex("fizika").containsMatchIn(name) -> R.drawable.ic_subject_physics
|
||||||
|
Regex("^enek|zene|szolfezs|zongora|korus").containsMatchIn(name) -> R.drawable.ic_subject_music
|
||||||
|
Regex("^tes(i|tneveles)|sport|edzeselmelet").containsMatchIn(name) -> R.drawable.ic_subject_pe
|
||||||
|
Regex("kemia").containsMatchIn(name) -> R.drawable.ic_subject_chemistry
|
||||||
|
Regex("biologia").containsMatchIn(name) -> R.drawable.ic_subject_biology
|
||||||
|
Regex("angol|nemet|francia|olasz|orosz|spanyol|latin|kinai|idegen|nyelv").containsMatchIn(name) -> R.drawable.ic_subject_language
|
||||||
|
Regex("informatika|szoftver|digitalis").containsMatchIn(name) -> R.drawable.ic_subject_it
|
||||||
|
Regex("prog|alkalmazas").containsMatchIn(name) -> R.drawable.ic_subject_code
|
||||||
|
Regex("halozat").containsMatchIn(name) -> R.drawable.ic_subject_networking
|
||||||
|
Regex("filozofia").containsMatchIn(name) -> R.drawable.ic_subject_philosophy
|
||||||
|
Regex("osztaly(fonoki|kozosseg)").containsMatchIn(name) -> R.drawable.ic_subject_ofo
|
||||||
|
Regex("penzugy|gazdasag").containsMatchIn(name) -> R.drawable.ic_subject_economics
|
||||||
|
Regex("kornyezet|termeszet").containsMatchIn(name) -> R.drawable.ic_subject_env
|
||||||
|
Regex("(hit|erkolcs)tan|vallas|etika").containsMatchIn(name) -> R.drawable.ic_subject_religion
|
||||||
|
Regex("adatbazis").containsMatchIn(name) -> R.drawable.ic_subject_database
|
||||||
|
else -> R.drawable.ic_subject_unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getSubjectIconRes(iconName: String?): Int {
|
||||||
|
if (iconName == null) return R.drawable.ic_subject_unknown
|
||||||
|
return when (iconName.lowercase()) {
|
||||||
|
"mathematics" -> R.drawable.ic_subject_mathematics
|
||||||
|
"grammar" -> R.drawable.ic_subject_grammar
|
||||||
|
"literature" -> R.drawable.ic_subject_literature
|
||||||
|
"history" -> R.drawable.ic_subject_history
|
||||||
|
"geography" -> R.drawable.ic_subject_geography
|
||||||
|
"art" -> R.drawable.ic_subject_art
|
||||||
|
"physics" -> R.drawable.ic_subject_physics
|
||||||
|
"music" -> R.drawable.ic_subject_music
|
||||||
|
"pe" -> R.drawable.ic_subject_pe
|
||||||
|
"chemistry" -> R.drawable.ic_subject_chemistry
|
||||||
|
"biology" -> R.drawable.ic_subject_biology
|
||||||
|
"env" -> R.drawable.ic_subject_env
|
||||||
|
"religion" -> R.drawable.ic_subject_religion
|
||||||
|
"economics" -> R.drawable.ic_subject_economics
|
||||||
|
"it" -> R.drawable.ic_subject_it
|
||||||
|
"code" -> R.drawable.ic_subject_code
|
||||||
|
"networking" -> R.drawable.ic_subject_networking
|
||||||
|
"theatre" -> R.drawable.ic_subject_theatre
|
||||||
|
"film" -> R.drawable.ic_subject_film
|
||||||
|
"electricalengineering" -> R.drawable.ic_subject_electricalengineering
|
||||||
|
"mechanicalengineering" -> R.drawable.ic_subject_mechanicalengineering
|
||||||
|
"technika" -> R.drawable.ic_subject_technika
|
||||||
|
"dance" -> R.drawable.ic_subject_dance
|
||||||
|
"philosophy" -> R.drawable.ic_subject_philosophy
|
||||||
|
"erettsegi" -> R.drawable.ic_subject_erettsegi
|
||||||
|
"ofo" -> R.drawable.ic_subject_ofo
|
||||||
|
"diligence" -> R.drawable.ic_subject_diligence
|
||||||
|
"attitude" -> R.drawable.ic_subject_attitude
|
||||||
|
"language" -> R.drawable.ic_subject_language
|
||||||
|
"linux" -> R.drawable.ic_subject_linux
|
||||||
|
"database" -> R.drawable.ic_subject_database
|
||||||
|
"applications" -> R.drawable.ic_subject_applications
|
||||||
|
"project" -> R.drawable.ic_subject_project
|
||||||
|
"break" -> R.drawable.ic_subject_break
|
||||||
|
else -> R.drawable.ic_subject_unknown
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createNotificationChannel() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
val nm = getSystemService(NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
try {
|
||||||
|
nm.deleteNotificationChannel("firka_progress_notification")
|
||||||
|
nm.deleteNotificationChannel("firka_progress_notification_v2")
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
|
||||||
|
val strings = getStrings(this)
|
||||||
|
val channelName = strings["progress_notif_channel_name"]?.takeIf { it.isNotBlank() } ?: "Firka"
|
||||||
|
val channelDesc = strings["progress_notif_channel_desc"] ?: ""
|
||||||
|
|
||||||
|
val channel = NotificationChannel(
|
||||||
|
channelId,
|
||||||
|
channelName,
|
||||||
|
NotificationManager.IMPORTANCE_DEFAULT
|
||||||
|
).apply {
|
||||||
|
setShowBadge(false)
|
||||||
|
setSound(null, null)
|
||||||
|
enableVibration(false)
|
||||||
|
description = channelDesc
|
||||||
|
}
|
||||||
|
nm.createNotificationChannel(channel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun scheduleNextTransitionAlarm(targetTime: LocalDateTime) {
|
||||||
|
val alarmManager = getSystemService(ALARM_SERVICE) as? AlarmManager ?: return
|
||||||
|
cancelTransitionAlarm()
|
||||||
|
|
||||||
|
val intent = Intent(this, ProgressNotificationForegroundService::class.java).apply {
|
||||||
|
action = ACTION_UPDATE
|
||||||
|
}
|
||||||
|
val pendingIntent = PendingIntent.getService(
|
||||||
|
this,
|
||||||
|
1001,
|
||||||
|
intent,
|
||||||
|
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
|
||||||
|
)
|
||||||
|
transitionPendingIntent = pendingIntent
|
||||||
|
|
||||||
|
val epochMillis = targetTime.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()
|
||||||
|
if (epochMillis > System.currentTimeMillis()) {
|
||||||
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
alarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
|
||||||
|
} else {
|
||||||
|
alarmManager.setExact(AlarmManager.RTC_WAKEUP, epochMillis, pendingIntent)
|
||||||
|
}
|
||||||
|
} catch (e: SecurityException) {
|
||||||
|
Log.w(TAG, "Cannot schedule transition alarm", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun cancelTransitionAlarm() {
|
||||||
|
val alarmManager = getSystemService(ALARM_SERVICE) as? AlarmManager ?: return
|
||||||
|
transitionPendingIntent?.let {
|
||||||
|
alarmManager.cancel(it)
|
||||||
|
transitionPendingIntent = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun stopForegroundService() {
|
||||||
|
isRunning = false
|
||||||
|
cancelTransitionAlarm()
|
||||||
|
tickerJob?.cancel()
|
||||||
|
isForegroundStarted = false
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
stopForeground(STOP_FOREGROUND_REMOVE)
|
||||||
|
} else {
|
||||||
|
@Suppress("DEPRECATION")
|
||||||
|
stopForeground(true)
|
||||||
|
}
|
||||||
|
stopSelf()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun minutesRemaining(from: LocalDateTime, to: LocalDateTime): Int {
|
||||||
|
val seconds = Duration.between(from, to).seconds
|
||||||
|
return if (seconds <= 0) 1 else ((seconds + 59) / 60).toInt().coerceAtLeast(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private const val TAG = "ProgressNotifService"
|
||||||
|
const val ACTION_START = "app.firka.naplo.ProgressNotificationForegroundService.START"
|
||||||
|
const val ACTION_UPDATE = "app.firka.naplo.ProgressNotificationForegroundService.UPDATE"
|
||||||
|
const val ACTION_STOP = "app.firka.naplo.ProgressNotificationForegroundService.STOP"
|
||||||
|
|
||||||
|
private const val PREFS_STRINGS = "firka_progress_strings"
|
||||||
|
|
||||||
|
@Volatile
|
||||||
|
var isRunning: Boolean = false
|
||||||
|
|
||||||
|
fun saveStrings(context: Context, strings: Map<String, String>) {
|
||||||
|
val prefs = context.applicationContext.getSharedPreferences(PREFS_STRINGS, Context.MODE_PRIVATE)
|
||||||
|
val editor = prefs.edit()
|
||||||
|
for ((k, v) in strings) {
|
||||||
|
editor.putString(k, v)
|
||||||
|
}
|
||||||
|
editor.apply()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getStrings(context: Context): Map<String, String> {
|
||||||
|
val prefs = context.applicationContext.getSharedPreferences(PREFS_STRINGS, Context.MODE_PRIVATE)
|
||||||
|
val all = prefs.all
|
||||||
|
val result = mutableMapOf<String, String>()
|
||||||
|
for ((k, v) in all) {
|
||||||
|
if (v is String) {
|
||||||
|
result[k] = v
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
fun loadTodayTimetable(context: Context): TimetableProgressData? {
|
||||||
|
return try {
|
||||||
|
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
|
||||||
|
val widgetStateFile = File(appFlutter, "widget_state.json")
|
||||||
|
if (!widgetStateFile.exists()) return null
|
||||||
|
val text = widgetStateFile.readText(Charsets.UTF_8)
|
||||||
|
val json = JSONObject(text)
|
||||||
|
|
||||||
|
val tt = json.getJSONArray("timetable")
|
||||||
|
val allLessons = mutableListOf<WidgetLesson>()
|
||||||
|
for (i in 0 until tt.length()) {
|
||||||
|
allLessons.add(WidgetLesson(tt.getJSONObject(i)))
|
||||||
|
}
|
||||||
|
|
||||||
|
val today = LocalDate.now()
|
||||||
|
var todayLessons = allLessons.filter { it.start.toLocalDate() == today }
|
||||||
|
if (todayLessons.isEmpty()) {
|
||||||
|
val displayDateStr = json.optString("displayDate", "")
|
||||||
|
if (displayDateStr.isNotEmpty()) {
|
||||||
|
try {
|
||||||
|
val displayDate = LocalDate.parse(displayDateStr)
|
||||||
|
todayLessons = allLessons.filter { it.start.toLocalDate() == displayDate }
|
||||||
|
} catch (_: Exception) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val colorsObj = json.optJSONObject("colors")
|
||||||
|
val accent = colorsObj?.optInt("accent", 0xFF4C662B.toInt()) ?: 0xFF4C662B.toInt()
|
||||||
|
val secondary = colorsObj?.optInt("secondary", 0xFF586249.toInt()) ?: 0xFF586249.toInt()
|
||||||
|
val language = json.optString("language", null)
|
||||||
|
|
||||||
|
TimetableProgressData(todayLessons, accent, secondary, language)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "Error reading timetable data", e)
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data class TimetableProgressData(
|
||||||
|
val lessons: List<WidgetLesson>,
|
||||||
|
val accentColor: Int,
|
||||||
|
val breakColor: Int,
|
||||||
|
val language: String? = null,
|
||||||
|
)
|
||||||
@@ -16,6 +16,7 @@ import androidx.glance.layout.padding
|
|||||||
import androidx.glance.layout.width
|
import androidx.glance.layout.width
|
||||||
import androidx.glance.text.FontWeight
|
import androidx.glance.text.FontWeight
|
||||||
import androidx.glance.text.Text
|
import androidx.glance.text.Text
|
||||||
|
import androidx.glance.text.TextAlign
|
||||||
import androidx.glance.text.TextStyle
|
import androidx.glance.text.TextStyle
|
||||||
import app.firka.naplo.model.Colors
|
import app.firka.naplo.model.Colors
|
||||||
import app.firka.naplo.glance.WidgetLesson
|
import app.firka.naplo.glance.WidgetLesson
|
||||||
@@ -31,6 +32,7 @@ fun LessonCard(
|
|||||||
colors: Colors,
|
colors: Colors,
|
||||||
modifier: GlanceModifier = GlanceModifier,
|
modifier: GlanceModifier = GlanceModifier,
|
||||||
roomBadgeWidthDp: Float = 48f,
|
roomBadgeWidthDp: Float = 48f,
|
||||||
|
subjectColumnWidthDp: Float = 226f,
|
||||||
) {
|
) {
|
||||||
Box(modifier =
|
Box(modifier =
|
||||||
modifier
|
modifier
|
||||||
@@ -49,17 +51,21 @@ fun LessonCard(
|
|||||||
|
|
||||||
|
|
||||||
Box(modifier = GlanceModifier.padding(12.dp)) {
|
Box(modifier = GlanceModifier.padding(12.dp)) {
|
||||||
Row {
|
Row(modifier = GlanceModifier.fillMaxWidth()) {
|
||||||
val badgeStyle = TextStyle(
|
val badgeStyle = TextStyle(
|
||||||
color = ColorProvider(colors.textSecondary, colors.textSecondary),
|
color = ColorProvider(colors.textSecondary, colors.textSecondary),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold,
|
||||||
|
textAlign = TextAlign.Center
|
||||||
)
|
)
|
||||||
val badgePadding = GlanceModifier.padding(8.dp, 4.dp)
|
val badgePadding = GlanceModifier.padding(8.dp, 4.dp)
|
||||||
val lessonNumberBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(24.dp)
|
val lessonNumberBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(24.dp)
|
||||||
val roomBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(roomBadgeWidthDp.dp)
|
val roomBadgeModifier = GlanceModifier.cornerRadius(16.dp).width(roomBadgeWidthDp.dp)
|
||||||
|
|
||||||
Row(modifier = GlanceModifier.width(226.dp), verticalAlignment = Alignment.CenterVertically) {
|
Row(
|
||||||
|
modifier = GlanceModifier.width(subjectColumnWidthDp.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
) {
|
||||||
if (lesson.lessonNumber != null) {
|
if (lesson.lessonNumber != null) {
|
||||||
Box(
|
Box(
|
||||||
modifier = lessonNumberBadgeModifier.background(bgColor),
|
modifier = lessonNumberBadgeModifier.background(bgColor),
|
||||||
@@ -79,12 +85,14 @@ fun LessonCard(
|
|||||||
}
|
}
|
||||||
// TODO: Add subject icons
|
// TODO: Add subject icons
|
||||||
Text(
|
Text(
|
||||||
lesson.name,
|
text = lesson.name,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = ColorProvider(colors.textPrimary, colors.textPrimary),
|
color = ColorProvider(colors.textPrimary, colors.textPrimary),
|
||||||
fontSize = 14.sp,
|
fontSize = 14.sp,
|
||||||
fontWeight = FontWeight.Bold
|
fontWeight = FontWeight.Bold
|
||||||
),
|
),
|
||||||
|
maxLines = 1,
|
||||||
|
modifier = GlanceModifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,15 +106,18 @@ fun LessonCard(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
Spacer(modifier = GlanceModifier.width(8.dp))
|
Spacer(modifier = GlanceModifier.width(8.dp))
|
||||||
val roomName = (lesson.roomName ?: "N/A").take(5)
|
val roomName = lesson.roomName ?: "N/A"
|
||||||
Box(
|
Box(
|
||||||
modifier = roomBadgeModifier.background(colors.a15p),
|
modifier = roomBadgeModifier.background(colors.a15p),
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
roomName,
|
text = roomName,
|
||||||
style = badgeStyle,
|
style = badgeStyle,
|
||||||
modifier = GlanceModifier.padding(4.dp, 4.dp),
|
maxLines = 1,
|
||||||
|
modifier = GlanceModifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(4.dp, 4.dp),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,31 +54,35 @@ class TimetableWidget : GlanceAppWidget() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun loadWidgetData(context: Context): WidgetData? {
|
private fun loadWidgetData(context: Context): WidgetData? {
|
||||||
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
|
try {
|
||||||
val widgetStateFile = File(appFlutter, "widget_state.json")
|
val appFlutter = File(context.applicationContext.dataDir, "app_flutter")
|
||||||
if (!widgetStateFile.exists()) return null
|
val widgetStateFile = File(appFlutter, "widget_state.json")
|
||||||
val widgetState = JSONObject(widgetStateFile.readText(Charsets.UTF_8))
|
if (!widgetStateFile.exists()) return null
|
||||||
val colors = Colors(widgetState)
|
val text = widgetStateFile.readText(Charsets.UTF_8)
|
||||||
val tt = widgetState.getJSONArray("timetable")
|
val widgetState = JSONObject(text)
|
||||||
val lessons = mutableListOf<WidgetLesson>()
|
val colors = Colors(widgetState)
|
||||||
for (i in 0..<tt.length()) {
|
val tt = widgetState.getJSONArray("timetable")
|
||||||
lessons.add(WidgetLesson(tt.getJSONObject(i)))
|
val lessons = mutableListOf<WidgetLesson>()
|
||||||
}
|
for (i in 0..<tt.length()) {
|
||||||
val displayDateStr = widgetState.optString("displayDate", "")
|
lessons.add(WidgetLesson(tt.getJSONObject(i)))
|
||||||
val targetDate = if (displayDateStr.isNotEmpty()) {
|
}
|
||||||
try {
|
val displayDateStr = widgetState.optString("displayDate", "")
|
||||||
LocalDate.parse(displayDateStr)
|
val targetDate = if (displayDateStr.isNotEmpty()) {
|
||||||
} catch (_: Exception) {
|
try {
|
||||||
|
LocalDate.parse(displayDateStr)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
LocalDate.now()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
LocalDate.now()
|
LocalDate.now()
|
||||||
}
|
}
|
||||||
} else {
|
val filtered = lessons.filter { it.start.toLocalDate() == targetDate }
|
||||||
LocalDate.now()
|
val headerText = if (displayDateStr.isNotEmpty()) displayDateStr else "Mai órarend"
|
||||||
|
return WidgetData(colors, headerText, filtered)
|
||||||
|
} catch (e: Throwable) {
|
||||||
|
android.util.Log.e("TimetableWidget", "Error in loadWidgetData", e)
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
val start = LocalDateTime.of(targetDate.year, targetDate.month, targetDate.dayOfMonth, 0, 0)
|
|
||||||
val end = start.plusHours(23)
|
|
||||||
val filtered = lessons.filter { it.start.isAfter(start) && it.end.isBefore(end) }
|
|
||||||
val headerText = if (displayDateStr.isNotEmpty()) displayDateStr else "Mai órarend"
|
|
||||||
return WidgetData(colors, headerText, filtered)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
@@ -116,8 +120,10 @@ class TimetableWidget : GlanceAppWidget() {
|
|||||||
val displayLessons = data.lessons.take(maxLessons)
|
val displayLessons = data.lessons.take(maxLessons)
|
||||||
val lessonChunks = displayLessons.chunked(2)
|
val lessonChunks = displayLessons.chunked(2)
|
||||||
val showDate = maxLessons > 1
|
val showDate = maxLessons > 1
|
||||||
val maxRoomNameLen = displayLessons.maxOfOrNull { (it.roomName ?: "N/A").take(5).length } ?: 0
|
val roomBadgeWidthDp = 48f
|
||||||
val roomBadgeWidthDp = if (maxRoomNameLen <= 3) 28f else 48f
|
val minWidthForTimeAndChipDp = 8f + 40f + roomBadgeWidthDp
|
||||||
|
val subjectColumnWidthDp = (size.width.value - 2 * paddingDp - 32f - minWidthForTimeAndChipDp)
|
||||||
|
.coerceIn(80f, 226f)
|
||||||
val dateSectionHeight = if (showDate) headerHeightDp + spacerDp else 0f
|
val dateSectionHeight = if (showDate) headerHeightDp + spacerDp else 0f
|
||||||
val lessonListHeight = when (val n = displayLessons.size) {
|
val lessonListHeight = when (val n = displayLessons.size) {
|
||||||
0 -> 0f
|
0 -> 0f
|
||||||
@@ -148,7 +154,12 @@ class TimetableWidget : GlanceAppWidget() {
|
|||||||
for (chunk in lessonChunks) {
|
for (chunk in lessonChunks) {
|
||||||
Column {
|
Column {
|
||||||
for (lesson in chunk) {
|
for (lesson in chunk) {
|
||||||
LessonCard(lesson, data.colors, roomBadgeWidthDp = roomBadgeWidthDp)
|
LessonCard(
|
||||||
|
lesson,
|
||||||
|
data.colors,
|
||||||
|
roomBadgeWidthDp = roomBadgeWidthDp,
|
||||||
|
subjectColumnWidthDp = subjectColumnWidthDp,
|
||||||
|
)
|
||||||
Spacer(modifier = GlanceModifier.height(spacerDp.dp))
|
Spacer(modifier = GlanceModifier.height(spacerDp.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,37 @@ import HomeWidgetGlanceWidgetReceiver
|
|||||||
import androidx.glance.appwidget.GlanceAppWidgetManager
|
import androidx.glance.appwidget.GlanceAppWidgetManager
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.glance.appwidget.updateAll
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.SupervisorJob
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
class TimetableWidgetReceiver : HomeWidgetGlanceWidgetReceiver<TimetableWidget>() {
|
class TimetableWidgetReceiver : HomeWidgetGlanceWidgetReceiver<TimetableWidget>() {
|
||||||
override val glanceAppWidget = TimetableWidget()
|
override val glanceAppWidget = TimetableWidget()
|
||||||
|
|
||||||
|
override fun onReceive(context: Context, intent: Intent) {
|
||||||
|
super.onReceive(context, intent)
|
||||||
|
val action = intent.action
|
||||||
|
if (action == ACTION_REFRESH_WIDGET ||
|
||||||
|
action == AppWidgetManager.ACTION_APPWIDGET_UPDATE ||
|
||||||
|
action == Intent.ACTION_BOOT_COMPLETED ||
|
||||||
|
action == Intent.ACTION_MY_PACKAGE_REPLACED) {
|
||||||
|
val pendingResult = goAsync()
|
||||||
|
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
||||||
|
try {
|
||||||
|
glanceAppWidget.updateAll(context)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("TimetableWidget", "Failed glanceAppWidget.updateAll from onReceive", e)
|
||||||
|
} finally {
|
||||||
|
pendingResult?.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onAppWidgetOptionsChanged(
|
override fun onAppWidgetOptionsChanged(
|
||||||
context: Context,
|
context: Context,
|
||||||
appWidgetManager: AppWidgetManager,
|
appWidgetManager: AppWidgetManager,
|
||||||
@@ -17,9 +45,18 @@ class TimetableWidgetReceiver : HomeWidgetGlanceWidgetReceiver<TimetableWidget>(
|
|||||||
newOptions: Bundle,
|
newOptions: Bundle,
|
||||||
) {
|
) {
|
||||||
super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions)
|
super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions)
|
||||||
runBlocking {
|
val pendingResult = goAsync()
|
||||||
val glanceId = GlanceAppWidgetManager(context).getGlanceIdBy(appWidgetId)
|
CoroutineScope(SupervisorJob() + Dispatchers.Default).launch {
|
||||||
glanceAppWidget.update(context, glanceId)
|
try {
|
||||||
|
val glanceId = GlanceAppWidgetManager(context).getGlanceIdBy(appWidgetId)
|
||||||
|
glanceAppWidget.update(context, glanceId)
|
||||||
|
} finally {
|
||||||
|
pendingResult?.finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val ACTION_REFRESH_WIDGET = "app.firka.naplo.ACTION_REFRESH_WIDGET"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -4,20 +4,46 @@ import app.firka.naplo.getIntOrNull
|
|||||||
import app.firka.naplo.getStringOrNull
|
import app.firka.naplo.getStringOrNull
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
import java.time.OffsetDateTime
|
||||||
|
import java.time.format.DateTimeFormatter
|
||||||
import java.time.format.DateTimeFormatterBuilder
|
import java.time.format.DateTimeFormatterBuilder
|
||||||
|
import java.time.temporal.ChronoField
|
||||||
|
|
||||||
class WidgetLesson(data: JSONObject) {
|
class WidgetLesson(data: JSONObject) {
|
||||||
val formatter = DateTimeFormatterBuilder()
|
companion object {
|
||||||
.appendPattern("yyyy-MM-dd'T'HH:mm:ss.SSS")
|
private val formatter: DateTimeFormatter = DateTimeFormatterBuilder()
|
||||||
.optionalStart()
|
.appendPattern("yyyy-MM-dd'T'HH:mm:ss")
|
||||||
.appendLiteral('Z')
|
.optionalStart()
|
||||||
.optionalEnd()
|
.appendFraction(ChronoField.NANO_OF_SECOND, 1, 9, true)
|
||||||
.toFormatter()
|
.optionalEnd()
|
||||||
|
.optionalStart()
|
||||||
|
.appendLiteral('Z')
|
||||||
|
.optionalEnd()
|
||||||
|
.optionalStart()
|
||||||
|
.appendOffset("+HH:MM", "+00:00")
|
||||||
|
.optionalEnd()
|
||||||
|
.toFormatter()
|
||||||
|
|
||||||
val name: String = data.getString("Nev")
|
fun parseDateTime(raw: String): LocalDateTime {
|
||||||
val start: LocalDateTime = LocalDateTime.parse(data.getString("KezdetIdopont"), formatter)
|
return try {
|
||||||
val end: LocalDateTime = LocalDateTime.parse(data.getString("VegIdopont"), formatter)
|
LocalDateTime.parse(raw, formatter)
|
||||||
val lessonNumber: Int? = data.getIntOrNull("Oraszam")
|
} catch (_: Exception) {
|
||||||
val roomName: String? = data.getStringOrNull("TeremNeve")
|
try {
|
||||||
val substituteTeacher: String? = data.getStringOrNull("HelyettesTanarNeve")
|
OffsetDateTime.parse(raw).toLocalDateTime()
|
||||||
|
} catch (_: Exception) {
|
||||||
|
LocalDateTime.parse(raw)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val name: String = data.optString("name", data.optString("Nev", ""))
|
||||||
|
val start: LocalDateTime = parseDateTime(data.optString("start", data.optString("KezdetIdopont", "")))
|
||||||
|
val end: LocalDateTime = parseDateTime(data.optString("end", data.optString("VegIdopont", "")))
|
||||||
|
val lessonNumber: Int? = data.getIntOrNull("dailyNth") ?: data.getIntOrNull("Oraszam")
|
||||||
|
val roomName: String? = (data.getStringOrNull("roomName") ?: data.getStringOrNull("TeremNeve"))
|
||||||
|
?.takeIf { it != "null" && it != "-" && it.isNotBlank() }
|
||||||
|
val substituteTeacher: String? = (data.getStringOrNull("substituteTeacher") ?: data.getStringOrNull("HelyettesTanarNeve"))
|
||||||
|
?.takeIf { it != "null" && it != "-" && it.isNotBlank() }
|
||||||
|
val icon: String? = data.getStringOrNull("icon")
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 957 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M19 4H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"
|
||||||
|
android:fillColor="#FFFFFFFF" />
|
||||||
|
<path
|
||||||
|
android:pathData="M12 16h7a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h7zm0 0v4m0 0h4m-4 0H8"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_art.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M15.586 3a2 2 0 0 1 2.828 0L21 5.586a2 2 0 0 1 0 2.828L19.414 10 14 4.586 15.586 3zm-3 3-9 9A2 2 0 0 0 3 16.414V19a2 2 0 0 0 2 2h2.586A2 2 0 0 0 9 20.414l9-9L12.586 6z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M 7.0,8.0 a 5.0,5.0 0 1,0 10.0,0 a 5.0,5.0 0 1,0 -10.0,0 Z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M20 21a8 8 0 1 0-16 0"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M12 13a8 8 0 0 0-8 8h16a8 8 0 0 0-8-8z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M10 1a1 1 0 0 0 0 2h1v1.062A7.96 7.96 0 0 0 7.094 5.68L5.914 4.5l.793-.793a1 1 0 0 0-1.414-1.414l-3 3a1 1 0 0 0 1.414 1.414l.793-.793 1.18 1.18A7.96 7.96 0 0 0 4.062 11H3v-1a1 1 0 0 0-2 0v4a1 1 0 1 0 2 0v-1h1.062c.182 1.46.759 2.8 1.618 3.906l-1.18 1.18-.793-.793a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.414-1.414l-.793-.793 1.18-1.18A7.965 7.965 0 0 0 11 19.938V21h-1a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2h-1v-1.062a7.965 7.965 0 0 0 3.906-1.618l1.18 1.18-.793.793a1 1 0 0 0 1.414 1.414l3-3a1 1 0 0 0-1.414-1.414l-.793.793-1.18-1.18A7.965 7.965 0 0 0 19.938 13H21v1a1 1 0 1 0 2 0v-4a1 1 0 1 0-2 0v1h-1.062a7.965 7.965 0 0 0-1.618-3.906l1.18-1.18.793.793a1 1 0 1 0 1.414-1.414l-3-3a1 1 0 1 0-1.414 1.414l.793.793-1.18 1.18A7.966 7.966 0 0 0 13 4.062V3h1a1 1 0 1 0 0-2h-4zm3 13a1 1 0 0 1 1-1h.001a1 1 0 1 1 0 2H14a1 1 0 0 1-1-1zm-3-3.5a.5.5 0 1 1 1 0 .5.5 0 0 1-1 0zm.5-2.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_break.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm11-5a1 1 0 1 0-2 0v3.764a3 3 0 0 0 1.658 2.683l2.895 1.447a1 1 0 1 0 .894-1.788l-2.894-1.448a1 1 0 0 1-.553-.894V7z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M6 2a1 1 0 0 0 0 2h1v13a5 5 0 0 0 10 0V4h1a1 1 0 1 0 0-2H6zm3 5V4h6v3H9zm4.708 5.708a1 1 0 0 1-1.414 0h-.001a1 1 0 0 1 1.414-1.415 1 1 0 0 1 0 1.415zm-3.414 4a1 1 0 1 0 1.414-1.414v-.001a1 1 0 0 0-1.415 1.414z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
13
firka/android/app/src/main/res/drawable/ic_subject_code.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M9.5 5H9a2 2 0 0 0-2 2v2c0 1-.6 3-3 3 1 0 3 .6 3 3v2a2 2 0 0 0 2 2h.5m5-14h.5a2 2 0 0 1 2 2v2c0 1 .6 3 3 3-1 0-3 .6-3 3v2a2 2 0 0 1-2 2h-.5"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
14
firka/android/app/src/main/res/drawable/ic_subject_dance.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M17 7a5.001 5.001 0 0 0-4.607 3.053C11.963 11.07 12.896 12 14 12h6c1.105 0 2.037-.93 1.607-1.947A5.001 5.001 0 0 0 17 7zm0 10a5.001 5.001 0 0 0-3.053-4.607C12.93 11.963 12 12.896 12 14v6c0 1.105.93 2.037 1.947 1.607A5.001 5.001 0 0 0 17 17zM7 17a5.001 5.001 0 0 0 4.607-3.053C12.037 12.93 11.104 12 10 12H4c-1.105 0-2.037.93-1.607 1.947A5.001 5.001 0 0 0 7 17zM7 7a5.001 5.001 0 0 0 3.053 4.607C11.07 12.037 12 11.104 12 10V4c0-1.105-.93-2.037-1.947-1.607A5.001 5.001 0 0 0 7 7z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M21 7c0 2.21-4.03 4-9 4S3 9.21 3 7s4.03-4 9-4 9 1.79 9 4z"
|
||||||
|
android:fillColor="#FFFFFFFF" />
|
||||||
|
<path
|
||||||
|
android:pathData="M21 7c0 2.21-4.03 4-9 4S3 9.21 3 7m18 0c0-2.21-4.03-4-9-4S3 4.79 3 7m18 0v5M3 7v5m18 0c0 2.21-4.03 4-9 4s-9-1.79-9-4m18 0v5c0 2.21-4.03 4-9 4s-9-1.79-9-4v-5"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M10 2a3.001 3.001 0 0 0-2.83 2H6a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3h12a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3h-1.17A3.001 3.001 0 0 0 14 2h-4zM9 5a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2h-4a1 1 0 0 1-1-1zm6.78 6.625a1 1 0 1 0-1.56-1.25l-3.303 4.128-1.21-1.21a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.488-.082l4-5z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M21 8c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 9.92 7 9.02 7 8c0-1.657 3.134-3 7-3s7 1.343 7 3z"
|
||||||
|
android:fillColor="#FFFFFFFF" />
|
||||||
|
<path
|
||||||
|
android:pathData="M21 8c0-1.657-3.134-3-7-3S7 6.343 7 8m14 0v4c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 13.92 7 13.02 7 12V8m14 0c0 1.02-1.186 1.92-3 2.462-1.134.34-2.513.538-4 .538s-2.866-.199-4-.538C8.187 9.92 7 9.02 7 8"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M3 12v4c0 1.02 1.187 1.92 3 2.462 1.134.34 2.513.538 4 .538s2.866-.199 4-.538c1.813-.542 3-1.442 3-2.462v-1M3 12c0-1.197 1.635-2.23 4-2.711M3 12c0 1.02 1.187 1.92 3 2.462 1.134.34 2.513.538 4 .538.695 0 1.366-.043 2-.124"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M4 14 14 3v7h6L10 21v-7H4z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_env.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M20.156 6.473a2.639 2.639 0 0 0-2.63-2.629C15.049 3.817 9.909 4.193 6.5 7.6c-2.796 2.796-2.915 7.3-.157 10.057 2.758 2.758 7.26 2.639 10.057-.157 3.407-3.408 3.783-8.548 3.756-11.027zm-4.62 1.991a1 1 0 0 1 0 1.415l-.978.977.587.195a1 1 0 0 1-.633 1.898l-1.535-.512-1.247 1.247.586.196a1 1 0 0 1-.632 1.897l-1.173-.39a3.01 3.01 0 0 1-.344-.14l-2.41 2.41-3.121 3.121a1 1 0 0 1-1.414-1.414l3.121-3.121 2.41-2.41a3.009 3.009 0 0 1-.14-.344l-.39-1.173a1 1 0 0 1 1.897-.632l.196.586 1.247-1.247-.512-1.535a1 1 0 0 1 1.898-.633l.195.587.977-.978a1 1 0 0 1 1.414 0z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M 5.0,9.0 a 7.0,7.0 0 1,0 14.0,0 a 7.0,7.0 0 1,0 -14.0,0 Z"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M7 20.234V14c.667.667 2.6 2 5 2s4.333-1.333 5-2v6.234a1 1 0 0 1-1.514.857l-2.972-1.782a1 1 0 0 0-1.028 0L8.514 21.09A1 1 0 0 1 7 20.234z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_film.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M5 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1.586l2.293 2.293A1 1 0 0 0 22 16V8a1 1 0 0 0-1.707-.707L18 9.586V8a3 3 0 0 0-3-3H5z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M 3.0,12.0 a 9.0,9.0 0 1,0 18.0,0 a 9.0,9.0 0 1,0 -18.0,0 Z"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M13.5 6h.5a2 2 0 0 0 2-2C8.4 1.2 4.5 6.5 3.5 9.5l4.167 5.093c.215.263.333.593.333.933C8 16.34 8.673 17 9.487 17c.828 0 1.513.672 1.513 1.5V21c2.167-.167 6.8-1.2 8-4h-1a2 2 0 0 1-2-2 2 2 0 0 0-2-2h-2a2 2 0 0 1-2-2v-1a1 1 0 0 1 1-1 1 1 0 0 0 1-1v-.5A1.5 1.5 0 0 1 13.5 6z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3 5a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V5zm5 0v7l2.293-2.293a1 1 0 0 1 1.414 0L14 12V5a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12zm14.243-4.243L9.879 9.88l-2.122 6.364 6.364-2.122 2.122-6.364z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_it.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v7.764l1.447 2.894-.894.448.894-.448c.998 1.995-.453 4.342-2.683 4.342H4.236c-2.23 0-3.68-2.347-2.683-4.342L3 13.764V6zm3-1a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1H6z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12 2H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.93a2 2 0 0 1 1.664.89l.574.862a1 1 0 0 0 1.664 0l.574-.861A2 2 0 0 1 11.07 12H12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M18 10h2a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2h-.93a2 2 0 0 0-1.664.89l-.574.862a1 1 0 0 1-1.664 0l-.574-.861A2 2 0 0 0 12.93 20H12a2 2 0 0 1-2-2v-1"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
11
firka/android/app/src/main/res/drawable/ic_subject_linux.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12 3a2 2 0 0 0-1 3.732V8H8c-3.2 0-4 2.667-4 4v7c0 .667.4 2 2 2h1v-4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v4h1c1.6 0 2-1.333 2-2v-7c0-3.2-2.667-4-4-4h-3V6.732A2 2 0 0 0 12 3zm3 18v-3h-2v3h2zm-4 0v-3H9v3h2zm10-3v-5c.667 0 2 .4 2 2v1c0 .667-.4 2-2 2zM3 13v5c-1.6 0-2-1.333-2-2v-1c0-1.6 1.333-2 2-2zm6-1a1 1 0 1 0 0 2h.001a1 1 0 1 0 0-2H9zm5 1a1 1 0 0 1 1-1h.001a1 1 0 1 1 0 2H15a1 1 0 0 1-1-1z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M11 4.85c-2.195-1.022-5.52-1.565-8.633.979A1 1 0 0 0 2 6.603V19a1 1 0 0 0 1.633.774c2.736-2.236 5.734-1.31 7.367-.255V4.849zm2 0v14.669c1.633-1.056 4.63-1.981 7.367.255A1 1 0 0 0 22 19V6.603a1 1 0 0 0-.367-.774C18.52 3.285 15.195 3.828 13 4.849z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M7 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H7zm0 4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V6zm1 7a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H8zm3 1a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1zm1 2a1 1 0 1 0 0 2h.01a1 1 0 1 0 0-2H12zm-5 1a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1zm10-3a1 1 0 1 0-2 0v3a1 1 0 1 0 2 0v-3z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M9.024 2.783A1 1 0 0 1 10 2h4a1 1 0 0 1 .976.783l.44 1.981c.4.19.781.41 1.14.66l1.938-.61a1 1 0 0 1 1.166.454l2 3.464a1 1 0 0 1-.19 1.237l-1.497 1.373a8.1 8.1 0 0 1 0 1.316l1.497 1.373a1 1 0 0 1 .19 1.237l-2 3.464a1 1 0 0 1-1.166.454l-1.937-.61c-.36.25-.741.47-1.14.66l-.44 1.98A1 1 0 0 1 14 22h-4a1 1 0 0 1-.976-.783l-.44-1.981c-.4-.19-.781-.41-1.14-.66l-1.938.61a1 1 0 0 1-1.166-.454l-2-3.464a1 1 0 0 1 .19-1.237l1.497-1.373a8.097 8.097 0 0 1 0-1.316L2.53 9.97a1 1 0 0 1-.19-1.237l2-3.464a1 1 0 0 1 1.166-.454l1.937.61c.36-.25.741-.47 1.14-.66l.44-1.98zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
16
firka/android/app/src/main/res/drawable/ic_subject_music.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M13 4h4v4h-4v9c0 1-.6 3-3 3s-3-2-3-3 .6-3 3-3 3 2 3 3V4z"
|
||||||
|
android:fillColor="#FFFFFFFF" />
|
||||||
|
<path
|
||||||
|
android:pathData="M13 17V8m0 9c0 1-.6 3-3 3s-3-2-3-3 .6-3 3-3 3 2 3 3zm0-9V4h4v4h-4z"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M2 13.5C2 17.9 5.667 19 7.5 19h10c1.5 0 4.5-.9 4.5-4.5S19 10 17.5 10c0-1.5-1.5-5-5-5-2.8 0-4.5 2-5 3C5.667 8 2 9.1 2 13.5z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
27
firka/android/app/src/main/res/drawable/ic_subject_ofo.xml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M 5.0,9.0 a 4.0,4.0 0 1,0 8.0,0 a 4.0,4.0 0 1,0 -8.0,0 Z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M9 13c-3.866 0-7 2.686-7 6h14c0-3.314-3.134-6-7-6z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M15 13a4 4 0 1 0-3-6.646m0 5.411c.897.942 2.193 1.235 3 1.235 3.866 0 7 2.686 7 6h-6"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
13
firka/android/app/src/main/res/drawable/ic_subject_pe.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3 12h4l3 7 4-14 3 7h4"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12 7a5 5 0 0 0-2 9.584V19h4v-2.416A5.001 5.001 0 0 0 12 7z"
|
||||||
|
android:fillColor="#FFFFFFFF" />
|
||||||
|
<path
|
||||||
|
android:pathData="M21 12h1m-3.5-6.5 1-1M12 3V2M5.5 5.5l-1-1M3 12H2m8 10h4m3-10a5 5 0 1 0-7 4.584V19h4v-2.416A5.001 5.001 0 0 0 17 12z"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M18.893 7.936a8.003 8.003 0 0 1-7.774 12.016m-6.012-3.888a8.003 8.003 0 0 1 7.774-12.016"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M 15.657,6.343 a 2.0,2.0 0 1,0 4.0,0 a 2.0,2.0 0 1,0 -4.0,0 Z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M 4.343,17.657 a 2.0,2.0 0 1,0 4.0,0 a 2.0,2.0 0 1,0 -4.0,0 Z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
<path
|
||||||
|
android:pathData="M 10.0,12.0 a 2.0,2.0 0 1,0 4.0,0 a 2.0,2.0 0 1,0 -4.0,0 Z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:strokeColor="#FFFFFFFF"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:strokeLineCap="round"
|
||||||
|
android:strokeLineJoin="round" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M3 2a1 1 0 0 0 0 2v11a1 1 0 0 0 1 1h4.613L7.05 20.684a1 1 0 0 0 1.898.632L10.72 16h2.558l1.772 5.316a1 1 0 0 0 1.898-.632L15.387 16H20a1 1 0 0 0 1-1V4a1 1 0 1 0 0-2H3z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12 3a1 1 0 0 1 1 1v1h1a1 1 0 1 1 0 2h-1v1.5l7.6 5.7A1 1 0 0 1 20 16h-1v3h2a1 1 0 1 1 0 2h-7v-3a2 2 0 1 0-4 0v3H3a1 1 0 1 1 0-2h2v-3H4a1 1 0 0 1-.6-1.8L11 8.5V7h-1a1 1 0 0 1 0-2h1V4a1 1 0 0 1 1-1z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12.879 3.707a3 3 0 0 1 4.242 0l3.172 3.172a3 3 0 0 1 0 4.242l-9.172 9.172a3 3 0 0 1-4.242 0L3.707 17.12a3 3 0 0 1 0-4.242L4.586 12l1.707 1.707a1 1 0 0 0 1.414-1.414L6 10.586 7.586 9l2.707 2.707a1 1 0 0 0 1.414-1.414L9 7.586 10.586 6l1.707 1.707a1 1 0 1 0 1.414-1.414L12 4.586l.879-.879z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M2 3a1 1 0 0 1 1-1h18a1 1 0 1 1 0 2v11a1 1 0 0 1-1 1h-4.613l1.562 4.684a1 1 0 0 1-1.898.632L13.28 16h-2.558L8.95 21.316a1 1 0 1 1-1.898-.632L8.613 16H4a1 1 0 0 1-1-1V4a1 1 0 0 1-1-1zm9.555 3.168A1 1 0 0 0 10 7v4a1 1 0 0 0 1.555.832l3-2a1 1 0 0 0 0-1.664l-3-2zM12.197 9 12 9.131V8.87l.197.131z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24">
|
||||||
|
<path
|
||||||
|
android:pathData="M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm0 5a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1zm1 9a1 1 0 1 0-2 0 1 1 0 1 0 2 0z"
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:fillType="evenOdd" />
|
||||||
|
</vector>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import com.android.build.gradle.BaseExtension
|
import com.android.build.api.dsl.ApplicationExtension
|
||||||
import org.jetbrains.kotlin.gradle.plugin.extraProperties
|
import com.android.build.api.dsl.LibraryExtension
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
@@ -13,34 +13,29 @@ rootProject.layout.buildDirectory.value(newBuildDir)
|
|||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||||
|
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||||
|
|
||||||
// fix for verifyReleaseResources
|
if (project.name != "app") {
|
||||||
|
project.evaluationDependsOn(":app")
|
||||||
|
|
||||||
// note(4831c0): taken from https://github.com/isar/isar/issues/1662
|
// android_alarm_manager_plus 5.1.1's own build.gradle.kts only applies
|
||||||
// note(4831c0): and adapted to kotlin
|
// org.jetbrains.kotlin.android when AGP < 9, then unconditionally
|
||||||
afterEvaluate {
|
// configures KotlinAndroidProjectExtension - which doesn't exist here
|
||||||
if (plugins.hasPlugin("com.android.application") || plugins.hasPlugin("com.android.library")) {
|
// on AGP 9+ unless we apply the plugin ourselves first.
|
||||||
val androidExtension = extensions.getByName("android") as BaseExtension
|
if (project.name == "android_alarm_manager_plus") {
|
||||||
androidExtension.apply {
|
pluginManager.apply("org.jetbrains.kotlin.android")
|
||||||
compileSdkVersion(36)
|
|
||||||
buildToolsVersion = "36.1.0"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (hasProperty("android")) {
|
|
||||||
val androidExtension = extensions.getByName("android") as BaseExtension
|
afterEvaluate {
|
||||||
androidExtension.apply {
|
if (plugins.hasPlugin("com.android.library")) {
|
||||||
// Set namespace if it's not already set
|
extensions.configure<LibraryExtension> {
|
||||||
if (!extraProperties.has("namespace")) {
|
compileSdk = 37
|
||||||
extraProperties["namespace"] = project.group.toString()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ===============================
|
|
||||||
|
|
||||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Delete>("clean") {
|
tasks.register<Delete>("clean") {
|
||||||
delete(rootProject.layout.buildDirectory)
|
delete(rootProject.layout.buildDirectory)
|
||||||
}
|
}
|
||||||
@@ -11,3 +11,10 @@ org.gradle.parallel=true
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
# Better Kotlin incremental compilation (warm builds)
|
# Better Kotlin incremental compilation (warm builds)
|
||||||
kotlin.incremental.useClasspathSnapshot=true
|
kotlin.incremental.useClasspathSnapshot=true
|
||||||
|
# This builtInKotlin flag was added automatically by Flutter migrator
|
||||||
|
android.builtInKotlin=false
|
||||||
|
|
||||||
|
android.newDsl=false
|
||||||
|
|
||||||
|
# Prevent AGP 9.0+ build failures due to relocated build directory ProGuard path mismatches
|
||||||
|
android.proguard.failOnMissingFiles=false
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-all.zip
|
||||||
|
|||||||
@@ -18,9 +18,12 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||||
id("com.android.application") version "8.11.1" apply false
|
id("com.android.application") version "9.2.0" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
// START: FlutterFire Configuration
|
||||||
id("org.jetbrains.kotlin.plugin.compose") version "2.1.0" apply false
|
id("com.google.gms.google-services") version("4.4.4") apply false
|
||||||
|
// END: FlutterFire Configuration
|
||||||
|
id("org.jetbrains.kotlin.android") version "2.3.10" apply false
|
||||||
|
id("org.jetbrains.kotlin.plugin.compose") version "2.3.10" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
include(":app")
|
include(":app")
|
||||||
|
|||||||
BIN
firka/assets/fonts/FiraCode-VariableFont_wght.ttf
Normal file
BIN
firka/assets/fonts/JustMeAgainDownHere.ttf
Normal file
BIN
firka/assets/fonts/Monoton-Regular.ttf
Normal file
BIN
firka/assets/fonts/PirataOne-Regular.ttf
Normal file
BIN
firka/assets/fonts/Vollkorn-VariableFont_wght.ttf
Normal file
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 13 KiB |
5
firka/assets/images/surprise_grades/play_card_star.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="tabler:play-card-star-filled">
|
||||||
|
<path id="Vector" d="M14.1667 1.66667C14.8297 1.66667 15.4656 1.93006 15.9344 2.3989C16.4033 2.86774 16.6667 3.50363 16.6667 4.16667V15.8333C16.6667 16.4964 16.4033 17.1323 15.9344 17.6011C15.4656 18.0699 14.8297 18.3333 14.1667 18.3333H5.83333C5.17029 18.3333 4.53441 18.0699 4.06557 17.6011C3.59673 17.1323 3.33333 16.4964 3.33333 15.8333V4.16667C3.33333 3.50363 3.59673 2.86774 4.06557 2.3989C4.53441 1.93006 5.17029 1.66667 5.83333 1.66667H14.1667ZM14.175 15H14.1667C13.9543 15.0002 13.75 15.0816 13.5955 15.2274C13.4411 15.3732 13.3481 15.5725 13.3357 15.7845C13.3232 15.9965 13.3922 16.2053 13.5286 16.3682C13.6649 16.5311 13.8583 16.6357 14.0692 16.6608L14.175 16.6667C14.396 16.6667 14.608 16.5789 14.7643 16.4226C14.9205 16.2663 15.0083 16.0543 15.0083 15.8333C15.0083 15.6123 14.9205 15.4004 14.7643 15.2441C14.608 15.0878 14.396 15 14.175 15ZM10.025 7.08333L9.92917 7.0875C9.60917 7.12083 9.32583 7.315 9.18083 7.60667L8.75583 8.4625L7.8075 8.60083C7.455 8.65 7.1575 8.89833 7.04583 9.24083L7.01833 9.345C6.9866 9.50024 6.99456 9.66098 7.04146 9.81233C7.08837 9.96368 7.17271 10.1007 7.28667 10.2108L7.97 10.875L7.80833 11.8142C7.75 12.1742 7.8975 12.5283 8.18667 12.7375L8.27583 12.7942C8.41247 12.8713 8.56621 12.9131 8.7231 12.9157C8.87998 12.9183 9.03503 12.8817 9.17417 12.8092L10.0258 12.3625L10.875 12.8083C11.1892 12.975 11.575 12.9483 11.8667 12.7367L11.95 12.67C12.1842 12.4542 12.2967 12.1325 12.2417 11.8133L12.08 10.875L12.7658 10.2092C13.0242 9.9575 13.1158 9.5825 13.005 9.24167L12.97 9.15C12.9051 9.00436 12.8044 8.87758 12.6771 8.78153C12.5499 8.68548 12.4003 8.6233 12.2425 8.60083L11.2942 8.4625L10.8708 7.6075C10.793 7.44983 10.6727 7.31709 10.5233 7.22431C10.374 7.13152 10.2016 7.0824 10.0258 7.0825M5.84167 3.33333H5.83333C5.62093 3.33357 5.41664 3.4149 5.26219 3.56071C5.10775 3.70651 5.0148 3.90579 5.00236 4.11783C4.98991 4.32986 5.0589 4.53865 5.19522 4.70153C5.33155 4.8644 5.52492 4.96908 5.73583 4.99417L5.84167 5C6.06268 5 6.27464 4.9122 6.43092 4.75592C6.5872 4.59964 6.675 4.38768 6.675 4.16667C6.675 3.94565 6.5872 3.73369 6.43092 3.57741C6.27464 3.42113 6.06268 3.33333 5.84167 3.33333Z" fill="#A7DC22"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.3 KiB |
3
firka/assets/images/surprise_grades/star_large.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path id="Star 9" d="M10.5 0L11.047 7.18922C11.1594 8.66653 12.3335 9.84055 13.8108 9.95296L21 10.5L13.8108 11.047C12.3335 11.1594 11.1594 12.3335 11.047 13.8108L10.5 21L9.95296 13.8108C9.84055 12.3335 8.66653 11.1594 7.18923 11.047L0 10.5L7.18922 9.95296C8.66653 9.84055 9.84055 8.66653 9.95296 7.18923L10.5 0Z" fill="#A7DC22"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 503 B |
3
firka/assets/images/surprise_grades/star_medium.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path id="Star 11" d="M12.5 0L13.1885 9.0478C13.3009 10.5251 14.4749 11.6991 15.9522 11.8115L25 12.5L15.9522 13.1885C14.4749 13.3009 13.3009 14.4749 13.1885 15.9522L12.5 25L11.8115 15.9522C11.6991 14.4749 10.5251 13.3009 9.0478 13.1885L0 12.5L9.0478 11.8115C10.5251 11.6991 11.6991 10.5251 11.8115 9.0478L12.5 0Z" fill="#A7DC22"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 504 B |
3
firka/assets/images/surprise_grades/star_small.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg preserveAspectRatio="none" overflow="visible" style="display: block;" width="9.87586" height="9.87586" viewBox="0 0 9.87586 9.87586" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path id="Star 10" d="M4.93793 0L5.15681 2.87656C5.23175 3.86143 6.01443 4.64411 6.9993 4.71905L9.87586 4.93793L6.9993 5.15681C6.01443 5.23175 5.23175 6.01443 5.15681 6.9993L4.93793 9.87586L4.71905 6.9993C4.64411 6.01443 3.86143 5.23175 2.87656 5.15681L0 4.93793L2.87656 4.71905C3.86143 4.64411 4.64411 3.86143 4.71905 2.87656L4.93793 0Z" fill="#A7DC22"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 549 B |
3
firka/assets/majesticons/check.svg
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M19.7069 7.70643C19.8891 7.51783 19.9899 7.26523 19.9876 7.00303C19.9853 6.74083 19.8801 6.49002 19.6947 6.30461C19.5093 6.1192 19.2585 6.01403 18.9963 6.01176C18.7341 6.00948 18.4815 6.11027 18.2929 6.29243L8.99992 15.5854L5.70692 12.2924C5.51832 12.1103 5.26571 12.0095 5.00352 12.0118C4.74132 12.014 4.49051 12.1192 4.3051 12.3046C4.11969 12.49 4.01452 12.7408 4.01224 13.003C4.00997 13.2652 4.11076 13.5178 4.29292 13.7064L8.29292 17.7064C8.48045 17.8939 8.73476 17.9992 8.99992 17.9992C9.26508 17.9992 9.51939 17.8939 9.70692 17.7064L19.7069 7.70643Z" fill="#A7DC22"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 726 B |
10
firka/assets/majesticons/checkSolid.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g clip-path="url(#clip0_2679_4048)">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.5 0.5C1.96957 0.5 1.46086 0.710714 1.08579 1.08579C0.710714 1.46086 0.5 1.96957 0.5 2.5V9.5C0.5 10.0304 0.710714 10.5391 1.08579 10.9142C1.46086 11.2893 1.96957 11.5 2.5 11.5H9.5C10.0304 11.5 10.5391 11.2893 10.9142 10.9142C11.2893 10.5391 11.5 10.0304 11.5 9.5V2.5C11.5 1.96957 11.2893 1.46086 10.9142 1.08579C10.5391 0.710714 10.0304 0.5 9.5 0.5H2.5ZM9.8535 3.8535C9.94458 3.7592 9.99498 3.6329 9.99384 3.5018C9.9927 3.3707 9.94011 3.24529 9.84741 3.15259C9.75471 3.05989 9.6293 3.0073 9.4982 3.00616C9.3671 3.00502 9.2408 3.05542 9.1465 3.1465L4.5 7.793L2.8535 6.1465C2.7592 6.05542 2.6329 6.00502 2.5018 6.00616C2.3707 6.0073 2.24529 6.05989 2.15259 6.15259C2.05989 6.24529 2.0073 6.3707 2.00616 6.5018C2.00502 6.6329 2.05542 6.7592 2.1465 6.8535L4.1465 8.8535C4.24026 8.94724 4.36742 8.99989 4.5 8.99989C4.63258 8.99989 4.75974 8.94724 4.8535 8.8535L9.8535 3.8535Z" fill="#A7DC22"/>
|
||||||
|
</g>
|
||||||
|
<defs>
|
||||||
|
<clipPath id="clip0_2679_4048">
|
||||||
|
<rect width="12" height="12" fill="white"/>
|
||||||
|
</clipPath>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,3 +1,3 @@
|
|||||||
<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.5 3C13.5 2.73478 13.3946 2.48043 13.2071 2.29289C13.0196 2.10536 12.7652 2 12.5 2C12.2348 2 11.9804 2.10536 11.7929 2.29289C11.6054 2.48043 11.5 2.73478 11.5 3V4C11.5 4.26522 11.6054 4.51957 11.7929 4.70711C11.9804 4.89464 12.2348 5 12.5 5C12.7652 5 13.0196 4.89464 13.2071 4.70711C13.3946 4.51957 13.5 4.26522 13.5 4V3ZM6.207 4.293C6.0184 4.11084 5.7658 4.01005 5.5036 4.01233C5.2414 4.0146 4.99059 4.11977 4.80518 4.30518C4.61977 4.49059 4.5146 4.7414 4.51233 5.0036C4.51005 5.2658 4.61084 5.5184 4.793 5.707L5.793 6.707C5.9816 6.88916 6.2342 6.98995 6.4964 6.98767C6.7586 6.9854 7.00941 6.88023 7.19482 6.69482C7.38023 6.50941 7.4854 6.2586 7.48767 5.9964C7.48995 5.7342 7.38916 5.4816 7.207 5.293L6.207 4.293ZM20.207 4.293C20.0195 4.10553 19.7652 4.00021 19.5 4.00021C19.2348 4.00021 18.9805 4.10553 18.793 4.293L17.793 5.293C17.6108 5.4816 17.51 5.7342 17.5123 5.9964C17.5146 6.2586 17.6198 6.50941 17.8052 6.69482C17.9906 6.88023 18.2414 6.9854 18.5036 6.98767C18.7658 6.98995 19.0184 6.88916 19.207 6.707L20.207 5.707C20.3945 5.51947 20.4998 5.26516 20.4998 5C20.4998 4.73484 20.3945 4.48053 20.207 4.293ZM12.5 7C11.1739 7 9.90215 7.52678 8.96447 8.46447C8.02678 9.40215 7.5 10.6739 7.5 12C7.5 13.3261 8.02678 14.5979 8.96447 15.5355C9.90215 16.4732 11.1739 17 12.5 17C13.8261 17 15.0979 16.4732 16.0355 15.5355C16.9732 14.5979 17.5 13.3261 17.5 12C17.5 10.6739 16.9732 9.40215 16.0355 8.46447C15.0979 7.52678 13.8261 7 12.5 7ZM3.5 11C3.23478 11 2.98043 11.1054 2.79289 11.2929C2.60536 11.4804 2.5 11.7348 2.5 12C2.5 12.2652 2.60536 12.5196 2.79289 12.7071C2.98043 12.8946 3.23478 13 3.5 13H4.5C4.76522 13 5.01957 12.8946 5.20711 12.7071C5.39464 12.5196 5.5 12.2652 5.5 12C5.5 11.7348 5.39464 11.4804 5.20711 11.2929C5.01957 11.1054 4.76522 11 4.5 11H3.5ZM20.5 11C20.2348 11 19.9804 11.1054 19.7929 11.2929C19.6054 11.4804 19.5 11.7348 19.5 12C19.5 12.2652 19.6054 12.5196 19.7929 12.7071C19.9804 12.8946 20.2348 13 20.5 13H21.5C21.7652 13 22.0196 12.8946 22.2071 12.7071C22.3946 12.5196 22.5 12.2652 22.5 12C22.5 11.7348 22.3946 11.4804 22.2071 11.2929C22.0196 11.1054 21.7652 11 21.5 11H20.5ZM7.207 18.707C7.30251 18.6148 7.37869 18.5044 7.4311 18.3824C7.48351 18.2604 7.5111 18.1292 7.51225 17.9964C7.5134 17.8636 7.4881 17.7319 7.43782 17.609C7.38754 17.4862 7.31329 17.3745 7.2194 17.2806C7.1255 17.1867 7.01385 17.1125 6.89095 17.0622C6.76806 17.0119 6.63638 16.9866 6.5036 16.9877C6.37082 16.9889 6.2396 17.0165 6.1176 17.0689C5.99559 17.1213 5.88525 17.1975 5.793 17.293L4.793 18.293C4.69749 18.3852 4.62131 18.4956 4.5689 18.6176C4.51649 18.7396 4.4889 18.8708 4.48775 19.0036C4.4866 19.1364 4.5119 19.2681 4.56218 19.391C4.61246 19.5138 4.68671 19.6255 4.7806 19.7194C4.8745 19.8133 4.98615 19.8875 5.10905 19.9378C5.23194 19.9881 5.36362 20.0134 5.4964 20.0123C5.62918 20.0111 5.7604 19.9835 5.8824 19.9311C6.00441 19.8787 6.11475 19.8025 6.207 19.707L7.207 18.707ZM19.207 17.293C19.0184 17.1108 18.7658 17.01 18.5036 17.0123C18.2414 17.0146 17.9906 17.1198 17.8052 17.3052C17.6198 17.4906 17.5146 17.7414 17.5123 18.0036C17.51 18.2658 17.6108 18.5184 17.793 18.707L18.793 19.707C18.9816 19.8892 19.2342 19.99 19.4964 19.9877C19.7586 19.9854 20.0094 19.8802 20.1948 19.6948C20.3802 19.5094 20.4854 19.2586 20.4877 18.9964C20.49 18.7342 20.3892 18.4816 20.207 18.293L19.207 17.293ZM13.5 20C13.5 19.7348 13.3946 19.4804 13.2071 19.2929C13.0196 19.1054 12.7652 19 12.5 19C12.2348 19 11.9804 19.1054 11.7929 19.2929C11.6054 19.4804 11.5 19.7348 11.5 20V21C11.5 21.2652 11.6054 21.5196 11.7929 21.7071C11.9804 21.8946 12.2348 22 12.5 22C12.7652 22 13.0196 21.8946 13.2071 21.7071C13.3946 21.5196 13.5 21.2652 13.5 21V20Z" fill="#FFFFFF"/>
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M13 3C13 2.73478 12.8946 2.48043 12.7071 2.29289C12.5196 2.10536 12.2652 2 12 2C11.7348 2 11.4804 2.10536 11.2929 2.29289C11.1054 2.48043 11 2.73478 11 3V4C11 4.26522 11.1054 4.51957 11.2929 4.70711C11.4804 4.89464 11.7348 5 12 5C12.2652 5 12.5196 4.89464 12.7071 4.70711C12.8946 4.51957 13 4.26522 13 4V3ZM5.707 4.293C5.5184 4.11084 5.2658 4.01005 5.0036 4.01233C4.7414 4.0146 4.49059 4.11977 4.30518 4.30518C4.11977 4.49059 4.0146 4.7414 4.01233 5.0036C4.01005 5.2658 4.11084 5.5184 4.293 5.707L5.293 6.707C5.4816 6.88916 5.7342 6.98995 5.9964 6.98767C6.2586 6.9854 6.50941 6.88023 6.69482 6.69482C6.88023 6.50941 6.9854 6.2586 6.98767 5.9964C6.98995 5.7342 6.88916 5.4816 6.707 5.293L5.707 4.293ZM19.707 4.293C19.5195 4.10553 19.2652 4.00021 19 4.00021C18.7348 4.00021 18.4805 4.10553 18.293 4.293L17.293 5.293C17.1108 5.4816 17.01 5.7342 17.0123 5.9964C17.0146 6.2586 17.1198 6.50941 17.3052 6.69482C17.4906 6.88023 17.7414 6.9854 18.0036 6.98767C18.2658 6.98995 18.5184 6.88916 18.707 6.707L19.707 5.707C19.8945 5.51947 19.9998 5.26516 19.9998 5C19.9998 4.73484 19.8945 4.48053 19.707 4.293ZM12 7C10.6739 7 9.40215 7.52678 8.46447 8.46447C7.52678 9.40215 7 10.6739 7 12C7 13.3261 7.52678 14.5979 8.46447 15.5355C9.40215 16.4732 10.6739 17 12 17C13.3261 17 14.5979 16.4732 15.5355 15.5355C16.4732 14.5979 17 13.3261 17 12C17 10.6739 16.4732 9.40215 15.5355 8.46447C14.5979 7.52678 13.3261 7 12 7ZM3 11C2.73478 11 2.48043 11.1054 2.29289 11.2929C2.10536 11.4804 2 11.7348 2 12C2 12.2652 2.10536 12.5196 2.29289 12.7071C2.48043 12.8946 2.73478 13 3 13H4C4.26522 13 4.51957 12.8946 4.70711 12.7071C4.89464 12.5196 5 12.2652 5 12C5 11.7348 4.89464 11.4804 4.70711 11.2929C4.51957 11.1054 4.26522 11 4 11H3ZM20 11C19.7348 11 19.4804 11.1054 19.2929 11.2929C19.1054 11.4804 19 11.7348 19 12C19 12.2652 19.1054 12.5196 19.2929 12.7071C19.4804 12.8946 19.7348 13 20 13H21C21.2652 13 21.5196 12.8946 21.7071 12.7071C21.8946 12.5196 22 12.2652 22 12C22 11.7348 21.8946 11.4804 21.7071 11.2929C21.5196 11.1054 21.2652 11 21 11H20ZM6.707 18.707C6.80251 18.6148 6.87869 18.5044 6.9311 18.3824C6.98351 18.2604 7.0111 18.1292 7.01225 17.9964C7.0134 17.8636 6.9881 17.7319 6.93782 17.609C6.88754 17.4862 6.81329 17.3745 6.7194 17.2806C6.6255 17.1867 6.51385 17.1125 6.39095 17.0622C6.26806 17.0119 6.13638 16.9866 6.0036 16.9877C5.87082 16.9889 5.7396 17.0165 5.6176 17.0689C5.49559 17.1213 5.38525 17.1975 5.293 17.293L4.293 18.293C4.19749 18.3852 4.12131 18.4956 4.0689 18.6176C4.01649 18.7396 3.9889 18.8708 3.98775 19.0036C3.9866 19.1364 4.0119 19.2681 4.06218 19.391C4.11246 19.5138 4.18671 19.6255 4.2806 19.7194C4.3745 19.8133 4.48615 19.8875 4.60905 19.9378C4.73194 19.9881 4.86362 20.0134 4.9964 20.0123C5.12918 20.0111 5.2604 19.9835 5.3824 19.9311C5.50441 19.8787 5.61475 19.8025 5.707 19.707L6.707 18.707ZM18.707 17.293C18.5184 17.1108 18.2658 17.01 18.0036 17.0123C17.7414 17.0146 17.4906 17.1198 17.3052 17.3052C17.1198 17.4906 17.0146 17.7414 17.0123 18.0036C17.01 18.2658 17.1108 18.5184 17.293 18.707L18.293 19.707C18.4816 19.8892 18.7342 19.99 18.9964 19.9877C19.2586 19.9854 19.5094 19.8802 19.6948 19.6948C19.8802 19.5094 19.9854 19.2586 19.9877 18.9964C19.99 18.7342 19.8892 18.4816 19.707 18.293L18.707 17.293ZM13 20C13 19.7348 12.8946 19.4804 12.7071 19.2929C12.5196 19.1054 12.2652 19 12 19C11.7348 19 11.4804 19.1054 11.2929 19.2929C11.1054 19.4804 11 19.7348 11 20V21C11 21.2652 11.1054 21.5196 11.2929 21.7071C11.4804 21.8946 11.7348 22 12 22C12.2652 22 12.5196 21.8946 12.7071 21.7071C12.8946 21.5196 13 21.2652 13 21V20Z" fill="#FFFFFF"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.6 KiB |
@@ -1,21 +1,10 @@
|
|||||||
icons:
|
icons:
|
||||||
"flutter_launcher_icons.yaml": "c600507ca0df7cebd0f708124842512a14ed3d597b779176200d6ba25b1335b1"
|
"flutter_launcher_icons.yaml": "993c1cd3a99db70747299601e556d19ec959b0a16fd9ff2dbf2386cb6f2a640d"
|
||||||
"pubspec.yaml": "cc5c8123f956bca34e25cec666ccc13fe5b7bdec06e217a58e1fa0ee58dedc20"
|
"pubspec.yaml": "97e478fd72968c34de0c0ad4421daa9b2e2531d60bb28a893d7d3b5a9a90116c"
|
||||||
"assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983"
|
"assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983"
|
||||||
"assets/images/logos/monochrome_logo.png": "188d2b0a64c70323b09bcee721663d6698fb557066f20ddaec97bba6869c1c6c"
|
"assets/images/logos/monochrome_logo.png": "c269a5e689622484d800a4fda5927591a0bf99d34790a4f146b93cf6edabd455"
|
||||||
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"
|
||||||
"assets/images/logos/colored_logo_only_mustache.png": "bad6220c11bdfb1dfe04e5173bd2ebedd3999689d4b3a68fc63dc520c96dd33b"
|
"assets/images/logos/colored_logo_only_mustache.png": "bad6220c11bdfb1dfe04e5173bd2ebedd3999689d4b3a68fc63dc520c96dd33b"
|
||||||
l10n:
|
|
||||||
"l10n.yml": "a57bc304cac4a2b0235593586f17f400a5165d67fc9aadeaa11893cfa36ee082"
|
|
||||||
"lib/l10n/app_de.arb": "9cd5913be1e3bc3ed6c088ef448d5ce2924a6290b7dd6006d1af624c5e9a2503"
|
|
||||||
"lib/l10n/app_hu.arb": "17077ec76b68ed03796a264b99e4dba9e6ddd532e27a92d8fb237ea6f211f757"
|
|
||||||
"lib/l10n/app_en.arb": "cbad6dd2485a983e399cce97371c19089b9110d30536488c14a7ea709c7b6ead"
|
|
||||||
isar:
|
|
||||||
"lib/data/models/app_settings_model.dart": "5eb5af345f1347f104257f0999763650fe2673f9da1754bd12d3f756fe5c9723"
|
|
||||||
"lib/data/models/generic_cache_model.dart": "79151d0467fb5d40c532eaaa08ad7c7e24a34304199280fbf49cf6e5adcce6bc"
|
|
||||||
"lib/data/models/homework_cache_model.dart": "45789970b27d5790cdc54c292ef2f5feaa5f4e293b8a8862fd676d5eb3e25d29"
|
|
||||||
"lib/data/models/timetable_cache_model.dart": "b972bf51e399f8d20d4f9ad660082d4cc4a9798df9ac9d6ec9ef6ac640205572"
|
|
||||||
"lib/data/models/token_model.dart": "8c957cd07e473827d78fd8fd4fb6c1336b636a69c25c93618e1e7f94b7cf0683"
|
|
||||||
splash:
|
splash:
|
||||||
"flutter_native_splash.yaml": "0fd4a85d6f950d97298e99916927649940ffcfdadfc136ceee126fed0dbaa9f2"
|
"flutter_native_splash.yaml": "f1bddb74798b1539c4e9213ca9ae305d625ebb0ac5bcbe079b523437e0abc2c4"
|
||||||
"assets/images/logos/splash.png": "88fbebc3d686cb9095bcce362029b69978b1b14270e465e91d962b1425db1152"
|
"assets/images/logos/splash.png": "88fbebc3d686cb9095bcce362029b69978b1b14270e465e91d962b1425db1152"
|
||||||
|
|||||||
1
firka/firebase.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"flutter":{"platforms":{"android":{"default":{"projectId":"firka-4633b","appId":"1:219357380322:android:5b776732799faa5c08a8bb","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"firka-4633b","configurations":{"android":"1:219357380322:android:5b776732799faa5c08a8bb"}}}}}}
|
||||||
@@ -1,11 +1,10 @@
|
|||||||
flutter_launcher_icons:
|
flutter_launcher_icons:
|
||||||
generate: true
|
generate: true
|
||||||
android: "launcher_icon"
|
android: "launcher_icon"
|
||||||
|
ios: false
|
||||||
image_path: "assets/images/logos/colored_logo.webp"
|
image_path: "assets/images/logos/colored_logo.webp"
|
||||||
adaptive_icon_monochrome: "assets/images/logos/monochrome_logo.png"
|
adaptive_icon_monochrome: "assets/images/logos/monochrome_logo.png"
|
||||||
adaptive_icon_background: "assets/images/logos/colored_logo_without_mustache.png"
|
adaptive_icon_background: "assets/images/logos/colored_logo_without_mustache.png"
|
||||||
adaptive_icon_foreground: "assets/images/logos/colored_logo_only_mustache.png"
|
adaptive_icon_foreground: "assets/images/logos/colored_logo_only_mustache.png"
|
||||||
adaptive_icon_foreground_inset: 0
|
adaptive_icon_foreground_inset: 0
|
||||||
min_sdk_android: 21
|
min_sdk_android: 21
|
||||||
ios: true
|
|
||||||
remove_alpha_channel_ios: true
|
|
||||||
|
|||||||
@@ -17,5 +17,6 @@ flutter_native_splash:
|
|||||||
icon_background_color: "#7ca120"
|
icon_background_color: "#7ca120"
|
||||||
icon_background_color_dark: "#7ca120"
|
icon_background_color_dark: "#7ca120"
|
||||||
|
|
||||||
ios: true
|
android: true
|
||||||
|
ios: false
|
||||||
web: false
|
web: false
|
||||||
|
|||||||
173
firka/integration_test/widget_e2e_test.dart
Normal file
@@ -0,0 +1,173 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:firka/app/app_state.dart';
|
||||||
|
import 'package:firka/app/initialization.dart';
|
||||||
|
import 'package:firka/core/settings/settings_repository.dart';
|
||||||
|
import 'package:firka/core/settings/settings_schema.dart';
|
||||||
|
import 'package:firka/data/widget.dart';
|
||||||
|
import 'package:firka/services/notification_diff_service.dart';
|
||||||
|
import 'package:firka_common/data/database.dart';
|
||||||
|
import 'package:firka_common/data/models/token_model.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:integration_test/integration_test.dart';
|
||||||
|
import 'package:kreta_api/kreta_api.dart';
|
||||||
|
import 'package:logging/logging.dart';
|
||||||
|
import 'package:path/path.dart' as p;
|
||||||
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
||||||
|
const _mockServerUrl = 'http://127.0.0.1:8090';
|
||||||
|
|
||||||
|
Future<TokenGrantResponse> _authenticateMockServer(HttpClient httpClient) async {
|
||||||
|
final loginReq = await httpClient.getUrl(Uri.parse('$_mockServerUrl/Account/Login'));
|
||||||
|
final loginResp = await loginReq.close();
|
||||||
|
final loginBody = await loginResp.transform(utf8.decoder).join();
|
||||||
|
|
||||||
|
final match = RegExp(r'name="code" value="([^"]+)"').firstMatch(loginBody);
|
||||||
|
if (match == null) {
|
||||||
|
throw Exception('Failed to extract code from mock server login: $loginBody');
|
||||||
|
}
|
||||||
|
final code = match.group(1)!;
|
||||||
|
|
||||||
|
final tokenReq = await httpClient.postUrl(Uri.parse('$_mockServerUrl/connect/token'));
|
||||||
|
tokenReq.headers.contentType = ContentType('application', 'x-www-form-urlencoded');
|
||||||
|
tokenReq.write('grant_type=authorization_code&code=${Uri.encodeQueryComponent(code)}');
|
||||||
|
final tokenResp = await tokenReq.close();
|
||||||
|
final tokenBody = await tokenResp.transform(utf8.decoder).join();
|
||||||
|
if (tokenResp.statusCode != 200) {
|
||||||
|
throw Exception('Token request failed (${tokenResp.statusCode}): $tokenBody');
|
||||||
|
}
|
||||||
|
return TokenGrantResponse.fromJson(jsonDecode(tokenBody) as Map<String, dynamic>);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Map<String, dynamic>>> _getMockLessons(HttpClient httpClient) async {
|
||||||
|
final req = await httpClient.getUrl(Uri.parse('$_mockServerUrl/admin/api/lessons'));
|
||||||
|
final resp = await req.close();
|
||||||
|
final body = await resp.transform(utf8.decoder).join();
|
||||||
|
final list = jsonDecode(body) as List;
|
||||||
|
return list.cast<Map<String, dynamic>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _putMockLessons(HttpClient httpClient, List<Map<String, dynamic>> lessons) async {
|
||||||
|
final req = await httpClient.putUrl(Uri.parse('$_mockServerUrl/admin/api/lessons'));
|
||||||
|
req.headers.contentType = ContentType.json;
|
||||||
|
req.write(jsonEncode(lessons));
|
||||||
|
final resp = await req.close();
|
||||||
|
if (resp.statusCode != 204 && resp.statusCode != 200) {
|
||||||
|
final body = await resp.transform(utf8.decoder).join();
|
||||||
|
throw Exception('Failed to update mock lessons (${resp.statusCode}): $body');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
||||||
|
logger = Logger("FirkaTest");
|
||||||
|
dio.options.connectTimeout = const Duration(seconds: 5);
|
||||||
|
dio.options.receiveTimeout = const Duration(seconds: 3);
|
||||||
|
dio.options.validateStatus = (status) => status != null && status < 500;
|
||||||
|
|
||||||
|
group('Widget End-to-End Test with Mock Kreta Server', () {
|
||||||
|
late HttpClient httpClient;
|
||||||
|
|
||||||
|
setUp(() {
|
||||||
|
httpClient = HttpClient();
|
||||||
|
});
|
||||||
|
|
||||||
|
tearDown(() {
|
||||||
|
httpClient.close(force: true);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('Opening app updates widget with timetable and FCM wakeup syncs timetable changes', (tester) async {
|
||||||
|
// 1. Initialize DB and authenticate with mock_kreta_server
|
||||||
|
final isar = await initDB();
|
||||||
|
Settings = SettingsRepository(isar);
|
||||||
|
await Settings.loadAll();
|
||||||
|
|
||||||
|
// Configure mock backend settings and enable notifications
|
||||||
|
await Settings.mockBackendEnabled.set(true);
|
||||||
|
await Settings.mockBackendUrl.set(_mockServerUrl);
|
||||||
|
await Settings.notifyAll.set(true);
|
||||||
|
|
||||||
|
final originalLessons = await _getMockLessons(httpClient);
|
||||||
|
final today = DateTime.now();
|
||||||
|
final seededLessons = originalLessons.indexed.map((entry) {
|
||||||
|
final (i, l) = entry;
|
||||||
|
final m = Map<String, dynamic>.from(l);
|
||||||
|
m['KezdetIdopont'] = DateTime(today.year, today.month, today.day, 8 + i, 0).toIso8601String();
|
||||||
|
m['VegIdopont'] = DateTime(today.year, today.month, today.day, 8 + i, 45).toIso8601String();
|
||||||
|
return m;
|
||||||
|
}).toList();
|
||||||
|
await _putMockLessons(httpClient, seededLessons);
|
||||||
|
|
||||||
|
final tokenResp = await _authenticateMockServer(httpClient);
|
||||||
|
final tokenModel = TokenModel.fromResp(tokenResp);
|
||||||
|
|
||||||
|
await isar.writeTxn(() async {
|
||||||
|
await isar.tokenModels.clear();
|
||||||
|
await isar.tokenModels.put(tokenModel);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 2. Initialize app (simulates opening the app)
|
||||||
|
await initializeApp();
|
||||||
|
expect(initDone, isTrue);
|
||||||
|
|
||||||
|
if (initData.client != null) {
|
||||||
|
await initData.client!.init();
|
||||||
|
await initData.client!.renewCache(reInit: false);
|
||||||
|
await WidgetCacheHelper.updateWidgetCacheFromIsar();
|
||||||
|
}
|
||||||
|
|
||||||
|
final dataDir = await getApplicationDocumentsDirectory();
|
||||||
|
final widgetFile = File(p.join(dataDir.path, 'widget_state.json'));
|
||||||
|
|
||||||
|
// Verify that widget_state.json was created on app opening
|
||||||
|
expect(widgetFile.existsSync(), isTrue, reason: 'widget_state.json must exist after opening app');
|
||||||
|
|
||||||
|
final initialContent = jsonDecode(widgetFile.readAsStringSync()) as Map<String, dynamic>;
|
||||||
|
expect(initialContent.containsKey('colors'), isTrue);
|
||||||
|
expect(initialContent.containsKey('timetable'), isTrue);
|
||||||
|
|
||||||
|
final initialTimetable = (initialContent['timetable'] as List).cast<Map<String, dynamic>>();
|
||||||
|
expect(initialTimetable.isNotEmpty, isTrue, reason: 'Timetable in widget must not be empty');
|
||||||
|
|
||||||
|
final firstLessonName = initialTimetable.first['name'];
|
||||||
|
expect(firstLessonName, isNotNull);
|
||||||
|
expect(initialTimetable.first.containsKey('dailyNth'), isTrue);
|
||||||
|
expect(initialTimetable.first.containsKey('start'), isTrue);
|
||||||
|
expect(initialTimetable.first.containsKey('end'), isTrue);
|
||||||
|
|
||||||
|
// 3. Simulate timetable change on mock server
|
||||||
|
final currentMockLessons = await _getMockLessons(httpClient);
|
||||||
|
expect(currentMockLessons.isNotEmpty, isTrue);
|
||||||
|
|
||||||
|
// Mutate the target lesson: change room and assign a substitute teacher
|
||||||
|
final modifiedLessons = List<Map<String, dynamic>>.from(currentMockLessons);
|
||||||
|
final targetIndex = modifiedLessons.indexWhere((l) => l['Nev'] == firstLessonName);
|
||||||
|
expect(targetIndex != -1, isTrue);
|
||||||
|
final updatedLesson = Map<String, dynamic>.from(modifiedLessons[targetIndex]);
|
||||||
|
updatedLesson['TeremNeve'] = 'LAB-999';
|
||||||
|
updatedLesson['HelyettesTanarNeve'] = 'Prof. E2E Teszt';
|
||||||
|
modifiedLessons[targetIndex] = updatedLesson;
|
||||||
|
|
||||||
|
await _putMockLessons(httpClient, modifiedLessons);
|
||||||
|
|
||||||
|
// 4. Trigger FCM wakeup processing
|
||||||
|
await NotificationDiffService.checkAll();
|
||||||
|
|
||||||
|
// 5. Verify widget_state.json was updated with modified timetable
|
||||||
|
final updatedContent = jsonDecode(widgetFile.readAsStringSync()) as Map<String, dynamic>;
|
||||||
|
final updatedTimetable = (updatedContent['timetable'] as List).cast<Map<String, dynamic>>();
|
||||||
|
|
||||||
|
final updatedMatch = updatedTimetable.firstWhere(
|
||||||
|
(l) => l['name'] == firstLessonName,
|
||||||
|
orElse: () => <String, dynamic>{},
|
||||||
|
);
|
||||||
|
expect(updatedMatch.isNotEmpty, isTrue);
|
||||||
|
expect(updatedMatch['roomName'], equals('LAB-999'), reason: 'Widget state should have updated room name');
|
||||||
|
expect(updatedMatch['substituteTeacher'], equals('Prof. E2E Teszt'), reason: 'Widget state should have updated substitute teacher');
|
||||||
|
|
||||||
|
// Revert mock server lessons back to original
|
||||||
|
await _putMockLessons(httpClient, originalLessons);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
39
firka/ios/.gitignore
vendored
@@ -1,39 +0,0 @@
|
|||||||
**/dgph
|
|
||||||
*.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
*.moved-aside
|
|
||||||
*.pbxuser
|
|
||||||
*.perspectivev3
|
|
||||||
**/*sync/
|
|
||||||
.sconsign.dblite
|
|
||||||
.tags*
|
|
||||||
**/.vagrant/
|
|
||||||
**/DerivedData/
|
|
||||||
Icon?
|
|
||||||
**/Pods/
|
|
||||||
**/.symlinks/
|
|
||||||
profile
|
|
||||||
xcuserdata
|
|
||||||
**/.generated/
|
|
||||||
Flutter/App.framework
|
|
||||||
Flutter/Flutter.framework
|
|
||||||
Flutter/Flutter.podspec
|
|
||||||
Flutter/Generated.xcconfig
|
|
||||||
Flutter/ephemeral/
|
|
||||||
Flutter/app.flx
|
|
||||||
Flutter/app.zip
|
|
||||||
Flutter/flutter_assets/
|
|
||||||
Flutter/flutter_export_environment.sh
|
|
||||||
ServiceDefinitions.json
|
|
||||||
Runner/GeneratedPluginRegistrant.*
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
|
||||||
!default.mode1v3
|
|
||||||
!default.mode2v3
|
|
||||||
!default.pbxuser
|
|
||||||
!default.perspectivev3
|
|
||||||
|
|
||||||
/.DerivedData
|
|
||||||
|
|
||||||
# Developer-specific configuration
|
|
||||||
.dev_config
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{
|
|
||||||
"colors" : [
|
|
||||||
{
|
|
||||||
"idiom" : "universal"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
{
|
|
||||||
"images" : [
|
|
||||||
{
|
|
||||||
"filename" : "Icon-1024.png",
|
|
||||||
"idiom" : "universal",
|
|
||||||
"platform" : "watchos",
|
|
||||||
"size" : "1024x1024"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"info" : {
|
|
||||||
"author" : "xcode",
|
|
||||||
"version" : 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 147 KiB |