Эх сурвалжийг харах

theme quote deletion image button

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 2 жил өмнө
parent
commit
f6e215ad63

+ 2 - 0
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -1760,6 +1760,8 @@ class ChatController(args: Bundle) :
             cancelReply()
         }
 
+        viewThemeUtils.themeImageButton(binding.messageInputView.findViewById<ImageButton>(R.id.cancelReplyButton))
+
         cancelNotificationsForCurrentConversation()
 
         Log.d(TAG, "onAttach inConversation: " + inConversation.toString())

+ 20 - 0
app/src/main/java/com/nextcloud/talk/ui/theme/ViewThemeUtils.kt

@@ -31,6 +31,7 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.CheckBox
 import android.widget.EditText
+import android.widget.ImageButton
 import android.widget.ImageView
 import android.widget.LinearLayout
 import android.widget.ProgressBar
@@ -211,6 +212,25 @@ class ViewThemeUtils @Inject constructor(private val theme: ServerTheme, private
         }
     }
 
+    fun themeImageButton(imageButton: ImageButton) {
+        withScheme(imageButton) { scheme ->
+            imageButton.imageTintList = ColorStateList(
+                arrayOf(
+                    intArrayOf(android.R.attr.state_selected),
+                    intArrayOf(-android.R.attr.state_selected),
+                    intArrayOf(android.R.attr.state_enabled),
+                    intArrayOf(-android.R.attr.state_enabled)
+                ),
+                intArrayOf(
+                    scheme.primary,
+                    scheme.onSurfaceVariant,
+                    scheme.onSurfaceVariant,
+                    calculateDisabledColor(scheme.onSurface, ON_SURFACE_OPACITY_BUTTON_DISABLED)
+                )
+            )
+        }
+    }
+
     /**
      * Tints the image with element color
      */

+ 2 - 2
app/src/main/res/layout/item_message_quote.xml

@@ -104,9 +104,9 @@
         android:layout_centerVertical="true"
         android:layout_marginStart="8dp"
         android:layout_marginEnd="8dp"
-        android:background="@drawable/ic_cancel_black_24dp"
-        android:backgroundTint="@color/grey_600"
+        android:background="@color/transparent"
         android:contentDescription="@string/nc_message_quote_cancel_reply"
+        android:src="@drawable/ic_cancel_black_24dp"
         android:visibility="gone"
         tools:visibility="visible" />