From ad9c9b2d84c4d9204f99350e70f0e1f4233a75b8 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Mon, 21 Dec 2020 09:57:38 +0200 Subject: [PATCH] Show dialpad automatically only when device orientation is portrait --- app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index 5b85c728..9a515e00 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -6,6 +6,7 @@ import android.app.KeyguardManager import android.app.NotificationManager import android.content.* import android.content.pm.PackageManager +import android.content.res.Configuration.ORIENTATION_PORTRAIT import android.media.AudioManager import android.os.Build import android.os.Bundle @@ -1488,7 +1489,8 @@ class MainActivity : AppCompatActivity() { dtmf.visibility = View.VISIBLE dtmf.isEnabled = true dtmf.requestFocus() - imm.showSoftInput(dtmf, InputMethodManager.SHOW_IMPLICIT) + if (resources.configuration.orientation == ORIENTATION_PORTRAIT) + imm.showSoftInput(dtmf, InputMethodManager.SHOW_IMPLICIT) if (dtmfWatcher != null) dtmf.removeTextChangedListener(dtmfWatcher) dtmfWatcher = call.dtmfWatcher dtmf.addTextChangedListener(dtmfWatcher)