Added a setting to have the dialpad automatically showing up (disabled by default)

This commit is contained in:
Sylvain Berfini 2024-08-07 17:12:15 +02:00
parent c8d9248e0c
commit 455db9b9eb
2 changed files with 15 additions and 0 deletions

View file

@ -220,6 +220,10 @@ class CorePreferences @UiThread constructor(private val context: Context) {
val useUsernameAsSingleSignOnLoginHint: Boolean
get() = config.getBool("ui", "use_username_as_sso_login_hint", true)
@get:WorkerThread
val automaticallyShowDialpad: Boolean
get() = config.getBool("ui", "automatically_show_dialpad", false)
/* Paths */
@get:WorkerThread

View file

@ -29,6 +29,7 @@ import androidx.core.view.doOnPreDraw
import androidx.lifecycle.ViewModelProvider
import com.google.android.material.bottomsheet.BottomSheetBehavior
import org.linphone.LinphoneApplication.Companion.coreContext
import org.linphone.LinphoneApplication.Companion.corePreferences
import org.linphone.R
import org.linphone.core.Address
import org.linphone.core.Friend
@ -169,6 +170,16 @@ class StartCallFragment : GenericAddressPickerFragment() {
viewModel.leaveFragmentEvent.postValue(Event(true))
}
override fun onResume() {
super.onResume()
coreContext.postOnCoreThread {
if (corePreferences.automaticallyShowDialpad) {
viewModel.isNumpadVisible.postValue(true)
}
}
}
override fun onPause() {
super.onPause()