feat(i18n): data-driven language picker + Weblate translation guard #5
@@ -3,9 +3,9 @@ package de.jeanlucmakiola.calendula
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -24,7 +24,7 @@ import de.jeanlucmakiola.calendula.ui.theme.CalendulaTheme
|
||||
import kotlinx.datetime.LocalDate
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
||||
// The occurrence a reminder notification was tapped for (eventId, begin,
|
||||
// end — the detail screen's key shape). singleTop + onNewIntent route a
|
||||
|
||||
6
app/src/main/res/values-night/colors.xml
Normal file
6
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<resources>
|
||||
<!-- Dark-scheme window backdrop, matching the Compose dark background/surface
|
||||
(#101316) so activity recreation (e.g. language switch) doesn't flash a
|
||||
lighter grey. See values/colors.xml. -->
|
||||
<color name="window_background">#FF101316</color>
|
||||
</resources>
|
||||
@@ -3,4 +3,8 @@
|
||||
<color name="seed">#FF5C6B7A</color>
|
||||
<!-- Adaptive icon background -->
|
||||
<color name="ic_launcher_background">#FF5C6B7A</color>
|
||||
<!-- Window backdrop shown during activity recreation (e.g. on a language
|
||||
switch). Matches the Compose light scheme background/surface so the
|
||||
recreation is seamless; overridden for dark in values-night. -->
|
||||
<color name="window_background">#FFFBFCFE</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<style name="Theme.Calendula" parent="android:Theme.Material.Light.NoActionBar">
|
||||
<!-- AppCompat (DayNight) parent so MainActivity can be an AppCompatActivity,
|
||||
which is required for AppCompatDelegate.setApplicationLocales (the in-app
|
||||
language picker) to sync to the system. Actual colours are driven by the
|
||||
Compose theme; this is essentially the launch/backdrop theme. -->
|
||||
<style name="Theme.Calendula" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="android:windowBackground">@color/window_background</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:navigationBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
||||
Reference in New Issue
Block a user