Browse Source

Fix dialog root

renovate/androidx.fragment-fragment-ktx-1.x
Ammar Githam 3 years ago
parent
commit
f59e2b900b
  1. 10
      app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt

10
app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt

@ -30,17 +30,17 @@ class PostsLayoutPreferencesDialogFragment(
} }
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
binding = DialogPostLayoutPreferencesBinding.inflate(layoutInflater, null, false)
binding = DialogPostLayoutPreferencesBinding.inflate(layoutInflater)
init() init()
return MaterialAlertDialogBuilder(requireContext()).apply {
setView(binding.root)
setPositiveButton(R.string.apply) { _: DialogInterface?, _: Int ->
return MaterialAlertDialogBuilder(requireContext())
.setView(binding.getRoot())
.setPositiveButton(R.string.apply) { _: DialogInterface?, _: Int ->
val preferences = preferencesBuilder.build() val preferences = preferencesBuilder.build()
val json = preferences.json val json = preferences.json
Utils.settingsHelper.putString(layoutPreferenceKey, json) Utils.settingsHelper.putString(layoutPreferenceKey, json)
onApplyListener.onApply(preferences) onApplyListener.onApply(preferences)
} }
}.create()
.create()
} }
private fun init() { private fun init() {

Loading…
Cancel
Save