Skip to content
Open
38 changes: 38 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="vi.filepicker">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />

<application
android:name=".AppDelegate"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".FragmentActivity"></activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="vi.filepicker"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths"></meta-data>
</provider>
</application>

</manifest>
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If your app

* As of now, It is only available in jCenter(), So just put this in your app dependencies:
```gradle
implementation 'com.droidninja:filepicker:2.2.4'
implementation 'com.droidninja:filepicker:2.2.5'
```
There is a method `getFilePath` in `ContentUriUtils` class through you can get the file path from Uri. e.g.

Expand Down Expand Up @@ -128,8 +128,9 @@ String zipTypes = {"zip","rar"};
addFileSupport("ZIP",zipTypes, R.drawable.ic_zip_icon);
```

#Styling
Just override these styles in your main module to change colors and themes.
# Styling

Just override these styles in your main module to change colors and themes.

- If you have dark theme colors, just use `LibAppTheme.Dark`
- If you have light theme colors, just use `LibAppTheme`
Expand Down Expand Up @@ -163,8 +164,8 @@ Just override these styles in your main module to change colors and themes.
<item name="tabGravity">fill</item>
<item name="tabMaxWidth">0dp</item>
</style>


<style name="ToolbarTheme" parent="Widget.MaterialComponents.Toolbar.Primary">
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Toolbar.Light</item>
<item name="android:theme">@style/ThemeOverlay.App.Toolbar.Light</item>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/vi/filepicker/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ public void onPickDoc() {
.setActivityTitle("Please select doc")
.setImageSizeLimit(5) //Provide Size in MB
.setVideoSizeLimit(20)
.addFileSupport("ZIP", zips)
.addFileSupport("AAC", pdfs, R.drawable.pdf_blue)
// .addFileSupport("ZIP", zips)
// .addFileSupport("AAC", pdfs, R.drawable.pdf_blue)
.enableDocSupport(true)
.enableSelectAll(true)
.sortDocumentsBy(SortingTypes.name)
.sortDocumentsBy(SortingTypes.NAME)
.withOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
.pickFile(this);
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="rationale_doc_picker">L\'app ha bisogno di questo permesso per accedere ai documenti del dispositivo.</string>
<string name="rationale_photo_picker">L\'app ha bisogno di questo permesso per selezionare foto dalla galleria e dalla camera.</string>
</resources>
9 changes: 4 additions & 5 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<resources>
<string name="app_name">Android FilePicker</string>
<string name="app_name" translatable="false">Android FilePicker</string>

<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="rationale_photo_picker">We require this permission to select photo from gallery and camera.</string>
<string name="rationale_doc_picker">We need this pemission to read documents from device.</string>
<string name="hello_blank_fragment" translatable="false">Hello blank fragment</string>
<string name="rationale_photo_picker">We require this permission to select photo from gallery and camera.</string>
<string name="rationale_doc_picker">We need this permission to read documents from device.</string>
</resources>
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ allprojects {
task clean(type: Delete) {
delete rootProject.buildDir
}

subprojects {
tasks.withType(Javadoc).all { enabled = false }
}
4 changes: 3 additions & 1 deletion filepicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

version = "2.2.4"
version = "2.2.5"

android {
compileSdkVersion 30
Expand Down Expand Up @@ -86,6 +86,7 @@ task javadoc(type: Javadoc) {
excludes = ['**/*.kt']
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}
Expand All @@ -94,6 +95,7 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives javadocJar
archives sourcesJar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ object PickerManager {
private var maxCount = FilePickerConst.DEFAULT_MAX_COUNT
private var showImages = true
var cameraDrawable = R.drawable.ic_camera
var sortingType = SortingTypes.none
var sortingType = SortingTypes.NONE

val selectedPhotos: ArrayList<Uri> = ArrayList()
val selectedFiles: ArrayList<Uri> = ArrayList()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package droidninja.filepicker.models.sort

import droidninja.filepicker.models.Document
import java.util.*

/**
* Created by gabriel on 10/2/17.
*/
class NameComparator : Comparator<Document> {
override fun compare(o1: Document, o2: Document): Int {
return o1.name.toLowerCase(Locale.getDefault()).compareTo(o2.name.toLowerCase(Locale.getDefault()))
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package droidninja.filepicker.models.sort

import droidninja.filepicker.models.Document
import java.util.*

/**
* Created by gabriel on 10/2/17.
*/
enum class SortingTypes(val comparator: Comparator<Document>?) {
NAME(NameComparator()), NONE(null);
}