Skip to content

Commit 9bbcf8d

Browse files
SUPERCILEXsamtstern
authored andcommitted
Add support for night mode (#749)
1 parent b348218 commit 9bbcf8d

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
99

1010
<application
11-
android:name=".auth.LeakCatcher"
11+
android:name=".auth.FirebaseUIDemo"
1212
android:allowBackup="true"
1313
android:fullBackupContent="true"
1414
android:icon="@mipmap/ic_launcher"

app/src/main/java/com/firebase/uidemo/auth/LeakCatcher.java renamed to app/src/main/java/com/firebase/uidemo/auth/FirebaseUIDemo.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22

33
import android.app.Application;
44
import android.content.Context;
5+
import android.support.v7.app.AppCompatDelegate;
56

67
import com.squareup.leakcanary.LeakCanary;
78
import com.squareup.leakcanary.RefWatcher;
89

9-
public class LeakCatcher extends Application {
10+
public class FirebaseUIDemo extends Application {
1011
private RefWatcher mRefWatcher;
1112

13+
static {
14+
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO);
15+
}
16+
1217
public static RefWatcher getRefWatcher(Context context) {
13-
return ((LeakCatcher) context.getApplicationContext()).mRefWatcher;
18+
return ((FirebaseUIDemo) context.getApplicationContext()).mRefWatcher;
1419
}
1520

1621
@Override

app/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<resources>
22

33
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
4+
<style name="AppTheme" parent="Theme.AppCompat.DayNight.DarkActionBar">
55
<item name="colorPrimary">@color/colorPrimary</item>
66
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
77
<item name="colorAccent">@color/colorAccent</item>

auth/src/main/res/values/styles.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources xmlns:tools="http://schemas.android.com/tools">
33

4-
<style name="FirebaseUI" parent="Theme.AppCompat.Light.DarkActionBar">
4+
<style name="FirebaseUI" parent="Theme.AppCompat.DayNight.DarkActionBar">
55
<item name="colorPrimary">@color/colorPrimary</item>
66
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
77
<item name="colorAccent">@color/colorAccent</item>

0 commit comments

Comments
 (0)