fix(i18n): make the language picker actually apply on device
The in-app language picker silently did nothing: AppCompatDelegate.set ApplicationLocales only syncs to the system from an AppCompatActivity, but MainActivity was a plain ComponentActivity (with a platform theme). Switch MainActivity to AppCompatActivity and base Theme.Calendula on Theme.AppCompat.DayNight.NoActionBar. Changing the locale recreates the activity; set android:windowBackground to a DayNight colour matching the Compose background (light #FBFCFE / dark #101316) so the recreation no longer flashes a contrasting backdrop. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
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>
|
||||
Reference in New Issue
Block a user