-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e19d04
commit 4e7a926
Showing
13 changed files
with
107 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
app/src/main/java/org/thoughtcrime/securesms/util/DynamicDarkActionBarTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicDarkActionBarTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) { | ||
return R.style.TextSecure_DarkTheme_Conversation; | ||
} | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.TextSecure_LightTheme_Conversation; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.TextSecure_DarkTheme_Conversation; | ||
} | ||
} |
14 changes: 6 additions & 8 deletions
14
app/src/main/java/org/thoughtcrime/securesms/util/DynamicDarkToolbarTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicDarkToolbarTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) { | ||
return R.style.TextSecure_DarkNoActionBar_DarkToolbar; | ||
} | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.TextSecure_LightNoActionBar_DarkToolbar; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.TextSecure_DarkNoActionBar_DarkToolbar; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
app/src/main/java/org/thoughtcrime/securesms/util/DynamicIntroTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicIntroTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) return R.style.TextSecure_DarkIntroTheme; | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.TextSecure_LightIntroTheme; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.TextSecure_DarkIntroTheme; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
app/src/main/java/org/thoughtcrime/securesms/util/DynamicNoActionBarInviteTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicNoActionBarInviteTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) return R.style.Signal_NoActionBar_Invite; | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.Signal_Light_NoActionBar_Invite; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.Signal_NoActionBar_Invite; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
app/src/main/java/org/thoughtcrime/securesms/util/DynamicNoActionBarTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicNoActionBarTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) return R.style.TextSecure_DarkNoActionBar; | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.TextSecure_LightNoActionBar; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.TextSecure_DarkNoActionBar; | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
app/src/main/java/org/thoughtcrime/securesms/util/DynamicRegistrationTheme.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package org.thoughtcrime.securesms.util; | ||
|
||
import android.app.Activity; | ||
import androidx.annotation.StyleRes; | ||
|
||
import org.thoughtcrime.securesms.R; | ||
|
||
public class DynamicRegistrationTheme extends DynamicTheme { | ||
@Override | ||
protected int getSelectedTheme(Activity activity) { | ||
String theme = TextSecurePreferences.getTheme(activity); | ||
|
||
if (theme.equals("dark")) return R.style.TextSecure_DarkRegistrationTheme; | ||
|
||
protected @StyleRes int getLightThemeStyle() { | ||
return R.style.TextSecure_LightRegistrationTheme; | ||
} | ||
|
||
protected @StyleRes int getDarkThemeStyle() { | ||
return R.style.TextSecure_DarkRegistrationTheme; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<string-array name="pref_theme_entries" tools:ignore="InconsistentArrays"> | ||
<item>@string/preferences__system_theme</item> | ||
<item>@string/preferences__light_theme</item> | ||
<item>@string/preferences__dark_theme</item> | ||
</string-array> | ||
|
||
<string-array name="pref_theme_values" translatable="false" tools:ignore="InconsistentArrays"> | ||
<item>system</item> | ||
<item>light</item> | ||
<item>dark</item> | ||
</string-array> | ||
|
||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference | ||
android:key="pref_theme" | ||
android:title="@string/preferences__theme" | ||
android:entries="@array/pref_theme_entries" | ||
android:entryValues="@array/pref_theme_values" | ||
android:defaultValue="system"> | ||
</org.thoughtcrime.securesms.preferences.widgets.SignalListPreference> | ||
|
||
<org.thoughtcrime.securesms.preferences.widgets.SignalListPreference | ||
android:key="pref_language" | ||
android:title="@string/preferences__language" | ||
android:entries="@array/language_entries" | ||
android:entryValues="@array/language_values" | ||
android:defaultValue="zz"/> | ||
</PreferenceScreen> |