mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 04:33:54 -04:00
hide file picker in playstore build
This commit is contained in:
parent
0cec4d898e
commit
f15cdfeb92
@ -150,6 +150,15 @@ class LocalLibraryFragment : BaseFragment() {
|
|||||||
go_to_downloads_button_no_files.setOnClickListener {
|
go_to_downloads_button_no_files.setOnClickListener {
|
||||||
offerAction(FileSelectActions.UserClickedDownloadBooksButton)
|
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 {
|
select_file.setOnClickListener {
|
||||||
showFileChooser()
|
showFileChooser()
|
||||||
|
@ -19,6 +19,7 @@ package org.kiwix.kiwixmobile.core.utils
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import android.os.Build
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.core.content.ContextCompat.getExternalFilesDirs
|
import androidx.core.content.ContextCompat.getExternalFilesDirs
|
||||||
@ -182,7 +183,10 @@ class SharedPreferenceUtil @Inject constructor(val context: Context) {
|
|||||||
|
|
||||||
fun getPublicDirectoryPath(path: String): String =
|
fun getPublicDirectoryPath(path: String): String =
|
||||||
if (isPlayStoreBuild)
|
if (isPlayStoreBuild)
|
||||||
path
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
|
||||||
|
path
|
||||||
|
else
|
||||||
|
path.substringBefore(context.getString(R.string.android_directory_seperator))
|
||||||
else
|
else
|
||||||
path.substringBefore(context.getString(R.string.android_directory_seperator))
|
path.substringBefore(context.getString(R.string.android_directory_seperator))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user