Prevent BottomSheet tap leaking to nav panels.
With the BottomSheet open, while trying to tap one of the controls (esp. add to playlist and favorite buttons) it is easy to miss the touch point and tap directly on the BottomSheet. This tap bleeds through to whatever fragment is currently displayed in the navigation area (Artist, Album, Playlists, etc.). That tap changes the view in the navigation panel. For example, if the Artist fragment it current, it will open a list of the artists albums. That change may be surprising when the BottomSheet is toggled closed. So, ignore BottomSheet taps outside the active controls.
This commit is contained in:
parent
feb86fe9c0
commit
2133d4a4fb
|
@ -3,6 +3,7 @@ package audio.funkwhale.ffa.views
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
@ -52,6 +53,8 @@ class NowPlayingBottomSheet @JvmOverloads constructor(
|
||||||
} ?: hide()
|
} ?: hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onTouchEvent(event: MotionEvent): Boolean = true
|
||||||
|
|
||||||
fun addBottomSheetCallback(callback: BottomSheetCallback) {
|
fun addBottomSheetCallback(callback: BottomSheetCallback) {
|
||||||
behavior.addBottomSheetCallback(callback)
|
behavior.addBottomSheetCallback(callback)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue