show full path at breadcrumbs if set so
This commit is contained in:
parent
899255fc68
commit
483b433dda
4 changed files with 9 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue