From f59e2b900b873efd91eadc2044707100da2daa3a Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Tue, 13 Jul 2021 23:40:10 +0900 Subject: [PATCH] Fix dialog root --- .../dialogs/PostsLayoutPreferencesDialogFragment.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt b/app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt index aca9516f..5002df37 100644 --- a/app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt +++ b/app/src/main/java/awais/instagrabber/dialogs/PostsLayoutPreferencesDialogFragment.kt @@ -30,17 +30,17 @@ class PostsLayoutPreferencesDialogFragment( } override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { - binding = DialogPostLayoutPreferencesBinding.inflate(layoutInflater, null, false) + binding = DialogPostLayoutPreferencesBinding.inflate(layoutInflater) 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 json = preferences.json Utils.settingsHelper.putString(layoutPreferenceKey, json) onApplyListener.onApply(preferences) } - }.create() + .create() } private fun init() {