mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01:00
handle end call button
Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
parent
3d536c2af4
commit
bf3ed0ed42
@ -698,26 +698,6 @@ class CallActivity : CallBaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding!!.callLayout.setOnTouchListener { _, event ->
|
|
||||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
|
||||||
if (binding!!.popupMenu.visibility == View.VISIBLE) {
|
|
||||||
val location = IntArray(2)
|
|
||||||
binding!!.popupMenu.getLocationOnScreen(location)
|
|
||||||
|
|
||||||
val popupMenuWidth = binding!!.popupMenu.width
|
|
||||||
val popupMenuHeight = binding!!.popupMenu.height
|
|
||||||
|
|
||||||
val x = event.rawX
|
|
||||||
val y = event.rawY
|
|
||||||
|
|
||||||
if (x < location[0] || x > location[0] + popupMenuWidth ||
|
|
||||||
y < location[1] || y > location[1] + popupMenuHeight) {
|
|
||||||
binding!!.popupMenu.visibility = View.GONE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
binding!!.popupMenu.setOnClickListener {
|
binding!!.popupMenu.setOnClickListener {
|
||||||
hangup(true, true)
|
hangup(true, true)
|
||||||
@ -1396,6 +1376,34 @@ 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() {
|
fun clickRaiseOrLowerHandButton() {
|
||||||
raiseHandViewModel!!.clickHandButton()
|
raiseHandViewModel!!.clickHandButton()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user