mirror of
https://github.com/SimpleMobileTools/Simple-Contacts.git
synced 2025-06-05 21:59:27 +02:00
show a dialpad at the call screen on button press
This commit is contained in:
@ -23,6 +23,7 @@ import com.simplemobiletools.commons.helpers.isOreoPlus
|
||||
import com.simplemobiletools.commons.helpers.isQPlus
|
||||
import com.simplemobiletools.contacts.pro.R
|
||||
import com.simplemobiletools.contacts.pro.extensions.audioManager
|
||||
import com.simplemobiletools.contacts.pro.extensions.config
|
||||
import com.simplemobiletools.contacts.pro.helpers.ACCEPT_CALL
|
||||
import com.simplemobiletools.contacts.pro.helpers.CallManager
|
||||
import com.simplemobiletools.contacts.pro.helpers.DECLINE_CALL
|
||||
@ -77,7 +78,13 @@ class CallActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
if (dialpad_wrapper.isVisible()) {
|
||||
dialpad_wrapper.beGone()
|
||||
return
|
||||
} else {
|
||||
super.onBackPressed()
|
||||
}
|
||||
|
||||
if (CallManager.getState() == Call.STATE_DIALING) {
|
||||
endCall()
|
||||
}
|
||||
@ -100,10 +107,15 @@ class CallActivity : SimpleActivity() {
|
||||
toggleSpeaker()
|
||||
}
|
||||
|
||||
call_dialpad.setOnClickListener { }
|
||||
call_dialpad.setOnClickListener {
|
||||
toggleDialpadVisibility()
|
||||
}
|
||||
|
||||
call_end.setOnClickListener {
|
||||
endCall()
|
||||
}
|
||||
|
||||
dialpad_wrapper.setBackgroundColor(config.backgroundColor)
|
||||
}
|
||||
|
||||
private fun toggleSpeaker() {
|
||||
@ -120,6 +132,14 @@ class CallActivity : SimpleActivity() {
|
||||
audioManager.isMicrophoneMute = !isMicrophoneOn
|
||||
}
|
||||
|
||||
private fun toggleDialpadVisibility() {
|
||||
if (dialpad_wrapper.isVisible()) {
|
||||
dialpad_wrapper.beGone()
|
||||
} else {
|
||||
dialpad_wrapper.beVisible()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateOtherPersonsInfo() {
|
||||
if (callContact == null) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user