Skip to content

Commit

Permalink
fix(Menu height and with): Input type
Browse files Browse the repository at this point in the history
  • Loading branch information
axel358 committed Feb 8, 2024
1 parent a56bddf commit c7009f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?) {
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/xml/preferences_app_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
android:title="@string/app_menu_fullscreen_title"
android:defaultValue="false" />
<EditTextPreference
android:inputType="number"
android:key="app_menu_height"
android:hint="540"
android:defaultValue="540"
android:title="@string/app_menu_height_title"/>
<EditTextPreference
android:inputType="number"
android:key="app_menu_width"
android:hint="650"
android:defaultValue="650"
Expand Down

0 comments on commit c7009f1

Please sign in to comment.