mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-03-01 22:22:15 +00:00
Increase clickable area of media download button.
This commit is contained in:
committed by
Cody Henthorne
parent
e5ab5241d5
commit
7ff0b7aa3c
@@ -207,7 +207,11 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
|
||||
private fun displayPendingGallery(currentState: TransferControlViewState) {
|
||||
binding.primaryProgressView.startClickListener = currentState.downloadClickedListener
|
||||
applyFocusableAndClickable(currentState, listOf(binding.primaryProgressView, binding.primaryDetailsText), listOf(binding.secondaryProgressView, binding.playVideoButton))
|
||||
applyFocusableAndClickable(
|
||||
currentState,
|
||||
listOf(binding.primaryProgressView, binding.primaryDetailsText, binding.primaryBackground),
|
||||
listOf(binding.secondaryProgressView, binding.playVideoButton)
|
||||
)
|
||||
binding.primaryProgressView.setStopped(false)
|
||||
showAllViews(
|
||||
playVideoButton = false,
|
||||
@@ -215,6 +219,9 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
secondaryDetailsText = currentState.showSecondaryText
|
||||
)
|
||||
|
||||
binding.primaryDetailsText.setOnClickListener(currentState.downloadClickedListener)
|
||||
binding.primaryBackground.setOnClickListener(currentState.downloadClickedListener)
|
||||
|
||||
binding.primaryDetailsText.translationX = if (ViewUtil.isLtr(this)) {
|
||||
ViewUtil.dpToPx(-8).toFloat()
|
||||
} else {
|
||||
@@ -430,7 +437,10 @@ class TransferControlView @JvmOverloads constructor(context: Context, attrs: Att
|
||||
inactiveViews.forEach { it.focusable = View.NOT_FOCUSABLE }
|
||||
}
|
||||
activeViews.forEach { it.isClickable = currentState.isClickable }
|
||||
inactiveViews.forEach { it.isClickable = false }
|
||||
inactiveViews.forEach {
|
||||
it.setOnClickListener(null)
|
||||
it.isClickable = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun setFocusable(focusable: Boolean) {
|
||||
|
||||
Reference in New Issue
Block a user