Parcourir la source

Make status card views themed like tonal buttons

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger il y a 2 ans
Parent
commit
e902396aa3

+ 1 - 1
app/build.gradle

@@ -355,7 +355,7 @@ dependencies {
     gplayImplementation "com.google.firebase:firebase-messaging:23.0.7"
 
     // TODO change back to tag before merging
-    implementation 'com.github.nextcloud.android-common:ui:fd9e4da593'
+    implementation 'com.github.nextcloud.android-common:ui:38cfcd97d2'
 }
 
 configurations.all {

+ 3 - 3
app/src/main/java/com/nextcloud/ui/SetStatusDialogFragment.kt

@@ -207,8 +207,8 @@ class SetStatusDialogFragment :
             }
         }
 
-        viewThemeUtils.material.colorMaterialButtonText(binding.clearStatus)
-        viewThemeUtils.material.colorMaterialButtonPrimaryFilled(binding.setStatus)
+        viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(binding.clearStatus)
+        viewThemeUtils.material.colorMaterialButtonPrimaryTonal(binding.setStatus)
         viewThemeUtils.material.colorTextInputLayout(binding.customStatusInputContainer)
 
         viewThemeUtils.platform.themeDialog(binding.root)
@@ -330,7 +330,7 @@ class SetStatusDialogFragment :
             }
         }
         views.first.isChecked = true
-        viewThemeUtils.platform.colorPrimaryTextViewElement(views.second)
+        viewThemeUtils.platform.colorOnSecondaryContainerTextViewElement(views.second)
     }
 
     private fun clearTopStatus() {

+ 0 - 2
app/src/main/java/com/owncloud/android/ui/fragment/OCFileListBottomSheetDialog.java

@@ -82,8 +82,6 @@ public class OCFileListBottomSheetDialog extends BottomSheetDialog implements In
         binding = FileListActionsBottomSheetFragmentBinding.inflate(getLayoutInflater());
         setContentView(binding.getRoot());
 
-        viewThemeUtils.platform.themeDialog(binding.getRoot());
-
         viewThemeUtils.platform.colorImageView(binding.menuIconUploadFiles);
         viewThemeUtils.platform.colorImageView(binding.menuIconUploadFromApp);
         viewThemeUtils.platform.colorImageView(binding.menuIconDirectCameraUpload);

+ 4 - 3
app/src/main/java/com/owncloud/android/utils/theme/newm3/FilesSpecificViewThemeUtils.kt

@@ -194,6 +194,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
 
     fun themeStatusCardView(cardView: MaterialCardView) {
         withScheme(cardView) { scheme ->
+            val background = cardView.context.getColor(R.color.grey_200)
             cardView.backgroundTintList =
                 ColorStateList(
                     arrayOf(
@@ -201,8 +202,8 @@ class FilesSpecificViewThemeUtils @Inject constructor(
                         intArrayOf(-android.R.attr.state_checked)
                     ),
                     intArrayOf(
-                        scheme.surfaceVariant,
-                        scheme.surfaceVariant
+                        scheme.secondaryContainer,
+                        background
                     )
                 )
             cardView.setStrokeColor(
@@ -212,7 +213,7 @@ class FilesSpecificViewThemeUtils @Inject constructor(
                         intArrayOf(-android.R.attr.state_checked)
                     ),
                     intArrayOf(
-                        scheme.primary,
+                        scheme.onSecondaryContainer,
                         scheme.surface
                     )
                 )

+ 1 - 1
app/src/main/res/layout/dialog_set_status.xml

@@ -443,7 +443,7 @@
 
         <com.google.android.material.button.MaterialButton
             android:id="@+id/clearStatus"
-            style="@style/OutlinedButton"
+            style="@style/Button.Borderless"
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
             android:layout_marginEnd="@dimen/standard_half_margin"