diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt index 5a8d17aa1..e8de0ea18 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/OnlineLibraryFragment.kt @@ -154,7 +154,20 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions { zimManageViewModel.networkStates.observe(viewLifecycleOwner, Observer(::onNetworkStateChange)) zimManageViewModel.shouldShowWifiOnlyDialog.observe(viewLifecycleOwner, Observer { if (it) { - showAllowMobileNetworkDialog() + dialogShower.show( + WifiOnly, + { + sharedPreferenceUtil.putPrefWifiOnly(false) + zimManageViewModel.shouldShowWifiOnlyDialog.value = false + }, + { + onRefreshStateChange(false) + context.toast( + resources.getString(R.string.denied_internet_permission_message), + Toast.LENGTH_SHORT + ) + } + ) } }) @@ -166,24 +179,6 @@ class OnlineLibraryFragment : BaseFragment(), FragmentActivityExtensions { }) } - private fun showAllowMobileNetworkDialog() { - dialogShower.show(WifiOnly, { - sharedPreferenceUtil.putPrefWifiOnly(false) - zimManageViewModel.shouldShowWifiOnlyDialog.value = false - }, { - dialogShower.show( - KiwixDialog.AllowMobileNetwork, - ::showAllowMobileNetworkDialog, { - onRefreshStateChange(false) - context.toast( - resources.getString(R.string.denied_internet_permission_message), - Toast.LENGTH_SHORT - ) - } - ) - }) - } - override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { super.onCreateOptionsMenu(menu, inflater) inflater.inflate(R.menu.menu_zim_manager, menu) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/dialog/KiwixDialog.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/dialog/KiwixDialog.kt index 4199b9229..f01df81c0 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/dialog/KiwixDialog.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/dialog/KiwixDialog.kt @@ -68,13 +68,6 @@ sealed class KiwixDialog( android.R.string.cancel ) - object AllowMobileNetwork : KiwixDialog( - null, - R.string.allow_network_access, - android.R.string.yes, - android.R.string.cancel - ) - object EnableWifiP2pServices : KiwixDialog( null, R.string.request_enable_wifi, R.string.yes, android.R.string.no ) diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 2d097b4a1..6bf635b4e 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -143,7 +143,6 @@ Next Previous Allow downloading content via mobile network? - Since you are on mobile network we required network access or enable wifi If you choose “Yes” you won\'t be warned in future. However, you can always change this in Settings Download content only via WiFi day