hide file picker in playstore build

This commit is contained in:
MohitMaliFtechiz 2022-06-14 17:15:24 +05:30 committed by Kelson
parent ad16e81d5d
commit 40d3b3d1d3
2 changed files with 14 additions and 1 deletions

View File

@ -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()

View File

@ -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))