Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit c114125

Browse files
committed
close keyboard when library settings save button is clicked
1 parent 229bc8f commit c114125

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sampleapp/src/main/java/io/matthewnelson/sampleapp/ui/fragments/settings/library/SettingsLibraryFragment.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,17 @@ class SettingsLibraryFragment : Fragment() {
110110
findNavController().addOnDestinationChangedListener(CloseKeyBoardNavListener(view))
111111

112112
view.findViewById<Button>(R.id.settings_library_button_save).setOnClickListener {
113-
saveSettings(view.context.applicationContext as Application)
113+
saveSettings(view)
114114
}
115115
}
116116

117117
override fun onDestroyView() {
118118
super.onDestroyView()
119119
}
120120

121-
private fun saveSettings(application: Application) {
121+
private fun saveSettings(view: View) {
122+
CloseKeyBoardNavListener.closeKeyboard(view)
123+
122124
val backgroundManagerPolicy = App.generateBackgroundManagerPolicy(
123125
prefs,
124126
backgroundManagerOptions.policy,
@@ -143,7 +145,7 @@ class SettingsLibraryFragment : Fragment() {
143145

144146
try {
145147
App.setupTorServices(
146-
application,
148+
view.context.applicationContext as Application,
147149
notificationBuilder,
148150
backgroundManagerPolicy,
149151
controllerOptions.getRestartDelayValue(),

0 commit comments

Comments
 (0)