Skip to content

Commit 1cd0f4f

Browse files
committed
Use MaterialComponents theme and add material lib
Switch Android app themes to Theme.MaterialComponents.DayNight.NoActionBar (values and values-night) so native UI (flutter_stripe PaymentSheet) works correctly; set windowBackground and navigationBarColor to use existing splash resources. Add com.google.android.material:material:1.12.0 to android/app/build.gradle.kts so Material attributes resolve. Also add docs/cursor_completed_issue_numbers_from_github.md (exported session notes) for bookkeeping.
1 parent 7ba3711 commit 1cd0f4f

4 files changed

Lines changed: 893 additions & 23 deletions

File tree

android/app/build.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ flutter {
4343
source = "../.."
4444
}
4545

46+
dependencies {
47+
// Ensures Theme.MaterialComponents resources resolve; required by flutter_stripe.
48+
implementation("com.google.android.material:material:1.12.0")
49+
}
50+
4651
// FCM: add `android/app/google-services.json` from Firebase Console (Android app
4752
// with package `com.example.pet_dating_app`). Without it, the app builds but
4853
// Firebase.initializeApp / device tokens will not work.
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3-
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
4-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
5-
<!-- Show a splash screen on the activity. Automatically removed when
6-
the Flutter engine draws its first frame -->
3+
<style name="LaunchTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
74
<item name="android:windowBackground">@drawable/launch_background</item>
85
</style>
9-
<!-- Theme applied to the Android Window as soon as the process has started.
10-
This theme determines the color of the Android Window while your
11-
Flutter UI initializes, as well as behind your Flutter UI while its
12-
running.
13-
14-
This Theme is only used starting with V2 of Flutter's Android embedding. -->
15-
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
16-
<item name="android:windowBackground">?android:colorBackground</item>
6+
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
7+
<item name="android:windowBackground">@color/splashBackground</item>
8+
<item name="android:navigationBarColor">@color/splashBackground</item>
179
</style>
1810
</resources>
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
3+
<!-- flutter_stripe PaymentSheet requires Theme.AppCompat / Theme.MaterialComponents
4+
(not android: Theme.Black.*). See: https://github.com/flutter-stripe/flutter_stripe -->
35
<!-- Theme applied to the Android Window while the process is starting.
4-
Always uses the dark theme so the splash matches PetSphere's dark UI. -->
5-
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
6-
<!-- Show a splash screen on the activity. Automatically removed when
7-
the Flutter engine draws its first frame -->
6+
Uses dark window + splash drawable to match PetSphere. -->
7+
<style name="LaunchTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
88
<item name="android:windowBackground">@drawable/launch_background</item>
99
</style>
10-
<!-- Theme applied to the Android Window as soon as the process has started.
11-
This theme determines the color of the Android Window while your
12-
Flutter UI initializes, as well as behind your Flutter UI while its
13-
running.
14-
15-
This Theme is only used starting with V2 of Flutter's Android embedding. -->
16-
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
10+
<!-- Theme behind Flutter after embedding starts; Stripe native UI inherits this. -->
11+
<style name="NormalTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
1712
<item name="android:windowBackground">@color/splashBackground</item>
13+
<!-- Keep edge-to-edge / status bar sane on modern Android -->
14+
<item name="android:navigationBarColor">@color/splashBackground</item>
1815
</style>
1916
</resources>

0 commit comments

Comments
 (0)