Skip to content

Commit

Permalink
fix(Notification display time): Input type
Browse files Browse the repository at this point in the history
  • Loading branch information
axel358 committed Feb 8, 2024
1 parent 659b51f commit 2ddcf4a
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
@@ -1,11 +1,20 @@
package cu.axel.smartdock.fragments

import android.os.Bundle
import android.text.InputType
import android.view.inputmethod.EditorInfo
import androidx.preference.EditTextPreference
import androidx.preference.PreferenceFragmentCompat
import cu.axel.smartdock.R

class NotificationPreferences : PreferenceFragmentCompat() {
override fun onCreatePreferences(arg0: Bundle?, arg1: String?) {
setPreferencesFromResource(R.xml.preferences_notification, arg1)

val notificationTimeout: EditTextPreference? = findPreference("notification_timeout")
notificationTimeout?.setOnBindEditTextListener { editText ->
editText.inputType = InputType.TYPE_CLASS_NUMBER
editText.imeOptions = EditorInfo.IME_ACTION_GO
}
}
}
1 change: 0 additions & 1 deletion app/src/main/res/xml/preferences_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<EditTextPreference
android:dependency="show_notifications"
android:inputType="number"
android:key="notification_timeout"
android:hint="5000"
android:defaultValue="5000"
Expand Down

0 comments on commit 2ddcf4a

Please sign in to comment.