theme quote deletion image button

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2022-08-01 22:20:44 +02:00
parent d27f0e2222
commit f6e215ad63
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
3 changed files with 24 additions and 2 deletions

View file

@ -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())

View file

@ -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
*/

View file

@ -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" />