diff --git a/.idea/dictionaries/PC.xml b/.idea/dictionaries/PC.xml
index e38eab1b9..b3436f116 100644
--- a/.idea/dictionaries/PC.xml
+++ b/.idea/dictionaries/PC.xml
@@ -70,6 +70,7 @@
Kyoya • kyoya
+ +أحمد البحيري • wowo774455
diff --git a/app/src/main/java/app/simple/inure/extensions/activities/BaseActivity.kt b/app/src/main/java/app/simple/inure/extensions/activities/BaseActivity.kt index fb011940a..ee799c105 100644 --- a/app/src/main/java/app/simple/inure/extensions/activities/BaseActivity.kt +++ b/app/src/main/java/app/simple/inure/extensions/activities/BaseActivity.kt @@ -25,7 +25,7 @@ import app.simple.inure.R import app.simple.inure.database.instances.StackTraceDatabase import app.simple.inure.decorations.transitions.compat.DetailsTransitionArc import app.simple.inure.dialogs.miscellaneous.Error.Companion.showError -import app.simple.inure.dialogs.miscellaneous.Warning +import app.simple.inure.dialogs.miscellaneous.Warning.Companion.showWarning import app.simple.inure.popups.behavior.PopupArcType import app.simple.inure.popups.behavior.PopupTransitionType import app.simple.inure.preferences.AppearancePreferences @@ -289,23 +289,15 @@ open class BaseActivity : AppCompatActivity(), ThemeChangedListener, android.con } open fun showWarning(warning: String) { - val p0 = Warning.newInstance(warning) - p0.setOnWarningCallbackListener(object : Warning.Companion.WarningCallbacks { - override fun onDismiss() { - onBackPressedDispatcher.onBackPressed() - } - }) - p0.show(supportFragmentManager, "warning") + supportFragmentManager.showWarning(warning).setOnWarningCallbackListener { + onBackPressedDispatcher.onBackPressed() + } } open fun showWarning(@StringRes warning: Int) { - val p0 = Warning.newInstance(warning) - p0.setOnWarningCallbackListener(object : Warning.Companion.WarningCallbacks { - override fun onDismiss() { - onBackPressedDispatcher.onBackPressed() - } - }) - p0.show(supportFragmentManager, "warning") + supportFragmentManager.showWarning(warning).setOnWarningCallbackListener { + onBackPressedDispatcher.onBackPressed() + } } override fun onSharedPreferenceChanged(sharedPreferences: android.content.SharedPreferences?, key: String?) { diff --git a/app/src/main/java/app/simple/inure/extensions/fragments/ScopedBottomSheetFragment.kt b/app/src/main/java/app/simple/inure/extensions/fragments/ScopedBottomSheetFragment.kt index ad51c052d..dc98e3a55 100644 --- a/app/src/main/java/app/simple/inure/extensions/fragments/ScopedBottomSheetFragment.kt +++ b/app/src/main/java/app/simple/inure/extensions/fragments/ScopedBottomSheetFragment.kt @@ -13,7 +13,7 @@ import app.simple.inure.R import app.simple.inure.constants.BundleConstants import app.simple.inure.constants.Misc import app.simple.inure.dialogs.miscellaneous.Error.Companion.showError -import app.simple.inure.dialogs.miscellaneous.Warning +import app.simple.inure.dialogs.miscellaneous.Warning.Companion.showWarning import app.simple.inure.preferences.BehaviourPreferences import app.simple.inure.preferences.SharedPreferences.getSharedPreferences import app.simple.inure.preferences.SharedPreferences.registerSharedPreferenceChangeListener @@ -174,22 +174,14 @@ abstract class ScopedBottomSheetFragment : BottomSheetDialogFragment(), } open fun showWarning(warning: String) { - val p0 = Warning.newInstance(warning) - p0.setOnWarningCallbackListener(object : Warning.Companion.WarningCallbacks { - override fun onDismiss() { - dismiss() - } - }) - p0.show(parentFragmentManager, "warning") + childFragmentManager.showWarning(warning).setOnWarningCallbackListener { + dismiss() + } } open fun showWarning(@StringRes warning: Int) { - val p0 = Warning.newInstance(warning) - p0.setOnWarningCallbackListener(object : Warning.Companion.WarningCallbacks { - override fun onDismiss() { - dismiss() - } - }) - p0.show(parentFragmentManager, "warning") + childFragmentManager.showWarning(warning).setOnWarningCallbackListener { + dismiss() + } } } \ No newline at end of file