diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostFragment.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostFragment.kt index feadfbda9..84f57414e 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostFragment.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/webserver/ZimHostFragment.kt @@ -49,6 +49,7 @@ import org.kiwix.kiwixmobile.core.base.BaseFragment import org.kiwix.kiwixmobile.core.databinding.ActivityZimHostBinding import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.cachedComponent import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.hasNotificationPermission +import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.isCustomApp import org.kiwix.kiwixmobile.core.extensions.ActivityExtensions.requestNotificationPermission import org.kiwix.kiwixmobile.core.extensions.toast import org.kiwix.kiwixmobile.core.navigateToAppSettings @@ -483,7 +484,7 @@ class ZimHostFragment : BaseFragment(), ZimHostCallbacks, ZimHostContract.View { @Suppress("NestedBlockDepth") override fun addBooks(books: List) { // Check if this is the app module, as custom apps may have multiple package names - if (requireActivity().packageName == "org.kiwix.kiwixmobile") { + if (!requireActivity().isCustomApp()) { booksAdapter.items = books } else { val updatedBooksList: MutableList = arrayListOf() diff --git a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt index 3c0d1fca3..308506cb9 100644 --- a/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt +++ b/custom/src/main/java/org/kiwix/kiwixmobile/custom/main/CustomMainActivity.kt @@ -95,6 +95,16 @@ class CustomMainActivity : CoreMainActivity() { override fun setupDrawerToggle(toolbar: Toolbar) { super.setupDrawerToggle(toolbar) activityCustomMainBinding.drawerNavView.apply { + /** + * Hide the 'ZimHostFragment' option from the navigation menu + * because we are now using fd (FileDescriptor) + * to read the zim file from the asset folder. Currently, + * 'KiwixServer' is unable to host zim files via fd. + * This feature is temporarily hidden for custom apps. + * We will re-enable it for custom apps once the issue is resolved. + * For more info see https://github.com/kiwix/kiwix-android/pull/3516 + */ + menu.findItem(R.id.menu_host_books)?.isVisible = false setNavigationItemSelectedListener { item -> closeNavigationDrawer() onNavigationItemSelected(item)