diff --git a/app/src/main/java/cu/axel/smartdock/fragments/AppMenuPreferences.kt b/app/src/main/java/cu/axel/smartdock/fragments/AppMenuPreferences.kt index 7c06c67d..c131d3b7 100644 --- a/app/src/main/java/cu/axel/smartdock/fragments/AppMenuPreferences.kt +++ b/app/src/main/java/cu/axel/smartdock/fragments/AppMenuPreferences.kt @@ -3,6 +3,9 @@ package cu.axel.smartdock.fragments import android.app.Activity import android.content.Intent import android.os.Bundle +import android.text.InputType +import android.view.inputmethod.EditorInfo +import androidx.preference.EditTextPreference import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat import cu.axel.smartdock.R @@ -48,6 +51,18 @@ class AppMenuPreferences : PreferenceFragmentCompat() { centerPreference.isEnabled = !checked true } + + val menuHeight: EditTextPreference? = findPreference("app_menu_height") + menuHeight?.setOnBindEditTextListener { editText -> + editText.inputType = InputType.TYPE_CLASS_NUMBER + editText.imeOptions = EditorInfo.IME_ACTION_GO + } + + val menuWidth: EditTextPreference? = findPreference("app_menu_width") + menuWidth?.setOnBindEditTextListener { editText -> + editText.inputType = InputType.TYPE_CLASS_NUMBER + editText.imeOptions = EditorInfo.IME_ACTION_GO + } } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { diff --git a/app/src/main/res/xml/preferences_app_menu.xml b/app/src/main/res/xml/preferences_app_menu.xml index a0f967af..b5da7d99 100644 --- a/app/src/main/res/xml/preferences_app_menu.xml +++ b/app/src/main/res/xml/preferences_app_menu.xml @@ -16,13 +16,11 @@ android:title="@string/app_menu_fullscreen_title" android:defaultValue="false" />