diff --git a/CHANGELOG b/CHANGELOG index 42dda4c0..bd61a4bd 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,12 @@ # Changelog +## 1.4.2s - 2019-04-22 + +\- removed refreshLayout +\+ instead, added refresh button in the options menu +\* bumped gradle +\* bugs fixed + ## 1.4.1s - 2019-04-08 \+ fileListItemFocusedDrawable attribute added diff --git a/README.md b/README.md index fab8cd11..1710de92 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ SmbFileChooserDialog.newDialog(context, "**.***.*.**", authenticator) e.printStackTrace(); } // This is NOT main UI thread. you can NOT access SmbFiles on UI thread. - Handler mainHandler = new Handler(ctx.getMainLooper()); + Handler mainHandler = new Handler(context.getMainLooper()); mainHandler.post(() -> { Toast.makeText(context, msg, @@ -82,7 +82,7 @@ SmbFileChooserDialog.newDialog(context, "**.***.*.**", authenticator) ```java .displayPath(/*displays the current path in the title (title must be enabled)*/ true) .enableOptions(/*enables 'New folder' and 'Delete'*/ true) -.setOptionResources("New folder", "Delete", "Cancel", "OK") +.setOptionResources("New folder", /*only on `SmbFileChooserDialog`*/ "Refresh", "Delete", "Cancel", "OK") .setNewFolderFilter(new NewFolderFilter(/*max length of 10*/ 10, /*regex pattern that only allows a to z (lowercase)*/ "^[a-z]*$")) .enableMultiple(/*enables the ability to select multiple*/ true, /*allows selecting folders along with files*/ true) .setOnSelectedListener(/*this gets called, when user selects more than 1 file*/ (files) -> { @@ -93,7 +93,7 @@ SmbFileChooserDialog.newDialog(context, "**.***.*.**", authenticator) dialog.setAdapter(new ArrayAdapter(context, android.R.layout.simple_expandable_list_item_1, paths) , null); dialog.show(); }) -.enableDpad(/*enables Dpad controls (mainly fot Android TVs)*/ true) +.enableDpad(/*enables Dpad controls (mainly for Android TVs)*/ true) .cancelOnTouchOutside(true) .setTheme(R.style.FileChooserStyle) .setAdapterSetter(adapter -> { @@ -123,15 +123,25 @@ FileChooserDialog.setOnSelectedListener(files -> { paths.add(file.getPath()); } - new AlertDialog.Builder(ctx) + new AlertDialog.Builder(context) .setTitle(files.size() + " files selected:") - .setAdapter(new ArrayAdapter<>(ctx, + .setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_expandable_list_item_1, paths), null) .create() .show(); }); ``` - there's no _**titleFollowsDir**_ option, and _**displayPath**_ is false by default +- in _**SmbFileChooserDialog**_ use _**setExceptionHandler**_ to handle exceptions +```java +interface ExceptionHandler { + /** + * @return true to attempt to terminate. + * false to attempt to ignore exception and continue + */ + boolean handle(Throwable exception, int id); +} +``` For more information please refer to the [upstream repo](https://github.com/hedzr/android-file-chooser). diff --git a/app/build.gradle b/app/build.gradle index 2740ae4b..775cd7f2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,6 @@ android { signingConfigs { Properties properties = new Properties() properties.load(project.rootProject.file('local.properties').newDataInputStream()) - //def sdkDir = properties.getProperty('sdk.dir') - //def ndkDir = properties.getProperty('ndk.dir') def ksPath = properties.getProperty('KS_PATH') def keystorePropertiesFile = ksPath == null ? rootProject.file("../keystore.properties") : new File(ksPath) if (!keystorePropertiesFile.exists()) @@ -73,10 +71,10 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation project(':library') - implementation 'androidx.appcompat:appcompat:1.1.0-alpha03' + implementation 'androidx.appcompat:appcompat:1.1.0-alpha04' implementation 'eu.agno3.jcifs:jcifs-ng:2.1.2' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3' + implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4' implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:design:28.0.0' diff --git a/app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/ChooseFileActivityFragment.java b/app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/ChooseFileActivityFragment.java index e2ef23c1..5db774a9 100644 --- a/app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/ChooseFileActivityFragment.java +++ b/app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/ChooseFileActivityFragment.java @@ -117,7 +117,7 @@ public void onClick(View v) { if (enableSamba.isChecked()) { SmbFileChooserDialog smbFileChooserDialog = SmbFileChooserDialog.newDialog(ctx, _server) .setResources(R.string.title_choose_folder, R.string.title_choose, R.string.dialog_cancel) - .setOptionResources(R.string.option_create_folder, R.string.options_delete, R.string.new_folder_cancel, R.string.new_folder_ok) + .setOptionResources(R.string.option_create_folder, R.string.option_refresh, R.string.options_delete, R.string.new_folder_cancel, R.string.new_folder_ok) .disableTitle(disableTitle.isChecked()) .enableOptions(enableOptions.isChecked()) .displayPath(displayPath.isChecked()) @@ -188,7 +188,7 @@ public void onClick(View v) { if (continueFromLast.isChecked()) { _path = dir; } - Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_SHORT).show(); + Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_LONG).show(); _tv.setText(dir); if (dirFile.isFile()) _iv.setImageBitmap(ImageUtil.decodeFile(dirFile)); }); diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 13def886..42963260 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -1,20 +1,21 @@ - - - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index a57dc37a..0913e4d7 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -3,58 +3,58 @@ - - - - - - - - -