Skip to content

Commit

Permalink
fix(Max running apps): Input type
Browse files Browse the repository at this point in the history
  • Loading branch information
axel358 committed Feb 8, 2024
1 parent 3f323e8 commit a56bddf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package cu.axel.smartdock.fragments

import android.content.Context
import android.os.Bundle
import android.text.InputType
import android.view.inputmethod.EditorInfo
import android.widget.CheckBox
import androidx.preference.EditTextPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.PreferenceManager
Expand Down Expand Up @@ -67,6 +70,12 @@ class DockPreferences : PreferenceFragmentCompat() {
handlePosition.isVisible = handleOpacity.isVisible
true
}

val maxRunningApps: EditTextPreference? = findPreference("max_running_apps")
maxRunningApps?.setOnBindEditTextListener { editText ->
editText.inputType = InputType.TYPE_CLASS_NUMBER
editText.imeOptions = EditorInfo.IME_ACTION_GO
}
}

private fun showAutopinDialog(context: Context) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/xml/preferences_dock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
android:title="@string/auto_pin_title"/>

<EditTextPreference
android:inputType="number"
android:key="max_running_apps"
android:hint="10"
android:defaultValue="10"
Expand Down

0 comments on commit a56bddf

Please sign in to comment.