removing some settings and filepickers on Android 11+

This commit is contained in:
tibbi 2022-02-12 18:02:29 +01:00
parent 032ca877ed
commit cfbeb85b0d
3 changed files with 37 additions and 19 deletions

View file

@ -5,10 +5,13 @@ import android.view.Menu
import android.view.MenuItem
import com.simplemobiletools.commons.dialogs.FilePickerDialog
import com.simplemobiletools.commons.extensions.beVisibleIf
import com.simplemobiletools.commons.helpers.VIEW_TYPE_GRID
import com.simplemobiletools.commons.helpers.isRPlus
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.adapters.ManageFoldersAdapter
import com.simplemobiletools.gallery.pro.extensions.config
import com.simplemobiletools.gallery.pro.helpers.MAX_COLUMN_COUNT
import kotlinx.android.synthetic.main.activity_manage_folders.*
class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
@ -21,10 +24,16 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
private fun updateFolders() {
val folders = ArrayList<String>()
config.excludedFolders.mapTo(folders) { it }
var placeholderText = getString(R.string.excluded_activity_placeholder)
manage_folders_placeholder.apply {
text = getString(R.string.excluded_activity_placeholder)
beVisibleIf(folders.isEmpty())
setTextColor(config.textColor)
if (isRPlus()) {
placeholderText = placeholderText.substringBefore("\n")
}
text = placeholderText
}
val adapter = ManageFoldersAdapter(this, folders, true, this, manage_folders_list) {}
@ -33,6 +42,7 @@ class ExcludedFoldersActivity : SimpleActivity(), RefreshRecyclerViewListener {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_add_folder, menu)
menu.findItem(R.id.add_folder).isVisible = !isRPlus()
updateMenuItemColors(menu)
return true
}

View file

@ -168,6 +168,7 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupFileLoadingPriority() {
settings_file_loading_priority_holder.beGoneIf(isRPlus())
settings_file_loading_priority.text = getFileLoadingPriorityText()
settings_file_loading_priority_holder.setOnClickListener {
val items = arrayListOf(
@ -192,6 +193,7 @@ class SettingsActivity : SimpleActivity() {
)
private fun setupManageIncludedFolders() {
settings_manage_included_folders_holder.beGoneIf(isRPlus())
settings_manage_included_folders_holder.setOnClickListener {
startActivity(Intent(this, IncludedFoldersActivity::class.java))
}
@ -204,7 +206,7 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupManageHiddenFolders() {
settings_manage_hidden_folders_holder.beVisibleIf(!isQPlus())
settings_manage_hidden_folders_holder.beGoneIf(isQPlus())
settings_manage_hidden_folders_holder.setOnClickListener {
handleHiddenFolderPasswordProtection {
startActivity(Intent(this, HiddenFoldersActivity::class.java))
@ -213,6 +215,11 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupShowHiddenItems() {
if (isRPlus()) {
settings_show_hidden_items_holder.beGone()
settings_manage_excluded_folders_holder.background = resources.getDrawable(R.drawable.ripple_bottom_corners, theme)
}
settings_show_hidden_items.isChecked = config.showHiddenMedia
settings_show_hidden_items_holder.setOnClickListener {
if (config.showHiddenMedia) {
@ -308,6 +315,7 @@ class SettingsActivity : SimpleActivity() {
}
private fun setupHiddenItemPasswordProtection() {
settings_hidden_item_password_protection_holder.beGoneIf(isRPlus())
settings_hidden_item_password_protection.isChecked = config.isHiddenPasswordProtectionOn
settings_hidden_item_password_protection_holder.setOnClickListener {
val tabToShow = if (config.isHiddenPasswordProtectionOn) config.hiddenProtectionType else SHOW_ALL_TABS

View file

@ -706,28 +706,12 @@
android:background="@drawable/section_holder_stroke"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/settings_hidden_item_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_top_corners">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_hidden_item_password_protection"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password_protect_hidden_items" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_app_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
android:background="@drawable/ripple_top_corners">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_app_password_protection"
@ -738,6 +722,22 @@
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_hidden_item_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_background">
<com.simplemobiletools.commons.views.MyAppCompatCheckbox
android:id="@+id/settings_hidden_item_password_protection"
style="@style/SettingsCheckboxStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password_protect_hidden_items" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_file_deletion_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"