mirror of
				https://github.com/SimpleMobileTools/Simple-File-Manager.git
				synced 2025-06-05 22:09:15 +02:00 
			
		
		
		
	use the new FilePicker for selecting the folder
This commit is contained in:
		| @@ -39,7 +39,7 @@ dependencies { | |||||||
|     compile 'com.android.support:design:23.4.0' |     compile 'com.android.support:design:23.4.0' | ||||||
|     compile 'com.jakewharton:butterknife:8.0.1' |     compile 'com.jakewharton:butterknife:8.0.1' | ||||||
|     compile 'com.github.bumptech.glide:glide:3.7.0' |     compile 'com.github.bumptech.glide:glide:3.7.0' | ||||||
|     compile 'com.simplemobiletools:filepicker:1.0.0' |     compile 'com.simplemobiletools:filepicker:1.0.0@aar' | ||||||
|     compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" |     compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" | ||||||
|  |  | ||||||
|     apt 'com.jakewharton:butterknife-compiler:8.0.1' |     apt 'com.jakewharton:butterknife-compiler:8.0.1' | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| package com.simplemobiletools.filemanager.fragments; | package com.simplemobiletools.filemanager.fragments; | ||||||
|  |  | ||||||
| import android.app.Activity; |  | ||||||
| import android.content.ActivityNotFoundException; | import android.content.ActivityNotFoundException; | ||||||
| import android.content.DialogInterface; | import android.content.DialogInterface; | ||||||
| import android.content.Intent; | import android.content.Intent; | ||||||
| @@ -39,6 +38,8 @@ import com.simplemobiletools.filemanager.Utils; | |||||||
| import com.simplemobiletools.filemanager.adapters.ItemsAdapter; | import com.simplemobiletools.filemanager.adapters.ItemsAdapter; | ||||||
| import com.simplemobiletools.filemanager.asynctasks.CopyTask; | import com.simplemobiletools.filemanager.asynctasks.CopyTask; | ||||||
| import com.simplemobiletools.filemanager.dialogs.PropertiesDialog; | import com.simplemobiletools.filemanager.dialogs.PropertiesDialog; | ||||||
|  | import com.simplemobiletools.filepicker.dialogs.PickFolderDialog; | ||||||
|  | import com.simplemobiletools.filepicker.models.FileDirItem; | ||||||
|  |  | ||||||
| import java.io.File; | import java.io.File; | ||||||
| import java.io.FileFilter; | import java.io.FileFilter; | ||||||
| @@ -60,7 +61,6 @@ public class ItemsFragment extends android.support.v4.app.Fragment | |||||||
|     @BindView(R.id.items_swipe_refresh) SwipeRefreshLayout mSwipeRefreshLayout; |     @BindView(R.id.items_swipe_refresh) SwipeRefreshLayout mSwipeRefreshLayout; | ||||||
|     @BindView(R.id.items_holder) CoordinatorLayout mCoordinatorLayout; |     @BindView(R.id.items_holder) CoordinatorLayout mCoordinatorLayout; | ||||||
|  |  | ||||||
|     public static final int SELECT_FOLDER_REQUEST = 1; |  | ||||||
|     private static Map<String, Parcelable> mStates; |     private static Map<String, Parcelable> mStates; | ||||||
|  |  | ||||||
|     private List<FileDirItem> mItems; |     private List<FileDirItem> mItems; | ||||||
| @@ -579,20 +579,20 @@ public class ItemsFragment extends android.support.v4.app.Fragment | |||||||
|         public void onClick(final View view) { |         public void onClick(final View view) { | ||||||
|             final boolean showHiddenItems = mConfig.getShowHidden(); |             final boolean showHiddenItems = mConfig.getShowHidden(); | ||||||
|             final boolean showFullPath = mConfig.getShowFullPath(); |             final boolean showFullPath = mConfig.getShowFullPath(); | ||||||
|             /*PickFolderDialog dialog = PickFolderDialog.Companion.newInstance(mCopyDestinationPath, showHiddenItems, showFullPath); |             new PickFolderDialog(getContext(), mCopyDestinationPath, showHiddenItems, showFullPath, new PickFolderDialog.OnPickFolderListener() { | ||||||
|             dialog.setTargetFragment(ItemsFragment.this, SELECT_FOLDER_REQUEST); |                 @Override | ||||||
|             dialog.show(getFragmentManager(), "selectFolder");*/ |                 public void onFail(PickFolderDialog.PickFolderResult pickFolderResult) { | ||||||
|  |  | ||||||
|                 } |                 } | ||||||
|     }; |  | ||||||
|  |  | ||||||
|                 @Override |                 @Override | ||||||
|     public void onActivityResult(int requestCode, int resultCode, Intent data) { |                 public void onSuccess(String path) { | ||||||
|         if (requestCode == SELECT_FOLDER_REQUEST && resultCode == Activity.RESULT_OK && data != null) { |                     mCopyDestinationPath = path; | ||||||
|             mCopyDestinationPath = data.getDataString(); |                     mDestinationView.setText(path); | ||||||
|             mDestinationView.setText(mCopyDestinationPath); |  | ||||||
|                 } |                 } | ||||||
|         super.onActivityResult(requestCode, resultCode, data); |             }); | ||||||
|         } |         } | ||||||
|  |     }; | ||||||
|  |  | ||||||
|     @Override |     @Override | ||||||
|     public boolean onTouch(View v, MotionEvent event) { |     public boolean onTouch(View v, MotionEvent event) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user