[Android] Make Network dialog resize if keyboard is opened

Nicolas Pomepuy git at videolan.org
Tue Apr 14 15:16:34 CEST 2020


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Tue Apr 14 15:11:07 2020 +0200| [cafb9a2a92db4a0bd2c524655b1d0ba707958121] | committer: Nicolas Pomepuy

Make Network dialog resize if keyboard is opened

Fixes #1274

> https://code.videolan.org/videolan/vlc-android/commit/cafb9a2a92db4a0bd2c524655b1d0ba707958121
---

 .../src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.kt           | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.kt b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.kt
index 1e4c0c258..146e575fe 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/dialogs/NetworkServerDialog.kt
@@ -10,6 +10,7 @@ import android.text.TextWatcher
 import android.view.LayoutInflater
 import android.view.View
 import android.view.ViewGroup
+import android.view.WindowManager
 import android.widget.*
 import androidx.appcompat.app.AppCompatDialog
 import androidx.fragment.app.DialogFragment
@@ -44,7 +45,6 @@ class NetworkServerDialog : DialogFragment(), AdapterView.OnItemSelectedListener
     //Dummy hack because spinner callback is called right on registration
     var ignoreFirstSpinnerCb = false
 
-
     override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
         val activity = activity
         val dialog = AppCompatDialog(activity, theme)
@@ -52,6 +52,7 @@ class NetworkServerDialog : DialogFragment(), AdapterView.OnItemSelectedListener
 
         dialog.setCancelable(true)
         dialog.setCanceledOnTouchOutside(true)
+        dialog.window?.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
         return dialog
     }
 
@@ -167,7 +168,6 @@ class NetworkServerDialog : DialogFragment(), AdapterView.OnItemSelectedListener
         return 0
     }
 
-
     private fun getPortForProtocol(position: Int): String {
         return when (protocols[position]) {
             "FTP" -> FTP_DEFAULT_PORT



More information about the Android mailing list