mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-09 23:53:04 +00:00
use touch listeners for hiding popup button
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
0920029183
commit
eda9b94182
@ -896,6 +896,7 @@ class CallActivity : CallBaseActivity() {
|
||||
val action = me.actionMasked
|
||||
if (action == MotionEvent.ACTION_DOWN) {
|
||||
animateCallControls(true, 0)
|
||||
binding!!.popupMenu.visibility = View.GONE
|
||||
}
|
||||
false
|
||||
}
|
||||
@ -903,6 +904,7 @@ class CallActivity : CallBaseActivity() {
|
||||
val action = me.actionMasked
|
||||
if (action == MotionEvent.ACTION_DOWN) {
|
||||
animateCallControls(true, 0)
|
||||
binding!!.popupMenu.visibility = View.GONE
|
||||
}
|
||||
false
|
||||
}
|
||||
@ -1380,30 +1382,6 @@ class CallActivity : CallBaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
||||
if (binding!!.popupMenu.visibility == View.VISIBLE) {
|
||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
||||
val buttonLocation = IntArray(2)
|
||||
binding!!.popupMenu.getLocationOnScreen(buttonLocation)
|
||||
|
||||
val popupMenuWidth = binding!!.popupMenu.width
|
||||
val popupMenuHeight = binding!!.popupMenu.height
|
||||
|
||||
val buttonLeft = buttonLocation[0]
|
||||
val buttonTop = buttonLocation[1]
|
||||
val buttonRight = buttonLeft + popupMenuWidth
|
||||
val buttonBottom = buttonTop + popupMenuHeight
|
||||
|
||||
val x = event.rawX
|
||||
val y = event.rawY
|
||||
if (x < buttonLeft || x > buttonRight || y < buttonTop || y > buttonBottom) {
|
||||
binding!!.popupMenu.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.dispatchTouchEvent(event)
|
||||
}
|
||||
|
||||
fun clickRaiseOrLowerHandButton() {
|
||||
raiseHandViewModel!!.clickHandButton()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user