From c4c51c1faaf12ba5b6fd4c96ebf4127d4aebca7e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Mar 2017 14:09:23 +0100 Subject: [PATCH] open the home folder initially --- .../filemanager/activities/MainActivity.kt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt index d59df444..b44a7175 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt @@ -26,7 +26,6 @@ import kotlinx.android.synthetic.main.activity_main.* import java.util.* class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Breadcrumbs.BreadcrumbsListener { - var mBasePath = getInternalStoragePath() var latestFragment: ItemsFragment? = null var mScrollStates = HashMap() var mStoredTextColor = 0 @@ -53,7 +52,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br if (mStoredTextColor != config.textColor) { mStoredTextColor = config.textColor breadcrumbs.setTextColor(mStoredTextColor) - initRootFileManager() + openPath(getCurrenPath()) } } @@ -76,7 +75,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br } private fun initRootFileManager() { - openPath(mBasePath) + openPath(config.homeFolder) } private fun openPath(path: String) { @@ -165,8 +164,8 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br override fun breadcrumbClicked(id: Int) { if (id == 0) { - StoragePickerDialog(this@MainActivity, mBasePath) { - changePath(it) + StoragePickerDialog(this@MainActivity, getCurrenPath()) { + openPath(it) } } else { val item = breadcrumbs.getChildAt(id).tag as FileDirItem @@ -174,11 +173,6 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br } } - private fun changePath(pickedPath: String) { - mBasePath = pickedPath - openPath(pickedPath) - } - private fun checkWhatsNewDialog() { arrayListOf().apply { add(Release(26, R.string.release_26))