mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 12:03:09 -04:00
hide file picker in playstore build
This commit is contained in:
parent
ad16e81d5d
commit
40d3b3d1d3
@ -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()
|
||||
|
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user