Skip to content

Commit

Permalink
go back to root when icon was pressed
Browse files Browse the repository at this point in the history
Closes #25
  • Loading branch information
newhinton committed Jul 7, 2024
1 parent 5ea514a commit f9e4026
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/main/java/de/felixnuesse/disky/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,12 @@ class MainActivity : AppCompatActivity(), ChangeFolderCallback, ScanCompleteCall
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
val id = item.itemId

if (id == android.R.id.home) {
currentElement = rootElement
currentElement?.let { changeFolder(it) }
return true
}
if (id == R.id.action_settings) {
val bl = BottomSheet()
bl.show(supportFragmentManager, BottomSheet.TAG)
Expand Down

0 comments on commit f9e4026

Please sign in to comment.