From f9e4026b106b9ec697023f8a5be456d0abbfc91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Sun, 7 Jul 2024 11:35:51 +0200 Subject: [PATCH] go back to root when icon was pressed Closes #25 --- app/src/main/java/de/felixnuesse/disky/MainActivity.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/de/felixnuesse/disky/MainActivity.kt b/app/src/main/java/de/felixnuesse/disky/MainActivity.kt index c9ccaec..8415d40 100644 --- a/app/src/main/java/de/felixnuesse/disky/MainActivity.kt +++ b/app/src/main/java/de/felixnuesse/disky/MainActivity.kt @@ -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)