Skip to content

Commit

Permalink
fixed #153, #144, #138
Browse files Browse the repository at this point in the history
  • Loading branch information
DroidNinja committed Apr 14, 2018
1 parent 0057c92 commit a957a3e
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 36 deletions.
25 changes: 13 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "26.0.3"
buildToolsVersion "27.0.3"

defaultConfig {
applicationId "vi.filepicker"
Expand All @@ -21,25 +21,26 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
implementation project(':filepicker')
implementation 'com.android.support:appcompat-v7:27.1.0'
compile 'com.jakewharton:butterknife:8.8.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'pub.devrel:easypermissions:1.1.1'

// Required for instrumented tests
androidTestCompile 'com.android.support:support-annotations:27.1.0'
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
// Optional -- UI testing with Espresso
androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.1', {
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:3.0.1'
androidTestCompile 'com.android.support.test.espresso:espresso-intents:3.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.1'

// compile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
}
3 changes: 2 additions & 1 deletion app/src/main/java/vi/filepicker/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,14 @@ public void onPickDoc() {
Toast.LENGTH_SHORT).show();
} else {
FilePickerBuilder.getInstance()
.setMaxCount(1)
.setMaxCount(maxCount)
.setSelectedFiles(docPaths)
.setActivityTheme(R.style.FilePickerTheme)
.setActivityTitle("Please select doc")
.addFileSupport("ZIP", zips)
.addFileSupport("PDF", pdfs, R.drawable.pdf_blue)
.enableDocSupport(false)
.enableSelectAll(true)
.sortDocumentsBy(SortingTypes.name)
.withOrientation(Orientation.UNSPECIFIED)
.pickFile(this);
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
Expand Down
10 changes: 5 additions & 5 deletions filepicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

version = "2.1.4"
version = "2.1.5"

android {
compileSdkVersion 27
buildToolsVersion "26.0.3"
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 15
Expand All @@ -24,9 +24,9 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'com.android.support:appcompat-v7:27.1.0'
api 'com.android.support:support-v4:27.1.0'
api 'com.android.support:design:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
api 'com.github.bumptech.glide:glide:4.6.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1'
testImplementation 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
Expand Down Expand Up @@ -134,24 +133,25 @@ public void updateList(List<Document> dirs) {
selectAllItem.setVisible(true);
onItemSelected();
} else {
MenuItem search = menu.findItem(R.id.search);
SearchView searchView = (SearchView) search.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override public boolean onQueryTextSubmit(String query) {
selectAllItem.setVisible(false);
}

return false;
}
MenuItem search = menu.findItem(R.id.search);
SearchView searchView = (SearchView) search.getActionView();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override public boolean onQueryTextSubmit(String query) {

@Override public boolean onQueryTextChange(String newText) {
if (fileListAdapter != null) {
fileListAdapter.getFilter().filter(newText);
}
return true;
return false;
}

@Override public boolean onQueryTextChange(String newText) {
if (fileListAdapter != null) {
fileListAdapter.getFilter().filter(newText);
}
});
return true;
}
});

selectAllItem.setVisible(false);
}
super.onCreateOptionsMenu(menu, inflater);
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sat Nov 04 17:41:48 IST 2017
#Thu Mar 29 00:48:14 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

0 comments on commit a957a3e

Please sign in to comment.