mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
We are temporary hiding the kiwixServer
feature from Custom Apps
.
* Since 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.
This commit is contained in:
parent
bdb00d7aae
commit
8b1cb8bc7e
@ -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<BooksOnDiskListItem>) {
|
||||
// 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<BooksOnDiskListItem> = arrayListOf()
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user