Resource and style cleanup.

This commit is contained in:
Anton Chekulaev 2020-08-19 11:48:16 +10:00
parent 9d9affe4f9
commit 720afa8fbe
47 changed files with 223 additions and 279 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 721 B

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 454 B

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:topLeftRadius="44dp"
android:topRightRadius="44dp"
android:bottomLeftRadius="44dp"
android:bottomRightRadius="0dp"/>
<solid android:color="#FF0288D1" />
<size android:height="88dp" android:width="88dp" />
</shape>

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/touch_highlight">
<item android:id="@android:id/mask">
<shape android:shape="oval">
<solid android:color="@color/black" />
</shape>
</item>
</ripple>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/textsecure_primary">
<item android:id="@android:id/mask" android:drawable="@android:color/black" />
<item>
<selector>
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
</selector>
</item>
</ripple>

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/textsecure_primary">
<item android:id="@android:id/mask" android:drawable="@android:color/black" />
<item>
<selector>
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
</selector>
</item>
</ripple>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
android:insetLeft="0dp"
android:insetTop="16dp"
android:insetRight="0dp"
android:insetBottom="16dp">
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="?dialog_background_color" />
</shape>
</inset>

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/core_grey_45">
<item android:id="@+id/mask">
<shape>
<corners android:radius="1000dp" />
<solid android:color="@color/white" />
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="@color/core_white" />
</shape>
</item>
</ripple>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_white_40">
<item android:id="@+id/mask">
<shape>
<corners android:radius="1000dp" />
<solid android:color="@color/white" />
</shape>
</item>
<item android:drawable="@drawable/pill" />
</ripple>

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_white_40">
<item android:id="@+id/mask">
<shape>
<corners android:radius="5dp" />
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners android:radius="5dp" />
<solid android:color="@color/transparent_black_70"/>
</shape>
</item>
</ripple>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_white_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_75"/>
</shape>
</item>
</ripple>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/transparent_black_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_05"/>
</shape>
</item>
</ripple>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/touch_highlight">
<item
android:id="@android:id/mask"
android:drawable="@android:color/white" />
</ripple>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 932 B

After

Width:  |  Height:  |  Size: 872 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <ripple xmlns:android="http://schemas.android.com/apk/res/android"
<item android:state_pressed="true"> android:color="@color/touch_highlight">
<item android:id="@android:id/mask">
<shape android:shape="oval"> <shape android:shape="oval">
<solid android:color="@color/touch_highlight" /> <solid android:color="@color/black" />
</shape> </shape>
</item> </item>
</selector> </ripple>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <ripple xmlns:android="http://schemas.android.com/apk/res/android"
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" /> android:color="@color/textsecure_primary">
<item android:drawable="@color/textsecure_primary_alpha33" android:state_pressed="true" /> <item android:id="@android:id/mask" android:drawable="@android:color/black" />
<item android:drawable="@color/signal_primary_alpha_focus" android:state_focused="true" /> <item>
</selector> <selector>
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
</selector>
</item>
</ripple>

View File

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <ripple xmlns:android="http://schemas.android.com/apk/res/android"
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" /> android:color="@color/textsecure_primary">
<item android:drawable="@color/textsecure_primary_alpha33" android:state_pressed="true" /> <item android:id="@android:id/mask" android:drawable="@android:color/black" />
<item android:drawable="@color/signal_primary_alpha_focus" android:state_focused="true" /> <item>
</selector> <selector>
<item android:drawable="@color/textsecure_primary_alpha33" android:state_selected="true" />
</selector>
</item>
</ripple>

View File

@ -5,8 +5,8 @@
<gradient <gradient
android:angle="90" android:angle="90"
android:startColor="#121212" android:startColor="@color/default_background_start"
android:endColor="#171717" android:endColor="@color/default_background_end"
android:type="linear" /> android:type="linear" />
</shape> </shape>

View File

@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <inset xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:insetLeft="0dp"
<solid android:color="@color/transparent" /> android:insetTop="16dp"
</shape> android:insetRight="0dp"
android:insetBottom="16dp">
<shape android:shape="rectangle">
<corners android:radius="2dp" />
<solid android:color="?dialog_background_color" />
</shape>
</inset>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/ic_advanced_white_24dp" android:src="@drawable/ic_advanced_white_24dp"
android:tint="?attr/pref_icon_tint"/> android:tint="?attr/pref_icon_tint"/>

View File

@ -1,4 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <ripple
<solid android:color="@color/core_white"/> xmlns:android="http://schemas.android.com/apk/res/android"
</shape> android:color="@color/core_grey_45">
<item android:id="@+id/mask">
<shape>
<corners android:radius="1000dp" />
<solid android:color="@color/white" />
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="@color/core_white" />
</shape>
</item>
</ripple>

View File

@ -1,5 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <ripple
<corners android:radius="1000dp" /> xmlns:android="http://schemas.android.com/apk/res/android"
<solid android:color="@color/accent" /> android:color="@color/transparent_white_40">
</shape> <item android:id="@+id/mask">
<shape>
<corners android:radius="1000dp" />
<solid android:color="@color/white" />
</shape>
</item>
<item android:drawable="@drawable/pill" />
</ripple>

View File

@ -1,5 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <ripple
<corners android:radius="5dp" /> xmlns:android="http://schemas.android.com/apk/res/android"
<solid android:color="@color/transparent_black_70"/> android:color="@color/transparent_white_40">
</shape>
<item android:id="@+id/mask">
<shape>
<corners android:radius="5dp" />
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners android:radius="5dp" />
<solid android:color="@color/transparent_black_70"/>
</shape>
</item>
</ripple>

View File

@ -2,8 +2,8 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:topLeftRadius="44dp" <corners android:topLeftRadius="44dp"
android:topRightRadius="44dp" android:topRightRadius="44dp"
android:bottomLeftRadius="0dp" android:bottomLeftRadius="44dp"
android:bottomRightRadius="44dp"/> android:bottomRightRadius="0dp"/>
<solid android:color="#FF0288D1" /> <solid android:color="#FF0288D1" />
<size android:height="88dp" android:width="88dp" /> <size android:height="88dp" android:width="88dp" />
</shape> </shape>

View File

@ -1,4 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <ripple
<solid android:color="@color/core_grey_75"/> xmlns:android="http://schemas.android.com/apk/res/android"
</shape> android:color="@color/transparent_white_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_75"/>
</shape>
</item>
</ripple>

View File

@ -1,4 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <ripple
<solid android:color="@color/core_grey_05"/> xmlns:android="http://schemas.android.com/apk/res/android"
</shape> android:color="@color/transparent_black_40">
<item android:id="@+id/mask">
<shape android:shape="oval">
<solid android:color="@color/transparent_black" />
</shape>
</item>
<item>
<shape android:shape="oval" >
<solid android:color="@color/core_grey_05"/>
</shape>
</item>
</ripple>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <ripple xmlns:android="http://schemas.android.com/apk/res/android"
<item android:state_pressed="true" android:drawable="@color/touch_highlight" /> android:color="@color/touch_highlight">
<item android:state_focused="true" android:drawable="@color/signal_primary" /> <item
<item android:drawable="@android:color/transparent" /> android:id="@android:id/mask"
</selector> android:drawable="@android:color/white" />
</ripple>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.exoplayer2.ui.PlayerView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
app:player_layout_id="@layout/media_preview_exoplayer_layout"/>
</FrameLayout>

View File

@ -161,6 +161,22 @@
android:layout_marginTop="@dimen/large_spacing" android:layout_marginTop="@dimen/large_spacing"
android:background="@color/separator" /> android:background="@color/separator" />
<TextView
android:id="@+id/themeSwitchButton"
android:layout_width="match_parent"
android:layout_height="@dimen/setting_button_height"
android:background="@color/accent"
android:textColor="@color/text"
android:textSize="@dimen/medium_font_size"
android:textStyle="bold"
android:gravity="center"
android:text="Switch Theme" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/separator" />
<TextView <TextView
android:id="@+id/privacyButton" android:id="@+id/privacyButton"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout
android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"> android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<VideoView android:id="@+id/video_view" <com.google.android.exoplayer2.ui.PlayerView
android:layout_width="match_parent" android:id="@+id/video_view"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_gravity="center" android:layout_height="match_parent"
android:gravity="center"/> android:layout_gravity="center"
android:gravity="center"
app:player_layout_id="@layout/media_preview_exoplayer_layout"/>
</FrameLayout> </FrameLayout>

View File

@ -0,0 +1,32 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources>
<!-- Session -->
<color name="accent">#00E97B</color>
<color name="text">#000000</color>
<color name="cell_background">#FCFCFC</color>
<color name="cell_selected">#DFDFDF</color>
<color name="navigation_bar_background">#FCFCFC</color>
<color name="unimportant_button_background">@color/transparent</color>
<color name="dialog_background">#FCFCFC</color>
<color name="dialog_border">#212121</color>
<color name="compose_view_background">#FCFCFC</color>
<color name="compose_text_view_background">#EDEDED</color>
<color name="received_message_background">#F5F5F5</color>
<color name="sent_message_background">#00E97B</color>
<color name="new_conversation_button_collapsed_background">#F5F5F5</color>
<color name="pn_option_background">#FCFCFC</color>
<color name="fake_chat_bubble_background">#F5F5F5</color>
<color name="default_background_start">#fcfcfd</color>
<color name="default_background_end">#fcfcfd</color>
<color name="action_bar_background">#fcfcfd</color>
<color name="unimportant_dialog_button_background">#1B1B1B</color>
<color name="app_icon_background">#333132</color>
<color name="progress_bar_background">#0AFFFFFF</color>
<color name="quote_not_found_background">#99FFFFFF</color>
</resources>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.ProgressBar.Horizontal" parent="@android:style/Widget.Holo.ProgressBar.Horizontal">
</style>
</resources>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="touch_highlight">#22000000</color>
</resources>

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TextSecure.ScribbleTheme" parent="TextSecure.DarkNoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
</resources>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TextSecure.DarkTheme" parent="@style/TextSecure.BaseDarkTheme">
<item name="android:navigationBarColor">@color/compose_view_background</item>
</style>
<style name="TextSecure.DarkNoActionBar" parent="@style/TextSecure.BaseDarkNoActionBar">
<item name="android:navigationBarColor">@color/compose_view_background</item>
<item name="android:colorControlActivated">@color/signal_primary_dark</item>
</style>
</resources>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent" />
<style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title" />
</resources>

View File

@ -82,7 +82,7 @@
<color name="conversation_compose_divider">#32000000</color> <color name="conversation_compose_divider">#32000000</color>
<color name="action_mode_status_bar">@color/gray65</color> <color name="action_mode_status_bar">@color/gray65</color>
<color name="touch_highlight">#400099cc</color> <color name="touch_highlight">#22000000</color>
<color name="device_link_item_background_light">#ffffffff</color> <color name="device_link_item_background_light">#ffffffff</color>
<color name="device_link_item_background_dark">#ff333333</color> <color name="device_link_item_background_dark">#ff333333</color>
@ -107,4 +107,7 @@
<color name="avatar_background">@color/transparent_black_90</color> <color name="avatar_background">@color/transparent_black_90</color>
<color name="default_background_start">#121212</color>
<color name="default_background_end">#171717</color>
</resources> </resources>

View File

@ -296,13 +296,12 @@
<item name="android:textColor">#BFffffff</item> <item name="android:textColor">#BFffffff</item>
</style> </style>
<style name="NotificationText"> <style name="NotificationText" parent="android:TextAppearance.StatusBar.EventContent">
<item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textColor">?android:attr/textColorPrimary</item>
</style> </style>
<style name="NotificationTitle" parent="android:TextAppearance.StatusBar.EventContent.Title">
<style name="NotificationTitle"> <item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textColor">?android:attr/textColorPrimary</item> <item name="android:textStyle">bold</item>
<item name="android:textStyle">bold</item>
</style> </style>
<style name="Registration.Description" parent="@android:style/TextAppearance"> <style name="Registration.Description" parent="@android:style/TextAppearance">
@ -350,7 +349,7 @@
<!-- For Holo Light Dialog Activity Styling Emulation --> <!-- For Holo Light Dialog Activity Styling Emulation -->
<style name="Widget.ProgressBar.Horizontal" parent="@android:style/Widget.ProgressBar.Horizontal"> <style name="Widget.ProgressBar.Horizontal" parent="@android:style/Widget.Holo.ProgressBar.Horizontal">
</style> </style>
<style name="MaterialButton"> <style name="MaterialButton">

View File

@ -3,43 +3,23 @@
<resources> <resources>
<!-- Session --> <!-- Session -->
<style name="Session.DarkTheme" parent="@style/Theme.AppCompat"> <style name="Session.DarkTheme" parent="@style/Theme.AppCompat.DayNight.DarkActionBar">
<item name="actionBarStyle">@style/Session.DarkActionBar</item>
<item name="colorPrimary">@color/action_bar_background</item> <item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/action_bar_background</item> <item name="colorPrimaryDark">@color/action_bar_background</item>
<item name="android:navigationBarColor">@color/navigation_bar_background</item> <item name="colorAccent">@color/accent</item>
<item name="actionBarStyle">@style/Session.DarkActionBar</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item> <item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:navigationBarColor">@color/compose_view_background</item>
<item name="android:windowBackground">@drawable/default_session_background</item> <item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item> <item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
<item name="actionModeBackground">@color/compose_view_background</item> <item name="actionModeBackground">@color/compose_view_background</item>
<item name="windowActionModeOverlay">true</item> <item name="windowActionModeOverlay">true</item>
</style> </style>
<style name="Session.DarkTheme.NoActionBar" parent="@style/Theme.AppCompat.NoActionBar"> <style name="Session.DarkTheme.NoActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar"/>
<item name="actionBarStyle">@style/Session.DarkActionBar</item>
<item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/action_bar_background</item>
<item name="android:navigationBarColor">@color/navigation_bar_background</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
<item name="actionModeBackground">@color/compose_view_background</item>
<item name="windowActionModeOverlay">true</item>
</style>
<style name="Session.DarkTheme.SubtitleActionBar" parent="@style/Theme.AppCompat"> <style name="Session.DarkTheme.SubtitleActionBar" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="actionBarStyle">@style/Session.DarkSubtitleActionBar</item> <item name="actionBarStyle">@style/Session.DarkSubtitleActionBar</item>
<item name="colorPrimary">@color/action_bar_background</item>
<item name="colorPrimaryDark">@color/action_bar_background</item>
<item name="android:navigationBarColor">@color/navigation_bar_background</item>
<item name="alertDialogTheme">@style/Session.AlertDialog</item>
<item name="android:windowBackground">@drawable/default_session_background</item>
<item name="preferenceTheme">@style/Session.SettingsTheme</item>
<item name="colorAccent">@color/accent</item>
<item name="actionModeBackground">@color/compose_view_background</item>
<item name="windowActionModeOverlay">true</item>
</style> </style>
<!-- Session --> <!-- Session -->
@ -68,7 +48,8 @@
</style> </style>
<style name="TextSecure.DarkNoActionBar" parent="@style/TextSecure.BaseDarkNoActionBar"> <style name="TextSecure.DarkNoActionBar" parent="@style/TextSecure.BaseDarkNoActionBar">
<!-- leave empty to allow overriding --> <item name="android:navigationBarColor">@color/compose_view_background</item>
<item name="android:colorControlActivated">@color/signal_primary_dark</item>
</style> </style>
<style name="TextSecure.BaseDarkNoActionBar" parent="@style/TextSecure.BaseDarkTheme"> <style name="TextSecure.BaseDarkNoActionBar" parent="@style/TextSecure.BaseDarkTheme">
@ -535,6 +516,8 @@
</style> </style>
<style name="TextSecure.ScribbleTheme" parent="TextSecure.DarkNoActionBar"> <style name="TextSecure.ScribbleTheme" parent="TextSecure.DarkNoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style> </style>
<style name="TextSecure.MediaSendProgressDialog" parent="@android:style/Theme.Dialog"> <style name="TextSecure.MediaSendProgressDialog" parent="@android:style/Theme.Dialog">

View File

@ -5,11 +5,13 @@ import android.content.ClipData
import android.content.ClipboardManager import android.content.ClipboardManager
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.res.Configuration
import android.net.Uri import android.net.Uri
import android.os.AsyncTask import android.os.AsyncTask
import android.os.Bundle import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.support.v7.app.AppCompatDelegate
import android.view.View import android.view.View
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.LinearLayout import android.widget.LinearLayout
@ -66,6 +68,11 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
// region Lifecycle // region Lifecycle
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) { override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
super.onCreate(savedInstanceState, isReady) super.onCreate(savedInstanceState, isReady)
// setTheme(if (isDarkTheme())
// R.style.Session_DarkTheme_NoActionBar
// else
// R.style.Session_LightTheme_NoActionBar)
setContentView(R.layout.activity_settings) setContentView(R.layout.activity_settings)
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
cancelButton.setOnClickListener { cancelEditingDisplayName() } cancelButton.setOnClickListener { cancelEditingDisplayName() }
@ -96,6 +103,21 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
seedButton.setOnClickListener { showSeed() } seedButton.setOnClickListener { showSeed() }
clearAllDataButton.setOnClickListener { clearAllData() } clearAllDataButton.setOnClickListener { clearAllData() }
versionTextView.text = String.format(getString(R.string.version_s), BuildConfig.VERSION_NAME) versionTextView.text = String.format(getString(R.string.version_s), BuildConfig.VERSION_NAME)
themeSwitchButton.setOnClickListener {
setDarkTheme(!isDarkTheme())
recreate()
}
}
private fun isDarkTheme(): Boolean {
val themeFlag = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
return themeFlag == Configuration.UI_MODE_NIGHT_YES;
}
private fun setDarkTheme(darkTheme: Boolean) {
// AppCompatDelegate.setDefaultNightMode(if (darkTheme) AppCompatDelegate.MODE_NIGHT_YES else AppCompatDelegate.MODE_NIGHT_NO )
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_AUTO)
} }
public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {