forked from hardcoresushi/DroidFS
Fix explorer menu display
This commit is contained in:
parent
4bbc9360b4
commit
c8d266150c
@ -497,7 +497,7 @@ open class BaseExplorerActivity : BaseActivity(), ExplorerElementAdapter.Listene
|
||||
}
|
||||
}
|
||||
|
||||
protected fun handleMenuItems(menu: Menu){
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menu.findItem(R.id.rename).isVisible = false
|
||||
menu.findItem(R.id.open_as)?.isVisible = false
|
||||
if (usf_open){
|
||||
@ -522,6 +522,7 @@ open class BaseExplorerActivity : BaseActivity(), ExplorerElementAdapter.Listene
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
|
@ -258,11 +258,12 @@ class ExplorerActivity : BaseExplorerActivity() {
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.explorer, menu)
|
||||
val result = super.onCreateOptionsMenu(menu)
|
||||
if (currentItemAction != ItemsActions.NONE) {
|
||||
menu.findItem(R.id.validate).isVisible = true
|
||||
menu.findItem(R.id.close).isVisible = false
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
} else {
|
||||
handleMenuItems(menu)
|
||||
if (usf_share){
|
||||
menu.findItem(R.id.share).isVisible = false
|
||||
}
|
||||
@ -285,7 +286,7 @@ class ExplorerActivity : BaseExplorerActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
return result
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
|
@ -21,9 +21,9 @@ class ExplorerActivityDrop : BaseExplorerActivity() {
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.explorer_drop, menu)
|
||||
handleMenuItems(menu)
|
||||
val result = super.onCreateOptionsMenu(menu)
|
||||
menu.findItem(R.id.validate).isVisible = explorerAdapter.selectedItems.isEmpty()
|
||||
return true
|
||||
return result
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
|
@ -45,11 +45,11 @@ class ExplorerActivityPick : BaseExplorerActivity() {
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.explorer_pick, menu)
|
||||
handleMenuItems(menu)
|
||||
val result = super.onCreateOptionsMenu(menu)
|
||||
val anyItemSelected = explorerAdapter.selectedItems.isNotEmpty()
|
||||
menu.findItem(R.id.select_all).isVisible = anyItemSelected
|
||||
menu.findItem(R.id.validate).isVisible = anyItemSelected
|
||||
return true
|
||||
return result
|
||||
}
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
|
Loading…
Reference in New Issue
Block a user