|
@@ -89,6 +89,8 @@ public class FileChooserDialog extends DialogFragment implements MaterialDialog.
|
|
|
return false;
|
|
|
}
|
|
|
String fileExtension = filename.substring(dotPos + 1);
|
|
|
+ if (fileExtension.endsWith("json"))
|
|
|
+ return mimeType.startsWith("application/json");
|
|
|
String fileType = mimeTypeMap.getMimeTypeFromExtension(fileExtension);
|
|
|
if (fileType == null) {
|
|
|
return false;
|
|
@@ -151,7 +153,6 @@ public class FileChooserDialog extends DialogFragment implements MaterialDialog.
|
|
|
})
|
|
|
.autoDismiss(false)
|
|
|
.negativeText(getBuilder().mCancelButton)
|
|
|
- .positiveText(getBuilder().mChooseButton)
|
|
|
.build();
|
|
|
}
|
|
|
|
|
@@ -202,8 +203,6 @@ public class FileChooserDialog extends DialogFragment implements MaterialDialog.
|
|
|
@NonNull
|
|
|
protected final transient AppCompatActivity mContext;
|
|
|
@StringRes
|
|
|
- protected int mChooseButton;
|
|
|
- @StringRes
|
|
|
protected int mCancelButton;
|
|
|
protected String mInitialPath;
|
|
|
protected String mMimeType;
|
|
@@ -212,7 +211,6 @@ public class FileChooserDialog extends DialogFragment implements MaterialDialog.
|
|
|
public <ActivityType extends AppCompatActivity & FileCallback> Builder(@NonNull ActivityType context) {
|
|
|
mContext = context;
|
|
|
mCancelButton = android.R.string.cancel;
|
|
|
- mChooseButton = R.string.md_choose_label;
|
|
|
mInitialPath = Environment.getExternalStorageDirectory().getAbsolutePath();
|
|
|
mMimeType = null;
|
|
|
}
|
|
@@ -223,12 +221,6 @@ public class FileChooserDialog extends DialogFragment implements MaterialDialog.
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
- @NonNull
|
|
|
- public Builder chooseButton(@StringRes int text) {
|
|
|
- mChooseButton = text;
|
|
|
- return this;
|
|
|
- }
|
|
|
-
|
|
|
@NonNull
|
|
|
public Builder initialPath(@Nullable String initialPath) {
|
|
|
if (initialPath == null)
|