From 483b433dda4ef73285751a076cd71b19fa53fcec Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 11 Oct 2016 22:47:51 +0200 Subject: [PATCH] show full path at breadcrumbs if set so --- .../filemanager/activities/MainActivity.java | 4 ++-- .../filemanager/fragments/ItemsFragment.java | 3 ++- .../filepicker/dialogs/SelectFolderDialog.kt | 6 ++++-- .../com/simplemobiletools/filepicker/views/Breadcrumbs.kt | 3 +-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/filemanager/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/filemanager/activities/MainActivity.java index b8b18157..c8517de3 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/activities/MainActivity.java @@ -73,7 +73,7 @@ public class MainActivity extends SimpleActivity implements ItemsFragment.ItemIn private void initRootFileManager() { final String path = Environment.getExternalStorageDirectory().toString(); openPath(path); - mBreadcrumbs.setInitialBreadcrumb(path); + mBreadcrumbs.setInitialBreadcrumb(path, mConfig.getShowFullPath()); mRootFoldersCnt = mBreadcrumbs.getChildCount(); } @@ -143,7 +143,7 @@ public class MainActivity extends SimpleActivity implements ItemsFragment.ItemIn public void breadcrumbClicked(int id) { final FileDirItem item = (FileDirItem) mBreadcrumbs.getChildAt(id).getTag(); final String path = item.getPath(); - mBreadcrumbs.setInitialBreadcrumb(path); + mBreadcrumbs.setInitialBreadcrumb(path, mConfig.getShowFullPath()); openPath(path); } } diff --git a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java index 02175786..8adf00f0 100644 --- a/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java +++ b/app/src/main/java/com/simplemobiletools/filemanager/fragments/ItemsFragment.java @@ -549,7 +549,8 @@ public class ItemsFragment extends android.support.v4.app.Fragment @Override public void onClick(final View view) { final boolean showHiddenItems = Config.newInstance(getContext()).getShowHidden(); - SelectFolderDialog dialog = SelectFolderDialog.Companion.newInstance(mCopyDestinationPath, showHiddenItems); + final boolean showFullPath = Config.newInstance(getContext()).getShowFullPath(); + SelectFolderDialog dialog = SelectFolderDialog.Companion.newInstance(mCopyDestinationPath, showHiddenItems, showFullPath); dialog.setTargetFragment(ItemsFragment.this, SELECT_FOLDER_REQUEST); dialog.show(getFragmentManager(), "selectFolder"); } diff --git a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt index 51e56649..33f48703 100644 --- a/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt +++ b/library/src/main/kotlin/com/simplemobiletools/filepicker/dialogs/SelectFolderDialog.kt @@ -25,11 +25,13 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { lateinit var mPath: String var mFirstUpdate: Boolean = true var mShowHidden: Boolean = false + var mShowFullPath: Boolean = false - fun newInstance(path: String, showHidden: Boolean): SelectFolderDialog { + fun newInstance(path: String, showHidden: Boolean, showFullPath: Boolean): SelectFolderDialog { mPath = path mFirstUpdate = true mShowHidden = showHidden + mShowFullPath = showFullPath return SelectFolderDialog() } } @@ -61,7 +63,7 @@ class SelectFolderDialog : DialogFragment(), Breadcrumbs.BreadcrumbsListener { val adapter = ItemsAdapter(context, items) dialog.directory_picker_list.adapter = adapter - dialog.directory_picker_breadcrumbs.setInitialBreadcrumb(mPath) + dialog.directory_picker_breadcrumbs.setInitialBreadcrumb(mPath, mShowFullPath) dialog.directory_picker_list.setOnItemClickListener { adapterView, view, position, id -> val item = items[position] if (item.isDirectory) { diff --git a/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt b/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt index 5174431c..866cb625 100644 --- a/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt +++ b/library/src/main/kotlin/com/simplemobiletools/filepicker/views/Breadcrumbs.kt @@ -96,8 +96,7 @@ class Breadcrumbs(context: Context, attrs: AttributeSet) : LinearLayout(context, setMeasuredDimension(parentWidth, calculatedHeight) } - fun setInitialBreadcrumb(fullPath: String) { - val showFullPath = false//Config.newInstance(context).showFullPath + fun setInitialBreadcrumb(fullPath: String, showFullPath: Boolean) { val basePath = Environment.getExternalStorageDirectory().toString() var tempPath = fullPath var currPath = basePath