From b05350b5aaaa6825bcac24eaa5715b4d6c10fa39 Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Mon, 31 Aug 2020 23:16:15 +1000 Subject: [PATCH] Daynight theme for media preview & overview activities. --- AndroidManifest.xml | 5 +- res/animator/appbar_elevation.xml | 13 +++++ res/layout/activity_create_private_chat.xml | 2 +- res/layout/activity_join_public_chat.xml | 2 +- res/layout/activity_link_device.xml | 2 +- res/layout/activity_qr_code.xml | 2 +- res/layout/document_view.xml | 12 +++-- res/layout/giphy_activity.xml | 2 +- res/layout/media_overview_activity.xml | 19 ++++--- res/layout/media_overview_document_item.xml | 6 +-- .../media_overview_documents_fragment.xml | 33 ++++++------ res/layout/media_preview_activity.xml | 13 +++++ res/values-notnight-v21/themes.xml | 17 ++----- res/values-v23/themes.xml | 14 ++---- res/values/attrs.xml | 1 + res/values/styles.xml | 30 +++++++---- res/values/themes.xml | 50 +++++++++++++++---- .../securesms/MediaOverviewActivity.java | 37 ++++++-------- .../securesms/MediaPreviewActivity.java | 11 ++-- .../securesms/util/DynamicTheme.java | 4 ++ 20 files changed, 167 insertions(+), 108 deletions(-) create mode 100644 res/animator/appbar_elevation.xml diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 2b2f24d0d8..729f9f2d92 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -125,7 +125,8 @@ android:screenOrientation="portrait" /> + android:screenOrientation="portrait" + android:theme="@style/Theme.Session.DayNight.FlatActionBar"/> @@ -411,7 +412,7 @@ android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:label="@string/AndroidManifest__media_preview" android:screenOrientation="portrait" - android:theme="@style/Theme.Session.DayNight" + android:theme="@style/Theme.Session.DayNight.NoActionBar" android:launchMode="singleTask" android:windowSoftInputMode="stateHidden" /> + + + + + + \ No newline at end of file diff --git a/res/layout/activity_create_private_chat.xml b/res/layout/activity_create_private_chat.xml index d0ca41225c..6a1229648e 100644 --- a/res/layout/activity_create_private_chat.xml +++ b/res/layout/activity_create_private_chat.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" > diff --git a/res/layout/activity_join_public_chat.xml b/res/layout/activity_join_public_chat.xml index 7d50533711..8ad81ba3de 100644 --- a/res/layout/activity_join_public_chat.xml +++ b/res/layout/activity_join_public_chat.xml @@ -11,7 +11,7 @@ android:layout_height="match_parent" > diff --git a/res/layout/activity_link_device.xml b/res/layout/activity_link_device.xml index d0ca41225c..6a1229648e 100644 --- a/res/layout/activity_link_device.xml +++ b/res/layout/activity_link_device.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" > diff --git a/res/layout/activity_qr_code.xml b/res/layout/activity_qr_code.xml index d0ca41225c..6a1229648e 100644 --- a/res/layout/activity_qr_code.xml +++ b/res/layout/activity_qr_code.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" > diff --git a/res/layout/document_view.xml b/res/layout/document_view.xml index 5cf4436d27..428375f087 100644 --- a/res/layout/document_view.xml +++ b/res/layout/document_view.xml @@ -28,7 +28,7 @@ android:visibility="gone" android:clickable="false" android:layout_gravity="center" - app:matProg_barColor="@color/white" + app:matProg_barColor="?android:textColorPrimary" app:matProg_linearProgress="true" app:matProg_spinSpeed="0.333" tools:visibility="gone"/> @@ -42,7 +42,8 @@ android:gravity="center" android:visibility="visible" android:clickable="false" - android:focusable="false"> + android:focusable="false" + tools:visibility="visible"> @@ -75,8 +76,9 @@ android:clickable="true" android:visibility="gone" android:background="@drawable/circle_touch_highlight_background" - android:src="@drawable/ic_download_circle_fill_white_48dp" - android:contentDescription="@string/audio_view__download_accessibility_description"/> + android:src="@drawable/ic_download_circle_filled_48" + android:contentDescription="@string/audio_view__download_accessibility_description" + tools:visibility="visible"/> diff --git a/res/layout/giphy_activity.xml b/res/layout/giphy_activity.xml index 89562bc5fc..63f1909b9f 100644 --- a/res/layout/giphy_activity.xml +++ b/res/layout/giphy_activity.xml @@ -28,7 +28,7 @@ android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/Session.DarkTabLayout" + android:theme="@style/Widget.Session.TabLayout" app:tabRippleColor="@color/cell_selected" app:tabIndicatorColor="@color/accent" android:scrollbars="horizontal"/> diff --git a/res/layout/media_overview_activity.xml b/res/layout/media_overview_activity.xml index c985986d56..514d20d631 100644 --- a/res/layout/media_overview_activity.xml +++ b/res/layout/media_overview_activity.xml @@ -1,32 +1,31 @@ + tools:context="org.thoughtcrime.securesms.MediaOverviewActivity" + android:theme="@style/Theme.Session.DayNight.NoActionBar"> + android:layout_height="wrap_content" + android:stateListAnimator="@animator/appbar_elevation"> + android:layout_gravity="top"/> diff --git a/res/layout/media_overview_document_item.xml b/res/layout/media_overview_document_item.xml index 400c88cf76..231592530f 100644 --- a/res/layout/media_overview_document_item.xml +++ b/res/layout/media_overview_document_item.xml @@ -16,8 +16,8 @@ android:layout_gravity="center_vertical" android:layout_weight="1" android:visibility="visible" - app:doc_titleColor="?media_overview_document_primary" - app:doc_captionColor="?media_overview_document_secondary" + app:doc_titleColor="?android:textColorPrimary" + app:doc_captionColor="?android:textColorTertiary" tools:visibility="visible"/> diff --git a/res/layout/media_overview_documents_fragment.xml b/res/layout/media_overview_documents_fragment.xml index 9f9aaa3ff8..03d041c5c4 100644 --- a/res/layout/media_overview_documents_fragment.xml +++ b/res/layout/media_overview_documents_fragment.xml @@ -1,22 +1,25 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent"> + android:id="@+id/recycler_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scrollbars="vertical" + tools:listitem="@layout/media_overview_document_item" /> - + diff --git a/res/layout/media_preview_activity.xml b/res/layout/media_preview_activity.xml index 53023d2283..2f32fbc1d4 100644 --- a/res/layout/media_preview_activity.xml +++ b/res/layout/media_preview_activity.xml @@ -7,6 +7,19 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + + + ?colorAccent @android:color/black + + @drawable/ic_document_small_light + @drawable/ic_document_large_light - - + \ No newline at end of file diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 49dbe90b4d..d59dee787e 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -5,6 +5,7 @@ + diff --git a/res/values/styles.xml b/res/values/styles.xml index 04fa232c5d..26fc33d1e1 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -3,10 +3,9 @@ @@ -21,7 +20,7 @@ - - + + + + diff --git a/res/values/themes.xml b/res/values/themes.xml index 58ef0b3edc..e36c37d5ed 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -18,8 +18,6 @@ @drawable/default_session_background @color/default_background_start @color/compose_view_background - - @style/ThemeOverlay.AppCompat.Light @null @@ -31,9 +29,13 @@ @style/Session.SettingsTheme @color/accent true - @style/Widget.Design.AppBarLayout + @style/Widget.Session.AppBarLayout + @style/Widget.Session.TabBar + @color/black + @color/black + true @drawable/ic_baseline_clear_24 @color/compose_view_background @@ -41,8 +43,23 @@ @color/separator ?dividerVertical + @color/dialog_background + @color/transparent + @color/white + @color/text + @color/core_grey_05 + #99FFFFFF + @color/core_grey_25 + @style/TextSecure.BaseDarkTheme.SearchView + + ?background + @drawable/ic_document_small_dark + @drawable/ic_document_large_dark + #222 + + #00000000 #FF000000 @@ -72,17 +89,22 @@ + - + + + - +