Skip to content
This repository has been archived by the owner on Oct 14, 2023. It is now read-only.

Commit

Permalink
v1.3.4s
Browse files Browse the repository at this point in the history
\+ enabled R8 shrinker
\* bump jcifs-ng from 2.1.1 to 2.1.2
\* removed the workaround introduced in commit 3b94230, release v1.3.1s, as the problem was fixed in eu.agno3.jcifs:jcifs-ng:2.1.2 thanks to mbechler
  • Loading branch information
Guiorgy authored Mar 12, 2019
1 parent 7a7e656 commit 4160edc
Show file tree
Hide file tree
Showing 17 changed files with 243 additions and 249 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ projectFilesBackup/
.idea/workspace.xml___jb_old___
app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/App.java___jb_tmp___
library/src/main/java/com/obsez/android/lib/smbfilechooser/SmbFileChooserDialog.java___jb_tmp___
app/src/main/java/com/obsez/android/lib/smbfilechooser/demo/ChooseFileActivityFragment.java___jb_tmp___
*.iml___jb_tmp___
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.3.4s - 2019-03-12

\+ enabled R8 shrinker
\* bump jcifs-ng from 2.1.1 to 2.1.2
\* removed the workaround introduced in commit 3b94230, release v1.3.1s, as the problem was fixed in eu.agno3.jcifs:jcifs-ng:2.1.2 thanks to mbechler

## 1.3.3s - 2019-03-01

\* fixed a bug that threw NullPointerException when selecting multiple files.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# android-file-chooser


## Overview

![banner](captures/banner.svg)
Expand Down Expand Up @@ -96,6 +95,7 @@ SmbFileChooserDialog.newDialog(context, "**.***.*.**", authenticator)
dialog.show();
})
.enableDpad(/*enables Dpad controls (mainly fot Android TVs)*/ true)
.cancelOnTouchOutside(true)
```

## What's Different?
Expand Down Expand Up @@ -127,4 +127,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ android {

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'eu.agno3.jcifs:jcifs-ng:2.1.1'
implementation project(':library')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* A placeholder fragment containing a simple view.
*/
public class ChooseFileActivityFragment extends Fragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {

@SuppressWarnings("unused")
private static final String TAG = "ChooseFileActivityFragment";

private CheckBox disableTitle;
Expand Down Expand Up @@ -95,10 +95,10 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

ViewGroup.LayoutParams params = input.getLayoutParams();
((ViewGroup.MarginLayoutParams) params).setMargins(
(int) UiUtil.dip2px(20),
(int) UiUtil.dip2px(10),
(int) UiUtil.dip2px(20),
(int) UiUtil.dip2px(10));
UiUtil.dip2px(20),
UiUtil.dip2px(10),
UiUtil.dip2px(20),
UiUtil.dip2px(10));
input.setLayoutParams(params);
}
}
Expand All @@ -115,7 +115,22 @@ public void onClick(View v) {
.setOptionResources(R.string.option_create_folder, R.string.options_delete, R.string.new_folder_cancel, R.string.new_folder_ok)
.disableTitle(disableTitle.isChecked())
.enableOptions(enableOptions.isChecked())
.displayPath(displayPath.isChecked());
.displayPath(displayPath.isChecked())
.setOnChosenListener((dir, dirFile) -> {
if (continueFromLast.isChecked()) {
_path = dir;
}
try {
Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_SHORT).show();
_tv.setText(dir);
} catch (SmbException e) {
e.printStackTrace();
}
})
.setExceptionHandler((exception, id) -> {
Toast.makeText(ctx, "Please, check your internet connection", Toast.LENGTH_SHORT).show();
return true;
});
if (filterImages.isChecked()) {
// Most common image file extensions (source: http://preservationtutorial.library.cornell.edu/presentation/table7-1.html)
smbFileChooserDialog.setFilter(dirOnly.isChecked(),
Expand All @@ -140,18 +155,6 @@ public void onClick(View v) {
.create()
.show();
});
} else {
smbFileChooserDialog.setOnChosenListener((dir, dirFile) -> {
if (continueFromLast.isChecked()) {
_path = dir;
}
try {
Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_SHORT).show();
_tv.setText(dir);
} catch (SmbException e) {
e.printStackTrace();
}
});
}
if (continueFromLast.isChecked() && _path != null) {
smbFileChooserDialog.setStartFile(_path);
Expand All @@ -169,7 +172,15 @@ public void onClick(View v) {
.setOptionResources(R.string.option_create_folder, R.string.options_delete, R.string.new_folder_cancel, R.string.new_folder_ok)
.disableTitle(disableTitle.isChecked())
.enableOptions(enableOptions.isChecked())
.displayPath(displayPath.isChecked());
.displayPath(displayPath.isChecked())
.setOnChosenListener((dir, dirFile) -> {
if (continueFromLast.isChecked()) {
_path = dir;
}
Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_SHORT).show();
_tv.setText(dir);
if (dirFile.isFile()) _iv.setImageBitmap(ImageUtil.decodeFile(dirFile));
});
if (filterImages.isChecked()) {
// Most common image file extensions (source: http://preservationtutorial.library.cornell.edu/presentation/table7-1.html)
fileChooserDialog.setFilter(dirOnly.isChecked(),
Expand All @@ -194,15 +205,6 @@ public void onClick(View v) {
.create()
.show();
});
} else {
fileChooserDialog.setOnChosenListener((dir, dirFile) -> {
if (continueFromLast.isChecked()) {
_path = dir;
}
Toast.makeText(ctx, (dirFile.isDirectory() ? "FOLDER: " : "FILE: ") + dir, Toast.LENGTH_SHORT).show();
_tv.setText(dir);
if (dirFile.isFile()) _iv.setImageBitmap(ImageUtil.decodeFile(dirFile));
});
}
if (continueFromLast.isChecked() && _path != null) {
fileChooserDialog.setStartFile(_path);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
@file:Suppress("unused")

package com.obsez.android.lib.smbfilechooser.demo

import android.content.Context
import com.obsez.android.lib.smbfilechooser.FileChooserDialog

object Demo {


fun demo1(context: Context, startPath: String, callback: FileChooserDialog.OnChosenListener) {
FileChooserDialog.newDialog(context)
.displayPath(true)
.setIcon(R.mipmap.ic_launcher)
.setFilterRegex(false, true, ".*\\.(jpe?g|png)")
.setStartFile(startPath)
.setResources(R.string.title_choose_file, R.string.title_choose, R.string.dialog_cancel)
Expand All @@ -16,6 +18,23 @@ object Demo {
.setNavigateTo { true }
.build()
.show()
}

fun demo2(context: Context, startPath: String, onChosenListener: FileChooserDialog.OnChosenListener, onSelectedListener: FileChooserDialog.OnSelectedListener) {
FileChooserDialog.newDialog(context)
.displayPath(true)
.setFilter(false, true, "jpg", "jpeg", "png")
.setStartFile(startPath)
.enableOptions(true)
.enableMultiple(true, false)
.setResources(R.string.title_choose_file, 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)
.setOnSelectedListener(onSelectedListener)
.setOnChosenListener(onChosenListener)
.setNavigateUpTo { true }
.setNavigateTo { true }
.setDateFormat("dd MMMM yyyy")
.build()
.show()
}
}
26 changes: 5 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,26 @@ buildscript {
repositories {
google()
maven { url "https://maven.google.com" }
//maven { url "http://dl.bintray.com/hedzr/maven" }
mavenCentral()
mavenLocal()
maven { url "https://dl.bintray.com/kotlin/kotlinx/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.android.tools:r8:1.3.52'

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '3.1.0')
//classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3"
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

//plugins {
// id "com.jfrog.bintray" version "1.2"
//}
//apply plugin: 'com.jfrog.artifactory'
//apply plugin: 'com.jfrog.bintray'
// only our subprojects have a bintray configuration. replace the root project's
// `bintrayUpload` task with one that restricts the calls to the subprojects.
//project.afterEvaluate {
// task bintrayUpload(group: "publishing", overwrite: true) {
// dependsOn subprojects.bintrayUpload
// }
//}

allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
jcenter()
}
}
36 changes: 14 additions & 22 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
# Project-wide Gradle settings.
# Enable build caching and other things for faster builds.
android.enableBuildCache=true
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m
#org.gradle.parallel=true

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# Enable R8 code shrinker and obfuscator
android.enableR8=true
#android.enableR8.fullMode=true

# Enable AndroidX
android.enableJetifier=true
android.useAndroidX=true

VERSION_NAME=1.3.3s
VERSION_CODE=103300
# Global variables
VERSION_NAME=1.3.4s
VERSION_CODE=103340
GROUP=com.obsez.android.lib.filechooser

POM_DESCRIPTION=Android File Chooser Library
Expand All @@ -34,10 +29,7 @@ POM_DEVELOPER_ID=hedzr
POM_DEVELOPER_NAME=Hedzr Yeh
POM_DEVELOPER_EMAIL=hedzrz@gmail.com


ANDROID_COMPILE_SDK_VERSION=28
ANDROID_BUILD_TOOLS_VERSION=28.0.3
ANDROID_MIN_SDK_VERSION=14
ANDROID_TARGET_SDK_VERSION=28
android.useAndroidX=true
android.enableJetifier=true
8 changes: 5 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'eu.agno3.jcifs:jcifs-ng:2.1.1'
implementation 'eu.agno3.jcifs:jcifs-ng:2.1.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

Expand All @@ -59,12 +59,12 @@ dependencies {
// gradle bintrayUpload
//apply from: '_bintray.gradle'

task createPom << {
task createPom {
pom {
project {
groupId 'com.github.Guiorgy'
artifactId 'android-smbfile-chooser'
version 'v1.2.0s'
version VERSION_NAME

inceptionYear '2018'
licenses {
Expand All @@ -77,3 +77,5 @@ task createPom << {
}
}.writeTo("pom.xml")
}

build.finalizedBy(createPom)
4 changes: 2 additions & 2 deletions library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.Guiorgy</groupId>
<artifactId>android-smbfile-chooser</artifactId>
<version>v1.2.0s</version>
<version>1.3.4s</version>
<inceptionYear>2018</inceptionYear>
<licenses>
<license>
Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>eu.agno3.jcifs</groupId>
<artifactId>jcifs-ng</artifactId>
<version>2.1.1</version>
<version>2.1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.obsez.android.lib.smbfilechooser.demo;
package com.obsez.android.lib.smbfilechooser;

import android.app.Application;
import android.test.ApplicationTestCase;
Expand All @@ -10,4 +10,4 @@ public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
}
Loading

0 comments on commit 4160edc

Please sign in to comment.