1
0
Fork 0

For #7725: Increase info button touch target while keeping size.

Also removed unnecessary touch delegate.
master
mcarare 2020-06-03 10:16:45 +03:00 committed by Mihai Branescu
parent 8f3274eba9
commit 2d24369362
2 changed files with 5 additions and 10 deletions

View File

@ -11,7 +11,6 @@ import androidx.core.content.res.TypedArrayUtils
import androidx.core.content.withStyledAttributes
import androidx.preference.PreferenceViewHolder
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.increaseTapArea
class RadioButtonInfoPreference @JvmOverloads constructor(
context: Context,
@ -61,15 +60,10 @@ class RadioButtonInfoPreference @JvmOverloads constructor(
override fun onBindViewHolder(holder: PreferenceViewHolder) {
super.onBindViewHolder(holder)
infoView = holder.findViewById(R.id.info_button) as ImageView
infoView?.increaseTapArea(EXTRA_TAP_AREA)
infoView?.setOnClickListener {
infoClickListener?.invoke()
}
infoView?.alpha = if (isEnabled) FULL_ALPHA else HALF_ALPHA
contentDescription?.let { infoView?.contentDescription = it }
}
companion object {
const val EXTRA_TAP_AREA = 22
}
}

View File

@ -65,10 +65,11 @@
<ImageView
android:id="@+id/info_button"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="18dp"
android:layout_marginEnd="18dp"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:padding="12dp"
app:srcCompat="@drawable/ic_info"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"