GeezerVison is showing github.com — fixed bugs · Xiao-ShaBi/Android-FilePicker@ed6bc53
File tree
Expand file treeCollapse file tree
Open diff view settings
filepicker/src/main/java/droidninja/filepicker
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: filepicker/src/main/java/droidninja/filepicker/MediaDetailsActivity.java +13-1Lines changed: 13 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
32 | 32 | import droidninja.filepicker.utils.AndroidLifecycleUtils; |
33 | 33 | import droidninja.filepicker.utils.MediaStoreHelper; |
34 | 34 |
|
35 | | -public class MediaDetailsActivity extends AppCompatActivity { |
| 35 | +public class MediaDetailsActivity extends AppCompatActivity implements PickerManagerListener { |
36 | 36 |
|
37 | 37 | private static final int SCROLL_THRESHOLD = 30; |
38 | 38 | private RecyclerView recyclerView; |
@@ -67,6 +67,7 @@ private void initView() { |
67 | 67 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
68 | 68 | getSupportActionBar().setTitle(photoDirectory.getName()); |
69 | 69 | } |
| 70 | + PickerManager.getInstance().setPickerManagerListener(this); |
70 | 71 | } |
71 | 72 | } |
72 | 73 | } |
@@ -193,4 +194,15 @@ public boolean onOptionsItemSelected(MenuItem item) { |
193 | 194 | } |
194 | 195 | return super.onOptionsItemSelected(item); |
195 | 196 | } |
| 197 | + |
| 198 | + @Override |
| 199 | + public void onItemSelected(int currentCount) { |
| 200 | + |
| 201 | + } |
| 202 | + |
| 203 | + @Override |
| 204 | + public void onSingleItemSelected(ArrayList<String> paths) { |
| 205 | + setResult(RESULT_OK, null); |
| 206 | + finish(); |
| 207 | + } |
196 | 208 | } |
Collapse file
Copy file name to clipboardExpand all lines: filepicker/src/main/java/droidninja/filepicker/cursors/DocScannerTask.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -83,7 +83,7 @@ private ArrayList<Document> getDocumentFromCursor(Cursor data) |
83 | 83 | if(path!=null) { |
84 | 84 |
|
85 | 85 | FileType fileType = getFileType(PickerManager.getInstance().getFileTypes(),path); |
86 | | - if(fileType!=null) { |
| 86 | + if(fileType!=null && !(new File(path).isDirectory())) { |
87 | 87 |
|
88 | 88 | Document document = new Document(imageId, title, path); |
89 | 89 | document.setFileType(fileType); |
|