fix #381, handle media pick intents in Show All Folders content view

This commit is contained in:
tibbi 2017-10-02 22:47:23 +02:00
parent 4203939d62
commit 74edee735a

View file

@ -252,10 +252,15 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
config.showAll = true
Intent(this, MediaActivity::class.java).apply {
putExtra(DIRECTORY, "/")
if (mIsThirdPartyIntent) {
handleMediaIntent(this)
} else {
startActivity(this)
}
finish()
}
}
}
private fun changeViewType() {
val items = arrayListOf(
@ -477,7 +482,12 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
private fun itemClicked(path: String) {
Intent(this, MediaActivity::class.java).apply {
putExtra(DIRECTORY, path)
handleMediaIntent(this)
}
}
private fun handleMediaIntent(intent: Intent) {
intent.apply {
if (mIsSetWallpaperIntent) {
putExtra(SET_WALLPAPER_INTENT, true)
startActivityForResult(this, PICK_WALLPAPER)