For #15963 - Increase touch target for the close button in the tabs tray grid layout

We need to ensure it has at least 48dp while also not appearing too big.
upstream-sync
Mugurell 4 years ago committed by Gabriel Luong
parent 83bd80c873
commit a6092c34cc

@ -62,6 +62,7 @@ class TabTrayViewHolder(
@VisibleForTesting
internal val urlView: TextView? = itemView.findViewById(R.id.mozac_browser_tabstray_url)
private val playPauseButtonView: ImageButton = itemView.findViewById(R.id.play_pause_button)
private val closeButton: AppCompatImageButton = itemView.findViewById(R.id.mozac_browser_tabstray_close)
override var tab: Tab? = null
@ -88,6 +89,10 @@ class TabTrayViewHolder(
loadIntoThumbnailView(thumbnailView, tab.id)
}
if (itemView.context.settings().gridTabView) {
closeButton.increaseTapArea(GRID_ITEM_CLOSE_BUTTON_EXTRA_DPS)
}
// Media state
playPauseButtonView.increaseTapArea(PLAY_PAUSE_BUTTON_EXTRA_DPS)
with(playPauseButtonView) {
@ -236,5 +241,6 @@ class TabTrayViewHolder(
companion object {
private const val PLAY_PAUSE_BUTTON_EXTRA_DPS = 24
private const val GRID_ITEM_CLOSE_BUTTON_EXTRA_DPS = 24
}
}

@ -70,8 +70,8 @@ A FrameLayout here is an efficient way of having a views stack while allowing:
<androidx.appcompat.widget.AppCompatImageButton
android:id="@+id/mozac_browser_tabstray_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/close_tab"
app:layout_constraintBottom_toTopOf="@+id/horizonatal_divider"

Loading…
Cancel
Save