40 Commits

Author SHA1 Message Date
zypherift
9b87e2c3e4 fix: 401 token retry, reauth UX, consistent headers, feedback screen, login spinner
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
- Add 401 retry with race-condition protection in kreta_client
- Fix ThemeSync null cast crash on missing code field
- Consistent H_H2 header style across all screens
- Reauth: clear toast on tap, proper bottom sheet sizing
- Login WebView: show loading spinner during token exchange
- Feedback screen: combined back button with H_H2 title
- Notification service, settings, widget, and l10n updates
- Theme screen: prevent visual flash on theme selection
2026-11-29 16:27:58 +01:00
zypherift
25f303e1e9 feat(themes): keep themes per account and keep shared ones live
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
A theme now follows the account rather than the install: it is pulled
on login and when the theme list opens, and every edit is pushed back,
so signing in elsewhere brings the theme along.

Sharing no longer hands over a dead snapshot. The link carries the
whole theme so it still imports with no network, plus a share id the
copy refetches by, which is how an edit by the owner reaches everyone
who scanned the code. Imported themes catch up on app open.

The editor's per-slot settings lookup moved to theme_palette, where
the share format already needed the same mapping.
2026-11-29 01:10:12 +01:00
7c08119ebc remove l10n submodule
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
include translation files directly
2026-11-28 21:12:46 +01:00
945d698f4c fix(wear): sync lessons and grades to the watch 2026-11-28 21:12:42 +01:00
f19d8cd387 feat(theming): share and import themes with qr codes 2026-11-28 21:12:41 +01:00
bc605dde0d fix(theming): make Dave stylized 2026-11-28 21:12:41 +01:00
f2317c1fe5 feat(theming): m3 dynamic color scheme 2026-11-28 21:12:41 +01:00
b41fc7ec08 feat(theming): background gradients 2026-11-28 21:12:41 +01:00
368545dc24 feat(theming): theme editor 2026-11-28 21:12:41 +01:00
b933e1e7b8 feat(theme): add grade color customization screen 2026-11-28 21:12:41 +01:00
fd909ade1d feat: initial color themes 2026-11-28 21:12:41 +01:00
dceeed25a3 feat(theme/preview): improve test pages 2026-11-28 21:12:41 +01:00
9c06a87001 feat(theme/preview): make one of the lessons dismissed on the tt 2026-11-28 21:12:41 +01:00
02b2043b5c feat(android): add progress centric notification support 2026-11-28 21:12:41 +01:00
77af5acba3 Merge pull request 'chore: drop the fallback rules from CLAUDE.md' (#51) from chore/claude-md-no-fallback into dev
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-11-28 02:24:10 +01:00
85dbc6d373 Merge pull request 'ci: build and publish a release apk on main' (#50) from ci/release-apk into dev
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
2026-11-28 02:24:01 +01:00
zypherift
e008325e53 chore: drop the fallback rules from CLAUDE.md
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-11-28 02:22:43 +01:00
zypherift
facb3326de ci: build and publish a release apk on main
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
The website's .apk button links to the newest main build, and main only published an .aab, which phones can't install.
2026-11-28 02:19:03 +01:00
eb196e9f60 Merge pull request 'chore: point CLAUDE.md at the style guide's CLAUDE.md' (#48) from chore/claude-md-chain into dev
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was canceled
2026-11-28 01:21:23 +01:00
zypherift
744fcbf233 chore: point CLAUDE.md at the style guide's CLAUDE.md
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-11-28 01:21:20 +01:00
4334ed095e Merge pull request 'chore: add CLAUDE.md pointing at the style guide' (#47) from chore/claude-md into dev
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
2026-11-28 01:16:30 +01:00
zypherift
ed55ed6226 chore: add CLAUDE.md pointing at the style guide
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-11-28 01:05:19 +01:00
8645e7d4c7 feat(debug): add verbose stats for nerds to lesson and message views
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Persist raw Kreta UIDs in LessonCacheModel and MessageCacheModel, extract StatsForNerdsTable into a shared component, and render debug info cards in showLessonBottomSheet and MessageScreen when Settings.statsForNerds is enabled.
2026-09-17 06:28:13 +02:00
6a058f5166 fix(bottom_sheet): make text expanded to avoid overflow 2026-09-16 22:28:55 +02:00
76fa644ccd fix(icon): match Szakmai Idegen Nyelv (and it's variations) as lang
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-16 19:52:14 +02:00
74064054e1 chore: update lib/l10n
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2026-09-16 15:28:09 +02:00
1373fef4af test: add month timetable flicker regression test
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2026-09-16 14:31:37 +02:00
2082bdbdbc test: add timetable cache regression tests 2026-09-16 14:31:29 +02:00
c1d677b4df fix: cover full visible grid on month view refresh 2026-09-16 14:31:14 +02:00
34d386c033 fix: reset lesson cache on refresh instead of merging 2026-09-16 14:31:06 +02:00
69ec627762 fix: avoid resyncing on quick app resume 2026-09-16 14:30:59 +02:00
6cb461654e fix: reuse kreta client across quick app resumes 2026-09-16 14:30:51 +02:00
fdf350c2c6 fix: migrate lesson cache after cachekey fix 2026-09-16 14:29:31 +02:00
857fa5e230 fix(api): derive lesson cache key from full uid hash 2026-09-16 14:27:55 +02:00
5a15894833 fix(cache): fix off-by-one in timetable range delete 2026-09-16 14:27:40 +02:00
609f79c3b9 fix(cache): trim renewTimetable chunks instead of skipping 2026-09-16 14:26:39 +02:00
e42298d32a fix(cache): dedupe concurrent init and renewCache calls 2026-09-16 14:25:35 +02:00
de4e8339a1 fix(cache): serialize kreta client writes 2026-09-16 14:24:46 +02:00
62d6a829bf fix(cache/tt): replace full cache when fetched 2026-09-14 23:21:16 +02:00
9dcf04e32d fix(tests): update tests to cover bugs 2026-09-14 23:21:12 +02:00
161 changed files with 22194 additions and 1241 deletions

8
.gitmodules vendored
View File

@@ -1,8 +0,0 @@
[submodule "firka/lib/l10n"]
path = firka/lib/l10n
url = https://git.firka.app/firka/firka-localization
branch = weblate
[submodule "firka_wear/lib/l10n"]
path = firka_wear/lib/l10n
url = https://git.firka.app/firka/firka-localization
branch = weblate

View File

@@ -122,6 +122,8 @@ steps:
- 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
@@ -157,6 +159,23 @@ steps:
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

10
CLAUDE.md Normal file
View 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.

View File

@@ -6,7 +6,13 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<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_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
android:name=".AppMain"
@@ -17,6 +23,24 @@
android:exported="false"
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
android:name=".MainActivity"
android:exported="true"

View File

@@ -7,8 +7,9 @@ import org.json.JSONObject
fun JSONObject.getStringOrNull(key: String): String? {
return try {
if (has(key)) {
getString(key)
if (has(key) && !isNull(key)) {
val v = getString(key)
if (v == "null" || v.isBlank()) null else v
} else {
null
}

View File

@@ -1,5 +1,6 @@
package app.firka.naplo
import android.app.NotificationManager
import android.appwidget.AppWidgetManager
import android.content.ComponentName
import android.content.Intent
@@ -25,6 +26,7 @@ class MainActivity : FlutterActivity() {
private val channel = "firka.app/main"
private val wearSyncChannel = "app.firka/wear_sync"
private val progressNotificationChannel = "app.firka/progress_notification"
private fun forceIconUpdate() {
try {
@@ -92,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 {
call, result ->
when (call.method) {

View File

@@ -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")
}
}
}

View File

@@ -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,
)

View File

@@ -41,6 +41,9 @@ class WidgetLesson(data: JSONObject) {
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")
val substituteTeacher: String? = data.getStringOrNull("substituteTeacher") ?: data.getStringOrNull("HelyettesTanarNeve")
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")
}

View 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="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>

View 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>

View 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 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>

View 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="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>

View 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>

View 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="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>

View 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>

View 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>

View 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="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>

View 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="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>

View File

@@ -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>

View 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="M4 14 14 3v7h6L10 21v-7H4z"
android:fillColor="#FFFFFFFF"
android:strokeColor="#FFFFFFFF"
android:strokeWidth="2"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>

View 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>

View File

@@ -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>

View 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>

View File

@@ -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>

View 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 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>

View 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 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>

View 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>

View File

@@ -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>

View 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>

View 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="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>

View 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="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>

View 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="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>

View 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>

View 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="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>

View 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>

View 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>

View 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="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>

View File

@@ -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>

View 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 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>

View 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 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>

View 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.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>

View 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 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>

View 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 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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,6 +1,6 @@
icons:
"flutter_launcher_icons.yaml": "993c1cd3a99db70747299601e556d19ec959b0a16fd9ff2dbf2386cb6f2a640d"
"pubspec.yaml": "198608775541fab3b6ff8cc21545e12a3413455f6ed87355cfdb576a97efab2d"
"pubspec.yaml": "5f054e5c3d601a26cc9fade986f20c68ef5a8ac85d2bc983a5b456b60c50d072"
"assets/images/logos/colored_logo.webp": "4b4fa99d144fe6694aa4487ba1b26aeecafae41e3c877836cd7da28d61a77983"
"assets/images/logos/monochrome_logo.png": "c269a5e689622484d800a4fda5927591a0bf99d34790a4f146b93cf6edabd455"
"assets/images/logos/colored_logo_without_mustache.png": "d11cff9f38985885873bfdd2d84e61f8fab03803eada94d4caac1545ef3685f3"

View File

@@ -38,6 +38,22 @@ class KretaClient {
final CacheManager cache;
final ToastCubit _toastCubit = initData.toastCubit;
// Serializes writes from independent call sites (renewCache,
// refreshHomeFeed, etc.) so one can't clobber another's fresher data.
Future<void> _writeQueue = Future.value();
Future<T> _enqueueWrite<T>(Future<T> Function() action) {
final completer = Completer<T>();
_writeQueue = _writeQueue.then((_) async {
try {
completer.complete(await action());
} catch (ex, st) {
completer.completeError(ex, st);
}
});
return completer.future;
}
KretaClient(TokenModel model) : cache = CacheManager(model);
bool get needsReauth => _toastCubit.state.type == ActiveToastType.reauth;
@@ -75,6 +91,27 @@ class KretaClient {
return lessons;
}
/// Splits [from, to) into the sub-range(s) that don't fall inside
/// [excludeFrom, excludeTo). Returns [(from, to)] unchanged if there's no
/// overlap (including when either exclude bound is null).
static List<(DateTime, DateTime)> _excludingRange(
DateTime from,
DateTime to,
DateTime? excludeFrom,
DateTime? excludeTo,
) {
if (excludeFrom == null ||
excludeTo == null ||
!from.isBefore(excludeTo) ||
!to.isAfter(excludeFrom)) {
return [(from, to)];
}
final ranges = <(DateTime, DateTime)>[];
if (from.isBefore(excludeFrom)) ranges.add((from, excludeFrom));
if (to.isAfter(excludeTo)) ranges.add((excludeTo, to));
return ranges;
}
Future<void> renewTimetable({
bool wholeYear = false,
DateTime? skipFrom,
@@ -129,13 +166,15 @@ class KretaClient {
int waitAfter = 5;
while (date.isBefore(to)) {
DateTime tmpTo = date.add(Duration(days: 14));
final alreadyFetched =
skipFrom != null &&
skipTo != null &&
!date.isBefore(skipFrom) &&
!tmpTo.isAfter(skipTo);
if (!alreadyFetched) {
requests.add(getLessons(date, tmpTo));
// Chunk boundaries rarely align with skipFrom/skipTo. Trim the
// overlap instead of skipping only fully-contained chunks.
for (final (reqFrom, reqTo) in _excludingRange(
date,
tmpTo,
skipFrom,
skipTo,
)) {
requests.add(getLessons(reqFrom, reqTo));
i++;
}
date = tmpTo;
@@ -161,12 +200,50 @@ class KretaClient {
await getNoticeBoard(from: from);
}
Future<void> init() async {
Future<void>? _initInFlight;
/// Two `init()` calls close together (initialization.dart + a
/// reInit-triggered renewCache()) used to run fully concurrently and
/// interleave writes. Coalesce to one in-flight future.
Future<void> init() {
final inFlight = _initInFlight;
if (inFlight != null) return inFlight;
final future = _initImpl();
_initInFlight = future;
// whenComplete() would return an unawaited derived future, so an
// error here would get reported as unhandled even though real
// callers already catch it via the returned `future`.
future.then(
(_) => _initInFlight = null,
onError: (_) => _initInFlight = null,
);
return future;
}
Future<void> _initImpl() async {
await getStudent();
await getClassGroups();
}
Future<void> renewCache({bool reInit = false}) async {
Future<void>? _renewCacheInFlight;
/// Multiple call sites trigger renewCache() close together on cold
/// start; without this a second call re-runs the whole sync concurrently
/// and can clobber the first's fresher writes.
Future<void> renewCache({bool reInit = false}) {
final inFlight = _renewCacheInFlight;
if (inFlight != null) return inFlight;
final future = _renewCacheImpl(reInit: reInit);
_renewCacheInFlight = future;
// See init()'s comment on why this isn't future.whenComplete(...).
future.then(
(_) => _renewCacheInFlight = null,
onError: (_) => _renewCacheInFlight = null,
);
return future;
}
Future<void> _renewCacheImpl({bool reInit = false}) async {
_toastCubit.setActiveToast(.fetching);
try {
if (reInit) {
@@ -316,18 +393,22 @@ class KretaClient {
}).whenComplete(() => _tokenMutexCompleter = null);
}
Future<Response> _authReq(String method, String url, [Object? data]) async {
Future<Response> _authReq(
String method,
String url, [
Object? data,
bool isRetry = false,
]) async {
var localToken = (await _lockAndRecoverToken()).accessToken;
final headers = <String, String>{
// "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
"accept": "*/*",
"user-agent": initData.userAgent,
"authorization": "Bearer $localToken",
"apiKey": "21ff6c25-d1da-4a68-a811-c881a6057463",
};
return await dio.get(
final resp = await dio.get(
MockBackend.rewrite(url),
options: Options(
method: method,
@@ -336,6 +417,16 @@ class KretaClient {
),
data: data,
);
if (resp.statusCode == 401 && !isRetry) {
logger.info("[AuthRetry] 401 on $url, forcing token refresh...");
if (cache.token.accessToken == localToken) {
cache.token.expiryDate = DateTime.now();
}
return _authReq(method, url, data, true);
}
return resp;
}
Future<(dynamic, int)> _authJson(
@@ -456,11 +547,20 @@ class KretaClient {
}
}
/// Upserts [caches]. Deletes stale rows in [staleScope].
/// Upserts [caches]. Deletes stale rows in [staleScope]. Queued behind
/// [_writeQueue] — see its doc comment.
Future<List<C>> _save<C extends GenericCacheModel<I>, I extends Identifiable>(
List<C> caches, [
QueryBuilder<C, C, QAfterFilterCondition>? staleScope,
]) async {
]) {
return _enqueueWrite(() => _saveImpl(caches, staleScope));
}
Future<List<C>>
_saveImpl<C extends GenericCacheModel<I>, I extends Identifiable>(
List<C> caches,
QueryBuilder<C, C, QAfterFilterCondition>? staleScope,
) async {
isarInit.writeTxnSync(() {
if (staleScope != null) {
final freshKeys = caches.map((c) => c.cacheKey).toSet();
@@ -489,19 +589,46 @@ class KretaClient {
}
Future<StudentCacheModel> getStudent() async {
return (await _renewCache<StudentCacheModel, Student>(
final list = await _renewCache<StudentCacheModel, Student>(
KretaEndpoints.getStudent(cache.token.iss),
StudentCacheModel.new,
(cache) => Student.fromJson(cache),
).then(_save)).first;
).then(_save);
if (list.isNotEmpty) {
return list.first;
}
final existing = cache.findStudentOrNull();
if (existing != null) {
logger.warning(
"getStudent returned empty, falling back to cached student",
);
return existing;
}
throw StateError(
"No student data returned from Kreta and no cached student found",
);
}
Future<List<ClassGroupCacheModel>> getClassGroups() async {
return await _renewCache(
final list = await _renewCache(
KretaEndpoints.getClassGroups(cache.token.iss),
ClassGroupCacheModel.new,
(item) => ClassGroup.fromJson(item),
).then(_save);
if (list.isNotEmpty) {
return list;
}
final existing = isarInit.classGroupCacheModels
.filter()
.group(cache.isCurrentClassGroup)
.findAllSync();
if (existing.isNotEmpty) {
logger.warning(
"getClassGroups returned empty, falling back to cached class groups",
);
return existing;
}
return list;
}
Future<List<MessageCacheModel>> getNoticeBoard({
@@ -548,19 +675,67 @@ class KretaClient {
).then((caches) => _save(caches, cache.getHomeworks()));
}
/// Automatically aligns requests to start at Monday and end at Sunday
Future<List<LessonCacheModel>> getLessons(DateTime from, DateTime to) async {
/// Wipes and replaces every cached lesson in [from]..[to], no Uid diffing.
Future<List<LessonCacheModel>> _replaceTimetableRange(
DateTime from,
DateTime to,
List<LessonCacheModel> caches,
) async {
late int existingCount;
late int deletedCount;
isarInit.writeTxnSync(() {
// NOT between(from, to): it's inclusive of `to`'s whole day, but
// `to` here is exclusive (matches what was actually fetched) — the
// inclusive version deleted a day beyond what `caches` covers.
final scope = cache.getTimeTable().and().startBetween(
from.getMidnight(),
to.getMidnight(),
includeUpper: false,
);
existingCount = scope.countSync();
deletedCount = scope.deleteAllSync();
isarInit.lessonCacheModels.putAllSync(caches);
});
logger.fine(
"[RenewCache] _replaceTimetableRange $from..$to: "
"existing=$existingCount deleted=$deletedCount inserting=${caches.length}",
);
initData.homeRefreshCubit.requestRefresh();
return caches;
}
/// Automatically aligns requests to start at Monday and end at Sunday.
/// Queued behind [_writeQueue] so overlapping ranges can't race.
Future<List<LessonCacheModel>> getLessons(DateTime from, DateTime to) {
return _enqueueWrite(() => _getLessonsImpl(from, to));
}
Future<List<LessonCacheModel>> _getLessonsImpl(
DateTime from,
DateTime to,
) async {
assert(from.difference(to).inDays < 30);
return (await _renewCache(
KretaEndpoints.getTimeTable(cache.token.iss, from, to),
LessonCacheModel.new,
(json) => Lesson.fromJson(json),
)
.then(resolveDailyNth)
.then(
(caches) =>
_save(caches, cache.getTimeTable().and().between(from, to)),
))
List<LessonCacheModel> caches;
try {
caches = await _renewCache(
KretaEndpoints.getTimeTable(cache.token.iss, from, to),
LessonCacheModel.new,
(json) => Lesson.fromJson(json),
).then(resolveDailyNth);
} catch (ex) {
if (isTokenExpired(ex)) {
rethrow;
}
// fall back to cache instead of losing the range
logger.warning(
"[Timetable] failed to refresh $from..$to, falling back to cache: $ex",
);
return cache.getTimeTable().and().between(from, to).findAllSync()
..sort((a, b) => a.start.compareTo(b.start));
}
return (await _replaceTimetableRange(from, to, caches))
..sort((a, b) => a.start.compareTo(b.start));
}

View File

@@ -125,9 +125,7 @@ class NotificationBackendClient {
return true;
}
_logger.warning(
'Failed to unregister FCM token: ${response.statusCode}',
);
_logger.warning('Failed to unregister FCM token: ${response.statusCode}');
return false;
} catch (e) {
_logger.severe('Error unregistering FCM token: $e');

View File

@@ -1,5 +1,6 @@
import "package:firka/app/app_state.dart";
import "package:firka/app/initialization.dart";
import "package:firka/core/theme_sync.dart";
import "package:firka/services/notification_delivery_service.dart";
import "package:firka_common/data/models/token_model.dart";
import "package:kreta_api/kreta_api.dart";
@@ -17,9 +18,10 @@ Future<void> completeLogin(
await data.settings.setSelectedAccountKey(tokenModel.key);
await initializeApp();
// this account may already have a theme stored server side
await syncThemeFromServer(data.settings);
if (data.client != null) {
await NotificationDeliveryService.onUserLogin(
client: data.client!,
);
await NotificationDeliveryService.onUserLogin(client: data.client!);
}
}

View File

@@ -0,0 +1,75 @@
import 'package:dio/dio.dart';
import 'package:firka/app/app_state.dart';
const _base = 'https://api.firka.app/v1';
Options _options(String? writeKey) => Options(
contentType: Headers.jsonContentType,
receiveTimeout: const Duration(seconds: 10),
sendTimeout: const Duration(seconds: 10),
headers: writeKey == null ? null : {'X-Theme-Key': writeKey},
);
/// the owner's own copy, by vault. null when nothing is stored yet.
Future<({String code, String name, String shareId})?> fetchTheme(
String vault,
) async {
try {
final res = await dio.get(
'$_base/theme-sync/$vault',
options: _options(null),
);
final data = res.data as Map<String, dynamic>;
return (
code: (data['code'] as String?) ?? '',
name: (data['name'] as String?) ?? '',
shareId: (data['share_id'] as String?) ?? '',
);
} on DioException catch (e) {
if (e.response?.statusCode == 404) return null;
rethrow;
}
}
/// what a share link points at right now. null when the link is dead.
Future<({String code, String name})?> fetchSharedTheme(String shareId) async {
try {
final res = await dio.get(
'$_base/theme-share/$shareId',
options: _options(null),
);
final data = res.data as Map<String, dynamic>;
return (
code: data['code'] as String,
name: (data['name'] as String?) ?? '',
);
} on DioException catch (e) {
if (e.response?.statusCode == 404) return null;
rethrow;
}
}
/// stores the theme under the vault. the write key claims the vault on the
/// first push and proves ownership on every later one.
Future<void> pushTheme(
String vault, {
required String writeKey,
required String code,
required String name,
}) async {
await dio.put(
'$_base/theme-sync/$vault',
data: {'code': code, 'name': name},
options: _options(writeKey),
);
}
/// publishes the theme and returns its public, read-only share id
Future<String> shareTheme(String vault, {required String writeKey}) async {
final res = await dio.post(
'$_base/theme-sync/$vault/share',
options: _options(writeKey),
);
return (res.data as Map<String, dynamic>)['share_id'] as String;
}

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:ui' as ui;
import 'package:firka_common/data/database.dart';
import 'package:firka_common/data/models/lesson_cache_model.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
@@ -9,7 +10,9 @@ import 'package:firka/app/app_state.dart';
import 'package:firka/api/client/kreta_client.dart';
import 'package:firka_common/data/models/token_model.dart';
import 'package:firka/services/notification_delivery_service.dart';
import 'package:firka/services/progress_notification_service.dart';
import 'package:firka/data/widget.dart';
import 'package:firka/core/extensions.dart';
import 'package:firka/core/settings/settings_effects.dart';
import 'package:firka/core/settings/settings_repository.dart';
import 'package:firka/core/settings/settings_schema.dart';
@@ -20,7 +23,9 @@ import 'package:firka/l10n/app_localizations_hu.dart';
import 'package:firka/core/swear_generator.dart';
import 'package:firka/ui/phone/screens/themes/builtin_theme_id.dart';
import 'package:firka/ui/theme/style.dart';
import 'package:firka_common/ui/theme/core_theme.dart';
import 'package:intl/intl.dart';
import 'package:firka/core/theme_sync.dart';
import 'package:logging/logging.dart';
import 'package:path/path.dart' as p;
import 'package:isar_community/isar.dart';
@@ -54,12 +59,15 @@ Future<void> initLang(AppInitialization data) async {
}
}
void initTheme(AppInitialization data) {
final themeCubit = data.themeCubit;
final brightness =
SchedulerBinding.instance.platformDispatcher.platformBrightness;
/// Builds a full style for an explicit brightness, applying all custom color
/// overrides — independent of the device's/app's actual current brightness.
/// Used by [initTheme] itself, and by screens (like the theme editor) that
/// need to preview a brightness other than the one currently on screen.
FirkaStyle buildStyleForBrightness(
bool isLight, {
bool? isCustomTheme,
bool forceCustomColors = false,
}) {
final titleFont = Settings.titleFont.value;
final titleWeight = Settings.titleWeight.value;
final fonts = buildAppFonts(
@@ -67,6 +75,28 @@ void initTheme(AppInitialization data) {
headingWeight: titleWeight,
supportsWeight: titleFont.supportsWeight,
);
final coreId = Settings.selectedCoreThemeId.value;
final gradeId = Settings.selectedGradeThemeId.value;
final style = styleFor(
coreId: coreId,
gradeId: gradeId,
isLight: isLight,
fonts: fonts,
);
_applyCustomColors(
style,
isCustomTheme: isCustomTheme,
force: forceCustomColors,
);
return style;
}
void initTheme(AppInitialization data) {
final themeCubit = data.themeCubit;
final brightness =
SchedulerBinding.instance.platformDispatcher.platformBrightness;
appHeadingTextCase = switch (Settings.titleCapitalization.value) {
TitleCapitalization.lower => HeadingTextCase.lower,
@@ -74,63 +104,244 @@ void initTheme(AppInitialization data) {
TitleCapitalization.normal => HeadingTextCase.normal,
};
FirkaStyle baseStyle;
final coreId = Settings.selectedCoreThemeId.value;
final gradeId = Settings.selectedGradeThemeId.value;
switch (Settings.themeBrightness.value) {
case ThemeBrightness.light:
baseStyle = styleFor(
coreId: coreId,
gradeId: gradeId,
isLight: true,
fonts: fonts,
);
themeCubit.setLightMode(true);
break;
case ThemeBrightness.dark:
baseStyle = styleFor(
coreId: coreId,
gradeId: gradeId,
isLight: false,
fonts: fonts,
);
themeCubit.setLightMode(false);
break;
case ThemeBrightness.auto:
if (brightness == Brightness.dark) {
baseStyle = styleFor(
coreId: coreId,
gradeId: gradeId,
isLight: false,
fonts: fonts,
);
themeCubit.setLightMode(false);
} else {
baseStyle = styleFor(
coreId: coreId,
gradeId: gradeId,
isLight: true,
fonts: fonts,
);
themeCubit.setLightMode(true);
}
final isLight = switch (Settings.themeBrightness.value) {
ThemeBrightness.light => true,
ThemeBrightness.dark => false,
ThemeBrightness.auto => brightness != Brightness.dark,
};
themeCubit.setLightMode(isLight);
appStyle = buildStyleForBrightness(isLight);
}
void _applyCustomColors(
FirkaStyle style, {
bool? isCustomTheme,
bool force = false,
}) {
final colors = style.colors;
colors.grade5 = Settings.customGradeColor5.value.toColorFromHexSetting();
colors.grade4 = Settings.customGradeColor4.value.toColorFromHexSetting();
colors.grade3 = Settings.customGradeColor3.value.toColorFromHexSetting();
colors.grade2 = Settings.customGradeColor2.value.toColorFromHexSetting();
colors.grade1 = Settings.customGradeColor1.value.toColorFromHexSetting();
final customActive =
isCustomTheme ?? !isBuiltinThemeId(Settings.selectedThemeId.value);
if (!force && !customActive) {
return;
}
appStyle = baseStyle;
final isLight = style.isLight;
colors.accent =
(isLight
? Settings.customAccentColorLight
: Settings.customAccentColorDark)
.value
.toColorFromHexSetting();
colors.a10p = colors.accent.withAlpha(0x1a);
colors.a15p = colors.accent.withAlpha(0x26);
final bgGrad =
(isLight
? Settings.customBackgroundGradientLight
: Settings.customBackgroundGradientDark)
.value
.toColorListFromHexSetting();
if (bgGrad.isNotEmpty) {
colors.backgroundGradient = bgGrad;
colors.background = bgGrad.first;
} else {
colors.background =
(isLight
? Settings.customBackgroundColorLight
: Settings.customBackgroundColorDark)
.value
.toColorFromHexSetting();
colors.backgroundGradient = null;
}
colors.background0p = colors.background.withAlpha(0);
colors.card =
(isLight ? Settings.customCardColorLight : Settings.customCardColorDark)
.value
.toColorFromHexSetting();
colors.cardTranslucent = colors.card.withAlpha(0x80);
colors.buttonSecondaryFill =
(isLight
? Settings.customButtonColorLight
: Settings.customButtonColorDark)
.value
.toColorFromHexSetting();
colors.secondary =
(isLight
? Settings.customSecondaryColorLight
: Settings.customSecondaryColorDark)
.value
.toColorFromHexSetting();
colors.buttonDisabledIcon = colors.secondary.withAlpha(0x80);
final customTextLight = Settings.customTextColorLight.value;
final customTextDark = Settings.customTextColorDark.value;
final isCustomTextLight =
customTextLight != SettingsRegistry.customTextColorLight.defaultValue;
final isCustomTextDark =
customTextDark != SettingsRegistry.customTextColorDark.defaultValue;
final textLight = customTextLight.toColorFromHexSetting();
final textDark = customTextDark.toColorFromHexSetting();
colors.textPrimary = isLight ? textLight : textDark;
final customSecLight = Settings.customTextSecondaryColorLight.value;
final customSecDark = Settings.customTextSecondaryColorDark.value;
final isCustomSecLight =
customSecLight !=
SettingsRegistry.customTextSecondaryColorLight.defaultValue;
final isCustomSecDark =
customSecDark !=
SettingsRegistry.customTextSecondaryColorDark.defaultValue;
colors.textSecondary = isLight
? (isCustomSecLight
? customSecLight.toColorFromHexSetting()
: (isCustomTextLight
? textLight.withAlpha(0xCC)
: customSecLight.toColorFromHexSetting()))
: (isCustomSecDark
? customSecDark.toColorFromHexSetting()
: (isCustomTextDark
? textDark.withAlpha(0xB3)
: customSecDark.toColorFromHexSetting()));
final customTertLight = Settings.customTextTertiaryColorLight.value;
final customTertDark = Settings.customTextTertiaryColorDark.value;
final isCustomTertLight =
customTertLight !=
SettingsRegistry.customTextTertiaryColorLight.defaultValue;
final isCustomTertDark =
customTertDark !=
SettingsRegistry.customTextTertiaryColorDark.defaultValue;
colors.textTertiary = isLight
? (isCustomTertLight
? customTertLight.toColorFromHexSetting()
: (isCustomTextLight
? textLight.withAlpha(0x80)
: customTertLight.toColorFromHexSetting()))
: (isCustomTertDark
? customTertDark.toColorFromHexSetting()
: (isCustomTextDark
? textDark.withAlpha(0x80)
: customTertDark.toColorFromHexSetting()));
colors.textTeritary = colors.textTertiary;
colors.textPrimaryLight = textLight;
colors.textSecondaryLight = isCustomSecLight
? customSecLight.toColorFromHexSetting()
: (isCustomTextLight
? textLight.withAlpha(0xCC)
: customSecLight.toColorFromHexSetting());
colors.textTertiaryLight = isCustomTertLight
? customTertLight.toColorFromHexSetting()
: (isCustomTextLight
? textLight.withAlpha(0x80)
: customTertLight.toColorFromHexSetting());
colors.shadowColor =
(isLight
? Settings.customShadowColorLight
: Settings.customShadowColorDark)
.value
.toColorFromHexSetting();
colors.success =
(isLight
? Settings.customSuccessColorLight
: Settings.customSuccessColorDark)
.value
.toColorFromHexSetting();
colors.warningAccent =
(isLight
? Settings.customWarningAccentColorLight
: Settings.customWarningAccentColorDark)
.value
.toColorFromHexSetting();
colors.warning15p = colors.warningAccent.withAlpha(0x26);
colors.warningText =
(isLight
? Settings.customWarningTextColorLight
: Settings.customWarningTextColorDark)
.value
.toColorFromHexSetting();
colors.warningCard =
(isLight
? Settings.customWarningCardColorLight
: Settings.customWarningCardColorDark)
.value
.toColorFromHexSetting();
colors.errorAccent =
(isLight
? Settings.customErrorAccentColorLight
: Settings.customErrorAccentColorDark)
.value
.toColorFromHexSetting();
colors.error15p = colors.errorAccent.withAlpha(0x26);
colors.errorText =
(isLight
? Settings.customErrorTextColorLight
: Settings.customErrorTextColorDark)
.value
.toColorFromHexSetting();
colors.errorCard =
(isLight
? Settings.customErrorCardColorLight
: Settings.customErrorCardColorDark)
.value
.toColorFromHexSetting();
}
DateTime? _lastInitDataAt;
String? _lastInitDataUsername;
Future<void> _initData(AppInitialization init) async {
await init.settings.loadAll();
// Old cacheKey scheme could collide across dates; wipe once so stale
// rows don't linger until their date range naturally resyncs.
if (!Settings.lessonCacheKeyMigrationDone.value) {
await isarInit.writeTxn(() async {
await isarInit.lessonCacheModels.clear();
});
await Settings.lessonCacheKeyMigrationDone.set(true);
logger.info(
"[Init] One-time migration: cleared the lesson cache to drop rows "
"keyed under the pre-fix cacheKey scheme",
);
}
final selectedThemeId = Settings.selectedThemeId.value;
final normalized = normalizeSelectedThemeId(selectedThemeId);
if (normalized != selectedThemeId) {
await Settings.selectedThemeId.set(normalized);
}
await initLang(init);
await regenerateM3eTheme();
initTheme(init);
var dispatcher = SchedulerBinding.instance.platformDispatcher;
dispatcher.onPlatformBrightnessChanged = () {
dispatcher.onPlatformBrightnessChanged = () async {
await regenerateM3eTheme();
initTheme(init);
};
@@ -148,6 +359,7 @@ Future<void> _initData(AppInitialization init) async {
logger.info(
"[Init] System locale changed in auto mode: $previousLocale -> $nextLocale",
);
await ProgressNotificationService.syncStrings(init.l10n);
}
init.themeCubit.refresh();
}());
@@ -159,6 +371,29 @@ Future<void> _initData(AppInitialization init) async {
init.client = null;
return;
}
// the owner of a shared theme keeps editing it, so catch up on app open
unawaited(refreshSharedThemes(init.settings));
// _initData reruns on ordinary resumes too (Android can recreate the
// Activity/engine without a real config change), and used to always
// build a fresh KretaClient — discarding its in-flight guards and
// letting two resumes race. Reuse the client within a short cooldown.
const initCooldown = Duration(minutes: 2);
final lastInit = _lastInitDataAt;
if (init.client != null &&
_lastInitDataUsername == token.username &&
lastInit != null &&
DateTime.now().difference(lastInit) < initCooldown) {
logger.info(
"[Init] Reusing existing kréta client for ${token.username} "
"(resynced within the last ${initCooldown.inMinutes}m)",
);
return;
}
_lastInitDataAt = DateTime.now();
_lastInitDataUsername = token.username;
logger.fine("Initializing kréta client as: ${token.username}");
init.client = KretaClient(token);
@@ -171,6 +406,7 @@ Future<void> _initData(AppInitialization init) async {
// Immediately refresh widget state from cached Isar lessons so widget is up to date
unawaited(WidgetCacheHelper.updateWidgetCacheFromIsar());
unawaited(ProgressNotificationService.checkAndStartOnMorning());
// Don't block first paint on the network: render whatever is already
// cached, then stream in student/timetable/grades/etc. as they arrive.
@@ -187,6 +423,7 @@ Future<void> _initData(AppInitialization init) async {
await init.client!.renewCache(reInit: false);
await WidgetCacheHelper.updateWidgetCacheFromIsar();
unawaited(ProgressNotificationService.checkAndStartIfActive());
init.homeRefreshCubit.requestRefresh();
}());
@@ -248,11 +485,17 @@ Future<void> initializeApp() async {
registerSettingsEffects(initData.settings, initData);
try {
await NotificationDeliveryService.initialize().timeout(const Duration(seconds: 8));
await NotificationDeliveryService.initialize().timeout(
const Duration(seconds: 8),
);
} on TimeoutException catch (e, st) {
logger.warning('NotificationDeliveryService init timed out: $e', e, st);
} catch (e, st) {
logger.severe('Failed to initialize NotificationDeliveryService: $e', e, st);
logger.severe(
'Failed to initialize NotificationDeliveryService: $e',
e,
st,
);
}
await _initData(initData);

View File

@@ -15,7 +15,8 @@ import 'package:firka/core/bloc/settings_cubit.dart';
import 'package:firka/core/bloc/theme_cubit.dart';
import 'package:firka/core/firka_bundle.dart';
import 'package:firka/routing/app_router.dart';
import 'package:firka/services/watch_sync_helper.dart';
import 'package:firka/services/shake_detector.dart';
import 'package:firka/services/wear_sync_helper.dart';
import 'package:firka/ui/theme/style.dart';
import 'package:firka/ui/phone/pages/extras/main_wear_pair.dart';
import 'package:firka/l10n/app_localizations.dart';
@@ -29,9 +30,44 @@ class InitializationScreen extends StatefulWidget {
State<InitializationScreen> createState() => _InitializationScreenState();
}
class _InitializationScreenState extends State<InitializationScreen> {
class _InitializationScreenState extends State<InitializationScreen>
with WidgetsBindingObserver {
GoRouter? _router;
final Future<void> _init = initializeApp();
late final _shake = ShakeDetector(_openFeedback);
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
}
@override
void dispose() {
WidgetsBinding.instance.removeObserver(this);
_shake.stop();
super.dispose();
}
@override
void didChangeAppLifecycleState(AppLifecycleState state) {
if (_router == null) return;
if (state == AppLifecycleState.resumed) {
_shake.start();
} else if (state == AppLifecycleState.paused) {
_shake.stop();
}
}
/// shaking the phone opens the feedback form, unless it is already open
void _openFeedback() {
final router = _router;
if (router == null) return;
if (router.routerDelegate.currentConfiguration.uri.path == '/feedback') {
return;
}
router.push('/feedback');
}
ThemeData _buildTheme(FirkaStyle style) {
return ThemeData(
@@ -156,6 +192,7 @@ class _InitializationScreenState extends State<InitializationScreen> {
if (_router == null) {
_router = createAppRouter();
appRouter = _router;
_shake.start();
}
final themeCubit = initData.themeCubit;

View File

@@ -1,3 +1,7 @@
import 'dart:convert';
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:firka/l10n/app_localizations.dart';
@@ -284,6 +288,42 @@ extension LessonExtension on List<Lesson> {
}
}
extension RandomColorExtension on Random {
HSVColor nextVividHSVColor() {
final hue = nextDouble() * 360;
final saturation = 0.55 + nextDouble() * 0.45;
final value = 0.7 + nextDouble() * 0.3;
return HSVColor.fromAHSV(1.0, hue, saturation, value);
}
}
extension ColorHexExtension on Color {
String toHexSetting() =>
"0x${toARGB32().toRadixString(16).toUpperCase().padLeft(8, '0')}";
}
extension HexSettingExtension on String {
Color toColorFromHexSetting() => Color(int.tryParse(this) ?? 0xFFFFFFFF);
List<Color> toColorListFromHexSetting() {
try {
final decoded = jsonDecode(this);
if (decoded is List) {
return decoded
.map((e) => e.toString().toColorFromHexSetting())
.toList();
}
} catch (_) {}
return [];
}
}
extension ColorListHexExtension on List<Color> {
String toHexSettingJson() {
return jsonEncode(map((c) => c.toHexSetting()).toList());
}
}
extension StringExtension on String {
bool isNumeric() {
final regex = RegExp(r'^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$');

View File

@@ -0,0 +1,54 @@
import 'dart:convert';
import 'dart:io';
import 'package:path/path.dart' as p;
/// characters of log that are sent, the newest ones. the api keeps up to 150 000
const feedbackLogLimit = 100000;
final _logFile = RegExp(r'^\d{4}_\d{2}_\d{2}\.log$');
/// things that look like a secret, in case one ever ends up in a log line
final _secrets = <RegExp>[
RegExp(r'Bearer\s+[A-Za-z0-9._~+/=-]+', caseSensitive: false),
RegExp(r'eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}(\.[A-Za-z0-9_-]*)?'),
RegExp(r'[\w.+-]+@[\w-]+(\.[\w-]+)+'),
];
final _urlSecret = RegExp(
r'([?&](?:code|access_token|refresh_token|id_token)=)[^&\s"]+',
);
String redactSecrets(String text) {
var out = text.replaceAllMapped(_urlSecret, (m) => '${m[1]}[redacted]');
for (final pattern in _secrets) {
out = out.replaceAll(pattern, '[redacted]');
}
return out;
}
/// the newest log lines of the app, oldest first, with anything secret removed.
/// [error] is the error the person is reporting, it goes on top.
Future<String> collectFeedbackLogs(Directory appDir, {String? error}) async {
final files =
appDir
.listSync()
.whereType<File>()
.where((file) => _logFile.hasMatch(p.basename(file.path)))
.toList()
..sort((a, b) => p.basename(b.path).compareTo(p.basename(a.path)));
final parts = <String>[];
var size = 0;
for (final file in files) {
if (size >= feedbackLogLimit) break;
final text = utf8.decode(await file.readAsBytes(), allowMalformed: true);
parts.insert(0, '--- ${p.basename(file.path)} ---\n$text');
size += text.length;
}
var logs = redactSecrets(parts.join('\n'));
if (logs.length > feedbackLogLimit) {
logs = logs.substring(logs.length - feedbackLogLimit);
}
return error == null ? logs : 'Hibaüzenet:\n${redactSecrets(error)}\n\n$logs';
}

View File

@@ -271,9 +271,7 @@ SettingsUiGroup buildSettingsTree(AppLocalizations l10n) {
FirkaIconType.majesticons,
Majesticon.flower2Solid,
l10n.s_c,
[
SettingsUiPersonalization(appIconPickerTree, always),
],
[SettingsUiPersonalization(appIconPickerTree, always)],
always,
null,
l10n.s_c_desc,
@@ -293,18 +291,34 @@ SettingsUiGroup buildSettingsTree(AppLocalizations l10n) {
SettingsRegistry.notifyAll,
always,
),
SettingsUiHeaderSmall(l10n.s_notif_delivery_method_header, isPushNotificationsEnabled),
SettingsUiBoolean(
FirkaIconType.majesticons,
Majesticon.clockSolid,
l10n.s_progress_notification,
SettingsRegistry.progressNotificationEnabled,
isPushNotificationsEnabled,
),
SettingsUiHeaderSmall(
l10n.s_notif_delivery_method_header,
isPushNotificationsEnabled,
),
SettingsUiEnum(SettingsRegistry.notificationDeliveryMethod, [
l10n.s_notif_delivery_auto,
l10n.s_notif_delivery_fcm,
l10n.s_notif_delivery_alarm,
], isPushNotificationsEnabled),
SettingsUiHeaderSmall(l10n.s_notif_wakeup_interval_header, isPushNotificationsEnabled),
SettingsUiHeaderSmall(
l10n.s_notif_wakeup_interval_header,
isPushNotificationsEnabled,
),
SettingsUiEnum(SettingsRegistry.notifyWakeupInterval, [
l10n.s_notif_wakeup_hourly,
l10n.s_notif_wakeup_two_hourly,
], isPushNotificationsEnabled),
SettingsUiHeaderSmall(l10n.s_notif_categories_header, isPushNotificationsEnabled),
SettingsUiHeaderSmall(
l10n.s_notif_categories_header,
isPushNotificationsEnabled,
),
SettingsUiBoolean(
null,
null,
@@ -522,8 +536,7 @@ SettingsUiGroup buildSettingsTree(AppLocalizations l10n) {
l10n.s_feedback,
const [],
always,
null,
l10n.s_todo,
"feedback",
),
SettingsUiBoolean(
null,

View File

@@ -6,8 +6,13 @@ import "package:firka/app/app_state.dart";
import "package:firka/app/initialization.dart";
import "package:firka/services/fcm_service.dart";
import "package:firka/services/notification_delivery_service.dart";
import "package:firka/services/watch_sync_helper.dart";
import "package:firka/services/progress_notification_service.dart";
import "package:firka/services/wear_sync_helper.dart";
import "package:firka/core/theme_palette.dart";
import "package:firka/ui/phone/screens/themes/builtin_theme_id.dart";
import "package:firka_common/ui/theme/core_theme.dart";
import "package:firka/data/widget.dart";
import "settings_repository.dart";
import "settings_schema.dart";
@@ -20,9 +25,14 @@ void registerSettingsEffects(
repo.onChange(SettingsRegistry.language, (_) async {
await initLang(initData);
initData.homeRefreshCubit.requestRefresh();
await WidgetCacheHelper.updateWidgetCacheFromIsar();
await ProgressNotificationService.syncStrings(initData.l10n);
});
repo.onChange(SettingsRegistry.themeBrightness, (_) async {
if (Settings.selectedCoreThemeId.value == "m3e") {
await regenerateM3eTheme();
}
initTheme(initData);
initData.themeCubit.refresh();
initData.homeRefreshCubit.requestRefresh();
@@ -38,6 +48,80 @@ void registerSettingsEffects(
repo.onChange(SettingsRegistry.titleWeight, refreshTitleStyle);
repo.onChange(SettingsRegistry.titleCapitalization, refreshTitleStyle);
Future<void> refreshPresetTheme(_) async {
if (Settings.selectedCoreThemeId.value == "m3e") {
await regenerateM3eTheme();
}
if (isBuiltinThemeId(Settings.selectedThemeId.value)) {
final next = composeBuiltinThemeId(
Settings.selectedCoreThemeId.value,
Settings.selectedGradeThemeId.value,
);
if (next != Settings.selectedThemeId.value) {
await Settings.selectedThemeId.setSilently(next);
}
}
initTheme(initData);
initData.themeCubit.refresh();
initData.homeRefreshCubit.requestRefresh();
}
repo.onChange(SettingsRegistry.selectedCoreThemeId, refreshPresetTheme);
repo.onChange(SettingsRegistry.selectedGradeThemeId, refreshPresetTheme);
repo.onChange(SettingsRegistry.selectedThemeId, refreshPresetTheme);
Future<void> refreshCustomColors(_) async {
initTheme(initData);
initData.themeCubit.refresh();
initData.homeRefreshCubit.requestRefresh();
// persist the new colors into the selected user theme
scheduleActiveThemeSave(repo);
}
for (final setting in [
SettingsRegistry.customGradeColor5,
SettingsRegistry.customGradeColor4,
SettingsRegistry.customGradeColor3,
SettingsRegistry.customGradeColor2,
SettingsRegistry.customGradeColor1,
SettingsRegistry.customAccentColorLight,
SettingsRegistry.customAccentColorDark,
SettingsRegistry.customBackgroundColorLight,
SettingsRegistry.customBackgroundColorDark,
SettingsRegistry.customCardColorLight,
SettingsRegistry.customCardColorDark,
SettingsRegistry.customButtonColorLight,
SettingsRegistry.customButtonColorDark,
SettingsRegistry.customSecondaryColorLight,
SettingsRegistry.customSecondaryColorDark,
SettingsRegistry.customTextColorLight,
SettingsRegistry.customTextColorDark,
SettingsRegistry.customTextSecondaryColorLight,
SettingsRegistry.customTextSecondaryColorDark,
SettingsRegistry.customTextTertiaryColorLight,
SettingsRegistry.customTextTertiaryColorDark,
SettingsRegistry.customShadowColorLight,
SettingsRegistry.customShadowColorDark,
SettingsRegistry.customSuccessColorLight,
SettingsRegistry.customSuccessColorDark,
SettingsRegistry.customWarningAccentColorLight,
SettingsRegistry.customWarningAccentColorDark,
SettingsRegistry.customWarningTextColorLight,
SettingsRegistry.customWarningTextColorDark,
SettingsRegistry.customWarningCardColorLight,
SettingsRegistry.customWarningCardColorDark,
SettingsRegistry.customErrorAccentColorLight,
SettingsRegistry.customErrorAccentColorDark,
SettingsRegistry.customErrorTextColorLight,
SettingsRegistry.customErrorTextColorDark,
SettingsRegistry.customErrorCardColorLight,
SettingsRegistry.customErrorCardColorDark,
SettingsRegistry.customBackgroundGradientLight,
SettingsRegistry.customBackgroundGradientDark,
]) {
repo.onChange(setting, refreshCustomColors);
}
repo.onChange(SettingsRegistry.wearOsSupport, (enabled) async {
if (!Platform.isAndroid) return;
if (enabled && initDone) {
@@ -56,12 +140,17 @@ void registerSettingsEffects(
repo.onChange(SettingsRegistry.notifyAll, (_) async {
await NotificationDeliveryService.syncDeliveryBackend();
await ProgressNotificationService.sync();
});
repo.onChange(SettingsRegistry.notificationDeliveryMethod, (_) async {
await NotificationDeliveryService.syncDeliveryBackend();
});
repo.onChange(SettingsRegistry.progressNotificationEnabled, (_) async {
await ProgressNotificationService.sync();
});
repo.onChange(SettingsRegistry.notifyWakeupInterval, (_) async {
await NotificationDeliveryService.handleWakeupIntervalChange();
});

View File

@@ -186,4 +186,133 @@ abstract class SettingsSchema {
values: NotificationDeliveryMethod.values,
)
NotificationDeliveryMethod get notificationDeliveryMethod;
// Gates a one-time lesson cache wipe to drop rows keyed under the old,
// colliding cacheKey scheme (see LessonCacheModel.cacheKey history).
@BoolSetting(id: 1048, defaultValue: false)
bool get lessonCacheKeyMigrationDone;
@BoolSetting(id: 1049, defaultValue: false)
bool get progressNotificationEnabled;
// Custom grade colors stored as 0xAARRGGBB hex strings.
// Defaults match the firka grade theme.
@StringSetting(id: 1050, defaultValue: "0xFF22CCAD")
String get customGradeColor5;
@StringSetting(id: 1051, defaultValue: "0xFF92EA3B")
String get customGradeColor4;
@StringSetting(id: 1052, defaultValue: "0xFFF9CF00")
String get customGradeColor3;
@StringSetting(id: 1053, defaultValue: "0xFFFFA046")
String get customGradeColor2;
@StringSetting(id: 1054, defaultValue: "0xFFFF54A1")
String get customGradeColor1;
// Custom theme colors stored as 0xAARRGGBB hex strings.
// Defaults match the firka core theme.
@StringSetting(id: 1055, defaultValue: "0xFFA7DC22")
String get customAccentColorLight;
@StringSetting(id: 1056, defaultValue: "0xFFA7DC22")
String get customAccentColorDark;
@StringSetting(id: 1057, defaultValue: "0xFFFAFFF0")
String get customBackgroundColorLight;
@StringSetting(id: 1058, defaultValue: "0xFF0D1202")
String get customBackgroundColorDark;
@StringSetting(id: 1059, defaultValue: "0xFFF3FBDE")
String get customCardColorLight;
@StringSetting(id: 1060, defaultValue: "0xFF141905")
String get customCardColorDark;
@StringSetting(id: 1061, defaultValue: "0xFFFEFFFD")
String get customButtonColorLight;
@StringSetting(id: 1062, defaultValue: "0xFF20290B")
String get customButtonColorDark;
@StringSetting(id: 1063, defaultValue: "0xFF6E8F1B")
String get customSecondaryColorLight;
@StringSetting(id: 1064, defaultValue: "0xFFCBEE71")
String get customSecondaryColorDark;
@StringSetting(id: 1065, defaultValue: "0xFF394C0A")
String get customTextColorLight;
@StringSetting(id: 1066, defaultValue: "0xFFEAF7CC")
String get customTextColorDark;
@StringSetting(id: 1067, defaultValue: "0xCC394C0A")
String get customTextSecondaryColorLight;
@StringSetting(id: 1068, defaultValue: "0xB3EAF7CC")
String get customTextSecondaryColorDark;
@StringSetting(id: 1069, defaultValue: "0x80394C0A")
String get customTextTertiaryColorLight;
@StringSetting(id: 1070, defaultValue: "0x80EAF7CC")
String get customTextTertiaryColorDark;
@StringSetting(id: 1071, defaultValue: "0x33647E22")
String get customShadowColorLight;
@StringSetting(id: 1072, defaultValue: "0x26CBEE71")
String get customShadowColorDark;
@StringSetting(id: 1073, defaultValue: "0xFF92EA3B")
String get customSuccessColorLight;
@StringSetting(id: 1074, defaultValue: "0xFF92EA3B")
String get customSuccessColorDark;
@StringSetting(id: 1075, defaultValue: "0xFFFFA046")
String get customWarningAccentColorLight;
@StringSetting(id: 1076, defaultValue: "0xFFFFA046")
String get customWarningAccentColorDark;
@StringSetting(id: 1077, defaultValue: "0xFF8F531B")
String get customWarningTextColorLight;
@StringSetting(id: 1078, defaultValue: "0xFFF0B37A")
String get customWarningTextColorDark;
@StringSetting(id: 1079, defaultValue: "0xFFFAEBDC")
String get customWarningCardColorLight;
@StringSetting(id: 1080, defaultValue: "0xFF201203")
String get customWarningCardColorDark;
@StringSetting(id: 1081, defaultValue: "0xFFFF54A1")
String get customErrorAccentColorLight;
@StringSetting(id: 1082, defaultValue: "0xFFFF54A1")
String get customErrorAccentColorDark;
@StringSetting(id: 1083, defaultValue: "0xFF8F1B4F")
String get customErrorTextColorLight;
@StringSetting(id: 1084, defaultValue: "0xFFF59EC5")
String get customErrorTextColorDark;
@StringSetting(id: 1085, defaultValue: "0xFFFADCE9")
String get customErrorCardColorLight;
@StringSetting(id: 1086, defaultValue: "0xFF1E030F")
String get customErrorCardColorDark;
@StringSetting(id: 1087, defaultValue: "[\"0xFFFAFFF0\",\"0xFFE8F7C8\"]")
String get customBackgroundGradientLight;
@StringSetting(id: 1088, defaultValue: "[\"0xFF0D1202\",\"0xFF1A2405\"]")
String get customBackgroundGradientDark;
}

View File

@@ -3,14 +3,47 @@
part of "settings_schema.dart";
class SettingsRegistry {
static const bellDelay = DoubleSetting(id: 1001, defaultValue: 0, min: 0, max: 120);
static const rounding1 = DoubleSetting(id: 1002, defaultValue: 0.5, min: 0.1, max: 0.99, precision: 2);
static const rounding2 = DoubleSetting(id: 1003, defaultValue: 0.5, min: 0.1, max: 0.99, precision: 2);
static const rounding3 = DoubleSetting(id: 1004, defaultValue: 0.5, min: 0.1, max: 0.99, precision: 2);
static const rounding4 = DoubleSetting(id: 1005, defaultValue: 0.5, min: 0.1, max: 0.99, precision: 2);
static const bellDelay = DoubleSetting(
id: 1001,
defaultValue: 0,
min: 0,
max: 120,
);
static const rounding1 = DoubleSetting(
id: 1002,
defaultValue: 0.5,
min: 0.1,
max: 0.99,
precision: 2,
);
static const rounding2 = DoubleSetting(
id: 1003,
defaultValue: 0.5,
min: 0.1,
max: 0.99,
precision: 2,
);
static const rounding3 = DoubleSetting(
id: 1004,
defaultValue: 0.5,
min: 0.1,
max: 0.99,
precision: 2,
);
static const rounding4 = DoubleSetting(
id: 1005,
defaultValue: 0.5,
min: 0.1,
max: 0.99,
precision: 2,
);
static const classAvgOnGraph = BoolSetting(id: 1006, defaultValue: true);
static const leftHandedMode = BoolSetting(id: 1007, defaultValue: false);
static const language = EnumSetting(id: 1008, defaultValue: AppLanguage.auto, values: AppLanguage.values);
static const language = EnumSetting(
id: 1008,
defaultValue: AppLanguage.auto,
values: AppLanguage.values,
);
static const appIcon = StringSetting(id: 0, defaultValue: "original");
static const childProtection = BoolSetting(id: 1010, defaultValue: true);
static const betaWarning = BoolSetting(id: 1011, defaultValue: false);
@@ -18,19 +51,53 @@ class SettingsRegistry {
static const ttToastTestsAndHw = BoolSetting(id: 1013, defaultValue: true);
static const ttToastBreaks = BoolSetting(id: 1014, defaultValue: true);
static const statsForNerds = BoolSetting(id: 1015, defaultValue: false);
static const developerOptsEnabled = BoolSetting(id: 1016, defaultValue: false);
static const themeBrightness = EnumSetting(id: 1017, defaultValue: ThemeBrightness.auto, values: ThemeBrightness.values);
static const developerOptsEnabled = BoolSetting(
id: 1016,
defaultValue: false,
);
static const themeBrightness = EnumSetting(
id: 1017,
defaultValue: ThemeBrightness.auto,
values: ThemeBrightness.values,
);
static const ttToastSubstitution = BoolSetting(id: 1018, defaultValue: true);
static const ttToastABTimetable = BoolSetting(id: 1023, defaultValue: true);
static const wearOsSupport = BoolSetting(id: 1024, defaultValue: false);
static const titleFont = EnumSetting(id: 1026, defaultValue: TitleFont.montserrat, values: TitleFont.values);
static const titleWeight = DoubleSetting(id: 1027, defaultValue: 700, min: 100, max: 900, precision: 0, step: 100);
static const titleCapitalization = EnumSetting(id: 1028, defaultValue: TitleCapitalization.normal, values: TitleCapitalization.values);
static const selectedThemeId = StringSetting(id: 1029, defaultValue: "builtin-firka-firka");
static const selectedCoreThemeId = StringSetting(id: 1030, defaultValue: "firka");
static const selectedGradeThemeId = StringSetting(id: 1031, defaultValue: "firka");
static const titleFont = EnumSetting(
id: 1026,
defaultValue: TitleFont.montserrat,
values: TitleFont.values,
);
static const titleWeight = DoubleSetting(
id: 1027,
defaultValue: 700,
min: 100,
max: 900,
precision: 0,
step: 100,
);
static const titleCapitalization = EnumSetting(
id: 1028,
defaultValue: TitleCapitalization.normal,
values: TitleCapitalization.values,
);
static const selectedThemeId = StringSetting(
id: 1029,
defaultValue: "builtin-firka-firka",
);
static const selectedCoreThemeId = StringSetting(
id: 1030,
defaultValue: "firka",
);
static const selectedGradeThemeId = StringSetting(
id: 1031,
defaultValue: "firka",
);
static const mockBackendEnabled = BoolSetting(id: 1032, defaultValue: false);
static const mockBackendUrl = StringSetting(id: 1033, defaultValue: "http://10.0.0.144:8090");
static const mockBackendUrl = StringSetting(
id: 1033,
defaultValue: "http://10.0.0.144:8090",
);
static const lastSeen = StringSetting(id: 1034, defaultValue: "{}");
static const surpriseGrades = BoolSetting(id: 1035, defaultValue: true);
static const seasonalAppIcons = BoolSetting(id: 1036, defaultValue: true);
@@ -41,57 +108,441 @@ class SettingsRegistry {
static const notifyAbsences = BoolSetting(id: 1041, defaultValue: true);
static const notifyLessons = BoolSetting(id: 1042, defaultValue: true);
static const notifyMessages = BoolSetting(id: 1043, defaultValue: true);
static const notifyMutedSubjects = StringSetting(id: 1044, defaultValue: "[]");
static const notifyWakeupInterval = EnumSetting(id: 1045, defaultValue: NotifyWakeupInterval.hourly, values: NotifyWakeupInterval.values);
static const fcmDebugNotifyOnMessage = BoolSetting(id: 1046, defaultValue: false);
static const notificationDeliveryMethod = EnumSetting(id: 1047, defaultValue: NotificationDeliveryMethod.auto, values: NotificationDeliveryMethod.values);
static const notifyMutedSubjects = StringSetting(
id: 1044,
defaultValue: "[]",
);
static const notifyWakeupInterval = EnumSetting(
id: 1045,
defaultValue: NotifyWakeupInterval.hourly,
values: NotifyWakeupInterval.values,
);
static const fcmDebugNotifyOnMessage = BoolSetting(
id: 1046,
defaultValue: false,
);
static const notificationDeliveryMethod = EnumSetting(
id: 1047,
defaultValue: NotificationDeliveryMethod.auto,
values: NotificationDeliveryMethod.values,
);
static const lessonCacheKeyMigrationDone = BoolSetting(
id: 1048,
defaultValue: false,
);
static const progressNotificationEnabled = BoolSetting(
id: 1049,
defaultValue: false,
);
static const customGradeColor5 = StringSetting(
id: 1050,
defaultValue: "0xFF22CCAD",
);
static const customGradeColor4 = StringSetting(
id: 1051,
defaultValue: "0xFF92EA3B",
);
static const customGradeColor3 = StringSetting(
id: 1052,
defaultValue: "0xFFF9CF00",
);
static const customGradeColor2 = StringSetting(
id: 1053,
defaultValue: "0xFFFFA046",
);
static const customGradeColor1 = StringSetting(
id: 1054,
defaultValue: "0xFFFF54A1",
);
static const customAccentColorLight = StringSetting(
id: 1055,
defaultValue: "0xFFA7DC22",
);
static const customAccentColorDark = StringSetting(
id: 1056,
defaultValue: "0xFFA7DC22",
);
static const customBackgroundColorLight = StringSetting(
id: 1057,
defaultValue: "0xFFFAFFF0",
);
static const customBackgroundColorDark = StringSetting(
id: 1058,
defaultValue: "0xFF0D1202",
);
static const customCardColorLight = StringSetting(
id: 1059,
defaultValue: "0xFFF3FBDE",
);
static const customCardColorDark = StringSetting(
id: 1060,
defaultValue: "0xFF141905",
);
static const customButtonColorLight = StringSetting(
id: 1061,
defaultValue: "0xFFFEFFFD",
);
static const customButtonColorDark = StringSetting(
id: 1062,
defaultValue: "0xFF20290B",
);
static const customSecondaryColorLight = StringSetting(
id: 1063,
defaultValue: "0xFF6E8F1B",
);
static const customSecondaryColorDark = StringSetting(
id: 1064,
defaultValue: "0xFFCBEE71",
);
static const customTextColorLight = StringSetting(
id: 1065,
defaultValue: "0xFF394C0A",
);
static const customTextColorDark = StringSetting(
id: 1066,
defaultValue: "0xFFEAF7CC",
);
static const customTextSecondaryColorLight = StringSetting(
id: 1067,
defaultValue: "0xCC394C0A",
);
static const customTextSecondaryColorDark = StringSetting(
id: 1068,
defaultValue: "0xB3EAF7CC",
);
static const customTextTertiaryColorLight = StringSetting(
id: 1069,
defaultValue: "0x80394C0A",
);
static const customTextTertiaryColorDark = StringSetting(
id: 1070,
defaultValue: "0x80EAF7CC",
);
static const customShadowColorLight = StringSetting(
id: 1071,
defaultValue: "0x33647E22",
);
static const customShadowColorDark = StringSetting(
id: 1072,
defaultValue: "0x26CBEE71",
);
static const customSuccessColorLight = StringSetting(
id: 1073,
defaultValue: "0xFF92EA3B",
);
static const customSuccessColorDark = StringSetting(
id: 1074,
defaultValue: "0xFF92EA3B",
);
static const customWarningAccentColorLight = StringSetting(
id: 1075,
defaultValue: "0xFFFFA046",
);
static const customWarningAccentColorDark = StringSetting(
id: 1076,
defaultValue: "0xFFFFA046",
);
static const customWarningTextColorLight = StringSetting(
id: 1077,
defaultValue: "0xFF8F531B",
);
static const customWarningTextColorDark = StringSetting(
id: 1078,
defaultValue: "0xFFF0B37A",
);
static const customWarningCardColorLight = StringSetting(
id: 1079,
defaultValue: "0xFFFAEBDC",
);
static const customWarningCardColorDark = StringSetting(
id: 1080,
defaultValue: "0xFF201203",
);
static const customErrorAccentColorLight = StringSetting(
id: 1081,
defaultValue: "0xFFFF54A1",
);
static const customErrorAccentColorDark = StringSetting(
id: 1082,
defaultValue: "0xFFFF54A1",
);
static const customErrorTextColorLight = StringSetting(
id: 1083,
defaultValue: "0xFF8F1B4F",
);
static const customErrorTextColorDark = StringSetting(
id: 1084,
defaultValue: "0xFFF59EC5",
);
static const customErrorCardColorLight = StringSetting(
id: 1085,
defaultValue: "0xFFFADCE9",
);
static const customErrorCardColorDark = StringSetting(
id: 1086,
defaultValue: "0xFF1E030F",
);
static const customBackgroundGradientLight = StringSetting(
id: 1087,
defaultValue: "[\"0xFFFAFFF0\",\"0xFFE8F7C8\"]",
);
static const customBackgroundGradientDark = StringSetting(
id: 1088,
defaultValue: "[\"0xFF0D1202\",\"0xFF1A2405\"]",
);
static const all = <Setting>[
bellDelay, rounding1, rounding2, rounding3, rounding4, classAvgOnGraph, leftHandedMode, language, appIcon, childProtection, betaWarning, ttToastLessonNo, ttToastTestsAndHw, ttToastBreaks, statsForNerds, developerOptsEnabled, themeBrightness, ttToastSubstitution, ttToastABTimetable, wearOsSupport, titleFont, titleWeight, titleCapitalization, selectedThemeId, selectedCoreThemeId, selectedGradeThemeId, mockBackendEnabled, mockBackendUrl, lastSeen, surpriseGrades, seasonalAppIcons, uwuMode, notifyAll, notifyGrades, notifyHomeworkTests, notifyAbsences, notifyLessons, notifyMessages, notifyMutedSubjects, notifyWakeupInterval, fcmDebugNotifyOnMessage, notificationDeliveryMethod,
bellDelay,
rounding1,
rounding2,
rounding3,
rounding4,
classAvgOnGraph,
leftHandedMode,
language,
appIcon,
childProtection,
betaWarning,
ttToastLessonNo,
ttToastTestsAndHw,
ttToastBreaks,
statsForNerds,
developerOptsEnabled,
themeBrightness,
ttToastSubstitution,
ttToastABTimetable,
wearOsSupport,
titleFont,
titleWeight,
titleCapitalization,
selectedThemeId,
selectedCoreThemeId,
selectedGradeThemeId,
mockBackendEnabled,
mockBackendUrl,
lastSeen,
surpriseGrades,
seasonalAppIcons,
uwuMode,
notifyAll,
notifyGrades,
notifyHomeworkTests,
notifyAbsences,
notifyLessons,
notifyMessages,
notifyMutedSubjects,
notifyWakeupInterval,
fcmDebugNotifyOnMessage,
notificationDeliveryMethod,
lessonCacheKeyMigrationDone,
progressNotificationEnabled,
customGradeColor5,
customGradeColor4,
customGradeColor3,
customGradeColor2,
customGradeColor1,
customAccentColorLight,
customAccentColorDark,
customBackgroundColorLight,
customBackgroundColorDark,
customCardColorLight,
customCardColorDark,
customButtonColorLight,
customButtonColorDark,
customSecondaryColorLight,
customSecondaryColorDark,
customTextColorLight,
customTextColorDark,
customTextSecondaryColorLight,
customTextSecondaryColorDark,
customTextTertiaryColorLight,
customTextTertiaryColorDark,
customShadowColorLight,
customShadowColorDark,
customSuccessColorLight,
customSuccessColorDark,
customWarningAccentColorLight,
customWarningAccentColorDark,
customWarningTextColorLight,
customWarningTextColorDark,
customWarningCardColorLight,
customWarningCardColorDark,
customErrorAccentColorLight,
customErrorAccentColorDark,
customErrorTextColorLight,
customErrorTextColorDark,
customErrorCardColorLight,
customErrorCardColorDark,
customBackgroundGradientLight,
customBackgroundGradientDark,
];
}
extension SettingsAccessors on SettingsRepository {
SilentlySettable<double> get bellDelay => SilentlySettable(this, SettingsRegistry.bellDelay);
SilentlySettable<double> get rounding1 => SilentlySettable(this, SettingsRegistry.rounding1);
SilentlySettable<double> get rounding2 => SilentlySettable(this, SettingsRegistry.rounding2);
SilentlySettable<double> get rounding3 => SilentlySettable(this, SettingsRegistry.rounding3);
SilentlySettable<double> get rounding4 => SilentlySettable(this, SettingsRegistry.rounding4);
SilentlySettable<bool> get classAvgOnGraph => SilentlySettable(this, SettingsRegistry.classAvgOnGraph);
SilentlySettable<bool> get leftHandedMode => SilentlySettable(this, SettingsRegistry.leftHandedMode);
SilentlySettable<AppLanguage> get language => SilentlySettable(this, SettingsRegistry.language);
SilentlySettable<String> get appIcon => SilentlySettable(this, SettingsRegistry.appIcon);
SilentlySettable<bool> get childProtection => SilentlySettable(this, SettingsRegistry.childProtection);
SilentlySettable<bool> get betaWarning => SilentlySettable(this, SettingsRegistry.betaWarning);
SilentlySettable<bool> get ttToastLessonNo => SilentlySettable(this, SettingsRegistry.ttToastLessonNo);
SilentlySettable<bool> get ttToastTestsAndHw => SilentlySettable(this, SettingsRegistry.ttToastTestsAndHw);
SilentlySettable<bool> get ttToastBreaks => SilentlySettable(this, SettingsRegistry.ttToastBreaks);
SilentlySettable<bool> get statsForNerds => SilentlySettable(this, SettingsRegistry.statsForNerds);
SilentlySettable<bool> get developerOptsEnabled => SilentlySettable(this, SettingsRegistry.developerOptsEnabled);
SilentlySettable<ThemeBrightness> get themeBrightness => SilentlySettable(this, SettingsRegistry.themeBrightness);
SilentlySettable<bool> get ttToastSubstitution => SilentlySettable(this, SettingsRegistry.ttToastSubstitution);
SilentlySettable<bool> get ttToastABTimetable => SilentlySettable(this, SettingsRegistry.ttToastABTimetable);
SilentlySettable<bool> get wearOsSupport => SilentlySettable(this, SettingsRegistry.wearOsSupport);
SilentlySettable<TitleFont> get titleFont => SilentlySettable(this, SettingsRegistry.titleFont);
SilentlySettable<double> get titleWeight => SilentlySettable(this, SettingsRegistry.titleWeight);
SilentlySettable<TitleCapitalization> get titleCapitalization => SilentlySettable(this, SettingsRegistry.titleCapitalization);
SilentlySettable<String> get selectedThemeId => SilentlySettable(this, SettingsRegistry.selectedThemeId);
SilentlySettable<String> get selectedCoreThemeId => SilentlySettable(this, SettingsRegistry.selectedCoreThemeId);
SilentlySettable<String> get selectedGradeThemeId => SilentlySettable(this, SettingsRegistry.selectedGradeThemeId);
SilentlySettable<bool> get mockBackendEnabled => SilentlySettable(this, SettingsRegistry.mockBackendEnabled);
SilentlySettable<String> get mockBackendUrl => SilentlySettable(this, SettingsRegistry.mockBackendUrl);
SilentlySettable<String> get lastSeen => SilentlySettable(this, SettingsRegistry.lastSeen);
SilentlySettable<bool> get surpriseGrades => SilentlySettable(this, SettingsRegistry.surpriseGrades);
SilentlySettable<bool> get seasonalAppIcons => SilentlySettable(this, SettingsRegistry.seasonalAppIcons);
SilentlySettable<bool> get uwuMode => SilentlySettable(this, SettingsRegistry.uwuMode);
SilentlySettable<bool> get notifyAll => SilentlySettable(this, SettingsRegistry.notifyAll);
SilentlySettable<bool> get notifyGrades => SilentlySettable(this, SettingsRegistry.notifyGrades);
SilentlySettable<bool> get notifyHomeworkTests => SilentlySettable(this, SettingsRegistry.notifyHomeworkTests);
SilentlySettable<bool> get notifyAbsences => SilentlySettable(this, SettingsRegistry.notifyAbsences);
SilentlySettable<bool> get notifyLessons => SilentlySettable(this, SettingsRegistry.notifyLessons);
SilentlySettable<bool> get notifyMessages => SilentlySettable(this, SettingsRegistry.notifyMessages);
SilentlySettable<String> get notifyMutedSubjects => SilentlySettable(this, SettingsRegistry.notifyMutedSubjects);
SilentlySettable<NotifyWakeupInterval> get notifyWakeupInterval => SilentlySettable(this, SettingsRegistry.notifyWakeupInterval);
SilentlySettable<bool> get fcmDebugNotifyOnMessage => SilentlySettable(this, SettingsRegistry.fcmDebugNotifyOnMessage);
SilentlySettable<NotificationDeliveryMethod> get notificationDeliveryMethod => SilentlySettable(this, SettingsRegistry.notificationDeliveryMethod);
SilentlySettable<double> get bellDelay =>
SilentlySettable(this, SettingsRegistry.bellDelay);
SilentlySettable<double> get rounding1 =>
SilentlySettable(this, SettingsRegistry.rounding1);
SilentlySettable<double> get rounding2 =>
SilentlySettable(this, SettingsRegistry.rounding2);
SilentlySettable<double> get rounding3 =>
SilentlySettable(this, SettingsRegistry.rounding3);
SilentlySettable<double> get rounding4 =>
SilentlySettable(this, SettingsRegistry.rounding4);
SilentlySettable<bool> get classAvgOnGraph =>
SilentlySettable(this, SettingsRegistry.classAvgOnGraph);
SilentlySettable<bool> get leftHandedMode =>
SilentlySettable(this, SettingsRegistry.leftHandedMode);
SilentlySettable<AppLanguage> get language =>
SilentlySettable(this, SettingsRegistry.language);
SilentlySettable<String> get appIcon =>
SilentlySettable(this, SettingsRegistry.appIcon);
SilentlySettable<bool> get childProtection =>
SilentlySettable(this, SettingsRegistry.childProtection);
SilentlySettable<bool> get betaWarning =>
SilentlySettable(this, SettingsRegistry.betaWarning);
SilentlySettable<bool> get ttToastLessonNo =>
SilentlySettable(this, SettingsRegistry.ttToastLessonNo);
SilentlySettable<bool> get ttToastTestsAndHw =>
SilentlySettable(this, SettingsRegistry.ttToastTestsAndHw);
SilentlySettable<bool> get ttToastBreaks =>
SilentlySettable(this, SettingsRegistry.ttToastBreaks);
SilentlySettable<bool> get statsForNerds =>
SilentlySettable(this, SettingsRegistry.statsForNerds);
SilentlySettable<bool> get developerOptsEnabled =>
SilentlySettable(this, SettingsRegistry.developerOptsEnabled);
SilentlySettable<ThemeBrightness> get themeBrightness =>
SilentlySettable(this, SettingsRegistry.themeBrightness);
SilentlySettable<bool> get ttToastSubstitution =>
SilentlySettable(this, SettingsRegistry.ttToastSubstitution);
SilentlySettable<bool> get ttToastABTimetable =>
SilentlySettable(this, SettingsRegistry.ttToastABTimetable);
SilentlySettable<bool> get wearOsSupport =>
SilentlySettable(this, SettingsRegistry.wearOsSupport);
SilentlySettable<TitleFont> get titleFont =>
SilentlySettable(this, SettingsRegistry.titleFont);
SilentlySettable<double> get titleWeight =>
SilentlySettable(this, SettingsRegistry.titleWeight);
SilentlySettable<TitleCapitalization> get titleCapitalization =>
SilentlySettable(this, SettingsRegistry.titleCapitalization);
SilentlySettable<String> get selectedThemeId =>
SilentlySettable(this, SettingsRegistry.selectedThemeId);
SilentlySettable<String> get selectedCoreThemeId =>
SilentlySettable(this, SettingsRegistry.selectedCoreThemeId);
SilentlySettable<String> get selectedGradeThemeId =>
SilentlySettable(this, SettingsRegistry.selectedGradeThemeId);
SilentlySettable<bool> get mockBackendEnabled =>
SilentlySettable(this, SettingsRegistry.mockBackendEnabled);
SilentlySettable<String> get mockBackendUrl =>
SilentlySettable(this, SettingsRegistry.mockBackendUrl);
SilentlySettable<String> get lastSeen =>
SilentlySettable(this, SettingsRegistry.lastSeen);
SilentlySettable<bool> get surpriseGrades =>
SilentlySettable(this, SettingsRegistry.surpriseGrades);
SilentlySettable<bool> get seasonalAppIcons =>
SilentlySettable(this, SettingsRegistry.seasonalAppIcons);
SilentlySettable<bool> get uwuMode =>
SilentlySettable(this, SettingsRegistry.uwuMode);
SilentlySettable<bool> get notifyAll =>
SilentlySettable(this, SettingsRegistry.notifyAll);
SilentlySettable<bool> get notifyGrades =>
SilentlySettable(this, SettingsRegistry.notifyGrades);
SilentlySettable<bool> get notifyHomeworkTests =>
SilentlySettable(this, SettingsRegistry.notifyHomeworkTests);
SilentlySettable<bool> get notifyAbsences =>
SilentlySettable(this, SettingsRegistry.notifyAbsences);
SilentlySettable<bool> get notifyLessons =>
SilentlySettable(this, SettingsRegistry.notifyLessons);
SilentlySettable<bool> get notifyMessages =>
SilentlySettable(this, SettingsRegistry.notifyMessages);
SilentlySettable<String> get notifyMutedSubjects =>
SilentlySettable(this, SettingsRegistry.notifyMutedSubjects);
SilentlySettable<NotifyWakeupInterval> get notifyWakeupInterval =>
SilentlySettable(this, SettingsRegistry.notifyWakeupInterval);
SilentlySettable<bool> get fcmDebugNotifyOnMessage =>
SilentlySettable(this, SettingsRegistry.fcmDebugNotifyOnMessage);
SilentlySettable<NotificationDeliveryMethod> get notificationDeliveryMethod =>
SilentlySettable(this, SettingsRegistry.notificationDeliveryMethod);
SilentlySettable<bool> get lessonCacheKeyMigrationDone =>
SilentlySettable(this, SettingsRegistry.lessonCacheKeyMigrationDone);
SilentlySettable<bool> get progressNotificationEnabled =>
SilentlySettable(this, SettingsRegistry.progressNotificationEnabled);
SilentlySettable<String> get customGradeColor5 =>
SilentlySettable(this, SettingsRegistry.customGradeColor5);
SilentlySettable<String> get customGradeColor4 =>
SilentlySettable(this, SettingsRegistry.customGradeColor4);
SilentlySettable<String> get customGradeColor3 =>
SilentlySettable(this, SettingsRegistry.customGradeColor3);
SilentlySettable<String> get customGradeColor2 =>
SilentlySettable(this, SettingsRegistry.customGradeColor2);
SilentlySettable<String> get customGradeColor1 =>
SilentlySettable(this, SettingsRegistry.customGradeColor1);
SilentlySettable<String> get customAccentColorLight =>
SilentlySettable(this, SettingsRegistry.customAccentColorLight);
SilentlySettable<String> get customAccentColorDark =>
SilentlySettable(this, SettingsRegistry.customAccentColorDark);
SilentlySettable<String> get customBackgroundColorLight =>
SilentlySettable(this, SettingsRegistry.customBackgroundColorLight);
SilentlySettable<String> get customBackgroundColorDark =>
SilentlySettable(this, SettingsRegistry.customBackgroundColorDark);
SilentlySettable<String> get customCardColorLight =>
SilentlySettable(this, SettingsRegistry.customCardColorLight);
SilentlySettable<String> get customCardColorDark =>
SilentlySettable(this, SettingsRegistry.customCardColorDark);
SilentlySettable<String> get customButtonColorLight =>
SilentlySettable(this, SettingsRegistry.customButtonColorLight);
SilentlySettable<String> get customButtonColorDark =>
SilentlySettable(this, SettingsRegistry.customButtonColorDark);
SilentlySettable<String> get customSecondaryColorLight =>
SilentlySettable(this, SettingsRegistry.customSecondaryColorLight);
SilentlySettable<String> get customSecondaryColorDark =>
SilentlySettable(this, SettingsRegistry.customSecondaryColorDark);
SilentlySettable<String> get customTextColorLight =>
SilentlySettable(this, SettingsRegistry.customTextColorLight);
SilentlySettable<String> get customTextColorDark =>
SilentlySettable(this, SettingsRegistry.customTextColorDark);
SilentlySettable<String> get customTextSecondaryColorLight =>
SilentlySettable(this, SettingsRegistry.customTextSecondaryColorLight);
SilentlySettable<String> get customTextSecondaryColorDark =>
SilentlySettable(this, SettingsRegistry.customTextSecondaryColorDark);
SilentlySettable<String> get customTextTertiaryColorLight =>
SilentlySettable(this, SettingsRegistry.customTextTertiaryColorLight);
SilentlySettable<String> get customTextTertiaryColorDark =>
SilentlySettable(this, SettingsRegistry.customTextTertiaryColorDark);
SilentlySettable<String> get customShadowColorLight =>
SilentlySettable(this, SettingsRegistry.customShadowColorLight);
SilentlySettable<String> get customShadowColorDark =>
SilentlySettable(this, SettingsRegistry.customShadowColorDark);
SilentlySettable<String> get customSuccessColorLight =>
SilentlySettable(this, SettingsRegistry.customSuccessColorLight);
SilentlySettable<String> get customSuccessColorDark =>
SilentlySettable(this, SettingsRegistry.customSuccessColorDark);
SilentlySettable<String> get customWarningAccentColorLight =>
SilentlySettable(this, SettingsRegistry.customWarningAccentColorLight);
SilentlySettable<String> get customWarningAccentColorDark =>
SilentlySettable(this, SettingsRegistry.customWarningAccentColorDark);
SilentlySettable<String> get customWarningTextColorLight =>
SilentlySettable(this, SettingsRegistry.customWarningTextColorLight);
SilentlySettable<String> get customWarningTextColorDark =>
SilentlySettable(this, SettingsRegistry.customWarningTextColorDark);
SilentlySettable<String> get customWarningCardColorLight =>
SilentlySettable(this, SettingsRegistry.customWarningCardColorLight);
SilentlySettable<String> get customWarningCardColorDark =>
SilentlySettable(this, SettingsRegistry.customWarningCardColorDark);
SilentlySettable<String> get customErrorAccentColorLight =>
SilentlySettable(this, SettingsRegistry.customErrorAccentColorLight);
SilentlySettable<String> get customErrorAccentColorDark =>
SilentlySettable(this, SettingsRegistry.customErrorAccentColorDark);
SilentlySettable<String> get customErrorTextColorLight =>
SilentlySettable(this, SettingsRegistry.customErrorTextColorLight);
SilentlySettable<String> get customErrorTextColorDark =>
SilentlySettable(this, SettingsRegistry.customErrorTextColorDark);
SilentlySettable<String> get customErrorCardColorLight =>
SilentlySettable(this, SettingsRegistry.customErrorCardColorLight);
SilentlySettable<String> get customErrorCardColorDark =>
SilentlySettable(this, SettingsRegistry.customErrorCardColorDark);
SilentlySettable<String> get customBackgroundGradientLight =>
SilentlySettable(this, SettingsRegistry.customBackgroundGradientLight);
SilentlySettable<String> get customBackgroundGradientDark =>
SilentlySettable(this, SettingsRegistry.customBackgroundGradientDark);
}

View File

@@ -0,0 +1,191 @@
import 'dart:async';
import 'package:firka/core/extensions.dart';
import 'package:firka/core/settings/setting.dart';
import 'package:firka/core/settings/settings_repository.dart';
import 'package:firka/core/settings/settings_schema.dart';
import 'package:firka/core/theme_sync.dart';
import 'package:firka/ui/phone/screens/themes/builtin_theme_id.dart';
import 'package:firka/ui/phone/screens/themes/user_theme.dart';
import 'package:firka_common/data/database.dart';
import 'package:firka_common/data/models/user_theme_model.dart';
import 'package:firka_common/ui/theme/theme_binary_format.dart';
import 'package:flutter/painting.dart';
/// the settings that hold a slot's light and dark color
(StringSetting, StringSetting) themeSlotSettings(ThemeColorSlot slot) {
switch (slot) {
case ThemeColorSlot.accent:
return (
SettingsRegistry.customAccentColorLight,
SettingsRegistry.customAccentColorDark,
);
case ThemeColorSlot.background:
return (
SettingsRegistry.customBackgroundColorLight,
SettingsRegistry.customBackgroundColorDark,
);
case ThemeColorSlot.card:
return (
SettingsRegistry.customCardColorLight,
SettingsRegistry.customCardColorDark,
);
case ThemeColorSlot.button:
return (
SettingsRegistry.customButtonColorLight,
SettingsRegistry.customButtonColorDark,
);
case ThemeColorSlot.secondary:
return (
SettingsRegistry.customSecondaryColorLight,
SettingsRegistry.customSecondaryColorDark,
);
case ThemeColorSlot.textPrimary:
return (
SettingsRegistry.customTextColorLight,
SettingsRegistry.customTextColorDark,
);
case ThemeColorSlot.textSecondary:
return (
SettingsRegistry.customTextSecondaryColorLight,
SettingsRegistry.customTextSecondaryColorDark,
);
case ThemeColorSlot.textTertiary:
return (
SettingsRegistry.customTextTertiaryColorLight,
SettingsRegistry.customTextTertiaryColorDark,
);
case ThemeColorSlot.shadowColor:
return (
SettingsRegistry.customShadowColorLight,
SettingsRegistry.customShadowColorDark,
);
case ThemeColorSlot.success:
return (
SettingsRegistry.customSuccessColorLight,
SettingsRegistry.customSuccessColorDark,
);
case ThemeColorSlot.warningAccent:
return (
SettingsRegistry.customWarningAccentColorLight,
SettingsRegistry.customWarningAccentColorDark,
);
case ThemeColorSlot.warningText:
return (
SettingsRegistry.customWarningTextColorLight,
SettingsRegistry.customWarningTextColorDark,
);
case ThemeColorSlot.warningCard:
return (
SettingsRegistry.customWarningCardColorLight,
SettingsRegistry.customWarningCardColorDark,
);
case ThemeColorSlot.errorAccent:
return (
SettingsRegistry.customErrorAccentColorLight,
SettingsRegistry.customErrorAccentColorDark,
);
case ThemeColorSlot.errorText:
return (
SettingsRegistry.customErrorTextColorLight,
SettingsRegistry.customErrorTextColorDark,
);
case ThemeColorSlot.errorCard:
return (
SettingsRegistry.customErrorCardColorLight,
SettingsRegistry.customErrorCardColorDark,
);
}
}
/// the grade color settings, grade 1 first, the order of the share format
final _gradeSettings = [
SettingsRegistry.customGradeColor1,
SettingsRegistry.customGradeColor2,
SettingsRegistry.customGradeColor3,
SettingsRegistry.customGradeColor4,
SettingsRegistry.customGradeColor5,
];
/// the colors the app has right now as a share code: every slot, the grade
/// colors and both background gradients
String captureThemeCode(SettingsRepository settings) {
Color read(StringSetting setting) =>
settings.get(setting).toColorFromHexSetting();
final bytes = ThemeBinaryFormat.encodeFullTheme(
light: {
for (final slot in ThemeColorSlot.values)
slot: read(themeSlotSettings(slot).$1),
},
dark: {
for (final slot in ThemeColorSlot.values)
slot: read(themeSlotSettings(slot).$2),
},
gradeColors: [for (final setting in _gradeSettings) read(setting)],
gradientLight: settings
.get(SettingsRegistry.customBackgroundGradientLight)
.toColorListFromHexSetting(),
gradientDark: settings
.get(SettingsRegistry.customBackgroundGradientDark)
.toColorListFromHexSetting(),
);
return ThemeBinaryFormat.toBase64(bytes);
}
/// puts the colors of a share code into the settings. everything is written
/// quietly except the last one, so the app refreshes once and not forty times.
/// throws a [FormatException] when the code is not a theme.
Future<void> applyThemeCode(SettingsRepository settings, String code) async {
final data = ThemeBinaryFormat.decodeFromBase64(code);
final slots = data.toThemeSlots();
for (final slot in ThemeColorSlot.values) {
final (light, dark) = themeSlotSettings(slot);
await settings.setSilently(light, slots.light[slot]!.toHexSetting());
await settings.setSilently(dark, slots.dark[slot]!.toHexSetting());
}
for (var i = 0; i < _gradeSettings.length; i++) {
await settings.setSilently(
_gradeSettings[i],
data.gradeColors[i].toHexSetting(),
);
}
await settings.setSilently(
SettingsRegistry.customBackgroundGradientLight,
data.gradientLight.toHexSettingJson(),
);
await settings.set(
SettingsRegistry.customBackgroundGradientDark,
data.gradientDark.toHexSettingJson(),
);
}
/// writes the colors being edited back into the selected theme, so each theme
/// keeps its own. nothing to do while a built-in theme is selected.
Future<void> saveActiveThemeCode(SettingsRepository settings) async {
final id = settings.get(SettingsRegistry.selectedThemeId);
if (isBuiltinThemeId(id)) return;
final stored = await isarInit.userThemeModels.getByThemeId(id);
if (stored == null) return;
stored.code = captureThemeCode(settings);
stored.swatchArgb = [
for (final color in UserTheme.swatchFromAppStyle()) color.toARGB32(),
];
await isarInit.writeTxn(() => isarInit.userThemeModels.putByThemeId(stored));
await pushThemeToServer(settings);
}
Timer? _saveTimer;
/// saves the selected theme a moment after the last change, dragging a slider
/// changes a color many times a second
void scheduleActiveThemeSave(SettingsRepository settings) {
_saveTimer?.cancel();
_saveTimer = Timer(
const Duration(milliseconds: 300),
() => saveActiveThemeCode(settings),
);
}

View File

@@ -0,0 +1,213 @@
import 'dart:convert';
import 'package:crypto/crypto.dart';
import 'package:isar_community/isar.dart';
import 'package:firka/api/theme_sync_api.dart' as api;
import 'package:firka/app/app_state.dart';
import 'package:firka/core/settings/settings_repository.dart';
import 'package:firka/core/settings/settings_schema.dart';
import 'package:firka/core/theme_palette.dart';
import 'package:firka/ui/phone/screens/themes/builtin_theme_id.dart';
import 'package:firka/ui/phone/screens/themes/user_theme.dart';
import 'package:firka_common/data/database.dart';
import 'package:firka_common/data/models/token_model.dart';
import 'package:firka_common/data/models/user_theme_model.dart';
import 'package:firka_common/ui/theme/theme_binary_format.dart';
/// identifies the account's row. baked into the app so the vault can't be
/// worked out from a student's institute code and id alone.
const _vaultSalt = 'firka-theme-sync-2026';
/// a different secret for the write key, so seeing a vault never tells
/// anyone what it takes to change what is in it
const _writeSalt = 'firka-theme-write-2026';
/// the account's row id. the only thing that leaves the device is this hash,
/// never the institute code or the student id behind it. both survive a token
/// refresh, so the vault stays the same for the life of the account.
String computeVault(TokenModel token) => sha256
.convert(utf8.encode('$_vaultSalt:${token.iss}:${token.studentId}'))
.toString();
/// proves to the server that this client owns the vault. the server only
/// ever stores a hash of it, and it never goes into a share link.
String computeWriteKey(TokenModel token) => Hmac(
sha256,
utf8.encode(_writeSalt),
).convert(utf8.encode('${token.iss}:${token.studentId}')).toString();
/// the local id of the theme mirroring the account's vault
String syncedThemeId(String vault) => 'sync-${vault.substring(0, 24)}';
/// pulls this account's own theme down, so signing in on another device
/// brings the theme along. quietly does nothing while nobody is logged in
/// or the network is down.
Future<void> syncThemeFromServer(SettingsRepository settings) async {
try {
final token = settings.getSelectedToken();
if (token == null) return;
final vault = computeVault(token);
final remote = await api.fetchTheme(vault);
if (remote == null) return;
final local = await isarInit.userThemeModels.where().findAll();
// the server's copy is usually a theme of ours pushed from another
// device, so match on the colors before making a second one
final stored =
local.where((t) => t.code == remote.code).firstOrNull ??
local.where((t) => t.themeId == syncedThemeId(vault)).firstOrNull;
if (stored != null &&
stored.code == remote.code &&
stored.shareId == remote.shareId) {
return;
}
final id = stored?.themeId ?? syncedThemeId(vault);
final model = (stored ?? UserThemeModel())
..themeId = id
..name = remote.name.isNotEmpty ? remote.name : (stored?.name ?? 'Firka')
..origin = stored?.origin ?? 'own'
..code = remote.code
..shareId = remote.shareId
..swatchArgb = _swatchOf(remote.code) ?? stored?.swatchArgb ?? const [];
await isarInit.writeTxn(() => isarInit.userThemeModels.putByThemeId(model));
// applying the code makes the app save the theme, which would otherwise
// push this very theme straight back up
_lastPushed = '${remote.code}:${model.name}';
// only take the colors over while the user is still on a built-in theme
final selected = settings.get(SettingsRegistry.selectedThemeId);
if (isBuiltinThemeId(selected) || selected == id) {
await settings.setSilently(SettingsRegistry.selectedThemeId, id);
await applyThemeCode(settings, remote.code);
}
} catch (e) {
logger.warning('[ThemeSync] fetch failed: $e');
}
}
/// re-reads every theme imported from a share link. the owner of a shared
/// theme keeps editing it, so these follow along on their own.
Future<void> refreshSharedThemes(SettingsRepository settings) async {
try {
final local = await isarInit.userThemeModels.where().findAll();
final followed = local.where(
(t) => t.origin == 'downloaded' && t.shareId.isNotEmpty,
);
final selected = settings.get(SettingsRegistry.selectedThemeId);
var changedSelected = false;
for (final theme in followed) {
final remote = await api.fetchSharedTheme(theme.shareId);
// a dead link keeps the copy that was imported, rather than losing it
if (remote == null || remote.code == theme.code) continue;
theme.code = remote.code;
theme.swatchArgb = _swatchOf(remote.code) ?? theme.swatchArgb;
await isarInit.writeTxn(
() => isarInit.userThemeModels.putByThemeId(theme),
);
if (theme.themeId == selected) changedSelected = true;
}
// repaint right away when the theme being worn is the one that moved
if (changedSelected) {
final theme = await isarInit.userThemeModels.getByThemeId(selected);
if (theme != null) await applyThemeCode(settings, theme.code);
}
} catch (e) {
logger.warning('[ThemeSync] shared refresh failed: $e');
}
}
/// what the server was last told, so dragging a colour slider and pulling a
/// theme back down don't each cost a request that changes nothing
String? _lastPushed;
/// pushes the selected theme up. a shared theme is pushed like any other —
/// that is how everyone following the link sees the edit.
Future<void> pushThemeToServer(SettingsRepository settings) async {
final id = settings.get(SettingsRegistry.selectedThemeId);
if (isBuiltinThemeId(id)) return;
final stored = await isarInit.userThemeModels.getByThemeId(id);
// someone else's theme is theirs to change, we only follow it
if (stored == null || stored.origin == 'downloaded') return;
await _push(settings, stored, captureThemeCode(settings));
}
/// publishes [theme] and returns the share id to put in the link, or an
/// empty string when it couldn't be published. the theme stays editable:
/// later edits reach everyone holding the link on their own.
Future<String> publishTheme(
SettingsRepository settings,
UserTheme theme,
) async {
try {
final token = settings.getSelectedToken();
if (token == null || theme.isBuiltin) return '';
final stored = await isarInit.userThemeModels.getByThemeId(theme.id);
if (stored == null) return '';
// the link has to point at the colours it was made from
await _push(settings, stored, theme.code, force: true);
final shareId = await api.shareTheme(
computeVault(token),
writeKey: computeWriteKey(token),
);
stored.shareId = shareId;
await isarInit.writeTxn(
() => isarInit.userThemeModels.putByThemeId(stored),
);
return shareId;
} catch (e) {
logger.warning('[ThemeSync] publish failed: $e');
return '';
}
}
Future<void> _push(
SettingsRepository settings,
UserThemeModel stored,
String code, {
bool force = false,
}) async {
try {
final token = settings.getSelectedToken();
if (token == null) return;
final sent = '$code:${stored.name}';
if (!force && sent == _lastPushed) return;
await api.pushTheme(
computeVault(token),
writeKey: computeWriteKey(token),
code: code,
name: stored.name,
);
_lastPushed = sent;
} catch (e) {
logger.warning('[ThemeSync] push failed: $e');
}
}
List<int>? _swatchOf(String code) {
final data = code.tryDecodeThemeData();
if (data == null) return null;
return [
data.lightSlot(ThemeColorSlot.accent).toARGB32(),
data.lightSlot(ThemeColorSlot.textPrimary).toARGB32(),
data.lightSlot(ThemeColorSlot.background).toARGB32(),
];
}

View File

@@ -1,6 +1,9 @@
import 'dart:convert';
import 'dart:io';
import 'dart:ui' as ui;
import 'package:firka/core/settings/settings_repository.dart';
import 'package:firka/core/settings/settings_schema.dart';
import 'package:firka/api/client/kreta_client.dart';
import 'package:firka_common/data/database.dart';
import 'package:firka_common/data/models/lesson_cache_model.dart';
@@ -13,6 +16,7 @@ import 'package:firka/core/debug_helper.dart';
import 'package:path/path.dart' as p;
import 'package:path_provider/path_provider.dart';
import 'package:firka_common/core/icon_helper.dart';
import 'package:firka/ui/theme/style.dart';
class WidgetCacheHelper {
@@ -29,6 +33,7 @@ class WidgetCacheHelper {
'topic': lesson.topic,
'state': lesson.state,
'type': lesson.type,
'icon': getIconTypeByName(lesson.name)?.name,
// Backward-compatibility aliases for legacy receivers
'Nev': lesson.name,
'KezdetIdopont': lesson.start.toIso8601String(),
@@ -48,7 +53,18 @@ class WidgetCacheHelper {
final colors = style != null
? _colorsMap(style)
: (existingColors ?? _defaultColors());
return {'colors': colors, 'timetable': timetableJson};
String? languageCode;
try {
final lang = Settings.language.value;
languageCode = lang == AppLanguage.auto
? ui.PlatformDispatcher.instance.locale.languageCode
: lang.name;
} catch (_) {}
return {
'colors': colors,
'timetable': timetableJson,
if (languageCode != null) 'language': languageCode,
};
}
static Map<String, dynamic> toAndroidWidgetJson(
@@ -196,7 +212,10 @@ class WidgetCacheHelper {
.sortByStart()
.findAll();
if (lessons.isEmpty) {
lessons = await isarInit.lessonCacheModels.where().sortByStart().findAll();
lessons = await isarInit.lessonCacheModels
.where()
.sortByStart()
.findAll();
}
await updateWidgetCacheFromLessons(
lessons,

Submodule firka/lib/l10n deleted from d064196553

447
firka/lib/l10n/app_de.arb Normal file
View File

@@ -0,0 +1,447 @@
{
"restart_title": "App neu starten",
"restart_body": "Klicke hier, um die App zu öffnen.",
"loginBtn": "Login mit E-Kréta",
"privacyLabel": "Datenschutzerklärung",
"title1": "Alles auf einen Blick",
"subtitle1": "Oben auf der Startseite findest du nützliche Informationen zu deinem Tag.",
"title2": "Hier finden deine Fächer Platz",
"subtitle2": "Hier findest du Statistiken, bevorstehende Prüfungen und sogar deine Noten aus früheren Schuljahren.",
"title3": "Individuell anpassbarer Stundenplan",
"subtitle3": "Wähle auf der Stundenplanseite aus, was du sehen möchtest, und schalte Tests, Hausaufgaben, Pausen und Freistunden ein oder aus.",
"title4": "Viele Extras, die du in Kreta niemals finden wirst",
"subtitle4": "",
"yesterday": "Gestern",
"today": "Heute",
"tomorrow": "Morgen",
"debug_screen": "Entwicklermenü",
"settings_screen": "Einstellungen",
"home": "Startseite",
"grades": "Noten",
"timetable": "Stundenplan",
"other": "Andere",
"refreshing": "Daten werden aktualisiert...",
"reauth": "Login notwendig",
"api_error": "Kréta API Fehler",
"pairing": "Koppel deine Uhr",
"pairing_description": "Möchtest du diese Uhr mit der Firka App koppeln?\nNach der Kopplung kannst du deinen Stundenplan, neue Noten, Tests und Aufgaben einsehen.",
"cancel": "Abbrechen",
"save": "Speichern",
"okay": "Okay",
"pair": "Kopplung",
"beta_title": "Firka - öffentliche Beta",
"beta_body": "Die Anwendung befindet sich noch in der Entwicklung; einige Funktionen sind möglicherweise noch nicht fertiggestellt, funktionieren nicht richtig oder weisen Fehler auf.",
"good_morning": "Guten Morgen, {p}!",
"@good_morning": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_day": "Guten Tag, {p}!",
"@good_day": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"n_left_subtitle": "Halte durch, es sind nur noch {n} Stunden übrig!",
"@n_left_subtitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"suffering_almost_over_subtitle": "Du hast es fast geschafft. Pass weiterhin bei deinem Lehrer gut auf.",
"school_ending": "Bist du nervös, {p}?",
"@school_ending": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tomorrow_subtitle": "So sieht dein morgiger Tag aus.",
"good_afternoon": "Guten Nachmittag, {p}!",
"@good_afternoon": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_night": "Guten Abend, {p}!",
"@good_night": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"starting_soon": "Deine erste Unterrichtstunde beginnt gleich!",
"starting_hour": "Stunde",
"starting_hour_plural": "Stunden",
"starting_min": "Minute",
"starting_min_plural": "Minuten",
"starting_sec": "Sekunde",
"starting_sec_plural": "Sekunden",
"subjects": "Fächer",
"your_subjects": "Deine Fächer",
"data": "Details",
"subject_avg": "Notendurchschnitt",
"subject_avg_rounded": "Notendurchschnitt nach Rundung",
"class_avg": "Klassendurchschnitt",
"class_n": "Wöchentliche Stundenzahl",
"tt_no_classes_l1": "Diese Woche hast du keinen Unterricht!",
"tt_no_classes_l2": "Yippee!",
"class_dismissed": "Abgesagte Unterrichtsstunde",
"class_substitution": "Vertretung",
"lesson_subject": "Thema der Stunde",
"tt_settings_toast": "Stundenplan Einstellungen",
"tt_settings_toast_lesson_nos": "Anzahl von Stunden",
"tt_settings_toast_lesson_tests": "Tests & Sonstiges",
"tt_settings_toast_lesson_breaks": "Pausen",
"a_week": "A Woche",
"b_week": "B Woche",
"stats_date": "Datum",
"stats_created_at": "Erstellt am",
"stats_last_mod": "Zuletzt bearbeitet",
"s_developer": "Entwicklereinstellungen",
"s_stats_for_nerds": "Statistiken für Nerds",
"s_settings": "Einstellungen",
"s_a": "Applikation",
"s_ag": "Allgemein",
"s_ag_bell_delay": "Glockenverzögerung",
"s_ag_rounding": "Standardmäßige Rundung",
"s_customization": "Personalisierung",
"s_ag_r1": "1 → 2",
"s_ag_r2": "2 → 3",
"s_ag_r3": "3 → 4",
"s_ag_r4": "4 → 5",
"s_ag_class_avg_on_graph": "Klassendurchschnitt in der Grafik",
"s_ag_navbar": "Navigationsleiste",
"s_ag_left_handed_mode": "Linkshänder Modus",
"s_ag_language_header": "Sprache",
"s_ag_language_auto": "Automatisch",
"s_ag_language_hu": "Ungarisch",
"s_ag_language_en": "Englisch",
"s_ag_language_de": "Deutsch",
"s_c": "Personalisierung",
"s_c_icon_header": "App Symbole",
"s_c_replace_icon": "Symbol ersetzen",
"s_ci_icon_header": "App Symbol",
"s_ci_warning_header": "[!] Im Debug-Modus funktioniert das Ändern des Symbols nicht",
"s_ci_icon_subtitle": "Such dir ein hübsches App-Symbol aus, wenn du das grüne satt hast.",
"s_ci_icon_g1": "Catboy domain",
"s_ci_icon_g2": "Filc-Stift",
"s_ci_icon_g3": "Nostalgie",
"s_ci_icon_g4": "Neu gedacht",
"s_ci_icon_g5": "Referenz",
"s_ci_icon_g6": "Weihnachtslogo-Wettbewerb 2024",
"s_ci_icon_g6_desc": "Von @emilia6_6",
"s_ci_icon_g7": "Pride",
"s_ci_icon_g8": "Pride ",
"s_c_theme_header": "Thema",
"s_c_theme_auto": "Automatisch",
"s_c_theme_light": "Hell",
"s_c_theme_dark": "Dunkel",
"s_ci_child_protection": "Kinderschutz",
"ic_ace": "Asexuell",
"ic_ace_f": "Asexuell",
"ic_bi": "Bisexuell",
"ic_bi_f": "Bisexuell",
"ic_cactus": "Kaktusgarten",
"ic_cc": "Kreative Wolke",
"ic_enby": "Nicht-binär",
"ic_enby_f": "Nicht-binär",
"ic_fidesz": "Orange",
"ic_filc": "Filc Tagebuch",
"ic_filco": "Filc . O",
"ic_galaxy": "Galaxie",
"ic_gay": "Schwul",
"ic_gay_f": "Schwul",
"ic_half_firka_2": "Revolution",
"ic_kreta": "eFirka",
"ic_lesb": "Lesbisch",
"ic_lesb_f": "Lesbisch",
"ic_lgbtq": "LGBTQ+",
"ic_lgbtq_f": "LGBTQ+",
"ic_lgbtqp": "Progression",
"ic_lgbtqp_f": "Progression",
"ic_lidl": "Einkaufen",
"ic_mkkp": "Freikarten",
"ic_nuke": "Nuklear",
"ic_modern": "Modern",
"ic_o1g": "Orbán ist ein Arschloch",
"ic_old": "Domain David",
"ic_original": "Original",
"ic_paper": "Papier",
"ic_pear": "Birne",
"ic_pixel": "Pixel",
"ic_pixelized": "Verpixelt",
"ic_pride": "Weltraumregenbogen",
"ic_proto": "Prototyp",
"ic_refilc": "reFilc",
"ic_refulc": "firk’a",
"ic_repont": "Fünfzig Forint",
"ic_szivacs": "Schwamm",
"ic_tisza": "Árad a firka",
"ic_trans": "Trans",
"ic_trans_f": "Trans",
"ic_void_icon": "Leere",
"ic_xmas1": "Liste der Bösen",
"ic_xmas2": "Geschenk",
"ic_xmas3": "FirWeihnachten",
"wear_phone_unpaired": "Deine Uhr ist nicht mit deinem Handy gekoppelt!",
"wear_phone_disconnected": "Deine Uhr ist nicht mit deinem Handy verbunden!",
"wear_pairing_request_sent": "Die Kopplung läuft, öffne die App auf deinem Smartphone",
"wear_pairing_check_phone": "Setze die Kopplung auf deinem Smartphone fort",
"wear_try_again": "Erneut versuchen",
"breakTxt": "Pause",
"empty_class": "Freistunde",
"timeLeft": "{mins} Minuten übrig",
"@timeLeft": {
"placeholders": {
"mins": {
"type": "num"
}
}
},
"noClasses": "Heute ist Schulfrei, ruh dich aus!",
"noMoreClasses": "Du hast heute keinen Unterricht mehr",
"firstIn": "Deine erste Stunde: {t}",
"@firstIn": {
"placeholders": {
"t": {
"type": "String"
}
}
},
"wearTitle": "{n}. Stunde",
"@wearTitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"view_subject_btn": "Fach anzeigen",
"view_lesson_btn": "Stunde anzeigen",
"date": "Datum",
"tt_settings_toast_lesson_substitution": "Vertretungen",
"tt_settings_toast_lesson_ab_timetable": "Zweiwöchiger Stundenplan",
"s_ag_navbar_desc": "Wähle aus, was in der Navigationsleiste angezeigt werden soll, und ordne die Elemente an. Die übrigen Seiten sind über die Schaltfläche „Mehr“ erreichbar. Du kannst maximal 4 Seiten festlegen.",
"s_ag_navbar_home": "Startseite",
"s_ag_navbar_visible": "Erscheint",
"s_ag_navbar_hidden": "Versteckt",
"tests_tomorrow": "Du hast {tests} Prüfungen",
"@tests_tomorrow": {
"placeholders": {
"tests": {
"type": "String"
}
}
},
"no_tests_tomorrow": "Du hast morgen keine Prüfungen",
"get_ready": "Entspann dich und mach dich bereit für morgen",
"mark_as_done": "Als erledigt markieren",
"mark_as_not_done": "Als unvollständig markieren",
"grade_teacherName": "Name des Lehrers: ",
"grade_strValue": "Textbasierte Bewertung: ",
"no_grades": "Du hast noch keine Noten für dieses Fach.",
"unknown_teacher": "Unbekannter Lehrer",
"s_your_account": "Dein Konto",
"s_acc_kreta": "eKRÉTA Konto",
"s_acc_add": "Neues Konto hinzufügen",
"s_acc_logout": "Abmelden",
"close": "Schließen",
"licensesLabel": "Lizenzen",
"tt_added": "Eingetragen: ",
"happy_birthday": "Alles Gute zum Geburtstag, {p}!",
"@happy_birthday": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"licenseDescription": "Lizenzen für die von der Applikation verwendeten externen Bibliotheken",
"homework": "Hausaufgaben",
"tt_non_instructional_day": "Unterrichtsfreier Schultag",
"tt_public_holiday": "Feiertag",
"tt_spring_break": "Frühlingsferien",
"tt_winter_break": "Winterferien",
"tt_autumn_break": "Herbstferien",
"tt_instructional_day": "Unterrichtstag",
"tt_first_semester_end": "Ende des ersten Semesters",
"tt_holiday": "Ferien",
"tt_rest_day": "Ruhetag",
"tt_first_instructional_day": "Erster Schultag",
"tt_last_instructional_day": "Letzter Schultag",
"tt_last_instructional_day_graduates": "Letzter Schultag für die Absolventen",
"tt_full_day_trip": "Ganztägiger Ausflug",
"tt_quarter_end": "Quartalsende",
"lessons_tomorrow": "{lessons} Stunden morgen",
"@lessons_tomorrow": {
"placeholders": {
"lessons": {
"type": "String"
}
}
},
"subject": "Fach",
"grade_calculator": "Notenrechner",
"grade_calculator_add": "Hinzufügen",
"ghost_grade": "Geist-Note",
"ghost_grades": "Geist-Noten",
"gradesCount": "{count} Note(n)",
"@gradesCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"overall_avg": "Gesamtdurchschnitt",
"now": "Jetzt",
"s_n": "Benachrichtigungen",
"s_n_morning": "Morgendliche Benachrichtigung",
"s_n_morning_time": "Zeitpunkt der Benachrichtigung vor Schulbeginn",
"s_n_live_activity": "Live Aktivität",
"s_n_test": "Testbenachrichtigung senden",
"s_wear": "Wear OS",
"s_wear_os_support": "Wear OS Unterstützung",
"wearSyncNotificationTitle": "Mit Uhr synchronisieren",
"wearSyncNotificationText": "Daten mit Uhr synchronisieren",
"wear_sync_with_phone": "Öffne die Smartphone App, um die Synchronisierung durchzuführen",
"wear_syncing": "Synchronisieren...",
"la_privacy_header": "Datenschutzerklärung für Live Aktivität",
"la_privacy_intro": "Um die Funktion „Live Aktivität“ nutzen zu können, müssen wir bestimmte Daten speichern und verarbeiten. Bitte lies dir die folgenden Informationen sorgfältig durch.",
"la_privacy_section1_title": "Welche Daten speichern wir?",
"la_privacy_section1_body": "Für den Betrieb von Live Aktivität speichern wir die folgenden Daten zusammen mit deiner Gerätekennung:\n\n• Gerätekennung (UUID)\n• Gerätetoken\n• Live-Aktivität-Push-Token\n• APNs-Push-Token\n• Geräte-Hash\n• Spracheinstellung\n• Glockenverzögerung\n\nDeine Stundenplandaten (Tabelle „lessons“) enthalten Folgendes:\n• Fach und Uhrzeit der Unterrichtsstunde\n• Name des Lehrers\n• Name des Raums\n• Nummer der Unterrichtsstunde\n• Thema der Unterrichtsstunde\n• Daten zur Vertretung\n• Kennzeichnung einer ausgefallenen Unterrichtsstunde\n\nDie zeitgesteuerten Benachrichtigungen (Tabelle „scheduled_notifications“) enthalten Folgendes:\n• ID\n• Geräte-ID\n• Zeitpunkt der Benachrichtigung\n• Status und Zeitpunkt der Übermittlung\n• Erstellungs- und Aktualisierungszeitpunkt",
"la_privacy_section2_title": "Wie schützen wir deine Daten?",
"la_privacy_section2_body": "Wir nehmen die Sicherheit deiner Daten ernst:\n\n• Alle Daten in den Tabellen „Geräte“ und „Stunden“ sind verschlüsselt\n• Die Daten werden auf einem sicheren Server gespeichert\n• Wir speichern die Daten nur so lange, wie es erforderlich ist",
"la_privacy_section3_title": "Wie lange speichern wir die Daten?",
"la_privacy_section3_body": "Die Speicherung der Daten ist auf einen minimalen Zeitraum beschränkt:\n\n• Live-Aktivität-Push-Token: Wird so lange gespeichert, wie du an diesem Tag Stunden hast (einschließlich des Zeitraums von zwei Stunden vor der ersten Stunde). Wenn du keine Stunden mehr hast, wird der Wert auf Null gesetzt.\n\n• Stundenplan-Daten: Sie werden nur für die Dauer der Stunden gespeichert und anschließend automatisch gelöscht. Am Freitag nach der letzten Stunde ist die Tabelle mit dem Stundenplan vollständig leer.\n\n• Gerätedaten (Token, Identifikatoren): Sie werden so lange gespeichert, wie die Live-Aktivität-Funktion aktiviert ist. Beim Deaktivieren der Funktion werden diese Daten sofort gelöscht.",
"la_privacy_section4_title": "Wofür verwenden wir die Daten?",
"la_privacy_section4_body": "Wir verwenden die Daten ausschließlich für den Betrieb der Live-Aktivität-Funktion:\n\n• Anzeige des Live-Stundenplans auf dem Sperrbildschirm\n• Versand von Push-Benachrichtigungen bei Stundenwechseln\n• Synchronisierung des Stundenplans auf deinem Gerät\n• Sicherstellung der Zustellung der Benachrichtigungen am Montagmorgen auch nach der wöchentlichen Datenbankbereinigung\n\nWir geben deine Daten nicht an Dritte weiter und verwenden sie nicht für Marketingzwecke.",
"la_privacy_section5_title": "Deine Rechte",
"la_privacy_section5_body": "Gemäß der DSGVO stehen dir folgende Rechte zu:\n\n• Recht auf Auskunft: Die Art der gespeicherten Daten kannst du in dieser Datenschutzerklärung einsehen.\n• Recht auf Löschung: Durch das Deaktivieren der Live-Aktivität-Funktion werden alle mit dieser Funktion verbundenen Daten (Geräte-IDs, Stundenplan) sofort und endgültig von unseren Servern gelöscht.\n• Recht auf Berichtigung: Die Änderung der Stundenplandaten erfolgt im Kréta-System durch die dazu berechtigten Personen (z. B. Lehrkräfte).\n• Widerspruchsrecht: Du kannst der Datenverarbeitung jederzeit widersprechen, indem du die Live-Aktivität-Funktion deaktivierst.",
"la_privacy_footer": "Letzte Aktualisierung der Datenschutzerklärung: November 2025",
"la_privacy_contact": "Hast du eine Frage? Schreib uns an support@firka.app.",
"la_privacy_summary1": "Gerätetoken, Live-Aktivität-Token, Stundenplandaten",
"la_privacy_summary2": "Verschlüsselte Speicherung, sichere Server",
"la_privacy_summary3": "Die Daten werden automatisch gelöscht, sobald sie nicht mehr benötigt werden",
"la_title": "Live Aktivität",
"la_subtitle": "Live-Anzeige des Stundenplans auf dem Sperrbildschirm des Geräts",
"la_privacy_title": "Datenschutzerklärung",
"la_privacy_required": "Um Live Aktivität nutzen zu können, musst du der Datenschutzerklärung zustimmen",
"la_learn_more": "Mehr dazu",
"la_accept": "Ich stimme zu",
"la_decline": "Ich lehne ab",
"runningInDomainBrowser": "Domain-Browser",
"copied": "Kopiert",
"view_day_btn": "Tag anzeigen",
"omission": "Abwesenheit",
"omissions": "Abwesenheiten",
"omission_state_excused": "Entschuldigt",
"omission_state_unexcused": "Unentschuldigt",
"omission_state_pending": "Ausstehend",
"omissions_count": "{state, select, unexcused{{count} unentschuldigt} pending{{count} zu entschuldigen} other{{count}}} Fehlzeiten",
"@omissions_count": {
"placeholders": {
"state": {
"type": "String"
},
"count": {
"type": "int"
}
}
},
"s_beta_warning": "Beta-Warnung",
"s_ag_privacy_ever_declined": "Datenschutz zuvor abgelehnt",
"s_c_tab_appearance": "App-Design",
"s_c_tab_subjects": "Fächer",
"s_c_tab_fonts": "Schriftarten",
"s_c_my_themes": "Meine Themes",
"s_c_manage_subjects": "Fächer verwalten",
"s_c_change_app_icon": "App-Icon ändern",
"s_c_colors_header": "Farben",
"s_c_grade_colors_header": "Notenfarben",
"s_c_title_style_header": "Titelstil",
"s_c_title_weight_header": "Titelstärke",
"s_c_title_weight_subtitle": "Wird nicht von allen Schriftarten unterstützt",
"s_c_title_weight_thin": "Dünn",
"s_c_title_weight_thick": "Fett",
"s_c_capitalization_header": "Groß-/Kleinschreibung",
"s_c_capitalization_lower": "kleinbuchstaben",
"s_c_capitalization_normal": "Normal",
"s_c_capitalization_upper": "GROSSBUCHSTABEN",
"s_c_change": "Ändern",
"s_c_customize": "Anpassen",
"s_c_themes_current": "Aktuell",
"s_c_themes_own": "Eigene",
"s_c_themes_downloaded": "Heruntergeladen",
"s_c_themes_share_current": "Aktuelles Theme teilen",
"s_c_themes_create_new": "Neues Theme erstellen",
"s_c_themes_import": "Theme importieren",
"s_c_themes_use": "Verwenden",
"s_c_themes_continue": "Weiter",
"s_c_themes_own_label": "Eigenes Theme",
"s_c_themes_imported_label": "Importiertes Theme",
"s_c_themes_builtin_label": "Integriertes Theme",
"s_c_themes_builtin_name": "Standard",
"s_c_themes_create_title": "Neues Theme erstellen",
"s_c_themes_create_subtitle": "Gib einen Namen für das Theme ein",
"s_c_themes_create_placeholder": "Themename",
"s_c_themes_delete_title": "Theme löschen",
"s_c_themes_delete_subtitle": "Möchtest du dieses Theme wirklich löschen? Diese Aktion kann rückgängig gemacht werden.",
"s_c_themes_delete_confirm": "Löschen",
"s_about": "Über die App",
"s_extras": "Extras",
"s_other": "Sonstiges",
"grade_weight_x1": "einfache Gewichtung",
"grade_weight_x2": "doppelte Gewichtung",
"grade_weight_x3": "dreifache Gewichtung",
"grade_weight_x4": "vierfache Gewichtung",
"grade_weight_x5": "fünffache Gewichtung",
"grade_weight_percent": "{percent}%ige Gewichtung",
"@grade_weight_percent": {
"placeholders": {
"percent": {
"type": "int"
}
}
},
"surprise_grade_rank_5": "LEGENDÄR",
"surprise_grade_rank_4": "AUSGEZEICHNET",
"surprise_grade_rank_3": "OKAY",
"surprise_grade_rank_2": "SCHWACH",
"surprise_grade_rank_1": "KATASTROPHE",
"new_grades_card": "Du hast neue Noten",
"s_notifications": "Benachrichtigungen",
"s_sticker_map": "Stickerkarte",
"s_qr_reader": "QR-Code-Scanner",
"s_feedback": "Feedback",
"s_a_desc": "Navigation, Sprache, Glocke, Rundung",
"s_c_desc": "Notenfarben, Thema, App-Symbol",
"s_todo": "túdú: program this",
"s_surprise_grades": "Überraschungsnoten",
"s_seasonal_icons": "Saisonale App-Symbole",
"s_uwu_mode": "UwU-Modus",
"s_calendar_sync": "Kalendersynchronisierung",
"s_save_grades": "Noten speichern",
"s_welcome_msg": "Begrüßungsnachricht",
"s_extras_desc": "Überraschungsnoten, Kalendersynchronisierung",
"s_notifications_desc": "Noten, Stundenplanänderungen, Fehlzeiten",
"s_n_all": "Alle",
"s_n_grades": "Neue Noten",
"s_n_homework_tests": "Hausaufgaben & Prüfungen",
"s_n_absences": "Fehlzeiten",
"s_n_lessons": "Stunden",
"s_n_messages": "Nachrichten",
"s_n_by_subject": "Nach Fach"
}

603
firka/lib/l10n/app_en.arb Normal file
View File

@@ -0,0 +1,603 @@
{
"restart_title": "Restart application",
"restart_body": "Click here to open the app again.",
"loginBtn": "Login with E-Kréta",
"privacyLabel": "Privacy policy",
"title1": "Know everything at a glance",
"subtitle1": "You can see useful info about your day on the top of your home screen.",
"title2": "Your classes fit here comfortably",
"subtitle2": "See statistics, upcoming tests, and even your grades from previous school years.",
"title3": "Customizable timetable",
"subtitle3": "Decide what you want to see on your timetable page. Turn tests, assignments, breaks, and even free periods on or off.",
"title4": "Many extras you will never find in Kréta",
"subtitle4": "",
"yesterday": "Yesterday",
"today": "Today",
"tomorrow": "Tomorrow",
"debug_screen": "Developer options",
"settings_screen": "Settings",
"home": "Home",
"grades": "Grades",
"timetable": "Timetable",
"other": "Other",
"refreshing": "Refreshing...",
"reauth": "Reauthentication required",
"api_error": "Kréta API error",
"pairing": "Pair your watch",
"pairing_description": "Would you like to pair this watch with the Firka app?\nAfter pairing, you will be able to see your timetable, new grades, tests and tasks.",
"cancel": "Cancel",
"save": "Save",
"okay": "Okay",
"pair": "Pair",
"beta_title": "Firka - Public Beta",
"beta_body": "The application is still in development; some features may be unfinished, not work correctly, or be buggy.",
"good_morning": "Good morning, {p}!",
"@good_morning": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_day": "Good day, {p}!",
"@good_day": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"n_left_subtitle": "Hang in there, there's only {n} lessons left!",
"@n_left_subtitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"suffering_almost_over_subtitle": "You're almost free. Keep paying attention to your teacher.",
"school_ending": "Are you anxious, {p}?",
"@school_ending": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tomorrow_subtitle": "Your next day",
"good_afternoon": "Good afternoon, {p}!",
"@good_afternoon": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_night": "Good evening, {p}!",
"@good_night": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"starting_soon": "Your first lesson will start soon!",
"starting_hour": "hour",
"starting_hour_plural": "hours",
"starting_min": "min",
"starting_min_plural": "mins",
"starting_sec": "sec",
"starting_sec_plural": "secs",
"subjects": "Subjects",
"your_subjects": "Your Subjects",
"data": "Info",
"subject_avg": "Subject average",
"subject_avg_rounded": "Subject average after rounding",
"class_avg": "Class average",
"class_n": "Weekly lesson number",
"tt_no_classes_l1": "You don't have any lessons on this day!",
"tt_no_classes_l2": "Yippee!",
"class_dismissed": "Dismissed lesson",
"catalog_lesson_btn": "Catalog lesson",
"catalog_lesson_title": "Catalog lesson",
"catalog_lesson_topic_hint": "Topic covered",
"catalog_lesson_submit_btn": "Save",
"class_substitution": "Substitution",
"lesson_subject": "Lesson subject",
"tt_settings_toast": "Timetable settings",
"tt_settings_toast_lesson_nos": "Number of lessons",
"tt_settings_toast_lesson_tests": "Tests & others",
"tt_settings_toast_lesson_breaks": "Breaks",
"a_week": "A week",
"b_week": "B week",
"stats_date": "Date",
"stats_created_at": "Created at",
"stats_last_mod": "Last modified",
"s_developer": "Developer settings",
"s_stats_for_nerds": "Stats for nerds",
"s_settings": "Settings",
"s_a": "Application",
"s_ag": "General",
"s_ag_bell_delay": "Bell delay",
"s_ag_rounding": "Default rounding",
"s_shortened_timetable": "Shortened timetable",
"s_shortened_timetable_enable": "Enable shortened timetable",
"s_shortened_timetable_start": "Starts",
"s_shortened_timetable_end": "Ends",
"s_shortened_timetable_no_lessons": "No lessons to show in the cache. Refresh the timetable and try again.",
"s_shortened_timetable_reset": "Reset to original times",
"s_shortened_timetable_invalid_time": "The end must be after the start",
"s_shortened_timetable_lesson": "Lesson {n}",
"@s_shortened_timetable_lesson": {
"placeholders": {
"n": {
"type": "int"
}
}
},
"s_customization": "Customization",
"s_ag_r1": "1 → 2",
"s_ag_r2": "2 → 3",
"s_ag_r3": "3 → 4",
"s_ag_r4": "4 → 5",
"s_ag_class_avg_on_graph": "Class's average on the graph",
"s_ag_navbar": "Navbar",
"s_ag_left_handed_mode": "Left-handed mode",
"s_ag_language_header": "Language",
"s_ag_language_auto": "Automatic",
"s_ag_language_hu": "Hungarian",
"s_ag_language_en": "English",
"s_ag_language_de": "German",
"s_c": "Customization",
"s_c_icon_header": "App icons",
"s_c_replace_icon": "Replace icon",
"s_ci_icon_header": "App icon",
"s_ci_warning_header": "[!] Changing the app's icon in debug mode won't work",
"s_ci_icon_subtitle": "Choose a pretty app icon if you're already tired of the green one.",
"s_ci_icon_g1": "Catboy domain",
"s_ci_icon_g2": "Felt pen",
"s_ci_icon_g3": "Nostalgia",
"s_ci_icon_g4": "Reimagined",
"s_ci_icon_g5": "Reference",
"s_ci_icon_g6": "Christmas logo competition 2024",
"s_ci_icon_g6_desc": "By @emilia6_6",
"s_ci_icon_g7": "Pride",
"s_ci_icon_g8": "Pride ",
"s_c_theme_header": "Theme",
"s_c_theme_auto": "Auto",
"s_c_theme_light": "Light",
"s_c_theme_dark": "Dark",
"s_ci_child_protection": "Child protection",
"ic_ace": "Asexual",
"ic_ace_f": "Asexual",
"ic_bi": "Bisexual",
"ic_bi_f": "Bisexual",
"ic_cactus": "Cactus grove",
"ic_cc": "Creative Cloud",
"ic_enby": "Non-binary",
"ic_enby_f": "Non-binary",
"ic_fidesz": "Fidesz",
"ic_filc": "Firka",
"ic_filco": "Filc . O",
"ic_galaxy": "Galaxy",
"ic_gay": "Gay",
"ic_gay_f": "Gay",
"ic_half_firka_2": "Revolution",
"ic_kreta": "eFirka",
"ic_lesb": "Lesbian",
"ic_lesb_f": "Lesbian",
"ic_lgbtq": "LGBTQ+",
"ic_lgbtq_f": "LGBTQ+",
"ic_lgbtqp": "Progression",
"ic_lgbtqp_f": "Progression",
"ic_lidl": "Shopping",
"ic_mkkp": "Free grades",
"ic_nuke": "Nuclear",
"ic_modern": "Modern",
"ic_o1g": "Orbán is a cunt",
"ic_old": "Domain Dave",
"ic_original": "Original",
"ic_paper": "Paper",
"ic_pear": "Pear",
"ic_pixel": "Pixel",
"ic_pixelized": "Pixelified",
"ic_pride": "Space rainbow",
"ic_proto": "Prototype",
"ic_refilc": "reFilc",
"ic_refulc": "firk'a",
"ic_repont": "Repont",
"ic_szivacs": "sponge",
"ic_tisza": "árad a firka",
"ic_trans": "Trans",
"ic_trans_f": "Trans",
"ic_void_icon": "Nothing",
"ic_xmas1": "naughty list",
"ic_xmas2": "gift",
"ic_xmas3": "FirCristmas",
"wear_phone_unpaired": "Your watch isn't paired with your phone!",
"wear_phone_disconnected": "Your watch isn't connected to your phone!",
"wear_pairing_request_sent": "Open the app on your phone",
"wear_pairing_check_phone": "Check your phone",
"wear_try_again": "Try again",
"breakTxt": "Break",
"empty_class": "Empty class",
"timeLeft": "{mins, plural, =1{1 min left} other{{mins} mins left}}",
"@timeLeft": {
"placeholders": {
"mins": {
"type": "num"
}
}
},
"noClasses": "School's out today, take it easy!",
"noMoreClasses": "No more classes for you today",
"firstIn": "First class in: {t}",
"@firstIn": {
"placeholders": {
"t": {
"type": "String"
}
}
},
"wearTitle": "{n}. class",
"@wearTitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"licensesLabel": "Licenses",
"licenseDescription": "Licenses for external libraries used by the application",
"view_subject_btn": "View subject",
"date": "Time of the class",
"tt_settings_toast_lesson_substitution": "Substitutions",
"tt_settings_toast_lesson_ab_timetable": "Two-week class schedule",
"s_ag_navbar_desc": "Choose which items appear in the navigation bar and arrange them. The other pages are accessible via the “More” button. You can display up to 4 pages.",
"s_ag_navbar_home": "Home",
"s_ag_navbar_visible": "Appears",
"happy_birthday": "Happy birthday, {p}!",
"@happy_birthday": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tests_tomorrow": "You'll have {tests} exams",
"@tests_tomorrow": {
"placeholders": {
"tests": {
"type": "String"
}
}
},
"no_tests_tomorrow": "You don't have any exams tomorrow",
"get_ready": "Relax, and prepare for tomorrow",
"homework": "Homework",
"mark_as_done": "Mark as finished",
"mark_as_not_done": "Mark as unfinished",
"grade_teacherName": "Teacher's name: ",
"grade_strValue": "Text-based rating: ",
"no_grades": "You don't have any grades for this subject yet.",
"unknown_teacher": "Unknown teacher",
"tt_added": "Created at: ",
"view_lesson_btn": "View lesson",
"s_ag_navbar_hidden": "Hidden",
"s_your_account": "Your account",
"s_acc_kreta": "eKRÉTA accounts",
"s_acc_accounts": "Accounts",
"s_neptun_title": "ELTE Neptun",
"s_neptun_user_hint": "ID (e.g. abc123)",
"s_neptun_password_hint": "Password",
"s_neptun_totp_code_hint": "Enter the 6-digit code",
"s_neptun_code_by_email": "code sent by e-mail",
"s_neptun_confirm_code": "Confirm code",
"s_neptun_login_btn": "Log in",
"s_neptun_seed_hint": "Authenticator key (optional)",
"s_neptun_seed_help": "Enter your 2FA authenticator's secret key. NOT the 6 digit code.",
"s_neptun_login_with_elte": "Log in with ELTE Neptun",
"s_neptun_seed_failed": "Automatic 2FA code generation failed — check your authenticator key.",
"s_neptun_2fa_rejected": "2FA code rejected — if the code is correct, restart the login and enter a fresh code.",
"s_neptun_login_failed": "Login failed",
"s_acc_accounts": "Accounts",
"s_acc_add": "Add new student account",
"s_acc_add_teacher": "Add new teacher account",
"s_acc_logout": "Log out",
"close": "Close",
"tt_non_instructional_day": "Non-instructional workday",
"tt_public_holiday": "Non-instructional day",
"tt_spring_break": "Spring break",
"tt_winter_break": "Winter break",
"tt_autumn_break": "Autumn break",
"tt_instructional_day": "Instructional day",
"tt_first_semester_end": "End of first semester",
"tt_holiday": "Holiday",
"tt_rest_day": "Rest day",
"tt_first_instructional_day": "First instructional day",
"tt_last_instructional_day": "Last instructional day",
"tt_last_instructional_day_graduates": "Last instructional day for graduates",
"tt_full_day_trip": "Full-day trip",
"tt_quarter_end": "end of quarter",
"lessons_tomorrow": "You'll have {lessons} lessons",
"@lessons_tomorrow": {
"placeholders": {
"lessons": {
"type": "String"
}
}
},
"subject": "Subject",
"grade_calculator": "Grade calculator",
"grade_calculator_add": "Add",
"ghost_grade": "Ghost grade",
"ghost_grades": "Ghost grades",
"gradesCount": "{count} grade(s)",
"@gradesCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"overall_avg": "Overall average",
"now": "Now",
"s_n": "Notifications",
"s_n_morning": "Morning notification",
"s_n_morning_time": "Time of notification before school",
"s_n_live_activity": "Live Activity",
"s_n_test": "Send test notification",
"s_wear": "Wear OS",
"s_wear_os_support": "Wear OS support",
"wearSyncNotificationTitle": "Synchronize with watch",
"wearSyncNotificationText": "Keep watch's data in sync",
"wear_sync_with_phone": "Open the mobile app to sync",
"wear_syncing": "Syncing...",
"la_privacy_header": "Live Activity privacy policy",
"la_privacy_intro": "We have to store and process certain data for use in the Live Activity function. Please, read the disclosure below.",
"la_privacy_section1_title": "What data do we store?",
"la_privacy_section1_body": "For the Live Activity to function, we store the below data with your device identifier:\n\n• Device Identifier (UUID)\n• Device token\n• Live Activity push token\n• APNs push token\n• Device hash\n• Language setting\n• Bell delay\n\nYour timetable data (lessons table) contains the following:\n• The subject and time of the lesson\n• The name of the teacher\n• The name of the classroom\n• Period number of the lesson\n• The topic of the lesson\n• Details of a substitution\n• Indication of dismissed lesson\n\nThe scheduled notifications (scheduled_notifications table) contains the following:\n• Identifier\n• Device identifier\n• Scheduled time\n• Status and time of notification\n• Time of creation and update",
"la_privacy_section2_title": "How do we protect your data?",
"la_privacy_section2_body": "We take the security of your data seriously:\n\n• The data in the \"devices\" and \"lessons\" tables are encrypted\n• We store the data on secure servers\n• We only store data for as long as we need it",
"la_privacy_section3_title": "How long do we store data for?",
"la_privacy_section3_body": "We store data for the least amount of time possible:\n\n• Live Activity push token: Only stored as long as you have lessons on the given day (including the 2-hour period before). If you don't have any lessons left, the value becomes zero.\n\n• Timetable data: Only stored for the length of the lessons and they're deleted automatically. On Fridays, the table containing the timetable will be completely empty after the last lesson.\n\n• Device data (token, identifiers): Stored for as long as the Live Activity function is enabled. This data gets deleted when disabling the function.",
"la_privacy_section4_title": "What do we use the data for?",
"la_privacy_section4_body": "We use the data exclusively for the Live Activity function:\n\n• Displaying a live timetable on your lockscreen\n• Sending push notifications when lessons change\n• Synchronizing the timetable on your device\n• Ensuring the Monday morning notifications get delivered even after the weekly database-clearing.\n\nWe don't share your data with third parties and we don't use them for marketing.",
"la_privacy_section5_title": "Your rights",
"la_privacy_section5_body": "Under the GDPR, you have the following rights:\n\n• Right of access: You can view the type of data stored in this privacy policy.\n• Right to erasure: By disabling the Live Activity function, all data related to the function (device identifiers, timetable) will be immediately and permanently deleted from our servers.\n• Right to modification: The timetable data is modified in the Kréta system by authorized persons (e.g. teachers).\n• Right to object: You can object to data processing at any time by disabling the Live Activity function.",
"la_privacy_footer": "This privacy policy was last updated on: November 2025",
"la_privacy_contact": "Do you have any questions? Contact us at support@firka.app.",
"la_privacy_summary1": "Device tokens, Live Activity tokens, timetable data",
"la_privacy_summary2": "Encrypted storage, secure servers",
"la_privacy_summary3": "Data is automatically deleted when it is no longer needed.",
"la_title": "Live Activity",
"la_subtitle": "Show your schedule live on your device's lock screen",
"la_privacy_title": "Privacy Policy",
"la_privacy_required": "To use Live Activity you must accept the privacy policy",
"la_learn_more": "Learn More",
"la_accept": "Accept",
"la_decline": "Decline",
"runningInDomainBrowser": "Domain Böngésző",
"copied": "Copied",
"view_day_btn": "View day",
"omission": "Absence",
"omissions": "Absences",
"omission_state_excused": "Verified",
"omission_state_unexcused": "Unverified",
"omission_state_pending": "Pending",
"omissions_count": "{state, select, unexcused{{count} igazolatlan} pending{{count} igazolandó} other{{count}}} hiányzás",
"@omissions_count": {
"placeholders": {
"state": {
"type": "String"
},
"count": {
"type": "int"
}
}
},
"s_beta_warning": "Beta warning",
"s_ag_privacy_ever_declined": "Privacy previously declined",
"s_c_tab_appearance": "Appearance",
"s_c_tab_subjects": "Subjects",
"s_c_tab_fonts": "Fonts",
"s_c_my_themes": "My themes",
"s_c_manage_subjects": "Manage subjects",
"s_c_change_app_icon": "Change app icon",
"s_c_colors_header": "Colors",
"s_c_grade_colors_header": "Grade colors",
"s_c_colors_theme_header": "Colors & Theme",
"s_c_slot_accent": "Accent",
"s_c_slot_background": "Background",
"s_c_slot_cards": "Cards",
"s_c_slot_buttons": "Buttons",
"s_c_mode_both": "Both",
"s_c_slot_secondary": "Secondary",
"s_c_slot_text": "Text",
"s_c_slot_text_secondary": "Secondary text",
"s_c_slot_text_tertiary": "Tertiary text",
"s_c_slot_shadow": "Shadow",
"s_c_slot_success": "Success",
"s_c_slot_warning": "Warning",
"s_c_slot_warning_text": "Warning text",
"s_c_slot_warning_card": "Warning card",
"s_c_slot_error": "Error",
"s_c_slot_error_text": "Error text",
"s_c_slot_error_card": "Error card",
"s_c_title_style_header": "Title style",
"s_c_title_weight_header": "Title weight",
"s_c_title_weight_subtitle": "Not all fonts support this",
"s_c_title_weight_thin": "Thin",
"s_c_title_weight_thick": "Bold",
"s_c_capitalization_header": "Capitalization",
"s_c_capitalization_lower": "lowercase",
"s_c_capitalization_normal": "Normal",
"s_c_capitalization_upper": "UPPERCASE",
"s_c_change": "Change",
"s_c_customize": "Customize",
"s_c_themes_current": "Current",
"s_c_themes_own": "Mine",
"s_c_themes_downloaded": "Downloaded",
"s_c_themes_share_current": "Share current theme",
"s_c_themes_create_new": "Create new theme",
"s_c_themes_import": "Import theme",
"s_c_themes_use": "Use",
"s_c_themes_continue": "Continue",
"s_c_themes_own_label": "My theme",
"s_c_themes_imported_label": "Imported theme",
"s_c_themes_builtin_label": "Built-in theme",
"s_c_themes_builtin_name": "Default",
"s_c_themes_create_title": "Create new theme",
"s_c_themes_create_subtitle": "Enter a name for the theme",
"s_c_themes_create_placeholder": "Theme name",
"s_c_themes_delete_title": "Delete theme",
"s_c_themes_delete_subtitle": "Are you sure you want to delete this theme? This action can be undone.",
"s_c_themes_delete_confirm": "Delete",
"s_about": "About",
"s_extras": "Extras",
"s_other": "Other",
"grade_weight_x1": "single weight",
"grade_weight_x2": "double weight",
"grade_weight_x3": "triple weight",
"grade_weight_x4": "quadruple weight",
"grade_weight_x5": "quintuple weight",
"grade_weight_percent": "{percent}% weight",
"@grade_weight_percent": {
"placeholders": {
"percent": {
"type": "int"
}
}
},
"surprise_grade_rank_5": "LEGENDARY",
"surprise_grade_rank_4": "EXCELLENT",
"surprise_grade_rank_3": "OKAY",
"surprise_grade_rank_2": "WEAK",
"surprise_grade_rank_1": "CATASTROPHE",
"new_grades_card": "You have new grades",
"s_notifications": "Notifications",
"s_sticker_map": "Sticker map",
"s_qr_reader": "QR code reader",
"s_feedback": "Feedback",
"s_a_desc": "Navigation, language, bell, rounding",
"s_c_desc": "Grade colors, theme, app icon",
"s_todo": "túdú: program this",
"s_surprise_grades": "Surprise grades",
"s_seasonal_icons": "Seasonal app icons",
"s_uwu_mode": "UwU mode",
"s_calendar_sync": "Calendar sync",
"s_save_grades": "Save grades",
"s_welcome_msg": "Welcome message",
"s_extras_desc": "Surprise grades, calendar sync",
"s_notifications_desc": "Grades, timetable changes, absences",
"s_notif_push_enabled": "Enable push notifications",
"s_notif_delivery_method_header": "Delivery method",
"s_notif_delivery_auto": "Automatic",
"s_notif_delivery_fcm": "Firebase Cloud Messaging (FCM)",
"s_notif_delivery_alarm": "Alarm (background check)",
"s_notif_wakeup_interval_header": "Check frequency",
"s_notif_wakeup_hourly": "Hourly",
"s_notif_wakeup_two_hourly": "Every 2 hours",
"s_notif_categories_header": "Categories",
"s_notif_grades": "Grades",
"s_notif_homework_tests": "Homework & tests",
"s_notif_absences": "Absences",
"s_notif_lessons": "Lesson changes",
"s_notif_lessons_cancelled": "Cancelled lessons",
"s_notif_lessons_substituted": "Substitutions",
"s_notif_messages": "Messages",
"s_progress_notification": "Progress-centric notification",
"s_progress_notification_desc": "Live progress notification for lessons and breaks throughout the school day",
"progress_notif_channel_name": "School day progress",
"progress_notif_channel_desc": "Live progress notification for today's lessons and breaks",
"progress_notif_lesson_title": "Lesson {number}: {name}",
"@progress_notif_lesson_title": {
"placeholders": {
"number": {"type": "String"},
"name": {"type": "String"}
}
},
"progress_notif_substitution": " (Substitution)",
"progress_notif_case1_text": "In {minutes} min ({timeRange}){room}{substitution}{remaining}",
"@progress_notif_case1_text": {
"placeholders": {
"minutes": {"type": "String"},
"timeRange": {"type": "String"},
"room": {"type": "String"},
"substitution": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_case2_lesson_text": "{minutes} min left ({timeRange}){room}{substitution}{remaining}",
"@progress_notif_case2_lesson_text": {
"placeholders": {
"minutes": {"type": "String"},
"timeRange": {"type": "String"},
"room": {"type": "String"},
"substitution": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_case2_break_title": "Break",
"progress_notif_case2_break_text": "{minutes} min left{remaining}",
"@progress_notif_case2_break_text": {
"placeholders": {
"minutes": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_critical_text": "{minutes}m",
"@progress_notif_critical_text": {
"placeholders": {
"minutes": {"type": "String"}
}
},
"progress_notif_remaining_lessons_one": " - 1 lesson remaining",
"progress_notif_remaining_lessons_other": " - {count} lessons remaining",
"@progress_notif_remaining_lessons_other": {
"placeholders": {
"count": {"type": "String"}
}
},
"s_fcm_status_title": "FCM status",
"s_fcm_status_initialized": "Initialized",
"s_fcm_status_not_initialized": "Not initialized",
"s_fcm_status_token_present": "Token present",
"s_fcm_status_token_missing": "No token",
"s_fcm_status_permission_label": "Notification permission",
"s_fcm_status_permission_granted": "Granted",
"s_fcm_status_permission_denied": "Denied",
"s_fcm_status_permission_unknown": "Unknown",
"s_fcm_status_topic_label": "Subscribed topic",
"s_fcm_status_last_refresh_label": "Last token refresh",
"s_fcm_status_last_refresh_never": "Never",
"s_fcm_status_refresh_button": "Refresh",
"s_fcm_notify_on_message": "Notify on FCM message",
"s_fcm_test_notifications_title": "Test notifications",
"s_fcm_test_notifications_multi_title": "Simulate multi-account",
"s_n_all": "All",
"s_n_grades": "New grades",
"s_n_homework_tests": "Homework & Tests",
"s_n_absences": "Absences",
"s_n_lessons": "Lessons",
"s_n_messages": "Messages",
"s_n_by_subject": "By subject",
"fb_intro": "Found a bug or have an idea? Tell us! If you add your e-mail address, we will reply.",
"fb_email": "E-mail address (optional)",
"fb_message": "Message",
"fb_attach_logs": "Attach logs and debug data",
"fb_attach_logs_desc": "We send the app's log and your device details (model, Android and app version) so it is easier to find the problem. The log can contain personal data.",
"fb_send": "Send feedback",
"fb_sending": "Sending…",
"fb_sent": "We got your message and will reply by e-mail soon.",
"fb_err_email_invalid": "Sorry, we can't reply to an invalid e-mail address yet.",
"fb_err_message_empty": "Tell us how we can help.",
"fb_err_send": "The message could not be sent, please try again later.",
"fb_add_images": "Attach pictures",
"fb_images_hint": "Up to 5 pictures, 5 MB each.",
"fb_remove_image": "Remove picture",
"fb_err_image_big": "A picture can be 5 MB at most.",
"fb_err_images_total": "The pictures can be 8 MB together at most.",
"fb_sent_no_reply": "We got your message, thank you!",
"fb_sent_title": "Sent!"
}

603
firka/lib/l10n/app_hu.arb Normal file
View File

@@ -0,0 +1,603 @@
{
"restart_title": "Alkalmazás újraindítása",
"restart_body": "Kattints ide az alkalmazás megnyitásához.",
"loginBtn": "Bejelentkezés E-Kréta fiókkal",
"privacyLabel": "Adatvédelmi tájékoztató",
"title1": "Egy pillantásra tudhatsz mindent",
"subtitle1": "A főoldal tetején hasznos információkat láthatsz a napodról.",
"title2": "A tantárgyaid kényelmesen elférnek itt",
"subtitle2": "Láss statisztikákat, közelgő számonkéréseket, és akár a régebbi tanéves jegyeidet is.",
"title3": "Személyre szabható órarend",
"subtitle3": "Válaszd ki, mit szeretnél látni az órarend oldalon, kapcsold ki vagy be a számonkéréseket, házi feladatokat, szüneteket és lyukas órákat is.",
"title4": "Sok extra dolog, amit a Krétában sosem fogsz megtalálni",
"subtitle4": "",
"yesterday": "Tegnap",
"today": "Ma",
"runningInDomainBrowser": "Doméjn böngésző",
"tomorrow": "Holnap",
"debug_screen": "Fejlesztői menü",
"settings_screen": "Beállítások",
"home": "Kezdőlap",
"grades": "Jegyek",
"timetable": "Órarend",
"other": "Több",
"refreshing": "Adatok frissítése...",
"reauth": "Bejelentkezés szükséges",
"api_error": "Kréta API hiba",
"pairing": "Óra párosítása",
"pairing_description": "Szeretnéd ezt az órát párosítani a Firka appal?\nPárosítás láthatod az órarendet, és a legújabb jegyeidet, számonkéréseidet, és a feladataidat.",
"cancel": "Mégse",
"save": "Mentés",
"okay": "Rendben",
"pair": "Párosítás",
"beta_title": "Firka - Publikus béta",
"beta_body": "Az alkalmazás fejlesztés alatt áll; egyes funkciók hibásan működhetnek, nem működnek, vagy még nem készültek el.",
"good_morning": "Jó reggelt, {p}!",
"@good_morning": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"happy_birthday": "Boldog születésnapot, {p}!",
"@happy_birthday": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_day": "Szép napot, {p}!",
"@good_day": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"n_left_subtitle": "Tarts ki, már csak {n} óra!",
"@n_left_subtitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"suffering_almost_over_subtitle": "Mindjárt szabad vagy. Figyelj oda a tanárra.",
"school_ending": "Izgulsz, {p}?",
"@school_ending": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tomorrow_subtitle": "Itt a holnapi napod.",
"good_afternoon": "Szép délutánt, {p}!",
"@good_afternoon": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"good_night": "Szép estét, {p}!",
"@good_night": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tests_tomorrow": "{tests} dolgozatod lesz",
"@tests_tomorrow": {
"placeholders": {
"tests": {
"type": "String"
}
}
},
"no_tests_tomorrow": "Holnap nincs dolgozatod",
"get_ready": "Pihend ki magad, és készülj fel",
"homework": "Házi feladat",
"mark_as_done": "Megjelölés befejezettként",
"mark_as_not_done": "Megjelölés befejezetlenként",
"starting_soon": "Hamarosan kezdődik az első órád!",
"starting_hour": "óra",
"starting_hour_plural": "óra",
"starting_min": "perc",
"starting_min_plural": "perc",
"starting_sec": "másodperc",
"starting_sec_plural": "másodperc",
"subjects": "Tantárgyak",
"your_subjects": "Tantárgyaid",
"data": "Adatok",
"subject_avg": "Tantárgyi átlag",
"subject_avg_rounded": "Tantárgyi átlag kerekítés után",
"class_avg": "Osztályátlag",
"class_n": "Heti óraszám",
"grade_teacherName": "Tanár neve: ",
"grade_strValue": "Szöveges értékelés: ",
"no_grades": "Ebből a tantárgyból még nincsen jegyed.",
"unknown_teacher": "Ismeretlen tanár",
"tt_no_classes_l1": "Ezen a napon nincsenek óráid!",
"tt_no_classes_l2": "Yippee!",
"tt_non_instructional_day": "Tanítás nélküli munkanap",
"tt_public_holiday": "Munkaszüneti nap",
"tt_spring_break": "Tavaszi szünet",
"tt_winter_break": "Téli szünet",
"tt_autumn_break": "Őszi szünet",
"tt_instructional_day": "Tanítási nap",
"tt_first_semester_end": "Első félév vége",
"tt_holiday": "Ünnepnap",
"tt_rest_day": "Pihenőnap",
"tt_first_instructional_day": "Első tanítási nap",
"tt_last_instructional_day": "Utolsó tanítási nap",
"tt_last_instructional_day_graduates": "Utolsó tanítási nap a végzős évfolyamokon",
"tt_full_day_trip": "Egész napos kirándulás",
"tt_quarter_end": "negyedév vége",
"tt_added": "Létrehozva: ",
"class_dismissed": "Elmaradt óra",
"catalog_lesson_btn": "Óra naplózása",
"catalog_lesson_title": "Óra naplózása",
"catalog_lesson_topic_hint": "Az óra témája",
"catalog_lesson_submit_btn": "Mentés",
"class_substitution": "Helyettesítés",
"lesson_subject": "Az óra tárgya",
"view_subject_btn": "Tantárgy megtekintése",
"view_lesson_btn": "Óra megtekintése",
"view_day_btn": "Nap megtekintése",
"date": "Időpont",
"tt_settings_toast": "Órarend beállításai",
"tt_settings_toast_lesson_nos": "Óraszámok",
"tt_settings_toast_lesson_tests": "Számonkérések & egyéb",
"tt_settings_toast_lesson_breaks": "Szünetek",
"tt_settings_toast_lesson_substitution": "Helyettesítések",
"tt_settings_toast_lesson_ab_timetable": "Kéthetes órarend",
"a_week": "A hét",
"b_week": "B hét",
"stats_date": "Dátum",
"stats_created_at": "Létrehozva",
"stats_last_mod": "Utoljára módosítva",
"s_developer": "Fejlesztői beállítások",
"s_stats_for_nerds": "Extra információ mutatása",
"s_beta_warning": "Béta figyelmeztetés",
"s_settings": "Beállítások",
"s_a": "Alkalmazás",
"s_ag": "Általános",
"s_ag_bell_delay": "Csengő eltolódása",
"s_ag_rounding": "Alapértelmezett kerekítés",
"s_shortened_timetable": "Rövidített órák",
"s_shortened_timetable_enable": "Rövidített órák engedélyezése",
"s_shortened_timetable_start": "Kezdete",
"s_shortened_timetable_end": "Vége",
"s_shortened_timetable_no_lessons": "Nincs megjeleníthető óra a gyorsítótárban. Frissítsd az órarendet, majd próbáld újra.",
"s_shortened_timetable_reset": "Eredeti időpontok visszaállítása",
"s_shortened_timetable_invalid_time": "A végének a kezdete után kell lennie",
"s_shortened_timetable_lesson": "{n}. óra",
"@s_shortened_timetable_lesson": {
"placeholders": {
"n": {
"type": "int"
}
}
},
"s_customization": "Személyre szabás",
"s_ag_r1": "1 → 2",
"s_ag_r2": "2 → 3",
"s_ag_r3": "3 → 4",
"s_ag_r4": "4 → 5",
"s_ag_class_avg_on_graph": "Osztályátlag a grafikonon",
"s_ag_navbar": "Navigációs sáv",
"s_ag_navbar_desc": "Válaszd ki, mik jelenjenek meg a navigációs sávon, és rendezd el őket. A többi oldal elérhető a “több” gombon keresztül. Maximum 4 oldalt tudsz kitűzni.",
"s_ag_navbar_home": "Kezdőlap",
"s_ag_navbar_visible": "Megjelenik",
"s_ag_navbar_hidden": "Elrejtve",
"s_ag_left_handed_mode": "Balkezes mód",
"s_ag_privacy_ever_declined": "Adatvédelem korábban elutasítva",
"s_ag_language_header": "Nyelv",
"s_ag_language_auto": "Automatikus",
"s_ag_language_hu": "Magyar",
"s_ag_language_en": "Angol",
"s_ag_language_de": "Német",
"s_c": "Személyre szabás",
"s_c_icon_header": "App ikonok",
"s_c_replace_icon": "Ikon cseréje",
"s_ci_icon_header": "App ikon",
"s_ci_warning_header": "[!] Debug módban nem fog működni az ikon megváltoztatása",
"s_ci_icon_subtitle": "Válassz egy csodaszép app ikont, ha már unod a zöldet.",
"s_ci_icon_g1": "Catboy domain",
"s_ci_icon_g2": "Filctoll",
"s_ci_icon_g3": "Nosztalgia",
"s_ci_icon_g4": "Újragondolt",
"s_ci_icon_g5": "Referencia",
"s_ci_icon_g6": "Karácsonyi logó verseny 2024",
"s_ci_icon_g6_desc": "@emilia6_6 által",
"s_ci_icon_g7": "Pride",
"s_ci_icon_g8": "Pride ",
"s_c_theme_header": "Téma",
"s_c_theme_auto": "Automatikus",
"s_c_theme_light": "Világos",
"s_c_theme_dark": "Sötét",
"s_c_tab_appearance": "App kinézete",
"s_c_tab_subjects": "Tantárgyak",
"s_c_tab_fonts": "Betűk",
"s_c_my_themes": "Témáim",
"s_c_manage_subjects": "Tantárgyak kezelése",
"s_c_change_app_icon": "App ikon cseréje",
"s_c_colors_header": "Színek",
"s_c_grade_colors_header": "Jegyek színei",
"s_c_colors_theme_header": "Színek & téma",
"s_c_slot_accent": "Accent",
"s_c_slot_background": "Háttér",
"s_c_slot_cards": "Kártyák",
"s_c_slot_buttons": "Gombok",
"s_c_mode_both": "Mindkettő",
"s_c_slot_secondary": "Másodlagos",
"s_c_slot_text": "Szöveg",
"s_c_slot_text_secondary": "Másodlagos szöveg",
"s_c_slot_text_tertiary": "Harmadlagos szöveg",
"s_c_slot_shadow": "Árnyék",
"s_c_slot_success": "Siker",
"s_c_slot_warning": "Figyelmeztetés",
"s_c_slot_warning_text": "Figyelmeztető szöveg",
"s_c_slot_warning_card": "Figyelmeztető kártya",
"s_c_slot_error": "Hiba",
"s_c_slot_error_text": "Hiba szöveg",
"s_c_slot_error_card": "Hiba kártya",
"s_c_title_style_header": "Címek stílusa",
"s_c_title_weight_header": "Címek vastagsága",
"s_c_title_weight_subtitle": "Ezt nem mindegyik betűtípus támogatja",
"s_c_title_weight_thin": "Vékony",
"s_c_title_weight_thick": "Vastag",
"s_c_capitalization_header": "Kapitalizáció",
"s_c_capitalization_lower": "kisbetűs",
"s_c_capitalization_normal": "Normál",
"s_c_capitalization_upper": "NAGYBETŰS",
"s_c_change": "Csere",
"s_c_customize": "Személyre szabás",
"s_c_themes_current": "Jelenlegi",
"s_c_themes_own": "Saját",
"s_c_themes_downloaded": "Letöltött",
"s_c_themes_share_current": "Jelenlegi téma megosztása",
"s_c_themes_create_new": "Új téma létrehozása",
"s_c_themes_import": "Téma importálása",
"s_c_themes_use": "Használat",
"s_c_themes_continue": "Folytatás",
"s_c_themes_own_label": "Saját téma",
"s_c_themes_imported_label": "Importált téma",
"s_c_themes_builtin_label": "Beépített téma",
"s_c_themes_builtin_name": "Alapértelmezett",
"s_c_themes_create_title": "Új téma létrehozása",
"s_c_themes_create_subtitle": "Add meg a téma nevét",
"s_c_themes_create_placeholder": "A téma neve",
"s_c_themes_delete_title": "Téma törlése",
"s_c_themes_delete_subtitle": "Biztosan törölni szeretnéd ezt a témát? Ez a művelet visszavonható.",
"s_c_themes_delete_confirm": "Törlés",
"s_ci_child_protection": "Gyermekvédelem",
"ic_ace": "Aszexuális",
"ic_ace_f": "Aszexuális",
"ic_bi": "Biszexuális",
"ic_bi_f": "Biszexuális",
"ic_cactus": "Kaktuszliget",
"ic_cc": "Kreatív Felhő",
"ic_enby": "Nembináris",
"ic_enby_f": "Nembináris",
"ic_fidesz": "Narancs",
"ic_filc": "Filc Napló",
"ic_filco": "Filc . O",
"ic_galaxy": "Galaxis",
"ic_gay": "Meleg",
"ic_gay_f": "Meleg",
"ic_half_firka_2": "Revolution",
"ic_kreta": "eFIRKA",
"ic_lesb": "Leszbikus",
"ic_lesb_f": "Leszbikus",
"ic_lgbtq": "LMGBTQ+",
"ic_lgbtq_f": "LMGBTQ+",
"ic_lgbtqp": "Progresszió",
"ic_lgbtqp_f": "Progresszió",
"ic_lidl": "Bevásárlás",
"ic_mkkp": "Ingyen jegyek",
"ic_nuke": "Nukleáris",
"ic_modern": "Modern",
"ic_o1g": "O1G",
"ic_old": "Domain Dév Dévid",
"ic_original": "Az eredeti",
"ic_paper": "Papír",
"ic_pear": "Körte",
"ic_pixel": "Pixel",
"ic_pixelized": "Pixelizált",
"ic_pride": "Űrszívárvány",
"ic_proto": "Prototípus",
"ic_refilc": "reFilc",
"ic_refulc": "firk’a",
"ic_repont": "Ötven forint",
"ic_szivacs": "Szivacs",
"ic_tisza": "Árad a firka",
"ic_trans": "Transz",
"ic_trans_f": "Transz",
"ic_void_icon": "Semmi",
"ic_xmas1": "Rosszak listája",
"ic_xmas2": "Ajándék",
"ic_xmas3": "reKarácsony",
"s_your_account": "Fiókod",
"s_acc_kreta": "eKRÉTA Fiókok",
"s_acc_accounts": "Fiókok",
"s_neptun_title": "ELTE Neptun",
"s_neptun_user_hint": "Azonosító (pl. abc123)",
"s_neptun_password_hint": "Jelszó",
"s_neptun_totp_code_hint": "Add meg a 6-jegyős kódot",
"s_neptun_code_by_email": "e-mailben elküldve",
"s_neptun_confirm_code": "Kód megerősítése",
"s_neptun_login_btn": "Bejelentkezés",
"s_neptun_seed_hint": "Hitelesítő kulcs (opcionális)",
"s_neptun_seed_help": "Add meg a 2FA hitelesítőd titkos kulcsát. NEM a 6 jegyű kódot.",
"s_neptun_login_with_elte": "Bejelentkezés ELTE Neptunnal",
"s_neptun_seed_failed": "A 2FA automatikus kódgenerálás sikertelen — ellenőrizd a hitelesítő kulcsot.",
"s_neptun_2fa_rejected": "A 2FA kódot elutasította a rendszer — ha a kód helyes, indítsd újra a bejelentkezést és adj meg egy friss kódot.",
"s_neptun_login_failed": "Bejelentkezés sikertelen",
"s_acc_accounts": "Fiókok",
"s_acc_add": "Új diákfiók hozzáadása",
"s_acc_add_teacher": "Új tanárfiók hozzáadása",
"s_acc_logout": "Kijelentkezés",
"close": "Bezárás",
"s_about": "Névjegy",
"licensesLabel": "Licencek",
"licenseDescription": "Az alkalmazás által használt külső könyvtárak licencei",
"wear_phone_unpaired": "Az órád nincs párosítva a telefonoddal!",
"wear_phone_disconnected": "Az órád nincs csatlakoztatva a telefonoddal!",
"wear_pairing_request_sent": "Párosítás folyamatban, nyisd meg az appot a telefonodon",
"wear_pairing_check_phone": "Folytasd a párosítást a telefonodon",
"wear_try_again": "Újra",
"copied": "Másolva",
"breakTxt": "Szünet",
"empty_class": "Lyukasóra",
"timeLeft": "Még {mins} perc",
"@timeLeft": {
"placeholders": {
"mins": {
"type": "num"
}
}
},
"noClasses": "Nincs ma iskola, pihend ki magad!",
"noMoreClasses": "Nincs több órád ma",
"firstIn": "Első órád: {t}",
"@firstIn": {
"placeholders": {
"t": {
"type": "String"
}
}
},
"wearTitle": "{n}. óra",
"@wearTitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"lessons_tomorrow": "{lessons} órád lesz",
"@lessons_tomorrow": {
"placeholders": {
"lessons": {
"type": "String"
}
}
},
"subject": "Tantárgy",
"grade_calculator": "Jegy kalkulátor",
"grade_calculator_add": "Hozzáadás",
"ghost_grade": "Szellem jegy",
"ghost_grades": "Szellem jegyek",
"gradesCount": "{count} jegy",
"@gradesCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"overall_avg": "Összesített átlag",
"now": "Most",
"s_n": "Értesítések",
"s_n_morning": "Reggeli értesítés",
"s_n_morning_time": "Értesítés ideje iskola előtt",
"s_n_live_activity": "Live Activity",
"s_n_test": "Teszt értesítés küldése",
"s_wear": "Wear OS",
"s_wear_os_support": "Wear OS támogatás",
"s_extras": "Extrák",
"s_other": "Egyéb",
"wearSyncNotificationTitle": "Szinkronizálás az órával",
"wearSyncNotificationText": "Óra adatainak szinkronban tartása",
"wear_sync_with_phone": "Nyisd meg a telefonos appot a szinkronizáláshoz",
"wear_syncing": "Szinkronizálás...",
"la_privacy_header": "Live Activity adatvédelmi tájékoztató",
"la_privacy_intro": "A Live Activity funkció használatához bizonyos adatokat kell tárolnunk és feldolgoznunk. Kérjük, olvasd el figyelmesen az alábbi tájékoztatót.",
"la_privacy_section1_title": "Milyen adatokat tárolunk?",
"la_privacy_section1_body": "A Live Activity működéséhez az alábbi adatokat tároljuk eszközazonosítóddal együtt:\n\n• Eszköz azonosító (UUID)\n• Eszköz token\n• Live Activity push token\n• APNs push token\n• Eszköz hash\n• Nyelvi beállítás\n• Csengő eltolódása\n\nAz órarendi adataid (lessons tábla) a következőket tartalmazzák:\n• Óra tárgya és időpontja\n• Tanár neve\n• Terem neve\n• Óra sorszáma\n• Óra témája\n• Helyettesítés adatai\n• Elmaradt óra jelzése\n\nAz időzített értesítések (scheduled_notifications tábla) a következőket tartalmazzák:\n• Azonosító\n• Eszköz azonosító\n• Időzített időpont\n• Küldés állapota és ideje\n• Létrehozás és frissítés ideje",
"la_privacy_section2_title": "Hogyan védjük az adataidat?",
"la_privacy_section2_body": "Komolyan vesszük az adataid biztonságát:\n\n• A devices és lessons táblákban lévő összes adat titkosítva van\n• Az adatokat biztonságos szerveren tároljuk\n• Csak a szükséges időtartamig tároljuk az adatokat",
"la_privacy_section3_title": "Meddig tároljuk az adatokat?",
"la_privacy_section3_body": "Az adatok tárolása minimális időtartamra korlátozódik:\n\n• Live Activity push token: Addig van tárolva, amíg óráid vannak az adott napon (beleértve az első óra előtti 2 órás időszakot is). Ha nincs több órád, az érték null lesz.\n\n• Órarendi adatok: Csak az órák időtartamára tárolódnak, majd automatikusan törlődnek. Pénteken az utolsó óra után az órarendet tartalmazó tábla teljesen üres lesz.\n\n• Eszközadatok (token, azonosítók): Addig van tárolva, amíg a Live Activity funkció engedélyezve van. A funkció kikapcsolásakor ezek az adatok azonnal törlésre kerülnek.",
"la_privacy_section4_title": "Mire használjuk az adatokat?",
"la_privacy_section4_body": "Az adatokat kizárólag a Live Activity funkció működtetésére használjuk:\n\n• Élő órarend megjelenítése a lezárási képernyőn\n• Push értesítések küldése óraváltásokkor\n• Az órarend szinkronizálása az eszközödön\n• A hétfő reggeli értesítések kézbesítésének biztosítása a heti adatbázis-ürítés után is\n\nAz adataidat nem adjuk át harmadik félnek, és nem használjuk marketing célokra.",
"la_privacy_section5_title": "Jogaid",
"la_privacy_section5_body": "A GDPR alapján az alábbi jogokkal rendelkezel:\n\n• Hozzáférési jog: A tárolt adatok típusát ebben az adatvédelmi tájékoztatóban tekintheted meg.\n• Törlési jog: A Live Activity funkció kikapcsolásával minden, a funkcióhoz kapcsolódó adat (eszközazonosítók, órarend) azonnal és véglegesen törlődik a szervereinkről.\n• Módosítási jog: Az órarendi adatok módosítása a Kréta rendszerben történik, az arra jogosult személyek (pl. tanárok) által.\n• Tiltakozási jog: Az adatkezelés ellen bármikor tiltakozhatsz a Live Activity funkció kikapcsolásával.",
"la_privacy_footer": "Az adatvédelmi tájékoztató utolsó frissítése: 2025. november",
"la_privacy_contact": "Kérdésed van? Keress minket a support @firka.app címen.",
"la_privacy_summary1": "Eszköz tokenek, Live Activity tokenek, órarendi adatok",
"la_privacy_summary2": "Titkosított tárolás, biztonságos szerverek",
"la_privacy_summary3": "Az adatok automatikusan törlődnek, ha már nincs rájuk szükség",
"la_title": "Live Activity",
"la_subtitle": "Az órarended élő megjelenítése az eszköz lezárási képernyőjén",
"la_privacy_title": "Adatvédelmi tájékoztató",
"la_privacy_required": "A Live Activity használatához el kell fogadnod az adatvédelmi tájékoztatót",
"la_learn_more": "Bővebben",
"la_accept": "Elfogadom",
"la_decline": "Elutasítom",
"omission": "Hiányzás",
"omissions": "Hiányzások",
"omission_state_excused": "Igazolt",
"omission_state_unexcused": "Igazolatlan",
"omission_state_pending": "Függőben",
"omissions_count": "{state, select, unexcused{{count} igazolatlan} pending{{count} igazolandó} other{{count}}} hiányzás",
"@omissions_count": {
"placeholders": {
"state": {
"type": "String"
},
"count": {
"type": "int"
}
}
},
"grade_weight_x1": "egyszeres súllyal",
"grade_weight_x2": "dupla súllyal",
"grade_weight_x3": "tripla súllyal",
"grade_weight_x4": "négyszeres súllyal",
"grade_weight_x5": "ötszörös súllyal",
"grade_weight_percent": "{percent}%-os súllyal",
"@grade_weight_percent": {
"placeholders": {
"percent": {
"type": "int"
}
}
},
"surprise_grade_rank_5": "LEGENDÁS",
"surprise_grade_rank_4": "KIVÁLÓ",
"surprise_grade_rank_3": "RENDBEN",
"surprise_grade_rank_2": "GYENGE",
"surprise_grade_rank_1": "KATASZTRÓFA",
"new_grades_card": "Új jegyeid vannak",
"s_notifications": "Értesítések",
"s_sticker_map": "Matrica térkép",
"s_qr_reader": "QR-kód olvasó",
"s_feedback": "Visszajelzés",
"s_a_desc": "Navigáció, nyelv, csengő, kerekítés",
"s_c_desc": "Jegyek színe, téma, app ikon",
"s_todo": "túdú: program this",
"s_surprise_grades": "Meglepetés jegyek",
"s_seasonal_icons": "Szezonális app ikonok",
"s_uwu_mode": "UwU mód",
"s_calendar_sync": "Naptár szinkronizálás",
"s_save_grades": "Jegyek mentése",
"s_welcome_msg": "Üdvözlő üzenet",
"s_extras_desc": "Meglepetés jegyek, naptár szinkronizálás",
"s_notifications_desc": "Jegyek, órarend változások, hiányok",
"s_notif_push_enabled": "Push értesítések engedélyezése",
"s_notif_delivery_method_header": "Kézbesítési mód",
"s_notif_delivery_auto": "Automatikus",
"s_notif_delivery_fcm": "Firebase Cloud Messaging (FCM)",
"s_notif_delivery_alarm": "Ébresztő (háttérellenőrzés)",
"s_notif_wakeup_interval_header": "Ellenőrzési gyakoriság",
"s_notif_wakeup_hourly": "Óránként",
"s_notif_wakeup_two_hourly": "Kétóránként",
"s_notif_categories_header": "Kategóriák",
"s_notif_grades": "Jegyek",
"s_notif_homework_tests": "Házi feladatok és dolgozatok",
"s_notif_absences": "Hiányzások",
"s_notif_lessons": "Órarendváltozások",
"s_notif_lessons_cancelled": "Elmaradt órák",
"s_notif_lessons_substituted": "Helyettesítések",
"s_notif_messages": "Üzenetek",
"s_progress_notification": "Folyamatjelző értesítés",
"s_progress_notification_desc": "Élő folyamatjelző értesítés a tanítási nap óráiról és szüneteiről",
"progress_notif_channel_name": "Tanítási nap folyamata",
"progress_notif_channel_desc": "Élő értesítés a mai órák és szünetek állapotáról",
"progress_notif_lesson_title": "{number}. óra: {name}",
"@progress_notif_lesson_title": {
"placeholders": {
"number": {"type": "String"},
"name": {"type": "String"}
}
},
"progress_notif_substitution": " (Helyettesítés)",
"progress_notif_case1_text": "{minutes} perc múlva ({timeRange}){room}{substitution}{remaining}",
"@progress_notif_case1_text": {
"placeholders": {
"minutes": {"type": "String"},
"timeRange": {"type": "String"},
"room": {"type": "String"},
"substitution": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_case2_lesson_text": "{minutes} perc van hátra ({timeRange}){room}{substitution}{remaining}",
"@progress_notif_case2_lesson_text": {
"placeholders": {
"minutes": {"type": "String"},
"timeRange": {"type": "String"},
"room": {"type": "String"},
"substitution": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_case2_break_title": "Szünet",
"progress_notif_case2_break_text": "{minutes} perc van hátra{remaining}",
"@progress_notif_case2_break_text": {
"placeholders": {
"minutes": {"type": "String"},
"remaining": {"type": "String"}
}
},
"progress_notif_critical_text": "{minutes}p",
"@progress_notif_critical_text": {
"placeholders": {
"minutes": {"type": "String"}
}
},
"progress_notif_remaining_lessons_one": " - Még 1 óra van hátra",
"progress_notif_remaining_lessons_other": " - Még {count} óra van hátra",
"@progress_notif_remaining_lessons_other": {
"placeholders": {
"count": {"type": "String"}
}
},
"s_fcm_status_title": "FCM állapot",
"s_fcm_status_initialized": "Inicializálva",
"s_fcm_status_not_initialized": "Nincs inicializálva",
"s_fcm_status_token_present": "Token megvan",
"s_fcm_status_token_missing": "Nincs token",
"s_fcm_status_permission_label": "Értesítési engedély",
"s_fcm_status_permission_granted": "Engedélyezve",
"s_fcm_status_permission_denied": "Elutasítva",
"s_fcm_status_permission_unknown": "Ismeretlen",
"s_fcm_status_topic_label": "Feliratkozott téma",
"s_fcm_status_last_refresh_label": "Utolsó token frissítés",
"s_fcm_status_last_refresh_never": "Még nem történt",
"s_fcm_status_refresh_button": "Frissítés",
"s_fcm_notify_on_message": "Értesítés FCM üzenetkor",
"s_fcm_test_notifications_title": "Teszt értesítések",
"s_fcm_test_notifications_multi_title": "Több fiók szimulálása",
"s_n_all": "Összes",
"s_n_grades": "Új jegyek",
"s_n_homework_tests": "Feladatok & Számonkérések",
"s_n_absences": "Hiányzások",
"s_n_lessons": "Órák",
"s_n_messages": "Üzenetek",
"s_n_by_subject": "Tantárgyak szerint",
"fb_intro": "Hibát találtál, vagy van egy ötleted? Írd meg nekünk! Ha megadod az e-mail címed, válaszolunk is rá.",
"fb_email": "E-mail cím (nem kötelező)",
"fb_message": "Üzenet",
"fb_attach_logs": "Naplók és hibakeresési adatok csatolása",
"fb_attach_logs_desc": "Elküldjük az alkalmazás naplóját és az eszközöd adatait (modell, Android és app verzió), így könnyebben megtaláljuk a hibát. A naplóban személyes adatok is lehetnek.",
"fb_send": "Visszajelzés küldése",
"fb_sending": "Küldés…",
"fb_sent": "Megkaptuk az üzeneted, hamarosan válaszolunk e-mailben.",
"fb_err_email_invalid": "Sajnos még nem tudunk hibás e-mail címre válaszolni.",
"fb_err_message_empty": "Írd le, miben segíthetünk.",
"fb_err_send": "Nem sikerült elküldeni az üzenetet, próbáld újra később.",
"fb_add_images": "Képek csatolása",
"fb_images_hint": "Legfeljebb 5 kép, egyenként 5 MB-ig.",
"fb_remove_image": "Kép eltávolítása",
"fb_err_image_big": "Egy kép legfeljebb 5 MB lehet.",
"fb_err_images_total": "A képek együtt legfeljebb 8 MB-ot tehetnek ki.",
"fb_sent_no_reply": "Megkaptuk az üzeneted, köszönjük!",
"fb_sent_title": "Elküldtük!"
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

406
firka/lib/l10n/app_pl.arb Normal file
View File

@@ -0,0 +1,406 @@
{
"tt_settings_toast_lesson_ab_timetable": "Dwutygodniowy plan lekcji",
"restart_title": "Uruchom ponownie aplikację",
"s_wear": "Wear OS",
"s_ag_navbar_home": "Strona główna",
"tt_holiday": "Dzień świąteczny",
"pairing": "Łączenie lekcji",
"s_c_replace_icon": "­Zmiana ikony",
"close": "Zamknij",
"ghost_grade": "Szellem jegy",
"la_privacy_required": "A Live Activity használatához el kell fogadnod az adatvédelmi tájékoztatót",
"debug_screen": "Menu deweloperskie",
"save": "Zapisz",
"starting_hour_plural": "godzina",
"ic_void_icon": "Nic",
"wearSyncNotificationText": "Óra adatainak szinkronban tartása",
"wear_pairing_check_phone": "Folytasd a párosítást a telefonodon",
"la_privacy_section2_body": "Komolyan vesszük az adataid biztonságát:\n\n• A devices és lessons táblákban lévő összes adat titkosítva van\n• Az adatokat biztonságos szerveren tároljuk\n• Csak a szükséges időtartamig tároljuk az adatokat",
"unknown_teacher": "Nieznany nauczyciel",
"la_privacy_header": "Live Activity adatvédelmi tájékoztató",
"title4": "Wiele dodatkowych rzeczy, których nigdy nie znajdziesz w Kréta.",
"gradesCount": "{count} jegy",
"@gradesCount": {
"placeholders": {
"count": {
"type": "int"
}
}
},
"s_ag_rounding": "Domyślne zaokrąglanie",
"wear_syncing": "Szinkronizálás...",
"s_ci_icon_g8": "Pride ",
"ic_lgbtq_f": "LGBTQ+",
"licensesLabel": "Licencek",
"s_c": "Dostosowanie",
"starting_hour": "godzina",
"wear_try_again": "Újra",
"title1": "Poznaj wszystko na pierwszy rzut oka",
"subtitle1": "Na górze strony głównej możesz zobaczyć przydatne informacje o swoim dniu.",
"subject_avg": "Średnia z przedmiotu",
"view_subject_btn": "Zobacz przedmiot",
"tt_winter_break": "Zimowa przerwa",
"stats_created_at": "Utworzono",
"s_n": "Értesítések",
"tt_settings_toast": "Ustawienia planu lekcji",
"refreshing": "Aktualizowanie danych...",
"la_privacy_footer": "Az adatvédelmi tájékoztató utolsó frissítése: 2025. november",
"la_privacy_section5_body": "A GDPR alapján az alábbi jogokkal rendelkezel:\n\n• Hozzáférési jog: A tárolt adatok típusát ebben az adatvédelmi tájékoztatóban tekintheted meg.\n• Törlési jog: A Live Activity funkció kikapcsolásával minden, a funkcióhoz kapcsolódó adat (eszközazonosítók, órarend) azonnal és véglegesen törlődik a szervereinkről.\n• Módosítási jog: Az órarendi adatok módosítása a Kréta rendszerben történik, az arra jogosult személyek (pl. tanárok) által.\n• Tiltakozási jog: Az adatkezelés ellen bármikor tiltakozhatsz a Live Activity funkció kikapcsolásával.",
"grades": "Oceny",
"good_afternoon": "Miłego popołudnia, {p}!",
"@good_afternoon": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tt_last_instructional_day_graduates": "Ostatni dzień zajęć dla klas kończących szkołę",
"s_ci_icon_g3": "Nostalgia",
"tt_first_instructional_day": "Pierwszy dzień nauki",
"ic_gay": "Gej",
"ic_nuke": "Nuklearny",
"noMoreClasses": "Nincs több órád ma",
"ic_lesb_f": "Lesbijka",
"s_acc_add": "Dodaj nowe konto",
"ic_old": "Domain Dave",
"licenseDescription": "Az alkalmazás által használt külső könyvtárak licencei",
"tt_autumn_break": "Jesienna przerwa",
"s_ci_icon_header": "Ikona aplikacji",
"empty_class": "Lyukasóra",
"lesson_subject": "Przedmiot lekcji",
"pairing_description": "Czy chcesz połączyć tę lekcję z aplikacją Firka?\nPo połączeniu zobaczysz plan lekcji oraz swoje najnowsze oceny, sprawdziany i zadania.",
"date": "Godzina lekcji",
"ic_szivacs": "Gąbka",
"starting_sec_plural": "sekunda",
"s_ci_icon_g6_desc": "przez @emilia6_6",
"ic_filco": "Filc . O",
"good_day": "Miłego dnia, {p}!",
"@good_day": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"tt_full_day_trip": "Całodniowa wycieczka",
"wear_pairing_request_sent": "Párosítás folyamatban, nyisd meg az appot a telefonodon",
"grade_calculator_add": "Hozzáadás",
"ic_kreta": "eFIRKA",
"subtitle2": "Zobacz statystyki, nadchodzące sprawdziany, a nawet oceny z poprzednich lat szkolnych.",
"s_n_live_activity": "Live Activity",
"wear_phone_disconnected": "Az órád nincs csatlakoztatva a telefonoddal!",
"la_privacy_section3_body": "Az adatok tárolása minimális időtartamra korlátozódik:\n\n• Live Activity push token: Addig van tárolva, amíg óráid vannak az adott napon (beleértve az első óra előtti 2 órás időszakot is). Ha nincs több órád, az érték null lesz.\n\n• Órarendi adatok: Csak az órák időtartamára tárolódnak, majd automatikusan törlődnek. Pénteken az utolsó óra után az órarendet tartalmazó tábla teljesen üres lesz.\n\n• Eszközadatok (token, azonosítók): Addig van tárolva, amíg a Live Activity funkció engedélyezve van. A funkció kikapcsolásakor ezek az adatok azonnal törlésre kerülnek.",
"tt_last_instructional_day": "Ostatni dzień nauki",
"tt_settings_toast_lesson_nos": "Numery lekcji",
"s_ci_icon_g5": "Referencja",
"tt_settings_toast_lesson_substitution": "Zastępstwa",
"tt_added": "Utworzono: ",
"la_privacy_section3_title": "Meddig tároljuk az adatokat?",
"school_ending": "Denerwujesz się, {p}?",
"@school_ending": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"s_wear_os_support": "Wear OS támogatás",
"ic_enby": "Niebinarna",
"tt_settings_toast_lesson_tests": "Sprawdziany i inne",
"happy_birthday": "Wszystkiego najlepszego, {p}!",
"@happy_birthday": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"api_error": "Błąd API Kréta",
"ic_trans_f": "Trans",
"ic_enby_f": "Niebinarna",
"ic_lidl": "Zakupy",
"tests_tomorrow": "Masz {tests} sprawdzianów",
"@tests_tomorrow": {
"placeholders": {
"tests": {
"type": "String"
}
}
},
"ic_trans": "Trans",
"s_ci_icon_g4": "Przeprojektowany",
"tt_public_holiday": "Dzień wolny od pracy",
"s_ag_language_header": "Język",
"tt_instructional_day": "Dzień zajęć szkolnych",
"ic_cc": "Chmura Kreatywna",
"la_privacy_title": "Adatvédelmi tájékoztató",
"s_ag_r1": "1 → 2",
"s_c_theme_light": "Jasny",
"title2": "Twoje przedmioty wygodnie się tutaj mieszczą",
"tomorrow_subtitle": "Oto Twój jutrzejszy dzień.",
"s_n_test": "Teszt értesítés küldése",
"starting_min_plural": "minuta",
"ic_mkkp": "Darmowe oceny",
"subjects": "­Przedmioty",
"s_c_theme_header": "Motyw",
"s_a": "Aplikacja",
"loginBtn": "Zaloguj się za pomocą konta E-Kréta",
"mark_as_not_done": "Oznacz jako nieukończone",
"wearSyncNotificationTitle": "Szinkronizálás az órával",
"mark_as_done": "­Oznacz jako ukończone",
"s_ag": "Ogólne",
"ic_xmas3": "FirŚwięta",
"data": "Dane",
"la_learn_more": "Bővebben",
"ic_pixelized": "Spikselizowany",
"other": "Więcej",
"ic_o1g": "Orbán to pizda",
"la_privacy_section2_title": "Hogyan védjük az adataidat?",
"good_night": "Miłego wieczoru, {p}!",
"@good_night": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"s_ag_r4": "4 → 5",
"s_ci_icon_g1": "Catboy domain",
"starting_min": "minuta",
"ic_pride": "Kosmiczna tęcza",
"suffering_almost_over_subtitle": "Już niedługo będziesz wolny. Uważaj na nauczyciela.",
"la_privacy_section5_title": "Jogaid",
"ghost_grades": "Szellem jegyek",
"s_customization": "Personalizacja",
"tomorrow": "Jutro",
"breakTxt": "Szünet",
"la_privacy_section1_title": "Milyen adatokat tárolunk?",
"s_ci_warning_header": "[!] W trybie debug zmiana ikony nie będzie działać",
"tt_spring_break": "Wiosenna przerwa",
"s_ag_language_hu": "Węgierski",
"tt_no_classes_l2": "Yippee!",
"class_n": "­Liczba godzin tygodniowo",
"s_settings": "Ustawienia",
"subject_avg_rounded": "Średnia z przedmiotu po zaokrągleniu",
"class_dismissed": "Odwołana lekcja",
"s_ci_icon_subtitle": "Wybierz piękną ikonę aplikacji, jeśli znudził Ci się zielony kolor.",
"s_ci_icon_g6": "Konkurs na świąteczne logo 2024",
"ic_lgbtqp": "Postęp",
"beta_title": "Firka – publiczna beta",
"la_title": "Live Activity",
"n_left_subtitle": "Wytrzymaj, zostało tylko {n} godzin!",
"@n_left_subtitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"pair": "Parowanie",
"grade_strValue": "Ocena opisowa: ",
"s_acc_kreta": "Konta eKRÉTA",
"ic_pear": "Gruszka",
"s_ag_bell_delay": "Przesunięcie dzwonka",
"s_your_account": "Twoje konto",
"wear_phone_unpaired": "Az órád nincs párosítva a telefonoddal!",
"tt_non_instructional_day": "Dzień wolny od zajęć dydaktycznych",
"b_week": "Tydzień B",
"home": "Strona główna",
"subject": "Tantárgy",
"s_c_icon_header": "Ikony aplikacji",
"cancel": "Anuluj",
"yesterday": "Wczoraj",
"ic_repont": "Pięćdziesiąt groszy",
"ic_cactus": "Kaktusowy zagajnik",
"get_ready": "Odpocznij i przygotuj się",
"ic_lesb": "Lesbijka",
"s_acc_logout": "Wyloguj się",
"stats_date": "Data",
"your_subjects": "Twoje przedmioty",
"reauth": "Wymagane logowanie",
"good_morning": "Dzień dobry, {p}!",
"@good_morning": {
"placeholders": {
"p": {
"type": "String"
}
}
},
"firstIn": "Első órád: {t}",
"@firstIn": {
"placeholders": {
"t": {
"type": "String"
}
}
},
"la_privacy_section4_title": "Mire használjuk az adatokat?",
"ic_xmas2": "Prezent",
"settings_screen": "Ustawienia",
"la_privacy_summary1": "Eszköz tokenek, Live Activity tokenek, órarendi adatok",
"title3": "Personalizowany plan lekcji",
"ic_filc": "Filc Dziennik",
"s_c_theme_dark": "Ciemny",
"grade_calculator": "Jegy kalkulátor",
"la_accept": "Elfogadom",
"s_stats_for_nerds": "Pokaż dodatkowe informacje",
"s_ag_r3": "3 → 4",
"ic_tisza": "Árad a firka",
"okay": "Ok",
"s_developer": "Ustawienia deweloperskie",
"privacyLabel": "Polityka prywatności",
"stats_last_mod": "Ostatnio zmodyfikowano",
"s_ag_navbar_desc": "Wybierz, co ma się wyświetlać na pasku nawigacyjnym, i uporządkuj elementy. Pozostałe strony są dostępne przez przycisk „więcej”. Możesz przypiąć maksymalnie 4 strony.",
"a_week": "Tydzień",
"s_ag_r2": "2 → 3",
"wearTitle": "{n}. óra",
"@wearTitle": {
"placeholders": {
"n": {
"type": "num"
}
}
},
"timetable": "Plan lekcji",
"ic_ace": "Aseksualny",
"s_ci_icon_g2": "­Pisak",
"s_ci_child_protection": "Ochrona dzieci",
"s_ag_navbar_hidden": "Ukryte",
"runningInDomainBrowser": "Przeglądarka domen",
"noClasses": "Nincs ma iskola, pihend ki magad!",
"ic_bi": "Biseksualny",
"ic_proto": "Prototyp",
"tt_first_semester_end": "Koniec pierwszego semestru",
"la_decline": "Elutasítom",
"s_c_theme_auto": "Automatyczny",
"ic_paper": "Papier",
"ic_xmas1": "Lista złych",
"s_ci_icon_g7": "Pride",
"lessons_tomorrow": "{lessons} órád lesz",
"@lessons_tomorrow": {
"placeholders": {
"lessons": {
"type": "String"
}
}
},
"ic_lgbtq": "LGBTQ+",
"subtitle3": "Wybierz, co chcesz widzieć na stronie planu lekcji. Włącz lub wyłącz sprawdziany, prace domowe, przerwy oraz okienka.",
"ic_original": "Oryginał",
"ic_refilc": "reFilc",
"la_privacy_contact": "Kérdésed van? Keress minket a support @firka.app címen.",
"tt_no_classes_l1": "W tym dniu nie masz lekcji!",
"s_ag_class_avg_on_graph": "Średnia klasy na wykresie",
"class_substitution": "Zastępstwo",
"ic_half_firka_2": "Rewolucja",
"no_tests_tomorrow": "Jutro nie masz sprawdzianu",
"overall_avg": "Összesített átlag",
"s_n_morning_time": "Értesítés ideje iskola előtt",
"ic_ace_f": "Aseksualny",
"wear_sync_with_phone": "Nyisd meg a telefonos appot a szinkronizáláshoz",
"s_ag_navbar": "Pasek nawigacyjny",
"class_avg": "Średnia klasy",
"tt_quarter_end": "koniec kwartału",
"la_privacy_section4_body": "Az adatokat kizárólag a Live Activity funkció működtetésére használjuk:\n\n• Élő órarend megjelenítése a lezárási képernyőn\n• Push értesítések küldése óraváltásokkor\n• Az órarend szinkronizálása az eszközödön\n• A hétfő reggeli értesítések kézbesítésének biztosítása a heti adatbázis-ürítés után is\n\nAz adataidat nem adjuk át harmadik félnek, és nem használjuk marketing célokra.",
"no_grades": "Z tego przedmiotu nie masz jeszcze ocen.",
"la_privacy_summary2": "Titkosított tárolás, biztonságos szerverek",
"ic_lgbtqp_f": "Postęp",
"ic_bi_f": "Biseksualny",
"now": "Most",
"la_privacy_section1_body": "A Live Activity működéséhez az alábbi adatokat tároljuk eszközazonosítóddal együtt:\n\n• Eszköz azonosító (UUID)\n• Eszköz token\n• Live Activity push token\n• APNs push token\n• Eszköz hash\n• Nyelvi beállítás\n• Csengő eltolódása\n\nAz órarendi adataid (lessons tábla) a következőket tartalmazzák:\n• Óra tárgya és időpontja\n• Tanár neve\n• Terem neve\n• Óra sorszáma\n• Óra témája\n• Helyettesítés adatai\n• Elmaradt óra jelzése\n\nAz időzített értesítések (scheduled_notifications tábla) a következőket tartalmazzák:\n• Azonosító\n• Eszköz azonosító\n• Időzített időpont\n• Küldés állapota és ideje\n• Létrehozás és frissítés ideje",
"starting_soon": "Już wkrótce zaczyna się Twoja pierwsza lekcja!",
"ic_refulc": "firk’a",
"s_ag_left_handed_mode": "Tryb dla leworęcznych",
"tt_rest_day": "Dzień wolny",
"la_privacy_summary3": "Az adatok automatikusan törlődnek, ha már nincs rájuk szükség",
"tt_settings_toast_lesson_breaks": "Przerwy",
"s_ag_language_auto": "Automatyczny",
"s_ag_navbar_visible": "Wyświetlane",
"starting_sec": "sekunda",
"la_subtitle": "Az órarended élő megjelenítése az eszköz lezárási képernyőjén",
"grade_teacherName": "Imię i nazwisko nauczyciela: ",
"ic_modern": "Nowoczesny",
"timeLeft": "Még {mins} perc",
"@timeLeft": {
"placeholders": {
"mins": {
"type": "num"
}
}
},
"s_ag_language_de": "Niemiecki",
"today": "Dziś",
"ic_gay_f": "Gej",
"ic_fidesz": "Fidesz",
"s_n_morning": "Reggeli értesítés",
"restart_body": "Kliknij tutaj, aby otworzyć aplikację.",
"s_ag_language_en": "Angielski",
"homework": "Praca domowa",
"ic_pixel": "Pixel",
"view_lesson_btn": "Zobacz lekcję",
"la_privacy_intro": "A Live Activity funkció használatához bizonyos adatokat kell tárolnunk és feldolgoznunk. Kérjük, olvasd el figyelmesen az alábbi tájékoztatót.",
"beta_body": "Aplikacja jest w trakcie rozwoju; niektóre funkcje mogą działać nieprawidłowo, nie działać lub jeszcze nie być ukończone.",
"ic_galaxy": "Galaktyka",
"copied": "Másolva",
"view_day_btn": "Zobacz dzień",
"omission": "Hiányzás",
"omissions": "Hiányzások",
"omission_state_excused": "Igazolt",
"omission_state_unexcused": "Igazolatlan",
"omission_state_pending": "Függőben",
"omissions_count": "{state, select, unexcused{{count} igazolatlan} pending{{count} igazolandó} other{{count}}} hiányzás",
"@omissions_count": {
"placeholders": {
"state": {
"type": "String"
},
"count": {
"type": "int"
}
}
},
"s_beta_warning": "Ostrzeżenie beta",
"s_ag_privacy_ever_declined": "Wcześniej odrzucono politykę prywatności",
"s_c_tab_appearance": "Wygląd aplikacji",
"s_c_tab_subjects": "Przedmioty",
"s_c_tab_fonts": "Czcionki",
"s_c_my_themes": "Moje motywy",
"s_c_manage_subjects": "Zarządzaj przedmiotami",
"s_c_change_app_icon": "Zmień ikonę aplikacji",
"s_c_colors_header": "Kolory",
"s_c_grade_colors_header": "Kolory ocen",
"s_c_title_style_header": "Styl tytułów",
"s_c_title_weight_header": "Grubość tytułów",
"s_c_title_weight_subtitle": "Nie wszystkie czcionki to obsługują",
"s_c_title_weight_thin": "Cienka",
"s_c_title_weight_thick": "Gruba",
"s_c_capitalization_header": "Wielkość liter",
"s_c_capitalization_lower": "małe litery",
"s_c_capitalization_normal": "Normalna",
"s_c_capitalization_upper": "WIELKIE LITERY",
"s_c_change": "Zmień",
"s_c_customize": "Dostosuj",
"s_c_themes_current": "Bieżący",
"s_c_themes_own": "Własne",
"s_c_themes_downloaded": "Pobrane",
"s_c_themes_share_current": "Udostępnij bieżący motyw",
"s_c_themes_create_new": "Utwórz nowy motyw",
"s_c_themes_import": "Importuj motyw",
"s_c_themes_use": "Użyj",
"s_c_themes_continue": "Kontynuuj",
"s_c_themes_own_label": "Własny motyw",
"s_c_themes_imported_label": "Zaimportowany motyw",
"s_c_themes_builtin_label": "Wbudowany motyw",
"s_c_themes_builtin_name": "Domyślny",
"s_c_themes_create_title": "Utwórz nowy motyw",
"s_c_themes_create_subtitle": "Podaj nazwę motywu",
"s_c_themes_create_placeholder": "Nazwa motywu",
"s_c_themes_delete_title": "Usuń motyw",
"s_c_themes_delete_subtitle": "Czy na pewno chcesz usunąć ten motyw? Tę czynność można cofnąć.",
"s_c_themes_delete_confirm": "Usuń",
"s_about": "O aplikacji",
"s_extras": "Dodatki",
"s_other": "Inne",
"subtitle4": ""
}

View File

@@ -0,0 +1,5 @@
files:
- source: app_hu.arb
translation: /app_%two_letters_code%.arb
bundles:
- 3

View File

@@ -16,10 +16,13 @@ import 'package:firka/ui/phone/pages/home/home_timetable_mo.dart';
import 'package:firka/ui/phone/screens/debug/debug_screen.dart';
import 'package:firka/ui/phone/screens/home/beta_screen.dart';
import 'package:firka/ui/phone/pages/error/error_page.dart';
import 'package:firka/ui/phone/screens/feedback/feedback_screen.dart';
import 'package:firka/ui/phone/screens/login/login_screen.dart';
import 'package:firka/ui/phone/screens/message/message_screen.dart';
import 'package:firka/ui/phone/screens/home/home_screen.dart';
import 'package:firka/ui/phone/screens/settings/settings_screen.dart';
import 'package:firka/ui/phone/screens/grade_colors/grade_colors_screen.dart';
import 'package:firka/ui/phone/screens/theme_editor/theme_editor_screen.dart';
import 'package:firka/ui/phone/screens/themes/theme_screen.dart';
import 'package:firka/ui/phone/screens/themes/themes_screen.dart';
import 'package:firka/ui/phone/screens/themes/user_theme.dart';
@@ -79,6 +82,17 @@ GoRouter createAppRouter() {
child: BetaScreen(initData, key: state.pageKey),
),
),
GoRoute(
path: '/feedback',
builder: (context, state) => DefaultAssetBundle(
bundle: FirkaBundle(),
child: FeedbackScreen(
initData,
error: state.extra as String?,
key: state.pageKey,
),
),
),
GoRoute(
path: '/debug',
builder: (context, state) => DefaultAssetBundle(
@@ -115,6 +129,20 @@ GoRouter createAppRouter() {
);
},
),
GoRoute(
path: '/grade-colors',
builder: (context, state) => DefaultAssetBundle(
bundle: FirkaBundle(),
child: GradeColorsScreen(initData, key: state.pageKey),
),
),
GoRoute(
path: '/theme-editor',
builder: (context, state) => DefaultAssetBundle(
bundle: FirkaBundle(),
child: ThemeEditorScreen(initData, key: state.pageKey),
),
),
GoRoute(
path: '/message',
builder: (context, state) {
@@ -235,6 +263,8 @@ String get _initialLocation {
String? _redirect(BuildContext context, GoRouterState state) {
if (!initDone) return null;
final location = state.matchedLocation;
// people who can not log in need it the most
if (location == '/feedback') return null;
final hasTokens = initData.client != null;
final betaWarning = Settings.betaWarning.value;

View File

@@ -22,18 +22,26 @@ class ShellWithNavBar extends StatelessWidget {
final data = initData;
final currentIndex = navigationShell.currentIndex;
final bottomBg =
appStyle.colors.backgroundGradient?.last ?? appStyle.colors.background;
return Scaffold(
backgroundColor: appStyle.colors.background,
body: child,
backgroundColor: Colors.transparent,
body: Container(
decoration: BoxDecoration(
color: appStyle.colors.backgroundLinearGradient == null
? appStyle.colors.background
: null,
gradient: appStyle.colors.backgroundLinearGradient,
),
child: child,
),
bottomNavigationBar: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.bottomCenter,
end: Alignment.topCenter,
colors: [
appStyle.colors.background,
appStyle.colors.background.withValues(alpha: 0.0),
],
colors: [bottomBg, bottomBg.withValues(alpha: 0.0)],
stops: const [0.0, 1.0],
),
),

View File

@@ -41,7 +41,11 @@ class AlarmNotificationService {
_isInitialized = true;
_logger.info('AlarmNotificationService initialized');
} catch (e, st) {
_logger.severe('Failed to initialize AlarmNotificationService: $e', e, st);
_logger.severe(
'Failed to initialize AlarmNotificationService: $e',
e,
st,
);
}
}

View File

@@ -69,7 +69,8 @@ class FcmService {
static Future<AuthorizationStatus?> permissionStatus() async {
if (!_isInitialized) return null;
try {
final settings = await FirebaseMessaging.instance.getNotificationSettings();
final settings = await FirebaseMessaging.instance
.getNotificationSettings();
return settings.authorizationStatus;
} catch (e) {
_logger.warning('Error reading notification permission status: $e');
@@ -88,15 +89,14 @@ class FcmService {
options: DefaultFirebaseOptions.currentPlatform,
);
FirebaseMessaging.onBackgroundMessage(
firebaseMessagingBackgroundHandler,
);
FirebaseMessaging.onBackgroundMessage(firebaseMessagingBackgroundHandler);
await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
alert: true,
badge: true,
sound: true,
);
await FirebaseMessaging.instance
.setForegroundNotificationPresentationOptions(
alert: true,
badge: true,
sound: true,
);
FirebaseMessaging.instance.onTokenRefresh.listen((token) {
_cachedToken = token;
@@ -147,7 +147,11 @@ class FcmService {
body: '${DateTime.now().toIso8601String()} - ${_channelLabel(message)}',
);
} catch (e, st) {
_logger.warning('Failed to show debug FCM message notification: $e', e, st);
_logger.warning(
'Failed to show debug FCM message notification: $e',
e,
st,
);
}
}
@@ -218,7 +222,8 @@ class FcmService {
static Future<void> _register({required String studentId}) async {
try {
final token = _cachedToken ??= await FirebaseMessaging.instance.getToken();
final token = _cachedToken ??= await FirebaseMessaging.instance
.getToken();
if (token == null) {
_logger.warning('No FCM token available to register');
return;
@@ -329,7 +334,11 @@ class FcmService {
notifyMessages: Settings.notifyMessages.value,
);
} catch (e, st) {
_logger.severe('Failed to update FCM notification preferences: $e', e, st);
_logger.severe(
'Failed to update FCM notification preferences: $e',
e,
st,
);
}
}
}

View File

@@ -15,7 +15,8 @@ class LocalNotificationService {
FlutterLocalNotificationsPlugin();
static bool _initialized = false;
static final List<({int id, String title, String body})> postedNotifications = [];
static final List<({int id, String title, String body})> postedNotifications =
[];
static Future<void> init() async {
if (_initialized) return;

View File

@@ -12,6 +12,7 @@ import 'package:firka/core/settings/settings_repository.dart';
import 'package:firka/core/settings/settings_schema.dart';
import 'package:firka/services/alarm_notification_service.dart';
import 'package:firka/services/fcm_service.dart';
import 'package:firka/services/progress_notification_service.dart';
class NotificationDeliveryService {
static final Logger _logger = Logger('NotificationDeliveryService');
@@ -59,14 +60,18 @@ class NotificationDeliveryService {
return configured;
}
final gms = await isGmsAvailable();
return gms ? NotificationDeliveryMethod.fcm : NotificationDeliveryMethod.alarm;
return gms
? NotificationDeliveryMethod.fcm
: NotificationDeliveryMethod.alarm;
}
static Future<void> initialize() async {
if (!_isAndroid) return;
final gms = await isGmsAvailable();
_logger.info('Initializing NotificationDeliveryService (GMS available: $gms)');
_logger.info(
'Initializing NotificationDeliveryService (GMS available: $gms)',
);
await AlarmNotificationService.initialize();
@@ -82,14 +87,18 @@ class NotificationDeliveryService {
try {
if (!Settings.notifyAll.value) {
_logger.info('Push notifications disabled, tearing down delivery backends');
_logger.info(
'Push notifications disabled, tearing down delivery backends',
);
await FcmService.handleEnabledChange(false);
await AlarmNotificationService.cancel();
return;
}
final effectiveMethod = await getEffectiveMethod();
_logger.info('Syncing delivery backend for effective method: $effectiveMethod');
_logger.info(
'Syncing delivery backend for effective method: $effectiveMethod',
);
switch (effectiveMethod) {
case NotificationDeliveryMethod.fcm:
@@ -103,6 +112,8 @@ class NotificationDeliveryService {
case NotificationDeliveryMethod.auto:
break;
}
await ProgressNotificationService.sync();
} catch (e, st) {
_logger.warning('Failed to sync delivery backend: $e', e, st);
}

View File

@@ -19,6 +19,7 @@ import 'package:firka/core/settings/settings_schema.dart';
import 'package:firka/data/widget.dart';
import 'package:firka/services/fcm_headless_bootstrap.dart';
import 'package:firka/services/local_notification_service.dart';
import 'package:firka/services/progress_notification_service.dart';
/// Runs on a silent FCM wakeup: for every locally logged-in account, fetches
/// grades/homework/tests/absences/lessons/messages, diffs each against what
@@ -43,9 +44,15 @@ class NotificationDiffService {
final client = KretaClient(token);
await _checkAccount(client, token.key, token.username);
} catch (e, st) {
_logger.warning('checkAll: account ${token.username} failed: $e', e, st);
_logger.warning(
'checkAll: account ${token.username} failed: $e',
e,
st,
);
}
}
await ProgressNotificationService.checkAndStartIfActive();
}
static Future<void> _checkAccount(
@@ -59,10 +66,18 @@ class NotificationDiffService {
await _diffAndNotify(
accountKey: accountKey,
kind: LastSeenHelper.notifGrades,
items: _excludeMuted(await client.getGrades(), mutedSubjects, (g) => g.subject.value?.name),
title: (n) => n.length == 1 ? 'Új jegy érkezett' : '${n.length} új jegy érkezett',
items: _excludeMuted(
await client.getGrades(),
mutedSubjects,
(g) => g.subject.value?.name,
),
title: (n) =>
n.length == 1 ? 'Új jegy érkezett' : '${n.length} új jegy érkezett',
body: (n) => n
.map((g) => '${g.subject.value?.name ?? "?"}: ${g.textValue} (${_fmtDate(g.writtenAt)})')
.map(
(g) =>
'${g.subject.value?.name ?? "?"}: ${g.textValue} (${_fmtDate(g.writtenAt)})',
)
.take(5)
.join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifGrades),
@@ -73,17 +88,28 @@ class NotificationDiffService {
await _diffAndNotify(
accountKey: accountKey,
kind: LastSeenHelper.notifHomework,
items: _excludeMuted(await client.getHomework(), mutedSubjects, (h) => h.subject.value?.name),
title: (n) => n.length == 1 ? 'Új házi feladat' : '${n.length} új házi feladat',
body: (n) => n.map((h) => h.subject.value?.name ?? "?").take(5).join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifHomework),
items: _excludeMuted(
await client.getHomework(),
mutedSubjects,
(h) => h.subject.value?.name,
),
title: (n) =>
n.length == 1 ? 'Új házi feladat' : '${n.length} új házi feladat',
body: (n) =>
n.map((h) => h.subject.value?.name ?? "?").take(5).join(', '),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifHomework,
),
);
await _diffAndNotify(
accountKey: accountKey,
kind: LastSeenHelper.notifTests,
items: await client.getTests(),
title: (n) => n.length == 1 ? 'Új témazáró/dolgozat' : '${n.length} új témazáró/dolgozat',
title: (n) => n.length == 1
? 'Új témazáró/dolgozat'
: '${n.length} új témazáró/dolgozat',
body: (n) => n.map((t) => t.topic ?? t.method).take(5).join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifTests),
);
@@ -94,17 +120,26 @@ class NotificationDiffService {
accountKey: accountKey,
kind: LastSeenHelper.notifAbsences,
items: await client.getOmissions(),
title: (n) => n.length == 1 ? 'Új hiányzás/késés' : '${n.length} új hiányzás/késés',
title: (n) => n.length == 1
? 'Új hiányzás/késés'
: '${n.length} új hiányzás/késés',
body: (n) => n.map((o) => o.state.name).take(5).join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifAbsences),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifAbsences,
),
);
}
final now = DateTime.now();
final lessons = await client.getLessons(now, now.add(const Duration(days: 7)));
final lessons = await client.getLessons(
now,
now.add(const Duration(days: 7)),
);
final selectedToken = Settings.getSelectedToken();
final isActiveAccount = selectedToken == null || selectedToken.key == accountKey;
final isActiveAccount =
selectedToken == null || selectedToken.key == accountKey;
if (isActiveAccount) {
await _checkAndUpdateWidget(lessons);
}
@@ -126,7 +161,8 @@ class NotificationDiffService {
accountKey: accountKey,
kind: LastSeenHelper.notifLessonsCancelled,
items: cancelled,
title: (n) => n.length == 1 ? 'Elmaradt óra' : '${n.length} elmaradt óra',
title: (n) =>
n.length == 1 ? 'Elmaradt óra' : '${n.length} elmaradt óra',
body: (n) => n
.map(
(l) =>
@@ -135,14 +171,18 @@ class NotificationDiffService {
)
.take(5)
.join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifLessonsCancelled),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifLessonsCancelled,
),
);
await _diffAndNotify(
accountKey: accountKey,
kind: LastSeenHelper.notifLessonsSubstituted,
items: substituted,
title: (n) => n.length == 1 ? 'Helyettesítés' : '${n.length} helyettesítés',
title: (n) =>
n.length == 1 ? 'Helyettesítés' : '${n.length} helyettesítés',
body: (n) => n
.map(
(l) =>
@@ -151,21 +191,29 @@ class NotificationDiffService {
)
.take(5)
.join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifLessonsSubstituted),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifLessonsSubstituted,
),
);
await _diffAndNotify(
accountKey: accountKey,
kind: LastSeenHelper.notifLessons,
items: otherChanges,
title: (n) => n.length == 1
? 'Órarendváltozás'
: '${n.length} órarendváltozás',
title: (n) =>
n.length == 1 ? 'Órarendváltozás' : '${n.length} órarendváltozás',
body: (n) => n
.map((l) => '${l.subject.value?.name ?? l.name} (${l.roomName ?? "?"})')
.map(
(l) =>
'${l.subject.value?.name ?? l.name} (${l.roomName ?? "?"})',
)
.take(5)
.join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifLessons),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifLessons,
),
);
}
@@ -180,7 +228,10 @@ class NotificationDiffService {
items: combined,
title: (n) => n.length == 1 ? 'Új üzenet' : '${n.length} új üzenet',
body: (n) => n.map((m) => m.title).take(5).join(', '),
notificationId: _notificationId(accountKey, LastSeenHelper.notifMessages),
notificationId: _notificationId(
accountKey,
LastSeenHelper.notifMessages,
),
);
}
}
@@ -246,7 +297,9 @@ class NotificationDiffService {
static int _notificationId(int accountKey, String kind) =>
Object.hash(accountKey, kind) & 0x7fffffff;
static Future<void> _checkAndUpdateWidget(List<LessonCacheModel> lessons) async {
static Future<void> _checkAndUpdateWidget(
List<LessonCacheModel> lessons,
) async {
try {
final dataDir = await getApplicationDocumentsDirectory();
final widgetFile = File(p.join(dataDir.path, "widget_state.json"));
@@ -259,7 +312,10 @@ class NotificationDiffService {
}
}
static bool _hasTimetableChanged(List<LessonCacheModel> lessons, File widgetFile) {
static bool _hasTimetableChanged(
List<LessonCacheModel> lessons,
File widgetFile,
) {
if (!widgetFile.existsSync()) return true;
try {
final content = jsonDecode(widgetFile.readAsStringSync());
@@ -341,7 +397,8 @@ class NotificationDiffService {
LastSeenHelper.notifMessages: (
titleSingle: 'Új üzeneted érkezett',
titleMulti: 'Új üzenet érkezett',
body: 'Nulladik óra átnevezése első órára - Müller Attila (2026-01-15 07:42)',
body:
'Nulladik óra átnevezése első órára - Müller Attila (2026-01-15 07:42)',
),
};

View File

@@ -0,0 +1,269 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:isar_community/isar.dart';
import 'package:logging/logging.dart';
import 'package:firka_common/core/debug_helper.dart';
import 'package:firka_common/data/database.dart';
import 'package:firka_common/data/models/lesson_cache_model.dart';
import 'package:firka/app/app_state.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/l10n/app_localizations.dart';
import 'package:firka/services/notification_delivery_service.dart';
class ProgressNotificationService {
static final Logger _logger = Logger('ProgressNotificationService');
static const MethodChannel _channel = MethodChannel(
'app.firka/progress_notification',
);
@visibleForTesting
static bool? isAndroidOverride;
static bool get _isAndroid => isAndroidOverride ?? Platform.isAndroid;
/// Syncs notification string templates from Flutter ARB localizations to Android SharedPreferences.
static Future<void> syncStrings([AppLocalizations? l10n]) async {
if (!_isAndroid) return;
try {
l10n ??= initDone ? initData.l10n : null;
if (l10n == null) return;
final strings = <String, String>{
'progress_notif_channel_name': l10n.progress_notif_channel_name,
'progress_notif_channel_desc': l10n.progress_notif_channel_desc,
'progress_notif_lesson_title': l10n.progress_notif_lesson_title(
'{number}',
'{name}',
),
'progress_notif_substitution': l10n.progress_notif_substitution,
'progress_notif_case1_text': l10n.progress_notif_case1_text(
'{minutes}',
'{timeRange}',
'{room}',
'{substitution}',
'{remaining}',
),
'progress_notif_case2_lesson_text': l10n
.progress_notif_case2_lesson_text(
'{minutes}',
'{timeRange}',
'{room}',
'{substitution}',
'{remaining}',
),
'progress_notif_case2_break_title':
l10n.progress_notif_case2_break_title,
'progress_notif_case2_break_text': l10n.progress_notif_case2_break_text(
'{minutes}',
'{remaining}',
),
'progress_notif_critical_text': l10n.progress_notif_critical_text(
'{minutes}',
),
'progress_notif_remaining_lessons_one':
l10n.progress_notif_remaining_lessons_one,
'progress_notif_remaining_lessons_other': l10n
.progress_notif_remaining_lessons_other('{count}'),
};
await _channel.invokeMethod<bool>('updateProgressStrings', strings);
_logger.info('Synced progress notification strings to native platform');
} catch (e, st) {
_logger.warning(
'Failed to sync progress notification strings: $e',
e,
st,
);
}
}
static Future<bool> startService() async {
if (!_isAndroid) return false;
try {
await syncStrings();
final res = await _channel.invokeMethod<bool>('startProgressService');
_logger.info('Started ProgressNotificationForegroundService: $res');
return res ?? true;
} catch (e, st) {
_logger.warning(
'Failed to start ProgressNotificationForegroundService: $e',
e,
st,
);
return false;
}
}
static Future<bool> stopService() async {
if (!_isAndroid) return false;
try {
final res = await _channel.invokeMethod<bool>('stopProgressService');
_logger.info('Stopped ProgressNotificationForegroundService: $res');
return res ?? true;
} catch (e, st) {
_logger.warning(
'Failed to stop ProgressNotificationForegroundService: $e',
e,
st,
);
return false;
}
}
static Future<bool> schedule6AmAlarm() async {
if (!_isAndroid) return false;
try {
final res = await _channel.invokeMethod<bool>('schedule6AmAlarm');
_logger.info('Scheduled 6 AM progress alarm: $res');
return res ?? true;
} catch (e, st) {
_logger.warning('Failed to schedule 6 AM progress alarm: $e', e, st);
return false;
}
}
static Future<bool> cancel6AmAlarm() async {
if (!_isAndroid) return false;
try {
final res = await _channel.invokeMethod<bool>('cancel6AmAlarm');
_logger.info('Cancelled 6 AM progress alarm: $res');
return res ?? true;
} catch (e, st) {
_logger.warning('Failed to cancel 6 AM progress alarm: $e', e, st);
return false;
}
}
static Future<bool> isRunning() async {
if (!_isAndroid) return false;
try {
final res = await _channel.invokeMethod<bool>('isProgressServiceRunning');
return res ?? false;
} catch (e, st) {
_logger.warning(
'Failed to check if progress service is running: $e',
e,
st,
);
return false;
}
}
/// Syncs service state based on current settings and delivery method.
static Future<void> sync() async {
if (!_isAndroid) return;
await syncStrings();
final isEnabled =
Settings.progressNotificationEnabled.value && Settings.notifyAll.value;
if (!isEnabled) {
_logger.info(
'Progress notifications disabled, stopping service and cancelling alarm',
);
await stopService();
await cancel6AmAlarm();
return;
}
final deliveryMethod =
await NotificationDeliveryService.getEffectiveMethod();
if (deliveryMethod == NotificationDeliveryMethod.alarm) {
await schedule6AmAlarm();
} else {
await cancel6AmAlarm();
}
await checkAndStartIfActive();
}
/// Checks if current time is on/after the start date (first lesson start)
/// and before the last lesson ends. If so, and the progress-centric
/// notification is not running, starts it up.
static Future<void> checkAndStartOnAppOpen() async {
if (!_isAndroid) return;
if (!Settings.progressNotificationEnabled.value ||
!Settings.notifyAll.value)
return;
try {
final now = timeNow();
final startOfDay = DateTime(now.year, now.month, now.day);
final endOfDay = DateTime(now.year, now.month, now.day, 23, 59, 59);
var lessons = await isarInit.lessonCacheModels
.filter()
.startBetween(startOfDay, endOfDay)
.sortByStart()
.findAll();
if (lessons.isEmpty) {
lessons = await isarInit.lessonCacheModels
.filter()
.on(now)
.sortByStart()
.findAll();
}
if (lessons.isEmpty) {
_logger.info(
'No lessons for today; not starting progress service on app open',
);
return;
}
final firstLesson = lessons.first;
final lastLesson = lessons.last;
final startDate = firstLesson.start;
final isAboveStartDate =
now.isAfter(startDate) || now.isAtSameMomentAs(startDate);
final isBelowLastLesson = now.isBefore(lastLesson.end);
if (!isAboveStartDate) {
_logger.info(
'Current time ($now) is before start date ($startDate); not starting progress service',
);
return;
}
if (!isBelowLastLesson) {
_logger.info(
'Current time ($now) is after last lesson end (${lastLesson.end}); stopping/not starting progress service',
);
final running = await isRunning();
if (running) {
await stopService();
}
return;
}
final running = await isRunning();
if (!running) {
_logger.info(
'Time is within school day and progress service is not running; starting up',
);
await WidgetCacheHelper.updateWidgetCacheFromIsar();
await startService();
} else {
_logger.info('Progress service is already running');
}
} catch (e, st) {
_logger.warning('Error in checkAndStartOnAppOpen: $e', e, st);
}
}
/// Checks if today has lessons and if current time is within active bounds.
static Future<void> checkAndStartIfActive() async {
await checkAndStartOnAppOpen();
}
/// Called on app startup in the morning.
static Future<void> checkAndStartOnMorning() async {
await sync();
}
}

View File

@@ -0,0 +1,56 @@
import 'dart:async';
import 'dart:math' as math;
import 'package:flutter/foundation.dart';
import 'package:sensors_plus/sensors_plus.dart';
/// calls [onShake] when the phone is shaken: a few hard jolts within a second.
class ShakeDetector {
static const _gravity = 9.81;
/// how far the pull may be from gravity (m/s²) before it counts as a jolt
static const _joltThreshold = 14.0;
static const _joltsNeeded = 3;
static const _window = Duration(milliseconds: 1000);
/// two samples of one jolt are one jolt
static const _minGap = Duration(milliseconds: 120);
static const _cooldown = Duration(seconds: 3);
final VoidCallback onShake;
final _jolts = <DateTime>[];
StreamSubscription<AccelerometerEvent>? _subscription;
DateTime? _lastShake;
ShakeDetector(this.onShake);
void start() {
_subscription ??= accelerometerEventStream(
samplingPeriod: SensorInterval.gameInterval,
).listen((event) => handle(event.x, event.y, event.z, DateTime.now()));
}
void stop() {
_subscription?.cancel();
_subscription = null;
_jolts.clear();
}
@visibleForTesting
void handle(double x, double y, double z, DateTime now) {
final pull = math.sqrt(x * x + y * y + z * z);
if ((pull - _gravity).abs() < _joltThreshold) return;
final last = _lastShake;
if (last != null && now.difference(last) < _cooldown) return;
if (_jolts.isNotEmpty && now.difference(_jolts.last) < _minGap) return;
_jolts
..add(now)
..removeWhere((jolt) => now.difference(jolt) > _window);
if (_jolts.length >= _joltsNeeded) {
_jolts.clear();
_lastShake = now;
onShake();
}
}
}

View File

@@ -1,114 +0,0 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/services.dart';
import 'package:watch_connectivity/watch_connectivity.dart';
import 'package:firka/app/app_state.dart';
import 'package:firka/services/wear_sync_cache.dart';
import 'package:firka/api/client/kreta_client.dart';
/// Helper class for Wear OS sync (Android).
class WatchSyncHelper {
static const _wearSyncChannel = MethodChannel('app.firka/wear_sync');
static WatchConnectivity? _androidWatchConnectivity;
static WatchConnectivity get _watchConnectivityAndroid {
_androidWatchConnectivity ??= WatchConnectivity();
return _androidWatchConnectivity!;
}
/// Callback for Watch pairing message events (Android Wear OS pairing flow).
/// Set by initialization_screen.dart to handle "ping" messages for Watch pairing.
static void Function(Map<String, dynamic> message)? onWatchMessage;
/// Send a fire-and-forget message to Watch via watch_connectivity (Android).
/// The payload is sent as a JSON string for reliable transport.
static Future<void> sendMessageToWatch(Map<String, dynamic> message) async {
if (!Platform.isAndroid) return;
await _watchConnectivityAndroid.sendMessage(<String, dynamic>{
'data': jsonEncode(message),
});
}
/// Starts the Wear sync foreground service (Android only). Call after writing initial cache.
/// [appDirPath] is the application documents directory path (for the background isolate).
static Future<void> startWearSyncService(
String cachePath,
String appDirPath,
) async {
if (!Platform.isAndroid) return;
await _wearSyncChannel.invokeMethod<void>(
'startWearSyncService',
<String, dynamic>{'cachePath': cachePath, 'appDirPath': appDirPath},
);
}
/// Builds fresh sync payload, writes cache, and starts the Wear sync service (Android only).
/// Use when enabling Wear OS support or on app launch when support is already enabled.
static Future<void> startWearSyncServiceWithFreshCache(
KretaClient client,
String appDirPath,
) async {
if (!Platform.isAndroid) return;
final payload = await buildWearSyncPayload(client);
if (payload == null) return;
final path = await getWearSyncCachePath();
await writeWearSyncCache(path, payload);
await startWearSyncService(path, appDirPath);
}
/// Sets the method call handler for getLocalizedString (Android). Call once when initData is ready.
static void setWearSyncMethodCallHandler() {
if (!Platform.isAndroid) return;
_wearSyncChannel.setMethodCallHandler((MethodCall call) async {
if (call.method == 'getLocalizedString') {
final key = call.arguments as String?;
return getLocalizedString(key);
}
return null;
});
}
/// Returns the localized string for [key] from l10n. Used by Kotlin for notification title/text.
static String? getLocalizedString(String? key) {
if (key == null || !initDone) return null;
switch (key) {
case 'wearSyncNotificationTitle':
return initData.l10n.wearSyncNotificationTitle;
case 'wearSyncNotificationText':
return initData.l10n.wearSyncNotificationText;
default:
return null;
}
}
/// Stops the Wear sync foreground service (Android only).
static Future<void> stopWearSyncService() async {
if (!Platform.isAndroid) return;
await _wearSyncChannel.invokeMethod<void>('stopWearSyncService');
}
/// Runs sync in foreground: fetches timetable + grades, writes cache, sends sync_data to watch.
/// Used when app is in foreground and watch sends request_sync (Android) or equivalent.
static Future<void> runWearSyncInForeground(KretaClient client) async {
final payload = await buildWearSyncPayload(client);
if (payload == null) return;
final path = await getWearSyncCachePath();
await writeWearSyncCache(path, payload);
await sendMessageToWatch(<String, dynamic>{'id': 'sync_data', ...payload});
}
/// Stream of messages from the watch (Android: watch_connectivity). Use for request_sync etc.
static Stream<Map<String, dynamic>> get watchMessageStream {
if (!Platform.isAndroid) return const Stream.empty();
return _watchConnectivityAndroid.messageStream.map((m) {
final map = Map<String, dynamic>.from(m);
final data = map['data'];
if (data is String) {
return jsonDecode(data) as Map<String, dynamic>;
}
return map;
});
}
}

View File

@@ -5,7 +5,6 @@ import 'package:path_provider/path_provider.dart'
show getApplicationDocumentsDirectory;
import 'package:firka/api/client/kreta_client.dart';
import 'package:kreta_api/kreta_api.dart';
import 'package:firka/core/debug_helper.dart';
/// File name for the Wear OS sync cache written by the phone (Dart isolate or main).
@@ -28,15 +27,15 @@ const String wearSyncCacheFileName = 'wear_sync_cache.json';
/// Builds the sync payload (same shape as init_data / sync_data): timetable (2 weeks), grades, lastSyncAt.
Future<Map<String, dynamic>?> buildWearSyncPayload(KretaClient client) async {
final (start, end) = getWearSyncTimetableRange();
await client.getLessons(start, end);
await client.getGrades();
final lessons = await client.getLessons(start, end);
final grades = await client.getGrades();
final now = timeNow();
final timetable = (<Lesson>[]).map((l) => l.toJson()).toList();
final grades = (<Grade>[]).map((g) => g.toJson()).toList();
final timetable = lessons.map((l) => l.toJson()).toList();
final gradesJson = grades.map((g) => g.toJson()).toList();
return {
'lastSyncAt': now.toUtc().toIso8601String(),
'timetable': timetable,
'grades': grades,
'grades': gradesJson,
};
}

View File

@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
@@ -5,30 +6,33 @@ import 'package:flutter/services.dart';
import 'package:watch_connectivity/watch_connectivity.dart';
import 'package:firka/app/app_state.dart';
import 'package:firka/api/client/kreta_client.dart';
import 'package:firka/services/wear_sync_cache.dart';
import 'package:firka/api/client/kreta_client.dart';
/// Helper for Wear OS ↔ phone communication (Android only).
/// Handles sync service, watch_connectivity messages, and sending data to the watch.
class WearSyncHelper {
WearSyncHelper._();
/// Helper class for Wear OS sync (Android).
class WatchSyncHelper {
static const _wearSyncChannel = MethodChannel('app.firka/wear_sync');
static WatchConnectivity? _watchConnectivity;
static WatchConnectivity get _watchConnectivityInstance {
_watchConnectivity ??= WatchConnectivity();
return _watchConnectivity!;
static WatchConnectivity? _androidWatchConnectivity;
static WatchConnectivity get _watchConnectivityAndroid {
_androidWatchConnectivity ??= WatchConnectivity();
return _androidWatchConnectivity!;
}
/// Sends a fire-and-forget message to the Wear OS watch (payload sent as JSON string).
/// Callback for Watch pairing message events (Android Wear OS pairing flow).
/// Set by initialization_screen.dart to handle "ping" messages for Watch pairing.
static void Function(Map<String, dynamic> message)? onWatchMessage;
/// Send a fire-and-forget message to Watch via watch_connectivity (Android).
/// The payload is sent as a JSON string for reliable transport.
static Future<void> sendMessageToWatch(Map<String, dynamic> message) async {
if (!Platform.isAndroid) return;
await _watchConnectivityInstance.sendMessage(<String, dynamic>{
await _watchConnectivityAndroid.sendMessage(<String, dynamic>{
'data': jsonEncode(message),
});
}
/// Starts the Wear sync foreground service (Android only).
/// Starts the Wear sync foreground service (Android only). Call after writing initial cache.
/// [appDirPath] is the application documents directory path (for the background isolate).
static Future<void> startWearSyncService(
String cachePath,
String appDirPath,
@@ -41,6 +45,7 @@ class WearSyncHelper {
}
/// Builds fresh sync payload, writes cache, and starts the Wear sync service (Android only).
/// Use when enabling Wear OS support or on app launch when support is already enabled.
static Future<void> startWearSyncServiceWithFreshCache(
KretaClient client,
String appDirPath,
@@ -85,8 +90,8 @@ class WearSyncHelper {
}
/// Runs sync in foreground: fetches timetable + grades, writes cache, sends sync_data to watch.
/// Used when app is in foreground and watch sends request_sync (Android) or equivalent.
static Future<void> runWearSyncInForeground(KretaClient client) async {
if (!Platform.isAndroid) return;
final payload = await buildWearSyncPayload(client);
if (payload == null) return;
final path = await getWearSyncCachePath();
@@ -94,10 +99,10 @@ class WearSyncHelper {
await sendMessageToWatch(<String, dynamic>{'id': 'sync_data', ...payload});
}
/// Stream of messages from the Wear OS watch. Empty when not on Android.
/// Stream of messages from the watch (Android: watch_connectivity). Use for request_sync etc.
static Stream<Map<String, dynamic>> get watchMessageStream {
if (!Platform.isAndroid) return const Stream.empty();
return _watchConnectivityInstance.messageStream.map((m) {
return _watchConnectivityAndroid.messageStream.map((m) {
final map = Map<String, dynamic>.from(m);
final data = map['data'];
if (data is String) {

View File

@@ -0,0 +1,87 @@
import "package:flutter/material.dart";
import "package:firka/ui/theme/style.dart";
import "package:firka_common/ui/components/firka_card.dart";
class ColorSlider extends StatelessWidget {
final double value;
final LinearGradient trackGradient;
final Color thumbColor;
final ValueChanged<double> onChanged;
const ColorSlider({
required this.value,
required this.trackGradient,
required this.thumbColor,
required this.onChanged,
super.key,
});
static const _trackHeight = 52.0;
static const _thumbSize = 28.0;
static const _thumbRadius = _thumbSize / 2;
static const _edgePad = 16.0;
void _setFromLocalX(double localX, double width) {
final start = _edgePad + _thumbRadius;
final end = width - _edgePad - _thumbRadius;
if (end <= start) return;
final t = ((localX - start) / (end - start)).clamp(0.0, 1.0);
onChanged(t);
}
@override
Widget build(BuildContext context) {
return FirkaCard.single(
width: double.infinity,
height: _trackHeight,
padding: EdgeInsets.zero,
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: LayoutBuilder(
builder: (context, constraints) {
final width = constraints.maxWidth;
final start = _edgePad + _thumbRadius;
final end = width - _edgePad - _thumbRadius;
final thumbLeft = start + value * (end - start) - _thumbRadius;
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTapDown: (d) => _setFromLocalX(d.localPosition.dx, width),
onHorizontalDragUpdate: (d) =>
_setFromLocalX(d.localPosition.dx, width),
child: Stack(
fit: StackFit.expand,
children: [
Container(decoration: BoxDecoration(gradient: trackGradient)),
Positioned(
left: thumbLeft,
top: (_trackHeight - _thumbSize) / 2,
child: Container(
width: _thumbSize,
height: _thumbSize,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: thumbColor,
border: Border.all(
color: appStyle.colors.buttonSecondaryFill,
width: 3,
),
boxShadow: [
BoxShadow(
color: appStyle.colors.shadowColor,
offset: const Offset(0, 1),
blurRadius: appStyle.isLight ? 3 : 0,
),
],
),
),
),
],
),
);
},
),
),
);
}
}

View File

@@ -28,6 +28,7 @@ import 'package:firka/ui/phone/widgets/lesson.dart';
import 'package:go_router/go_router.dart';
import 'package:firka/ui/shared/class_icon.dart';
import 'package:firka_common/ui/components/firka_card.dart';
import 'package:firka/ui/components/stats_table.dart';
import 'package:firka_common/ui/components/grade.dart';
Future<void> showFirkaBottomSheet(
@@ -47,34 +48,40 @@ Future<void> showFirkaBottomSheet(
Align(
alignment: AlignmentGeometry.bottomCenter,
child: Container(
width: double.infinity,
constraints: BoxConstraints(
maxHeight: MediaQuery.sizeOf(context).height * 0.85,
),
padding: const EdgeInsets.all(20) - EdgeInsets.only(top: 20),
decoration: BoxDecoration(
color: appStyle.colors.background,
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
),
child: SelectionArea(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Align(
heightFactor: 0,
alignment: Alignment.topCenter,
child: Container(
margin: EdgeInsets.only(top: 18),
width: 40,
height: 4,
foregroundDecoration: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadiusGeometry.circular(2),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Align(
heightFactor: 0,
alignment: Alignment.topCenter,
child: Container(
margin: EdgeInsets.only(top: 18),
width: 40,
height: 4,
foregroundDecoration: ShapeDecoration(
shape: RoundedRectangleBorder(
borderRadius: BorderRadiusGeometry.circular(2),
),
color: appStyle.colors.shadowColor,
),
color: appStyle.colors.shadowColor,
),
),
),
SizedBox(height: 40),
...children,
],
SizedBox(height: 40),
...children,
],
),
),
),
),
@@ -100,15 +107,47 @@ Future<void> showLessonBottomSheet(
final y2k = DateTime(2000, 1);
String fmt(DateTime? dt) => (dt != null && dt.isAfter(y2k))
? dt.format(data.l10n, FormatMode.yyyymmddhhmmss)
: 'N/A';
if (statsForNerdsEnabled) {
final stats =
"${data.l10n.stats_date}: ${lesson.start.isAfter(y2k) ? lesson.start.format(data.l10n, FormatMode.yyyymmddhhmmss) : "N/A"}\n"
"${data.l10n.stats_created_at}: ${lesson.createdAt.isAfter(y2k) ? lesson.createdAt.format(data.l10n, FormatMode.yyyymmddhhmmss) : "N/A"}\n";
//"${data.l10n.stats_last_mod}: ${lesson.lastModifiedAt.isAfter(y2k) ? lesson.lastModifiedAt.format(data.l10n, FormatMode.yyyymmddhhmmss) : "N/A"}";
statsForNerds = Text(
stats,
style: appStyle.fonts.B_16R.apply(color: appStyle.colors.textPrimary),
);
final cg = lesson.classGroup.loadAndGet();
final subj = lesson.subject.loadAndGet();
final hw = lesson.homework.loadAndGet();
final tst = lesson.test.loadAndGet();
final omission = lesson.omission.loadAndGet();
final rows = <(String, String)>[
('id (cache key)', lesson.cacheKey.toString()),
('uid (kréta)', lesson.uid ?? 'N/A'),
('name', lesson.name),
('state', lesson.state),
('type', lesson.type),
('start', fmt(lesson.start)),
('end', fmt(lesson.end)),
('last modified (kréta)', fmt(lesson.createdAt)),
('room', lesson.roomName ?? 'N/A'),
('teacher', lesson.teacher ?? 'N/A'),
('sub. teacher', lesson.substituteTeacher ?? '-'),
('lesson # (daily)', lesson.dailyNth?.toString() ?? 'N/A'),
('lesson # (yearly)', lesson.yearlyNth?.toString() ?? 'N/A'),
('topic', lesson.topic ?? 'N/A'),
('subject', subj?.name ?? 'N/A'),
('subject uid', subj?.cacheKey.toString() ?? 'N/A'),
('class group', cg?.name ?? 'N/A'),
('class group type', cg?.type ?? 'N/A'),
('edu. order', cg?.educationalOrderName ?? 'N/A'),
('homework', hw != null ? 'Yes (id: ${hw.cacheKey})' : 'None'),
('test', tst != null ? '${tst.method}: ${tst.topic ?? "N/A"}' : 'None'),
(
'omission',
omission != null
? '${omission.state.name}${omission.lateMins != null ? " (${omission.lateMins}m)" : ""}'
: 'None',
),
];
statsForNerds = StatsForNerdsTable(rows: rows);
}
showFirkaBottomSheet(context, [
Row(
@@ -142,49 +181,55 @@ Future<void> showLessonBottomSheet(
size: 26,
),
),
SizedBox(width: 6),
Card(
shadowColor: Colors.transparent,
color: appStyle.colors.a15p,
margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: Text(
lesson.roomName!,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.secondary,
if (lesson.roomName != null && lesson.roomName!.isNotEmpty) ...[
SizedBox(width: 6),
Card(
shadowColor: Colors.transparent,
color: appStyle.colors.a15p,
margin: EdgeInsets.all(0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 6),
child: Text(
lesson.roomName!,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.secondary,
),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
),
),
),
],
],
),
SizedBox(height: 20),
Row(
children: [
Text(
"${lesson.name} ${statsForNerdsEnabled ? "(${lesson.subject.loadAndGet()!.name})" : ""}",
style: appStyle.fonts.H_18px.apply(
color: appStyle.colors.textPrimary,
Expanded(
child: Text(
"${lesson.name} ${statsForNerdsEnabled ? "(${lesson.subject.loadAndGet()!.name})" : ""}",
style: appStyle.fonts.H_18px.apply(
color: appStyle.colors.textPrimary,
),
softWrap: true,
),
),
],
),
SizedBox(height: 2),
Text(
lesson.teacher!,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.textSecondary,
decoration: lesson.substituteTeacher != null
? TextDecoration.lineThrough
: TextDecoration.none,
if (lesson.teacher != null && lesson.teacher!.isNotEmpty)
Text(
lesson.teacher!,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.textSecondary,
decoration: lesson.substituteTeacher != null
? TextDecoration.lineThrough
: TextDecoration.none,
),
),
),
if (lesson.substituteTeacher != null)
Text(
lesson.substituteTeacher!,
@@ -220,11 +265,29 @@ Future<void> showLessonBottomSheet(
overflow: TextOverflow.ellipsis,
),
),
?statsForNerds,
],
),
],
),
if (statsForNerds != null) SizedBox(height: 6),
if (statsForNerds != null)
FirkaCard.single(
margin: EdgeInsets.all(0),
padding: EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Debug info',
style: appStyle.fonts.H_14px.apply(
color: appStyle.colors.textPrimary,
),
),
SizedBox(height: 10),
statsForNerds,
],
),
),
SizedBox(height: 6),
if (lesson.test.loadAndGet() != null)
InfoCard.testDesc(lesson.test.loadAndGet()!),

View File

@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:firka/ui/theme/style.dart';
class StatsForNerdsTable extends StatelessWidget {
final List<(String, String)> rows;
const StatsForNerdsTable({super.key, required this.rows});
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
for (int i = 0; i < rows.length; i++) ...[
if (i > 0)
Divider(
height: 1,
thickness: 0.5,
color: appStyle.colors.shadowColor,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 130,
child: Text(
rows[i].$1,
style: appStyle.fonts.B_12R.apply(
color: appStyle.colors.textSecondary,
),
),
),
SizedBox(width: 8),
Expanded(
child: Text(
rows[i].$2,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.textPrimary,
),
),
),
],
),
),
],
],
);
}
}

View File

@@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
import 'package:firka/core/image_preloader.dart';
import 'package:firka/core/firka_bundle.dart';
import 'package:firka/core/swear_generator.dart';
import 'package:firka/ui/shared/dave_mascot.dart';
class ErrorPage extends StatelessWidget {
final String exception;
@@ -22,21 +23,7 @@ class ErrorPage extends StatelessWidget {
Column(
children: [
SizedBox(height: 48),
Container(
width: 50,
height: 50,
clipBehavior: Clip.antiAlias,
decoration: ShapeDecoration(
image: DecorationImage(
image: PreloadedImageProvider(
FirkaBundle(),
('assets/images/logos/dave_error.png'),
),
fit: BoxFit.cover,
),
shape: ContinuousRectangleBorder(),
),
),
const DaveMascot.error(width: 50, height: 50),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 24,
@@ -125,8 +112,8 @@ class ErrorPage extends StatelessWidget {
),
SizedBox(height: 20),
ElevatedButton(
// TODO: report bug
onPressed: () => Navigator.pop(context),
onPressed: () =>
appRouter?.push('/feedback', extra: exception),
style: ElevatedButton.styleFrom(
foregroundColor: appStyle.colors.textPrimary,
backgroundColor: appStyle.colors.accent,

View File

@@ -76,6 +76,7 @@ class FirkaToastWidget extends StatefulWidget {
return FirkaToastWidget(
backgroundColor: appStyle.colors.errorCard,
onTap: () {
initData.toastCubit.clear();
showReauthBottomSheet(context, initData, initData.l10n.reauth);
},
onDismiss: () {

View File

@@ -8,6 +8,7 @@ void showReauthBottomSheet(
AppInitialization data,
String message,
) {
data.toastCubit.clear();
showModalBottomSheet(
context: context,
elevation: 100,
@@ -16,36 +17,41 @@ void showReauthBottomSheet(
enableDrag: false,
backgroundColor: Colors.transparent,
builder: (BuildContext context) {
return Container(
decoration: BoxDecoration(
color: appStyle.colors.background,
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: appStyle.colors.errorCard,
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
child: Text(
message,
style: appStyle.fonts.B_16R.copyWith(
color: appStyle.colors.errorText,
final height = MediaQuery.of(context).size.height * 0.92;
return SizedBox(
height: height,
child: Container(
decoration: BoxDecoration(
color: appStyle.colors.background,
borderRadius: BorderRadius.vertical(top: Radius.circular(16)),
),
child: Column(
children: [
Container(
width: double.infinity,
padding: const EdgeInsets.all(16.0),
decoration: BoxDecoration(
color: appStyle.colors.errorCard,
borderRadius:
BorderRadius.vertical(top: Radius.circular(16)),
),
child: Text(
message,
style: appStyle.fonts.B_16R.copyWith(
color: appStyle.colors.errorText,
),
textAlign: TextAlign.center,
),
textAlign: TextAlign.center,
),
),
Expanded(
child: LoginWebviewWidget(
data,
username: data.client!.cache.token.username,
schoolId: data.client!.cache.token.iss,
Expanded(
child: LoginWebviewWidget(
data,
username: data.client!.cache.token.username,
schoolId: data.client!.cache.token.iss,
),
),
),
],
],
),
),
);
},

View File

@@ -1,5 +1,5 @@
import 'package:firka/app/app_state.dart';
import 'package:firka/services/watch_sync_helper.dart';
import 'package:firka/services/wear_sync_helper.dart';
import 'package:firka/services/wear_sync_cache.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';

View File

@@ -104,125 +104,125 @@ class _HomeGradesScreen extends FirkaState<HomeGradesScreen> {
child: ListView(
physics: const AlwaysScrollableScrollPhysics(),
children: [
Text(
widget.data.l10n.your_subjects,
style: appStyle.fonts.H_14px.apply(
color: appStyle.colors.textSecondary,
),
),
SizedBox(height: 16),
Column(
spacing: 16,
mainAxisSize: MainAxisSize.min,
children: gradeCards,
),
SizedBox(height: 16),
Text(
widget.data.l10n.data,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textSecondary,
),
),
SizedBox(height: 16),
FirkaCard(
left: [
Text(
widget.data.l10n.subject_avg,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
Text(
widget.data.l10n.your_subjects,
style: appStyle.fonts.H_14px.apply(
color: appStyle.colors.textSecondary,
),
],
right: [
if (subjectAverage != null)
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(subjectAverage).withAlpha(38),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
subjectAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(subjectAverage),
),
),
),
),
],
),
FirkaCard(
left: [
Text(
widget.data.l10n.subject_avg_rounded,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
),
SizedBox(height: 16),
Column(
spacing: 16,
mainAxisSize: MainAxisSize.min,
children: gradeCards,
),
SizedBox(height: 16),
Text(
widget.data.l10n.data,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textSecondary,
),
],
right: [
if (roundedSubjectAverage != null)
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(
roundedSubjectAverage,
).withAlpha(38),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
roundedSubjectAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(roundedSubjectAverage),
),
),
),
),
],
),
if (classAverage != null)
),
SizedBox(height: 16),
FirkaCard(
left: [
Text(
widget.data.l10n.class_avg,
widget.data.l10n.subject_avg,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
),
],
right: [
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: Colors.transparent,
shape: RoundedRectangleBorder(
side: BorderSide(
color: getGradeColor(classAverage),
if (subjectAverage != null)
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(subjectAverage).withAlpha(38),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
subjectAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(subjectAverage),
),
),
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
classAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(classAverage),
),
),
],
),
FirkaCard(
left: [
Text(
widget.data.l10n.subject_avg_rounded,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
),
],
right: [
if (roundedSubjectAverage != null)
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: getGradeColor(
roundedSubjectAverage,
).withAlpha(38),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
roundedSubjectAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(roundedSubjectAverage),
),
),
),
),
],
),
/*
if (classAverage != null)
FirkaCard(
left: [
Text(
widget.data.l10n.class_avg,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
),
],
right: [
Container(
width: 48,
height: 26,
decoration: ShapeDecoration(
color: Colors.transparent,
shape: RoundedRectangleBorder(
side: BorderSide(
color: getGradeColor(classAverage),
),
borderRadius: BorderRadius.circular(12),
),
),
child: Center(
child: Text(
classAverage.toStringAsFixed(2),
style: appStyle.fonts.B_16R.apply(
color: getGradeColor(classAverage),
),
),
),
),
],
),
/*
FirkaCard(
left: [
Text(
@@ -247,10 +247,10 @@ class _HomeGradesScreen extends FirkaState<HomeGradesScreen> {
),
],
),*/
],
],
),
),
),
),
],
),
);

View File

@@ -10,10 +10,10 @@ import 'package:firka/ui/components/firka_icon_button.dart';
import 'package:firka/ui/phone/widgets/grade_chart.dart';
import 'package:firka/ui/shared/class_icon.dart';
import 'package:firka/ui/shared/firka_icon.dart';
import 'package:firka/ui/shared/dave_mascot.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter_svg/svg.dart';
import 'package:isar_community/isar.dart';
import 'package:majesticons_flutter/majesticons_flutter.dart';
@@ -163,11 +163,7 @@ class _HomeGradesSubjectScreen extends FirkaState<HomeGradesSubjectScreen> {
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SvgPicture.asset(
"assets/images/logos/dave.svg",
width: 48,
height: 48,
),
const DaveMascot(width: 48, height: 48),
SizedBox(height: 12),
Text(
initData.l10n.no_grades,

View File

@@ -206,12 +206,7 @@ class _HomeMainScreen extends FirkaState<HomeMainScreen> {
_FadeInWhenLoaded(
loaded: student != null,
child: student != null
? WelcomeWidget(
widget.data.l10n,
now,
student,
todayLesson,
)
? WelcomeWidget(widget.data.l10n, now, student, todayLesson)
: const SizedBox.shrink(),
),
SizedBox(height: 48),
@@ -262,10 +257,7 @@ class _HomeMainScreen extends FirkaState<HomeMainScreen> {
/// Fades in when [loaded] flips from false to true. First paint with data is instant.
class _FadeInWhenLoaded extends StatelessWidget {
const _FadeInWhenLoaded({
required this.loaded,
required this.child,
});
const _FadeInWhenLoaded({required this.loaded, required this.child});
final bool loaded;
final Widget child;

View File

@@ -186,119 +186,122 @@ class _HomeOmissionsScreen extends FirkaState<HomeOmissionsScreen> {
children: [
Text(
initData.l10n.subjects,
style: appStyle.fonts.B_16SB.copyWith(
color: appStyle.colors.textPrimary,
style: appStyle.fonts.B_16SB.copyWith(
color: appStyle.colors.textPrimary,
),
),
),
SizedBox(height: 10),
...omissionItems
.fold(
LinkedHashMap<
SubjectCacheModel,
List<OmissionCacheModel>
>(
equals: (a, b) => a.cacheKey == b.cacheKey,
hashCode: (a) => a.cacheKey,
),
(map, o) => map
..putIfAbsent(
o.lesson.loadAndGet()!.subject.loadAndGet()!,
() => [],
).add(o),
)
.entries
.map((entry) {
final excused = entry.value
.where((o) => o.state == OmissionState.excused)
.length;
final unexcused = entry.value
.where((o) => o.state == OmissionState.unexcused)
.length;
final pending = entry.value
.where((o) => o.state == OmissionState.pending)
.length;
return FirkaCard.single(
height: 64,
margin: EdgeInsets.only(bottom: 10),
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
spacing: 12,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InfoCard.buildSubject(
appStyle.colors.accent,
entry.key,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
spacing: 2,
children: [
Text(
entry.key.name,
style: appStyle.fonts.B_16SB.copyWith(
color: appStyle.colors.textPrimary,
),
overflow: TextOverflow.ellipsis,
),
Row(
spacing: 4,
children: [
FirkaIconWidget(
FirkaIconType.majesticonsLocal,
"checkSolid",
size: 12.0,
color: appStyle.colors.accent,
),
Text(
excused.toString(),
style: appStyle.fonts.B_14R.copyWith(
color: appStyle.colors.textSecondary,
),
),
SizedBox(width: 4),
FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.timerSolid,
size: 12.0,
color: appStyle.colors.warningAccent,
),
Text(
pending.toString(),
style: appStyle.fonts.B_14R.copyWith(
color: appStyle.colors.textSecondary,
),
),
SizedBox(width: 4),
FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.restrictedLine,
size: 12.0,
color: appStyle.colors.errorAccent,
),
Text(
unexcused.toString(),
style: appStyle.fonts.B_14R.copyWith(
color: appStyle.colors.textSecondary,
),
),
],
),
],
),
),
],
SizedBox(height: 10),
...omissionItems
.fold(
LinkedHashMap<
SubjectCacheModel,
List<OmissionCacheModel>
>(
equals: (a, b) => a.cacheKey == b.cacheKey,
hashCode: (a) => a.cacheKey,
),
);
}),
],
(map, o) => map
..putIfAbsent(
o.lesson.loadAndGet()!.subject.loadAndGet()!,
() => [],
).add(o),
)
.entries
.map((entry) {
final excused = entry.value
.where((o) => o.state == OmissionState.excused)
.length;
final unexcused = entry.value
.where((o) => o.state == OmissionState.unexcused)
.length;
final pending = entry.value
.where((o) => o.state == OmissionState.pending)
.length;
return FirkaCard.single(
height: 64,
margin: EdgeInsets.only(bottom: 10),
padding: EdgeInsets.symmetric(horizontal: 16),
child: Row(
spacing: 12,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InfoCard.buildSubject(
appStyle.colors.accent,
entry.key,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
spacing: 2,
children: [
Text(
entry.key.name,
style: appStyle.fonts.B_16SB.copyWith(
color: appStyle.colors.textPrimary,
),
overflow: TextOverflow.ellipsis,
),
Row(
spacing: 4,
children: [
FirkaIconWidget(
FirkaIconType.majesticonsLocal,
"checkSolid",
size: 12.0,
color: appStyle.colors.accent,
),
Text(
excused.toString(),
style: appStyle.fonts.B_14R.copyWith(
color:
appStyle.colors.textSecondary,
),
),
SizedBox(width: 4),
FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.timerSolid,
size: 12.0,
color: appStyle.colors.warningAccent,
),
Text(
pending.toString(),
style: appStyle.fonts.B_14R.copyWith(
color:
appStyle.colors.textSecondary,
),
),
SizedBox(width: 4),
FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.restrictedLine,
size: 12.0,
color: appStyle.colors.errorAccent,
),
Text(
unexcused.toString(),
style: appStyle.fonts.B_14R.copyWith(
color:
appStyle.colors.textSecondary,
),
),
],
),
],
),
),
],
),
);
}),
],
),
),
),
),
],
),
);

View File

@@ -167,12 +167,16 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
return TimeTableDayWidget(
lessons,
events,
onRefresh: () => widget.data.client!.pullRefresh(
() => widget.data.client!.getLessonsCovering(
_currentTabWeekMonday,
_currentTabWeekMonday.add(const Duration(days: 7)),
),
),
onRefresh: () async {
await widget.data.client!.pullRefresh(
() => widget.data.client!.getLessonsCovering(
_currentTabWeekMonday,
_currentTabWeekMonday.add(const Duration(days: 7)),
),
);
_lessonsCache.clear();
if (mounted) setState(() {});
},
);
}
@@ -338,6 +342,9 @@ class _HomeTimetableScreen extends FirkaState<HomeTimetableScreen>
listenWhen: (previous, current) =>
current.refreshTrigger != previous.refreshTrigger,
listener: (context, state) {
// Underlying writes are correct now (see kreta_client.dart), so
// a plain clear()+reread is reliable and needs no stale-value
// workaround.
_lessonsCache.clear();
setState(() {});
},

View File

@@ -360,10 +360,14 @@ class _HomeTimetableMonthlyScreen
right: 20,
),
child: RefreshIndicator(
// NOT currentMonthStart/End: End is built inclusive for
// display, but getLessonsCovering treats `to` as
// exclusive, so the last day of the month was never
// actually refreshed. Use the visible grid's own bounds.
onRefresh: () => widget.data.client!.pullRefresh(
() => widget.data.client!.getLessonsCovering(
currentMonthStart,
currentMonthEnd,
dates.first,
dates.last.add(const Duration(days: 1)),
),
),
child: GridView.count(

View File

@@ -26,6 +26,7 @@ import 'package:firka/core/state/firka_state.dart';
import 'package:firka/ui/phone/screens/surprise_grades/surprise_grades_screen.dart';
import 'package:firka/ui/shared/firka_icon.dart';
import 'package:firka/ui/theme/style.dart';
import 'package:firka_common/ui/components/filled_circle.dart';
import 'package:flutter/services.dart';
import 'package:home_widget/home_widget.dart';
import 'package:isar_community/isar.dart';
@@ -131,7 +132,9 @@ class _DebugScreen extends FirkaState<DebugScreen> {
padding: const EdgeInsets.symmetric(horizontal: 16),
child: TextField(
controller: _mockBackendUrlController,
decoration: const InputDecoration(labelText: 'mock backend url'),
decoration: const InputDecoration(
labelText: 'mock backend url',
),
onSubmitted: (value) {
Settings.mockBackendUrl.set(value);
},
@@ -292,19 +295,23 @@ class _DebugScreen extends FirkaState<DebugScreen> {
Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
SurpriseCardFaceDebugScreen(grades.first, widget.data.l10n),
builder: (context) => SurpriseCardFaceDebugScreen(
grades.first,
widget.data.l10n,
),
),
);
},
child: const Text('Epikus jegyszerzés (card face debug)'),
),
ElevatedButton(
ElevatedButton(
onPressed: () async {
final token = widget.data.settings.getSelectedToken();
if (token == null) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('No token available to copy')),
const SnackBar(
content: Text('No token available to copy'),
),
);
return;
}
@@ -428,6 +435,16 @@ class _DebugScreen extends FirkaState<DebugScreen> {
},
child: const Text('wipe users'),
),
const SizedBox(height: 20),
Wrap(
alignment: WrapAlignment.center,
spacing: 16,
runSpacing: 16,
children: [
for (final entry in _themeColorSwatches())
_themeColorSwatch(context, entry.$1, entry.$2),
],
),
SizedBox(
height: 600,
child: GridView.count(
@@ -471,3 +488,66 @@ class _DebugScreen extends FirkaState<DebugScreen> {
);
}
}
List<(String, Color)> _themeColorSwatches() {
final c = appStyle.colors;
return [
("background", c.background),
("backgroundAmoled", c.backgroundAmoled),
("background0p", c.background0p),
("success", c.success),
("textPrimary", c.textPrimary),
("textSecondary", c.textSecondary),
("textTertiary", c.textTertiary),
if (c.textTeritary != null) ("textTeritary", c.textTeritary!),
("textPrimaryLight", c.textPrimaryLight),
("textSecondaryLight", c.textSecondaryLight),
("textTertiaryLight", c.textTertiaryLight),
("card", c.card),
("cardTranslucent", c.cardTranslucent),
("buttonSecondaryFill", c.buttonSecondaryFill),
("buttonDisabledIcon", c.buttonDisabledIcon),
("accent", c.accent),
("secondary", c.secondary),
("shadowColor", c.shadowColor),
("a10p", c.a10p),
("a15p", c.a15p),
("warningAccent", c.warningAccent),
("warningText", c.warningText),
("warning15p", c.warning15p),
("warningCard", c.warningCard),
("errorAccent", c.errorAccent),
("errorText", c.errorText),
("error15p", c.error15p),
("errorCard", c.errorCard),
("grade5", c.grade5),
("grade4", c.grade4),
("grade3", c.grade3),
("grade2", c.grade2),
("grade1", c.grade1),
];
}
Widget _themeColorSwatch(BuildContext context, String name, Color color) {
final darkBg = color.computeLuminance() > 0.5;
final bg = darkBg ? const Color(0xFF121212) : const Color(0xFFF2F2F2);
final labelColor = darkBg ? const Color(0xFFF2F2F2) : const Color(0xFF121212);
return Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
decoration: BoxDecoration(
color: bg,
borderRadius: BorderRadius.circular(8),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
name,
style: TextTheme.of(context).bodySmall?.copyWith(color: labelColor),
),
FilledCircle(diameter: 40, color: color, child: const SizedBox()),
],
),
);
}

View File

@@ -0,0 +1,556 @@
import 'dart:convert';
import 'dart:typed_data';
import 'package:dio/dio.dart';
import 'package:firka/app/app_state.dart';
import 'package:firka/core/feedback_report.dart';
import 'package:firka/core/state/firka_state.dart';
import 'package:firka/ui/components/firka_icon_button.dart';
import 'package:firka/ui/phone/screens/settings/settings_toggle.dart';
import 'package:firka/ui/shared/dave_mascot.dart';
import 'package:firka/ui/shared/firka_icon.dart';
import 'package:firka/ui/theme/style.dart';
import 'package:firka_common/ui/components/firka_card.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:image_picker/image_picker.dart';
import 'package:majesticons_flutter/majesticons_flutter.dart';
const _feedbackUrl = 'https://api.firka.app/v1/contact';
const _maxImages = 5;
const _maxImageBytes = 5 * 1024 * 1024;
const _maxImagesTotalBytes = 8 * 1024 * 1024;
final _emailPattern = RegExp(r'^[^\s@]+@[^\s@]+\.[^\s@]+$');
class _Picture {
final String name;
final Uint8List bytes;
const _Picture(this.name, this.bytes);
}
class FeedbackScreen extends StatefulWidget {
final AppInitialization data;
/// the error the person is reporting, when they come from the error page
final String? error;
const FeedbackScreen(this.data, {this.error, super.key});
@override
State<FeedbackScreen> createState() => _FeedbackScreenState();
}
class _FeedbackScreenState extends FirkaState<FeedbackScreen> {
final _email = TextEditingController();
final _message = TextEditingController();
final _emailFocus = FocusNode();
final _messageFocus = FocusNode();
final _pictures = <_Picture>[];
late bool _attachLogs = widget.error != null;
String? _emailError;
String? _messageError;
String? _pictureError;
String? _sendError;
bool _sending = false;
bool _sent = false;
Future<void> _pickPictures() async {
final l10n = widget.data.l10n;
final room = _maxImages - _pictures.length;
if (room <= 0) return;
try {
// on android this is the system photo picker, it needs no permission
final picker = ImagePicker();
final List<XFile> picked;
if (room == 1) {
final one = await picker.pickImage(
source: ImageSource.gallery,
maxWidth: 2000,
maxHeight: 2000,
imageQuality: 85,
);
picked = one == null ? [] : [one];
} else {
picked = await picker.pickMultiImage(
maxWidth: 2000,
maxHeight: 2000,
imageQuality: 85,
limit: room,
);
}
String? problem;
var total = _pictures.fold<int>(0, (sum, p) => sum + p.bytes.length);
final added = <_Picture>[];
for (final file in picked) {
final bytes = await file.readAsBytes();
if (bytes.length > _maxImageBytes) {
problem = l10n.fb_err_image_big;
} else if (total + bytes.length > _maxImagesTotalBytes) {
problem = l10n.fb_err_images_total;
} else {
total += bytes.length;
added.add(_Picture(file.name, bytes));
}
}
if (!mounted) return;
setState(() {
_pictures.addAll(added);
_pictureError = problem;
});
} catch (e) {
logger.warning('[Feedback] picking pictures failed: $e');
}
}
Future<void> _send() async {
if (_sending) return;
final l10n = widget.data.l10n;
final email = _email.text.trim();
final message = _message.text.trim();
// only the message is needed, an e-mail address just lets us answer
final emailError = email.isNotEmpty && !_emailPattern.hasMatch(email)
? l10n.fb_err_email_invalid
: null;
final messageError = message.isEmpty ? l10n.fb_err_message_empty : null;
setState(() {
_emailError = emailError;
_messageError = messageError;
_sendError = null;
});
if (messageError != null || emailError != null) {
(messageError != null ? _messageFocus : _emailFocus).requestFocus();
return;
}
setState(() => _sending = true);
try {
final logs = _attachLogs
? await collectFeedbackLogs(widget.data.appDir, error: widget.error)
: null;
final info = widget.data.packageInfo;
final device = widget.data.devInfo;
final res = await dio.post(
_feedbackUrl,
data: {
'email': email,
'message': message,
'source': 'app',
'app_version': '${info.version}+${info.buildNumber}',
'platform':
'Android ${device.versionRelease} '
'(API ${device.versionSdkInt}), ${device.model}',
'logs': ?logs,
'images': [
for (final picture in _pictures)
{'name': picture.name, 'data': base64Encode(picture.bytes)},
],
},
options: Options(
contentType: Headers.jsonContentType,
sendTimeout: const Duration(seconds: 40),
receiveTimeout: const Duration(seconds: 40),
),
);
if (!mounted) return;
final status = res.statusCode ?? 0;
if (status >= 200 && status < 300) {
setState(() => _sent = true);
} else {
final data = res.data;
setState(
() => _sendError = data is Map && data['error'] is String
? data['error'] as String
: l10n.fb_err_send,
);
}
} catch (e) {
logger.warning('[Feedback] sending failed: $e');
if (mounted) setState(() => _sendError = l10n.fb_err_send);
} finally {
if (mounted) setState(() => _sending = false);
}
}
void _close() {
if (context.canPop()) {
context.pop();
} else {
context.go('/home');
}
}
@override
Widget build(BuildContext context) {
final l10n = widget.data.l10n;
if (_sent) return _sentPage();
return Scaffold(
backgroundColor: appStyle.colors.background,
body: SafeArea(
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
keyboardDismissBehavior:
ScrollViewKeyboardDismissBehavior.onDrag,
padding: const EdgeInsets.fromLTRB(20, 8, 20, 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_backButton(),
const SizedBox(height: 8),
..._formContent(),
],
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 8, 20, 16),
child: _primaryButton(
_sending ? l10n.fb_sending : l10n.fb_send,
_sending ? null : _send,
),
),
],
),
),
);
}
Widget _backButton() {
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: _close,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 8, 16, 8),
child: Row(
children: [
Transform.translate(
offset: const Offset(-4, 0),
child: FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.chevronLeftLine,
color: appStyle.colors.textSecondary,
),
),
Transform.translate(
offset: const Offset(-4, 1),
child: Text(
widget.data.l10n.s_feedback,
style: appStyle.fonts.H_H2.apply(
color: appStyle.colors.textPrimary,
),
),
),
],
),
),
);
}
/// the same button as on the error screen, with the dark text every lime button has
Widget _primaryButton(String text, VoidCallback? onPressed) {
return ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
foregroundColor: appStyle.colors.textPrimaryLight,
backgroundColor: appStyle.colors.accent,
disabledForegroundColor: appStyle.colors.textPrimaryLight,
disabledBackgroundColor: appStyle.colors.accent.withValues(alpha: 0.6),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
elevation: 1,
shadowColor: appStyle.colors.shadowColor,
minimumSize: Size.fromHeight(48),
),
child: Text(
text,
style: appStyle.fonts.H_18px.copyWith(
fontWeight: FontWeight.w700,
color: appStyle.colors.textPrimaryLight,
),
),
);
}
/// laid out like the error screen: the mascot, two lines, the button at the bottom
Widget _sentPage() {
final l10n = widget.data.l10n;
return Scaffold(
backgroundColor: appStyle.colors.background,
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 64, horizontal: 24),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
children: [
SizedBox(height: 48),
const DaveMascot.icon(width: 50, height: 50),
Padding(
padding: const EdgeInsets.symmetric(
vertical: 24,
horizontal: 32,
),
child: Text(
l10n.fb_sent_title,
style: appStyle.fonts.H_H2.copyWith(
color: appStyle.colors.textPrimary,
fontSize: 24,
),
textAlign: TextAlign.center,
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Text(
// without an address nobody can be answered
_email.text.trim().isEmpty
? l10n.fb_sent_no_reply
: l10n.fb_sent,
style: appStyle.fonts.B_14R.copyWith(
color: appStyle.colors.textSecondary,
),
textAlign: TextAlign.center,
),
),
],
),
_primaryButton(l10n.okay, _close),
],
),
),
);
}
List<Widget> _formContent() {
final l10n = widget.data.l10n;
return [
Text(
l10n.fb_intro,
style: appStyle.fonts.B_16R.apply(color: appStyle.colors.textSecondary),
),
const SizedBox(height: 20),
_field(
hint: l10n.fb_message,
controller: _message,
focus: _messageFocus,
error: _messageError,
keyboardType: TextInputType.multiline,
maxLength: 5000,
minLines: 6,
maxLines: 10,
onChanged: () => _messageError = null,
),
const SizedBox(height: 16),
_picturesSection(),
const SizedBox(height: 16),
_field(
hint: l10n.fb_email,
controller: _email,
focus: _emailFocus,
error: _emailError,
keyboardType: TextInputType.emailAddress,
maxLength: 254,
onChanged: () => _emailError = null,
),
const SizedBox(height: 16),
_logsCard(),
if (_sendError != null) ...[
const SizedBox(height: 16),
Text(
_sendError!,
style: appStyle.fonts.B_14R.apply(color: appStyle.colors.errorText),
),
],
];
}
Widget _field({
required String hint,
required TextEditingController controller,
required FocusNode focus,
required String? error,
required TextInputType keyboardType,
required int maxLength,
required VoidCallback onChanged,
int minLines = 1,
int maxLines = 1,
}) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
FirkaCard.single(
margin: EdgeInsets.zero,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
borderColor: error != null ? appStyle.colors.errorAccent : null,
child: TextField(
controller: controller,
focusNode: focus,
keyboardType: keyboardType,
minLines: minLines,
maxLines: maxLines,
maxLength: maxLength,
onChanged: (_) {
if (error != null) setState(onChanged);
},
cursorColor: appStyle.colors.accent,
style: appStyle.fonts.B_16R.apply(
color: appStyle.colors.textPrimary,
),
decoration: InputDecoration(
hintText: hint,
hintStyle: appStyle.fonts.B_16R.apply(
color: appStyle.colors.textTertiary,
),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
counterText: '',
),
),
),
if (error != null) ...[
const SizedBox(height: 6),
Text(
error,
style: appStyle.fonts.B_14R.apply(color: appStyle.colors.errorText),
),
],
],
);
}
Widget _picturesSection() {
final l10n = widget.data.l10n;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
spacing: 8,
runSpacing: 8,
children: [
for (var i = 0; i < _pictures.length; i++) _thumbnail(i),
if (_pictures.length < _maxImages)
Semantics(
button: true,
label: l10n.fb_add_images,
child: GestureDetector(
onTap: _pickPictures,
child: FirkaCard.single(
margin: EdgeInsets.zero,
width: 72,
height: 72,
child: Center(
child: FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.imageLine,
color: appStyle.colors.accent,
),
),
),
),
),
],
),
const SizedBox(height: 8),
Text(
_pictureError ?? l10n.fb_images_hint,
style: appStyle.fonts.B_14R.apply(
color: _pictureError != null
? appStyle.colors.errorText
: appStyle.colors.textTertiary,
),
),
],
);
}
Widget _thumbnail(int index) {
return SizedBox(
width: 72,
height: 72,
child: Stack(
children: [
Positioned.fill(
child: ClipRRect(
borderRadius: BorderRadius.circular(16),
child: Image.memory(
_pictures[index].bytes,
fit: BoxFit.cover,
cacheWidth: 216,
),
),
),
Positioned(
top: 4,
right: 4,
child: Semantics(
button: true,
label: widget.data.l10n.fb_remove_image,
child: FirkaIconButton(
onTap: () => setState(() {
_pictures.removeAt(index);
_pictureError = null;
}),
child: FirkaIconWidget(
FirkaIconType.majesticons,
Majesticon.closeLine,
color: appStyle.colors.textSecondary,
),
),
),
),
],
),
);
}
Widget _logsCard() {
final l10n = widget.data.l10n;
return FirkaCard.single(
margin: EdgeInsets.zero,
padding: const EdgeInsets.all(14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Expanded(
child: Text(
l10n.fb_attach_logs,
style: appStyle.fonts.B_16SB.apply(
color: appStyle.colors.textPrimary,
),
),
),
const SizedBox(width: 12),
SettingsToggle(
value: _attachLogs,
onChanged: (value) => setState(() => _attachLogs = value),
),
],
),
const SizedBox(height: 8),
Text(
l10n.fb_attach_logs_desc,
style: appStyle.fonts.B_14R.apply(
color: appStyle.colors.textSecondary,
),
),
],
),
);
}
@override
void dispose() {
_email.dispose();
_message.dispose();
_emailFocus.dispose();
_messageFocus.dispose();
super.dispose();
}
}

Some files were not shown because too many files have changed in this diff Show More