remove the Hide/show recycle bin menu items from the main screen

This commit is contained in:
tibbi 2022-12-13 23:25:54 +01:00
parent aee51a0294
commit e2ae1ddc4b
3 changed files with 1 additions and 28 deletions

View file

@ -78,7 +78,7 @@ android {
}
dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:a1ecb048c0'
implementation 'com.github.SimpleMobileTools:Simple-Commons:ecdc896381'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'it.sephiroth.android.exif:library:1.0.1'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.24'

View file

@ -306,12 +306,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
private fun refreshMenuItems() {
if (!mIsThirdPartyIntent) {
val useBin = config.useRecycleBin
directories_toolbar.menu.apply {
findItem(R.id.increase_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt < MAX_COLUMN_COUNT
findItem(R.id.reduce_column_count).isVisible = config.viewTypeFolders == VIEW_TYPE_GRID && config.dirColumnCnt > 1
findItem(R.id.hide_the_recycle_bin).isVisible = useBin && config.showRecycleBinAtFolders
findItem(R.id.show_the_recycle_bin).isVisible = useBin && !config.showRecycleBinAtFolders
findItem(R.id.set_as_default_folder).isVisible = !config.defaultFolder.isEmpty()
findItem(R.id.more_apps_from_us).isVisible = !resources.getBoolean(R.bool.hide_google_relations)
setupSearch(this)
@ -352,8 +349,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
R.id.temporarily_show_excluded -> tryToggleTemporarilyShowExcluded()
R.id.stop_showing_excluded -> tryToggleTemporarilyShowExcluded()
R.id.create_new_folder -> createNewFolder()
R.id.show_the_recycle_bin -> toggleRecycleBin(true)
R.id.hide_the_recycle_bin -> toggleRecycleBin(false)
R.id.increase_column_count -> increaseColumnCount()
R.id.reduce_column_count -> reduceColumnCount()
R.id.set_as_default_folder -> setAsDefaultFolder()
@ -751,18 +746,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
}
}
private fun toggleRecycleBin(show: Boolean) {
config.showRecycleBinAtFolders = show
refreshMenuItems()
ensureBackgroundThread {
var dirs = getCurrentlyDisplayedDirs()
if (!show) {
dirs = dirs.filter { it.path != RECYCLE_BIN } as ArrayList<Directory>
}
gotDirectories(dirs)
}
}
private fun createNewFolder() {
FilePickerDialog(this, internalStoragePath, false, config.shouldShowHidden, false, true) {
CreateNewFolderDialog(this, it) {

View file

@ -54,16 +54,6 @@
android:showAsAction="never"
android:title="@string/show_all"
app:showAsAction="never" />
<item
android:id="@+id/show_the_recycle_bin"
android:showAsAction="never"
android:title="@string/show_the_recycle_bin"
app:showAsAction="never" />
<item
android:id="@+id/hide_the_recycle_bin"
android:showAsAction="never"
android:title="@string/hide_the_recycle_bin"
app:showAsAction="never" />
<item
android:id="@+id/set_as_default_folder"
android:showAsAction="never"