Browse Source

Various improvements to dark theme

Signed-off-by: Daniel Bailey <daniel.bailey@grappleIT.co.uk>
Daniel Bailey 6 năm trước cách đây
mục cha
commit
6bb9a70603

+ 1 - 1
src/main/java/com/nextcloud/client/onboarding/FirstRunActivity.java

@@ -81,7 +81,7 @@ public class FirstRunActivity extends BaseActivity implements ViewPager.OnPageCh
 
         Button loginButton = findViewById(R.id.login);
         loginButton.setBackgroundColor(getResources().getColor(R.color.bg_default));
-        loginButton.setTextColor(getResources().getColor(R.color.fg_default));
+        loginButton.setTextColor(getResources().getColor(R.color.primary));
 
         loginButton.setOnClickListener(v -> {
             if (getIntent().getBooleanExtra(EXTRA_ALLOW_CLOSE, false)) {

+ 1 - 1
src/main/res/layout/storage_path_item.xml

@@ -50,7 +50,7 @@
         android:ellipsize="end"
         android:gravity="center_vertical"
         android:singleLine="true"
-        android:textColor="@color/textColor"
+        android:textColor="@color/fg_default"
         android:textSize="@dimen/file_details_username_text_size"
         tools:text="DCIM" />
 </LinearLayout>

+ 0 - 5
src/main/res/values-night/colors.xml

@@ -65,8 +65,6 @@
     <color name="indicator_dot_selected">#ffffff</color>
     <color name="drawer_shadow">#000000</color>
 
-    <color name="action_edit_text">#888888</color>
-
     <!-- special transparent action bar colors for image preview -->
     <color name="color_transparent">#201D2D44</color>
     <color name="color_dark_transparent">#40162233</color>
@@ -78,9 +76,6 @@
 
     <!--<color name="background_material_light">#555555</color>-->
     <color name="drawer_menu_icon">#ffffff</color>
-    <color name="date_picker_header_text">#616161</color>
     <color name="bg_fallback_highlight">#737373</color>
-    <color name="switchpref_track">#4DFFFFFF</color>
 
-    <color name="bg_fallback_activated">#525252</color>
 </resources>

+ 25 - 0
src/main/res/values-v21/styles.xml

@@ -17,6 +17,31 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <resources xmlns:android="http://schemas.android.com/apk/res/android">
+    <!-- General ownCloud app style -->
+    <style name="Theme.ownCloud" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
+        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
+    </style>
+
+    <style name="FallbackThemingTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
+        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
+    </style>
+
+    <style name="FallbackDatePickerDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
+        <item name="colorPrimary">@color/bg_default</item>
+        <item name="android:textAllCaps">false</item>
+        <item name="android:windowBackground">@color/bg_default</item>
+        <item name="android:textColor">@color/fg_inverse</item>
+        <item name="android:datePickerStyle">@style/DatePickerStyle</item>
+        <item name="colorControlHighlight">@color/bg_fallback_highlight</item>
+        <item name="colorControlActivated">@color/bg_fallback_highlight</item>
+    </style>
+
+    <style name="DatePickerStyle" parent="">
+        <item name="android:headerBackground">@color/bg_fallback_highlight</item>
+        <!-- TODO for < API21 -->
+        <item name="android:datePickerMode">calendar</item>
+    </style>
+
     <style name="Theme.ownCloud.Toolbar">
         <item name="android:windowDrawsSystemBarBackgrounds">true</item>
         <item name="windowNoTitle">true</item>

+ 0 - 6
src/main/res/values/colors.xml

@@ -70,8 +70,6 @@
     <color name="indicator_dot_selected">#ffffff</color>
     <color name="drawer_shadow">#000000</color>
 
-    <color name="action_edit_text">#888888</color>
-
     <!-- special transparent action bar colors for image preview -->
     <color name="color_transparent">#201D2D44</color>
     <color name="color_dark_transparent">#40162233</color>
@@ -83,14 +81,10 @@
 
     <!--<color name="background_material_light">#ef4</color>-->
     <color name="drawer_menu_icon">#757575</color>
-    <color name="date_picker_header_text">#ffffff</color>
     <color name="bg_fallback_highlight">#616161</color>
-    <color name="switchpref_track">#4D000000</color>
 
     <!-- Excluded from future app dark theme -->
     <color name="themed_fg">#FFFFFF</color>
     <color name="themed_fg_inverse">#000000</color>
 
-    <color name="bg_fallback_activated">#737373</color>
-
 </resources>

+ 2 - 34
src/main/res/values/styles.xml

@@ -43,14 +43,13 @@
         <item name="android:alertDialogTheme">@style/FallbackTheming.Dialog</item>
         <item name="dialogTheme">@style/FallbackTheming.Dialog</item>
         <item name="android:windowBackground">@color/bg_default</item>
-        <item name="android:datePickerDialogTheme">@style/FallbackDatePickerDialogTheme</item>
     </style>
 
 	<style name="FallbackDatePickerDialogTheme" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
-        <!-- TODO change these reference names -->
+        <item name="colorPrimary">@color/bg_default</item>
         <item name="android:textAllCaps">false</item>
         <item name="android:windowBackground">@color/bg_default</item>
-        <item name="android:textColor">@color/textColor_inverse</item>
+        <item name="android:textColor">@color/fg_inverse</item>
         <item name="android:datePickerStyle">@style/DatePickerStyle</item>
         <item name="colorControlHighlight">@color/bg_fallback_highlight</item>
         <item name="colorControlActivated">@color/bg_fallback_highlight</item>
@@ -58,8 +57,6 @@
 
     <style name="DatePickerStyle" parent="">
         <item name="android:headerBackground">@color/bg_fallback_highlight</item>
-        <!-- TODO for < API21 -->
-        <item name="android:datePickerMode">calendar</item>
     </style>
 
     <style name="FallbackTheming.Dialog" parent="Theme.MaterialComponents.DayNight.Dialog">
@@ -245,30 +242,6 @@
 		<item name="android:color">@color/textColor</item>
 	</style>
 
-	<!-- Button Bar hack due to Lollipop bug:
-		https://code.google.com/p/android/issues/detail?id=78302
-	fix see:
-		http://stackoverflow.com/questions/27187353/dialog-buttons-with-long-text-not-wrapping-squeezed-out-material-theme-on-an
-	 -->
-	<style name="Theme.ownCloud.Dialog.ButtonBar" parent="@style/Widget.AppCompat.Button.ButtonBar.AlertDialog">
-		<!-- Making sure, the button bar uses parent width and is not restricted in height -->
-		<item name="android:layout_width">match_parent</item>
-		<item name="android:layout_height">wrap_content</item>
-		<item name="android:height">@null</item>
-		<item name="android:minHeight">@null</item>
-	</style>
-
-	<style name="Theme.ownCloud.Dialog.ButtonBar.Button" parent="@style/Widget.MaterialComponents.Button.TextButton">
-		<!-- Setting the weight as follows should result in equally wide buttons filling the alert dialog width,
-            but instead they span further out of the dialog, breaking in multiple lines though -->
-		<item name="android:layout_width">0dp</item>
-		<item name="android:layout_weight">1</item>
-		<!-- setting a fixed width as follows results in narrow buttons with line breaks, but of course this is not a solution -->
-		<!-- <item name="android:width">100dp</item> -->
-        <item name="android:textAllCaps">false</item>
-        <item name="backgroundTint">@color/bg_default</item>
-	</style>
-
     <style name="PassCodeStyle">
         <item name="android:layout_width">50dp</item>
         <item name="android:layout_height">50dp</item>
@@ -297,11 +270,6 @@
 
     <style name="TextInputLayout" parent="Base.Widget.MaterialComponents.TextInputEditText"></style>
 
-    <style name="Nextcloud.TextInputLayout.Login" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
-        <item name="boxBackgroundColor">@color/primary</item>
-        <item name="android:textColorHint">@color/fg_inverse</item>
-	</style>
-
 	<style name="Nextcloud.EditText.Login" parent="ThemeOverlay.MaterialComponents.TextInputEditText">
         <item name="colorControlNormal">@color/login_text_color</item>
 		<item name="colorControlActivated">@color/login_text_color</item>