open the home folder initially

This commit is contained in:
tibbi 2017-03-18 14:09:23 +01:00
parent 41d67fe498
commit c4c51c1faa
1 changed files with 4 additions and 10 deletions

View File

@ -26,7 +26,6 @@ import kotlinx.android.synthetic.main.activity_main.*
import java.util.* import java.util.*
class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Breadcrumbs.BreadcrumbsListener { class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Breadcrumbs.BreadcrumbsListener {
var mBasePath = getInternalStoragePath()
var latestFragment: ItemsFragment? = null var latestFragment: ItemsFragment? = null
var mScrollStates = HashMap<String, Parcelable>() var mScrollStates = HashMap<String, Parcelable>()
var mStoredTextColor = 0 var mStoredTextColor = 0
@ -53,7 +52,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
if (mStoredTextColor != config.textColor) { if (mStoredTextColor != config.textColor) {
mStoredTextColor = config.textColor mStoredTextColor = config.textColor
breadcrumbs.setTextColor(mStoredTextColor) breadcrumbs.setTextColor(mStoredTextColor)
initRootFileManager() openPath(getCurrenPath())
} }
} }
@ -76,7 +75,7 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
} }
private fun initRootFileManager() { private fun initRootFileManager() {
openPath(mBasePath) openPath(config.homeFolder)
} }
private fun openPath(path: String) { private fun openPath(path: String) {
@ -165,8 +164,8 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
override fun breadcrumbClicked(id: Int) { override fun breadcrumbClicked(id: Int) {
if (id == 0) { if (id == 0) {
StoragePickerDialog(this@MainActivity, mBasePath) { StoragePickerDialog(this@MainActivity, getCurrenPath()) {
changePath(it) openPath(it)
} }
} else { } else {
val item = breadcrumbs.getChildAt(id).tag as FileDirItem 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() { private fun checkWhatsNewDialog() {
arrayListOf<Release>().apply { arrayListOf<Release>().apply {
add(Release(26, R.string.release_26)) add(Release(26, R.string.release_26))