diff --git a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt index 7add89e02..fed3e9f82 100644 --- a/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt +++ b/app/src/main/java/org/kiwix/kiwixmobile/nav/destination/library/LocalLibraryFragment.kt @@ -150,6 +150,15 @@ class LocalLibraryFragment : BaseFragment() { go_to_downloads_button_no_files.setOnClickListener { offerAction(FileSelectActions.UserClickedDownloadBooksButton) } + hideFilePickerButton() + } + + private fun hideFilePickerButton() { + if (sharedPreferenceUtil.isPlayStoreBuild) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + select_file.visibility = View.GONE + } + } select_file.setOnClickListener { showFileChooser() diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt index 2bc9badf9..3e4520155 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/utils/SharedPreferenceUtil.kt @@ -19,6 +19,7 @@ package org.kiwix.kiwixmobile.core.utils import android.content.Context import android.content.SharedPreferences +import android.os.Build import android.preference.PreferenceManager import androidx.appcompat.app.AppCompatDelegate import androidx.core.content.ContextCompat.getExternalFilesDirs @@ -182,7 +183,10 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) { fun getPublicDirectoryPath(path: String): String = if (isPlayStoreBuild) - path + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) + path + else + path.substringBefore(context.getString(R.string.android_directory_seperator)) else path.substringBefore(context.getString(R.string.android_directory_seperator))