1
0
Fork 0

For #1555: Bookmark Overflow menu tap area should be larger

master
Colin Lee 2019-04-18 23:44:15 -05:00 committed by Jeff Boek
parent d5557b0db3
commit 12614e0142
3 changed files with 12 additions and 7 deletions

View File

@ -7,15 +7,18 @@ package org.mozilla.fenix.ext
import android.graphics.Rect
import android.view.TouchDelegate
import android.view.View
import mozilla.components.support.ktx.android.content.res.pxToDp
fun View?.increaseTapArea(extraDps: Int) {
this!!.post {
val dips = this!!.resources.pxToDp(extraDps)
val parent = this.parent as View
parent.post {
val touchRect = Rect()
getHitRect(touchRect)
touchRect.top -= extraDps
touchRect.left -= extraDps
touchRect.right += extraDps
touchRect.bottom += extraDps
(parent as View).touchDelegate = TouchDelegate(touchRect, this)
touchRect.top -= dips
touchRect.left -= dips
touchRect.right += dips
touchRect.bottom += dips
parent.touchDelegate = TouchDelegate(touchRect, this)
}
}

View File

@ -371,7 +371,7 @@ class BookmarkAdapter(val emptyView: View, val actionEmitter: Observer<BookmarkA
}
companion object {
private const val bookmarkOverflowExtraDips = 8
private const val bookmarkOverflowExtraDips = 16
}
enum class ViewType {

View File

@ -36,6 +36,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:lines="1"
android:textSize="16sp"
@ -56,6 +57,7 @@
android:src="@drawable/ic_menu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/bookmark_title"
app:layout_constraintTop_toTopOf="parent" />
<View