allow creating file shortcuts too

This commit is contained in:
tibbi 2019-05-03 19:16:17 +02:00
parent ffa691eb4c
commit 253db88d0d
2 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import com.simplemobiletools.filemanager.pro.BuildConfig
import com.simplemobiletools.filemanager.pro.R
import com.simplemobiletools.filemanager.pro.dialogs.ChangeSortingDialog
import com.simplemobiletools.filemanager.pro.extensions.config
import com.simplemobiletools.filemanager.pro.extensions.tryOpenPathIntent
import com.simplemobiletools.filemanager.pro.fragments.ItemsFragment
import com.simplemobiletools.filemanager.pro.helpers.RootHelpers
import com.stericson.RootTools.RootTools
@ -202,6 +203,10 @@ class MainActivity : SimpleActivity() {
openPath(config.homeFolder)
}
}
if (!File(data.path).isDirectory) {
tryOpenPathIntent(data.path, false)
}
} else {
openPath(config.homeFolder)
}

View File

@ -77,7 +77,7 @@ class ItemsAdapter(activity: SimpleActivity, var listItems: MutableList<ListItem
findItem(R.id.cab_open_with).isVisible = isOneFileSelected()
findItem(R.id.cab_open_as).isVisible = isOneFileSelected()
findItem(R.id.cab_set_as).isVisible = isOneFileSelected()
findItem(R.id.cab_create_shortcut).isVisible = isNougatMR1Plus() && isOneItemSelected() && File(getFirstSelectedItemPath()).isDirectory
findItem(R.id.cab_create_shortcut).isVisible = isNougatMR1Plus() && isOneItemSelected()
checkHideBtnVisibility(this)
}