Skip to content

Commit

Permalink
fix(Icon padding): Input type
Browse files Browse the repository at this point in the history
  • Loading branch information
axel358 committed Feb 8, 2024
1 parent 383b859 commit 25ce383
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.provider.Settings
import android.text.InputType
import android.view.LayoutInflater
import android.view.inputmethod.EditorInfo
import android.widget.EditText
import androidx.preference.EditTextPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreferenceCompat
Expand Down Expand Up @@ -183,6 +186,11 @@ class AdvancedPreferences : PreferenceFragmentCompat() {
}
})

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

private fun showDisplaySizeDialog(context: Context) {
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/xml/preferences_advanced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,13 @@
<EditTextPreference
android:defaultValue="1.0"
android:hint="1.0"
android:inputType="numberDecimal"
android:key="scale_factor"
android:summary="@string/scale_factor_summary"
android:title="@string/scale_factor_title" />

<EditTextPreference
android:defaultValue="5"
android:hint="5"
android:inputType="number"
android:key="icon_padding"
android:summary="@string/icon_padding_summary"
android:title="@string/icon_padding_title" />
Expand Down

0 comments on commit 25ce383

Please sign in to comment.