Skip to content

Commit

Permalink
OLED friendly dark theme - initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dkopec91 committed Dec 17, 2018
1 parent 053f071 commit f5d1435
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 2 deletions.
16 changes: 16 additions & 0 deletions res/drawable/compose_background_oled.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">

<stroke
android:width="1dp"
android:color="@color/core_grey_75" />

<solid
android:color="@color/black" />

<corners
android:radius="20dp" />

</shape>
4 changes: 3 additions & 1 deletion res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@

<string-array name="pref_theme_entries">
<item>@string/preferences__light_theme</item>
<item>@string/preferences__dark_theme</item>
<item>@string/preferences__dark_theme</item>
<item>@string/preferences__oled_theme</item>
</string-array>

<string-array name="pref_theme_values" translatable="false">
<item>light</item>
<item>dark</item>
<item>oled</item>
</string-array>

<string-array name="pref_led_color_entries">
Expand Down
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,7 @@
<string name="preferences__linked_devices">Linked devices</string>
<string name="preferences__light_theme">Light</string>
<string name="preferences__dark_theme">Dark</string>
<string name="preferences__oled_theme">OLED Dark</string>
<string name="preferences__appearance">Appearance</string>
<string name="preferences__theme">Theme</string>
<string name="preferences__default">Default</string>
Expand Down
20 changes: 19 additions & 1 deletion res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<item name="media_overview_document_secondary">@color/core_grey_25</item>
</style>

<style name="TextSecure.DarkNoActionBarOled" parent="TextSecure.DarkNoActionBar">
<item name="android:windowBackground">@color/black</item>
<item name="colorPrimary">@color/black</item>
</style>

<style name="TextSecure.HighlightTheme" parent="@style/TextSecure.LightTheme">
<item name="actionBarStyle">@style/TextSecure.FlatLightActionBar</item>
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Dark</item>
Expand Down Expand Up @@ -94,6 +99,10 @@
<item name="login_floating_background">@drawable/rounded_rectangle_dark</item>
</style>

<style name="TextSecure.DarkIntroThemeOled" parent="TextSecure.DarkIntroTheme">
<item name="android:windowBackground">@color/black</item>
</style>

<style name="PopupAnimation" parent="@android:style/Animation">
<item name="android:windowEnterAnimation">@anim/slide_from_top</item>
<item name="android:windowExitAnimation">@anim/slide_to_top</item>
Expand Down Expand Up @@ -412,7 +421,16 @@
<item name="shared_contact_details_titlebar">@color/grey_900</item>
<item name="shared_contact_item_button_color">@color/core_grey_85</item>
</style>


<style name="TextSecure.DarkThemeOled" parent="TextSecure.DarkTheme">
<item name="android:windowBackground">@color/black</item>
<item name="attachment_type_selector_background">@color/black</item>
<item name="dialog_background_color">@color/black</item>
<item name="conversation_background">@color/black</item>
<item name="conversation_input_background">@drawable/compose_background_oled</item>
<item name="emoji_tab_strip_background">@color/black</item>
</style>

<style name="RationaleDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="android:windowBackground">@drawable/permission_rationale_dialog_corners</item>
</style>
Expand Down
1 change: 1 addition & 0 deletions src/org/thoughtcrime/securesms/util/DynamicIntroTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ protected int getSelectedTheme(Activity activity) {
String theme = TextSecurePreferences.getTheme(activity);

if (theme.equals("dark")) return R.style.TextSecure_DarkIntroTheme;
else if (theme.equals("oled")) return R.style.TextSecure_DarkIntroThemeOled;

return R.style.TextSecure_LightIntroTheme;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ protected int getSelectedTheme(Activity activity) {
String theme = TextSecurePreferences.getTheme(activity);

if (theme.equals("dark")) return R.style.TextSecure_DarkNoActionBar;
else if (theme.equals("oled")) return R.style.TextSecure_DarkNoActionBarOled;

return R.style.TextSecure_LightNoActionBar;
}
Expand Down
2 changes: 2 additions & 0 deletions src/org/thoughtcrime/securesms/util/DynamicTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class DynamicTheme {

public static final String DARK = "dark";
public static final String LIGHT = "light";
public static final String OLED = "oled";

private int currentTheme;

Expand All @@ -31,6 +32,7 @@ protected int getSelectedTheme(Activity activity) {
String theme = TextSecurePreferences.getTheme(activity);

if (theme.equals(DARK)) return R.style.TextSecure_DarkTheme;
else if (theme.equals(OLED)) return R.style.TextSecure_DarkThemeOled;

return R.style.TextSecure_LightTheme;
}
Expand Down

0 comments on commit f5d1435

Please sign in to comment.