├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── build.gradle
├── docs
├── allclasses-frame.html
├── allclasses-noframe.html
├── com
│ └── filestack
│ │ └── android
│ │ ├── CameraFragment.html
│ │ ├── CloudAuthFragment.html
│ │ ├── CloudListFragment.html
│ │ ├── FilestackPicker.Builder.html
│ │ ├── FilestackPicker.html
│ │ ├── FsActivity.html
│ │ ├── FsConstants.html
│ │ ├── LocalFilesFragment.html
│ │ ├── Selection.SimpleSaver.html
│ │ ├── Selection.html
│ │ ├── SpacingDecoration.html
│ │ ├── Theme.Builder.html
│ │ ├── Theme.html
│ │ ├── UploadService.html
│ │ ├── internal
│ │ ├── BackButtonListener.html
│ │ ├── CameraFragment.html
│ │ ├── CloudAuthFragment.html
│ │ ├── CloudListFragment.html
│ │ ├── Constants.html
│ │ ├── LocalFilesFragment.html
│ │ ├── SelectionSaver.Listener.html
│ │ ├── SelectionSaver.html
│ │ ├── Selector.Multi.html
│ │ ├── Selector.Single.html
│ │ ├── Selector.html
│ │ ├── SimpleSelectionSaver.html
│ │ ├── SourceInfo.html
│ │ ├── SpacingDecoration.html
│ │ ├── SquareImageView.html
│ │ ├── UploadService.html
│ │ ├── Util.html
│ │ ├── package-frame.html
│ │ ├── package-summary.html
│ │ └── package-tree.html
│ │ ├── package-frame.html
│ │ ├── package-summary.html
│ │ └── package-tree.html
├── constant-values.html
├── deprecated-list.html
├── help-doc.html
├── index-all.html
├── index.html
├── overview-frame.html
├── overview-summary.html
├── overview-tree.html
├── package-list
├── script.js
├── serialized-form.html
└── stylesheet.css
├── filestack
├── .gitignore
├── build.gradle
├── consumer-proguard-rules.pro
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── filestack
│ │ └── android
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── filestack
│ │ │ └── android
│ │ │ ├── FilestackPicker.java
│ │ │ ├── FsActivity.java
│ │ │ ├── FsConstants.java
│ │ │ ├── Selection.java
│ │ │ ├── Theme.java
│ │ │ ├── internal
│ │ │ ├── BackButtonListener.java
│ │ │ ├── CameraFragment.java
│ │ │ ├── CloudAuthFragment.java
│ │ │ ├── CloudListAdapter.java
│ │ │ ├── CloudListFragment.java
│ │ │ ├── CloudListViewHolder.java
│ │ │ ├── Constants.java
│ │ │ ├── LocalFilesFragment.java
│ │ │ ├── SelectionFactory.java
│ │ │ ├── SelectionSaver.java
│ │ │ ├── Selector.java
│ │ │ ├── SimpleSelectionSaver.java
│ │ │ ├── SourceInfo.java
│ │ │ ├── SpacingDecoration.java
│ │ │ ├── SquareImageView.java
│ │ │ ├── UploadService.java
│ │ │ ├── Util.java
│ │ │ └── package-info.java
│ │ │ └── package-info.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── filestack__ic_menu_upload_done_white.png
│ │ ├── filestack__ic_menu_upload_fail_white.png
│ │ └── filestack__ic_menu_upload_white.png
│ │ ├── drawable-mdpi
│ │ ├── filestack__ic_menu_upload_done_white.png
│ │ ├── filestack__ic_menu_upload_fail_white.png
│ │ └── filestack__ic_menu_upload_white.png
│ │ ├── drawable-v21
│ │ ├── filestack__ic_menu_upload_done_white.xml
│ │ ├── filestack__ic_menu_upload_fail_white.xml
│ │ └── filestack__ic_menu_upload_white.xml
│ │ ├── drawable-xhdpi
│ │ ├── filestack__ic_menu_upload_done_white.png
│ │ ├── filestack__ic_menu_upload_fail_white.png
│ │ └── filestack__ic_menu_upload_white.png
│ │ ├── drawable-xxhdpi
│ │ ├── filestack__ic_menu_upload_done_white.png
│ │ ├── filestack__ic_menu_upload_fail_white.png
│ │ └── filestack__ic_menu_upload_white.png
│ │ ├── drawable-xxxhdpi
│ │ ├── filestack__ic_menu_upload_done_white.png
│ │ ├── filestack__ic_menu_upload_fail_white.png
│ │ └── filestack__ic_menu_upload_white.png
│ │ ├── drawable
│ │ ├── filestack__ic_list_checkbox.xml
│ │ ├── filestack__ic_menu_grid_white.xml
│ │ ├── filestack__ic_menu_list_white.xml
│ │ ├── filestack__ic_menu_square_white.xml
│ │ ├── filestack__ic_menu_upload_done_white.xml
│ │ ├── filestack__ic_menu_upload_fail_white.xml
│ │ ├── filestack__ic_menu_upload_white.xml
│ │ ├── filestack__ic_source_amazon_drive.xml
│ │ ├── filestack__ic_source_box.xml
│ │ ├── filestack__ic_source_camera.xml
│ │ ├── filestack__ic_source_camera_video.xml
│ │ ├── filestack__ic_source_device.xml
│ │ ├── filestack__ic_source_dropbox.xml
│ │ ├── filestack__ic_source_facebook.xml
│ │ ├── filestack__ic_source_github.xml
│ │ ├── filestack__ic_source_gmail.xml
│ │ ├── filestack__ic_source_google_drive.xml
│ │ ├── filestack__ic_source_google_photos.xml
│ │ ├── filestack__ic_source_instagram.xml
│ │ ├── filestack__ic_source_onedrive.xml
│ │ └── filestack__list_grid_divider.xml
│ │ ├── layout-sw600dp
│ │ └── filestack__activity_filestack.xml
│ │ ├── layout
│ │ ├── filestack__activity_filestack.xml
│ │ ├── filestack__app_bar_filestack.xml
│ │ ├── filestack__cloud_grid_item.xml
│ │ ├── filestack__cloud_list_item.xml
│ │ ├── filestack__fragment_auth.xml
│ │ ├── filestack__fragment_camera.xml
│ │ ├── filestack__fragment_cloud_list.xml
│ │ ├── filestack__fragment_local_files.xml
│ │ └── filestack__nav_header_filestack.xml
│ │ ├── menu
│ │ └── filestack__menu.xml
│ │ ├── values-land
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── public.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── filestack
│ └── android
│ └── internal
│ └── SelectorTest.kt
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── logo.svg
├── samples
└── form
│ ├── .gitignore
│ ├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── filestack
│ │ │ └── android
│ │ │ └── samples
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── filestack
│ │ │ │ └── android
│ │ │ │ └── samples
│ │ │ │ └── form
│ │ │ │ ├── CompleteFragment.java
│ │ │ │ ├── EntryActivity.java
│ │ │ │ ├── FormFragment.java
│ │ │ │ ├── LoadingFragment.java
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ └── ic_launcher_background.xml
│ │ │ ├── layout
│ │ │ ├── activity_main.xml
│ │ │ ├── fragment_complete.xml
│ │ │ ├── fragment_form.xml
│ │ │ └── fragment_loading.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ │ └── xml
│ │ │ └── file_paths.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── filestack
│ │ └── android
│ │ └── samples
│ │ └── ExampleUnitTest.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ └── settings.gradle
├── settings.gradle
└── tester
├── .gitignore
├── build.gradle
├── filestack-tester.keystore
├── media
└── recording.gif
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── filestack
│ └── android
│ └── demo
│ └── ExampleInstrumentedTest.java
├── main
├── AndroidManifest.xml
├── java
│ └── com
│ │ └── filestack
│ │ └── android
│ │ └── demo
│ │ ├── EntryActivity.java
│ │ ├── MainActivity.java
│ │ ├── SettingsActivity.java
│ │ ├── SettingsFragment.java
│ │ └── UploadStatusReceiver.java
└── res
│ ├── layout
│ ├── activity_main.xml
│ └── activity_settings.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── file_paths.xml
│ └── preferences.xml
└── test
└── java
└── com
└── filestack
└── android
└── demo
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .gradle
3 | .idea
4 | *.iml
5 | /build
6 | local.properties
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: android
2 | android:
3 | components:
4 | - tools
5 | - platform-tools
6 | - tools
7 | - build-tools-28.0.3
8 | - android-28
9 |
10 | script: ./gradlew filestack:build
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.6.21'
5 | repositories {
6 | jcenter()
7 | google()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:7.4.2'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | mavenLocal()
21 | jcenter()
22 | google()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/docs/allclasses-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | All Classes (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 | All Classes
13 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/docs/allclasses-noframe.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | All Classes (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 | All Classes
13 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/docs/com/filestack/android/internal/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.filestack.android.internal (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
Interfaces
15 |
21 |
Classes
22 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/docs/com/filestack/android/package-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | com.filestack.android (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/docs/deprecated-list.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Deprecated List (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 |
22 |
23 | JavaScript is disabled on your browser.
24 |
25 |
26 |
43 |
70 |
71 |
78 |
106 |
107 |
124 |
125 |
126 | Prev
127 | Next
128 |
129 |
133 |
136 |
137 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | filestack 5.3.0 API
7 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | JavaScript is disabled on your browser.
70 |
71 | Frame Alert
72 | This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version .
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/docs/overview-frame.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Overview List (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 |
13 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/docs/overview-summary.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Overview (filestack 5.3.0 API)
7 |
8 |
9 |
10 |
11 |
12 |
22 |
23 | JavaScript is disabled on your browser.
24 |
25 |
26 |
43 |
70 |
71 |
74 |
75 |
76 | Packages
77 |
78 | Package
79 | Description
80 |
81 |
82 |
83 | com.filestack.android
84 |
85 | Filestack is an easy API for file uploading, conversion, and delivery.
86 |
87 |
88 |
89 | com.filestack.android.internal
90 |
91 | Internal API.
92 |
93 |
94 |
95 |
96 |
97 |
98 |
115 |
116 |
117 | Prev
118 | Next
119 |
120 |
124 |
127 |
128 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
--------------------------------------------------------------------------------
/docs/package-list:
--------------------------------------------------------------------------------
1 | com.filestack.android
2 | com.filestack.android.internal
3 |
--------------------------------------------------------------------------------
/docs/script.js:
--------------------------------------------------------------------------------
1 | function show(type)
2 | {
3 | count = 0;
4 | for (var key in methods) {
5 | var row = document.getElementById(key);
6 | if ((methods[key] & type) != 0) {
7 | row.style.display = '';
8 | row.className = (count++ % 2) ? rowColor : altColor;
9 | }
10 | else
11 | row.style.display = 'none';
12 | }
13 | updateTabs(type);
14 | }
15 |
16 | function updateTabs(type)
17 | {
18 | for (var value in tabs) {
19 | var sNode = document.getElementById(tabs[value][0]);
20 | var spanNode = sNode.firstChild;
21 | if (value == type) {
22 | sNode.className = activeTableTab;
23 | spanNode.innerHTML = tabs[value][1];
24 | }
25 | else {
26 | sNode.className = tableTab;
27 | spanNode.innerHTML = "" + tabs[value][1] + " ";
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/docs/serialized-form.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Serialized Form (filestack 2.0.0-alpha.2 API)
7 |
8 |
9 |
10 |
11 |
12 |
22 |
23 | JavaScript is disabled on your browser.
24 |
25 |
26 |
42 |
69 |
70 |
73 |
106 |
107 |
123 |
124 |
125 | Prev
126 | Next
127 |
128 |
132 |
135 |
136 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
--------------------------------------------------------------------------------
/filestack/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/filestack/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'com.jfrog.bintray' version '1.7.3'
3 | }
4 |
5 | apply plugin: 'com.android.library'
6 | apply plugin: 'kotlin-android'
7 |
8 | group = 'com.filestack'
9 | version = '6.0.0'
10 | project.archivesBaseName = 'filestack-android'
11 |
12 | android {
13 | compileSdkVersion 33
14 |
15 | defaultConfig {
16 | minSdkVersion 16
17 | targetSdkVersion 33
18 | multiDexEnabled = true
19 |
20 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
21 |
22 | vectorDrawables {
23 | useSupportLibrary true
24 | }
25 |
26 | resourcePrefix 'filestack__'
27 | buildConfigField "String", "FILESTACK_ANDROID_VERSION", "\"$version\""
28 |
29 | }
30 | buildTypes {
31 | release {
32 | minifyEnabled false
33 | consumerProguardFile 'consumer-proguard-rules.pro'
34 | }
35 | }
36 | }
37 |
38 | dependencies {
39 | api 'com.filestack:filestack-java:0.9.0'
40 |
41 | implementation 'androidx.appcompat:appcompat:1.0.0'
42 | implementation 'com.google.android.material:material:1.0.0'
43 | implementation 'androidx.browser:browser:1.0.0'
44 |
45 | implementation 'com.squareup.picasso:picasso:2.5.2'
46 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
47 |
48 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
49 | exclude group: 'com.android.support', module: 'support-annotations'
50 | })
51 | testImplementation 'junit:junit:4.12'
52 | testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
53 | }
54 |
55 | task sourcesJar(type: Jar) {
56 | from android.sourceSets.main.java.srcDirs
57 | classifier = 'sources'
58 | }
59 |
60 | task javadoc(type: Javadoc) {
61 | source = android.sourceSets.main.java.srcDirs
62 | options.addStringOption('Xdoclint:none', '-quiet')
63 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
64 | destinationDir = file("../docs/")
65 | }
66 |
67 | // Add dependencies to javadoc classpath so annotations work
68 | afterEvaluate {
69 | javadoc.classpath += files(android.libraryVariants.collect { variant ->
70 | variant.javaCompiler.classpath.files
71 | })
72 | }
73 |
74 | task javadocJar(type: Jar, dependsOn: javadoc) {
75 | classifier = 'javadoc'
76 | from javadoc.destinationDir
77 | }
78 |
79 | artifacts {
80 | archives javadocJar
81 | archives sourcesJar
82 | }
83 |
84 | bintray {
85 | user = project.hasProperty('bintrayUser') ? project.property('bintrayUser')
86 | : System.getenv('BINTRAY_USER')
87 | key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey')
88 | : System.getenv('BINTRAY_API_KEY')
89 | configurations = ['archives']
90 | publish = true
91 | pkg {
92 | repo = 'maven'
93 | userOrg = 'filestack'
94 | name = 'filestack-android'
95 | desc = 'Official Android SDK for Filestack.'
96 |
97 | publicDownloadNumbers = true
98 | licenses = ['Apache-2.0']
99 |
100 | websiteUrl = 'https://filestack.com'
101 | vcsUrl = 'https://github.com/filestack/filestack-android.git'
102 | issueTrackerUrl = 'https://github.com/filestack/filestack-android/issues'
103 |
104 | githubRepo = 'filestack/filestack-android'
105 | githubReleaseNotesFile = 'CHANGELOG.md'
106 |
107 | version {
108 | name = project.version
109 | vcsTag = project.version
110 | released = new Date()
111 | }
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/filestack/consumer-proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/saten/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 | # filestack-java-specific rules
27 | -keep public class com.filestack.internal.responses.** {
28 | private *;
29 | (...);
30 | }
31 |
32 | -keep public class com.filestack.CloudResponse {
33 | private *;
34 | (...);
35 | }
36 |
37 | -keep public class com.filestack.CloudItem {
38 | private *;
39 | (...);
40 | }
41 |
42 | -keep public class com.filestack.AppInfo {
43 | private *;
44 | (...);
45 | }
46 |
47 | # OkHttp-specific rules
48 | -dontwarn javax.annotation.**
49 | -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
50 | -dontwarn org.codehaus.mojo.animal_sniffer.*
51 | -dontwarn okhttp3.internal.platform.ConscryptPlatform
52 |
53 | # Okio-specific rules
54 | -dontwarn okio.**
55 |
56 | -dontwarn com.squareup.okhttp.*
57 |
--------------------------------------------------------------------------------
/filestack/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/saten/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/filestack/src/androidTest/java/com/filestack/android/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.filestack.android.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/filestack/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
12 |
13 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/FsConstants.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android;
2 |
3 | public class FsConstants {
4 | // Options for the picker UI
5 | /** Expects boolean value. Selections won't get uploaded automatically if set to false. */
6 | public static final String EXTRA_AUTO_UPLOAD = "autoUpload";
7 | /** Expects {{@link com.filestack.Config}}. Sets credential and other account info. */
8 | public static final String EXTRA_CONFIG = "config";
9 | /** Expects {{@link java.util.ArrayList}}. Sets sources to enable. */
10 | public static final String EXTRA_SOURCES = "sources";
11 | /** Expects {{@link com.filestack.StorageOptions}}. Sets options for how to store uploads. */
12 | public static final String EXTRA_STORE_OPTS = "storeOpts";
13 | /** Expects string array. Sets MIME types that are allowed to be selected. */
14 | public static final String EXTRA_MIME_TYPES = "mimeTypes";
15 | /**
16 | * Expects boolean. If true, multiple files can be selected for upload.
17 | * Settings this value to false restricts the selection to only one file.
18 | * Defaults to true.
19 | */
20 | public static final String EXTRA_ALLOW_MULTIPLE_FILES = "multipleFiles";
21 |
22 | /** Action for upload broadcast intent filter. */
23 | public static final String BROADCAST_UPLOAD = "com.filestack.android.BROADCAST_UPLOAD";
24 |
25 | static final String EXTRA_DISPLAY_VERSION_INFORMATION = "displayVersionInformation";
26 | static final String EXTRA_THEME = "theme";
27 |
28 | // Keys to access data from result intents
29 | /** For selections, returns {{@link java.util.ArrayList}} of {{@link Selection}} objects. */
30 | public static final String EXTRA_SELECTION_LIST = "selectionList";
31 | /** For uploads, returns the {{@link Selection}} that corresponded to this upload. */
32 | public static final String EXTRA_SELECTION = "selection";
33 | /** For uploads, returns upload metadata as {{@link com.filestack.FileLink}}. */
34 | public static final String EXTRA_FILE_LINK = "fileLink";
35 | /** For uploads, returns upload status string. */
36 | public static final String EXTRA_STATUS = "status";
37 | /** For uploads, returns upload percent uploaded. */
38 | public static final String EXTRA_PERCENT = "percent";
39 | /** Indicates an upload completed successfully. */
40 | public static final String STATUS_COMPLETE = "complete";
41 | /** Indicates an upload is still in progress. */
42 | public static final String STATUS_IN_PROGRESS = "inProgress";
43 | /** Indicates an upload failed. */
44 | public static final String STATUS_FAILED = "failed";
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/Selection.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android;
2 |
3 | import android.net.Uri;
4 | import android.os.Parcel;
5 | import android.os.Parcelable;
6 |
7 | /** Metadata for a user selection (but not yet upload) of a local or cloud file. */
8 | public class Selection implements Parcelable {
9 | public static final Parcelable.Creator CREATOR = new Creator();
10 |
11 | private String provider;
12 | private String path;
13 | private Uri uri;
14 | private int size;
15 | private String mimeType;
16 | private String name;
17 |
18 | /** Constructor for local file.
19 | *
20 | * @deprecated Creation of this class should not be available to any consumers of the library.
21 | * Access to this class is scheduled to be removed in future versions.
22 | * */
23 | @Deprecated
24 | public Selection(String provider, String path, String mimeType, String name) {
25 | this.provider = provider;
26 | this.path = path;
27 | this.mimeType = mimeType;
28 | this.name = name;
29 | }
30 |
31 | /** Constructor for local file.
32 | *
33 | * @deprecated Creation of this class should not be available to any consumers of the library.
34 | * Access to this class is scheduled to be removed in future versions.
35 | * */
36 | @Deprecated
37 | public Selection(String provider, Uri uri, int size, String mimeType, String name) {
38 | this.provider = provider;
39 | this.uri = uri;
40 | this.size = size;
41 | this.mimeType = mimeType;
42 | this.name = name;
43 | }
44 |
45 | @Override
46 | public boolean equals(Object o) {
47 | if (this == o) return true;
48 | if (o == null || getClass() != o.getClass()) return false;
49 |
50 | Selection selection = (Selection) o;
51 |
52 | if (size != selection.size) return false;
53 | if (provider != null ? !provider.equals(selection.provider) : selection.provider != null)
54 | return false;
55 | if (path != null ? !path.equals(selection.path) : selection.path != null) return false;
56 | if (uri != null ? !uri.equals(selection.uri) : selection.uri != null) return false;
57 | if (mimeType != null ? !mimeType.equals(selection.mimeType) : selection.mimeType != null)
58 | return false;
59 | return name != null ? name.equals(selection.name) : selection.name == null;
60 | }
61 |
62 | @Override
63 | public int hashCode() {
64 | int result = provider != null ? provider.hashCode() : 0;
65 | result = 31 * result + (path != null ? path.hashCode() : 0);
66 | result = 31 * result + (uri != null ? uri.hashCode() : 0);
67 | result = 31 * result + size;
68 | result = 31 * result + (mimeType != null ? mimeType.hashCode() : 0);
69 | result = 31 * result + (name != null ? name.hashCode() : 0);
70 | return result;
71 | }
72 |
73 | /** The source this file came from. */
74 | public String getProvider() {
75 | return provider;
76 | }
77 |
78 | /** The path of this file in a cloud provider. Null if a local file. */
79 | public String getPath() {
80 | return path;
81 | }
82 |
83 | /** The Android system URI of this file. Null if a cloud file. */
84 | public Uri getUri() {
85 | return uri;
86 | }
87 |
88 | /** Size in bytes. */
89 | public int getSize() {
90 | return size;
91 | }
92 |
93 | public String getMimeType() {
94 | return mimeType;
95 | }
96 |
97 | public String getName() {
98 | return name;
99 | }
100 |
101 | private static class Creator implements Parcelable.Creator {
102 | @Override
103 | public Selection createFromParcel(Parcel in) {
104 | return new Selection(in);
105 | }
106 |
107 | @Override
108 | public Selection[] newArray(int size) {
109 | return new Selection[size];
110 | }
111 | }
112 |
113 | public int describeContents() {
114 | return 0;
115 | }
116 |
117 | public void writeToParcel(Parcel out, int flags) {
118 | out.writeString(provider);
119 | out.writeString(path);
120 | out.writeParcelable(uri, flags);
121 | out.writeInt(size);
122 | out.writeString(mimeType);
123 | out.writeString(name);
124 | }
125 |
126 | private Selection(Parcel in) {
127 | provider = in.readString();
128 | path = in.readString();
129 | uri = in.readParcelable(Uri.class.getClassLoader());
130 | size = in.readInt();
131 | mimeType = in.readString();
132 | name = in.readString();
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/Theme.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android;
2 |
3 | import android.graphics.Color;
4 | import android.os.Parcel;
5 | import android.os.Parcelable;
6 | import androidx.annotation.ColorInt;
7 |
8 | public class Theme implements Parcelable {
9 |
10 | static Theme defaultTheme() {
11 | return new Builder().build();
12 | }
13 |
14 | private final String title;
15 | private final int backgroundColor;
16 | private final int accentColor;
17 | private final int textColor;
18 |
19 | private Theme(Builder builder) {
20 | this.title = builder.title;
21 | this.backgroundColor = builder.backgroundColor;
22 | this.accentColor = builder.accentColor;
23 | this.textColor = builder.textColor;
24 | }
25 |
26 | public String getTitle() {
27 | return title;
28 | }
29 |
30 | public int getBackgroundColor() {
31 | return backgroundColor;
32 | }
33 |
34 | public int getAccentColor() {
35 | return accentColor;
36 | }
37 |
38 | public int getTextColor() {
39 | return textColor;
40 | }
41 |
42 | public static class Builder {
43 | String title = "Filestack Picker";
44 | int backgroundColor = Color.WHITE;
45 | int accentColor = Color.parseColor("#FF9800");
46 | int textColor = Color.parseColor("#89000000");
47 |
48 | /**
49 | * Title of the Picker.
50 | */
51 | public Builder title(String title) {
52 | this.title = title;
53 | return this;
54 | }
55 |
56 | /**
57 | * Background color. Displayed in lists and a navigation drawer.
58 | * Used also as a text color for toolbar title and
59 | * buttons on authorization/local/camera screens.
60 | * @param backgroundColor int representation of a color
61 | */
62 | public Builder backgroundColor(@ColorInt int backgroundColor) {
63 | this.backgroundColor = backgroundColor;
64 | return this;
65 | }
66 |
67 | /**
68 | * Accent color. Used as a color for toolbar, selection markers and navigation drawer items.
69 | * @param accentColor int representation of a color
70 | */
71 | public Builder accentColor(@ColorInt int accentColor) {
72 | this.accentColor = accentColor;
73 | return this;
74 | }
75 |
76 | /**
77 | * Text color. Used as a color for text in camera/local/authorization/file list screens.
78 | * @param textColor int representation of a color
79 | */
80 | public Builder textColor(@ColorInt int textColor) {
81 | this.textColor = textColor;
82 | return this;
83 | }
84 |
85 | /**
86 | * Builds a new theme based on provided parameters.
87 | * @return new {@link Theme} instance
88 | */
89 | public Theme build() {
90 | return new Theme(this);
91 | }
92 | }
93 |
94 | protected Theme(Parcel in) {
95 | title = in.readString();
96 | backgroundColor = in.readInt();
97 | accentColor = in.readInt();
98 | textColor = in.readInt();
99 | }
100 |
101 | @Override
102 | public void writeToParcel(Parcel dest, int flags) {
103 | dest.writeString(title);
104 | dest.writeInt(backgroundColor);
105 | dest.writeInt(accentColor);
106 | dest.writeInt(textColor);
107 | }
108 |
109 | @Override
110 | public int describeContents() {
111 | return 0;
112 | }
113 |
114 | public static final Creator CREATOR = new Creator() {
115 | @Override
116 | public Theme createFromParcel(Parcel in) {
117 | return new Theme(in);
118 | }
119 |
120 | @Override
121 | public Theme[] newArray(int size) {
122 | return new Theme[size];
123 | }
124 | };
125 | }
126 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/BackButtonListener.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | /**
4 | * Communicates back button presses between activity and fragments. Needed to traverse backwards
5 | * in cloud files list.
6 | */
7 | public interface BackButtonListener {
8 | boolean onBackPressed();
9 | }
10 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/CloudAuthFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.content.res.ColorStateList;
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 | import androidx.annotation.Nullable;
7 | import androidx.browser.customtabs.CustomTabsIntent;
8 | import androidx.fragment.app.Fragment;
9 | import androidx.core.content.ContextCompat;
10 | import androidx.core.view.ViewCompat;
11 | import androidx.core.widget.ImageViewCompat;
12 | import android.view.LayoutInflater;
13 | import android.view.Menu;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 | import android.widget.Button;
17 | import android.widget.ImageView;
18 | import android.widget.TextView;
19 |
20 | import com.filestack.android.R;
21 | import com.filestack.android.Theme;
22 |
23 | /** Displays "cloud auth required" message and creates an intent to open the link in the browser. */
24 | public class CloudAuthFragment extends Fragment implements BackButtonListener {
25 | private final static String ARG_SOURCE = "source";
26 | private final static String ARG_AUTH_URL = "authUrl";
27 | private final static String ARG_THEME = "theme";
28 |
29 | private final static int[] TEXT_VIEW_IDS = {
30 | R.id.title, R.id.description, R.id.button, R.id.action };
31 |
32 | private SourceInfo sourceInfo;
33 | private String authUrl;
34 |
35 | public static CloudAuthFragment create(String source, String authUrl, Theme theme) {
36 | CloudAuthFragment fragment = new CloudAuthFragment();
37 | Bundle args = new Bundle();
38 | args.putString(ARG_SOURCE, source);
39 | args.putString(ARG_AUTH_URL, authUrl);
40 | args.putParcelable(ARG_THEME, theme);
41 | fragment.setArguments(args);
42 | return fragment;
43 | }
44 |
45 | @Override
46 | public void onCreate(@Nullable Bundle savedInstanceState) {
47 | super.onCreate(savedInstanceState);
48 |
49 | Bundle args = getArguments();
50 | sourceInfo = Util.getSourceInfo(args.getString(ARG_SOURCE));
51 | authUrl = args.getString(ARG_AUTH_URL);
52 | }
53 |
54 | @Nullable
55 | @Override
56 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
57 | @Nullable Bundle savedInstanceState) {
58 |
59 | View baseView = inflater.inflate(R.layout.filestack__fragment_auth, container, false);
60 |
61 | ImageView iconView = baseView.findViewById(R.id.icon);
62 | iconView.setImageResource(sourceInfo.getIconId());
63 |
64 | Theme theme = getArguments().getParcelable(ARG_THEME);
65 | String target = "Cloud";
66 | String replacement = getString(sourceInfo.getTextId());
67 | for (int id : TEXT_VIEW_IDS) {
68 | TextView textView = baseView.findViewById(id);
69 | textView.setTextColor(theme.getTextColor());
70 | Util.textViewReplace(textView, target, replacement);
71 | }
72 | Button button = baseView.findViewById(R.id.button);
73 | button.setOnClickListener(new View.OnClickListener() {
74 | @Override
75 | public void onClick(View v) {
76 | openAuthPage(authUrl);
77 | }
78 | });
79 |
80 | ViewCompat.setBackgroundTintList(button, ColorStateList.valueOf(theme.getAccentColor()));
81 | button.setTextColor(theme.getBackgroundColor());
82 | ImageViewCompat.setImageTintList(iconView, ColorStateList.valueOf(theme.getTextColor()));
83 |
84 | return baseView;
85 | }
86 |
87 | @Override
88 | public void onPrepareOptionsMenu(Menu menu) {
89 | super.onPrepareOptionsMenu(menu);
90 | menu.findItem(R.id.action_logout).setVisible(false);
91 | menu.findItem(R.id.action_toggle_list_grid).setVisible(false);
92 | }
93 |
94 | private void openAuthPage(String authUrl) {
95 | CustomTabsIntent intent = new CustomTabsIntent.Builder().build();
96 | intent.launchUrl(requireContext(), Uri.parse(authUrl));
97 | }
98 |
99 | @Override
100 | public boolean onBackPressed() {
101 | return false;
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/CloudListViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.content.Context;
4 | import android.content.res.ColorStateList;
5 | import androidx.annotation.ColorInt;
6 | import androidx.core.graphics.ColorUtils;
7 | import androidx.core.widget.ImageViewCompat;
8 | import androidx.recyclerview.widget.RecyclerView;
9 | import android.view.View;
10 | import android.widget.ImageView;
11 | import android.widget.TextView;
12 |
13 | import com.filestack.android.R;
14 | import com.filestack.android.Theme;
15 | import com.squareup.picasso.Picasso;
16 |
17 | /**
18 | * Holds references to view elements inside {{@link RecyclerView}} list items.
19 | * {{@link CloudListFragment}}, {{@link CloudListAdapter}}, and {{@link CloudListViewHolder}} work
20 | * together to create the cloud sources list.
21 | *
22 | * @see
23 | * https://developer.android.com/guide/topics/ui/layout/recyclerview
24 | */
25 | class CloudListViewHolder extends RecyclerView.ViewHolder {
26 | private TextView nameView;
27 | private TextView infoView;
28 | private ImageView iconView;
29 | private ImageView checkboxView;
30 |
31 | CloudListViewHolder(View listItemView) {
32 | super(listItemView);
33 | this.nameView = listItemView.findViewById(R.id.name);
34 | this.infoView = listItemView.findViewById(R.id.info);
35 | this.iconView = listItemView.findViewById(R.id.icon);
36 | this.checkboxView = listItemView.findViewById(R.id.checkbox);
37 | }
38 |
39 | public void setId(int id) {
40 | itemView.setId(id);
41 | }
42 |
43 | public void setName(String name) {
44 | if (nameView != null) {
45 | nameView.setText(name);
46 | }
47 | }
48 |
49 | public void setInfo(String info) {
50 | if (infoView != null) {
51 | infoView.setText(info);
52 | }
53 | }
54 |
55 | public void setInfoVisible(boolean isVisible) {
56 | if (infoView != null) {
57 | infoView.setVisibility(isVisible ? View.VISIBLE : View.GONE);
58 | }
59 | }
60 |
61 | public void setIcon(String url) {
62 | if (iconView != null) {
63 | Context context = iconView.getContext();
64 | Picasso.with(context).load(url).into(iconView);
65 | }
66 | }
67 |
68 | public void apply(Theme theme) {
69 | if (nameView != null) {
70 | nameView.setTextColor(theme.getTextColor());
71 | }
72 |
73 | if (infoView!= null) {
74 | infoView.setTextColor(ColorUtils.setAlphaComponent(theme.getTextColor(), 220));
75 | }
76 |
77 | ImageViewCompat.setImageTintList(checkboxView, ColorStateList.valueOf(theme.getAccentColor()));
78 |
79 | }
80 |
81 | void setOnClickListener(View.OnClickListener listener) {
82 | itemView.setOnClickListener(listener);
83 | }
84 |
85 | void setSelected(boolean selected) {
86 | if (selected) {
87 | checkboxView.setVisibility(View.VISIBLE);
88 | } else {
89 | checkboxView.setVisibility(View.INVISIBLE);
90 | }
91 | }
92 |
93 | void setEnabled(boolean enabled) {
94 | float alpha = enabled ? 1.0f : 0.45f;
95 | iconView.setAlpha(alpha);
96 | if (nameView != null) {
97 | nameView.setAlpha(alpha);
98 | infoView.setAlpha(alpha);
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/Constants.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import static android.app.Activity.RESULT_FIRST_USER;
4 |
5 | public class Constants {
6 | static final int REQUEST_MEDIA_CAPTURE = RESULT_FIRST_USER;
7 | }
8 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/LocalFilesFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.app.Activity;
4 | import android.content.ClipData;
5 | import android.content.ContentResolver;
6 | import android.content.Intent;
7 | import android.content.res.ColorStateList;
8 | import android.database.Cursor;
9 | import android.net.Uri;
10 | import android.os.Bundle;
11 | import android.provider.OpenableColumns;
12 | import androidx.annotation.Nullable;
13 | import androidx.fragment.app.Fragment;
14 | import androidx.core.view.ViewCompat;
15 | import androidx.core.widget.ImageViewCompat;
16 | import android.view.LayoutInflater;
17 | import android.view.Menu;
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.Button;
21 | import android.widget.ImageView;
22 |
23 | import com.filestack.android.FsConstants;
24 | import com.filestack.android.R;
25 | import com.filestack.android.Selection;
26 | import com.filestack.android.Theme;
27 |
28 | import java.util.ArrayList;
29 |
30 | import static android.app.Activity.RESULT_FIRST_USER;
31 |
32 | /**
33 | * Handles opening system file browser and processing results for local file selection.
34 | *
35 | * @see
36 | * https://developer.android.com/guide/topics/providers/document-provider
37 | */
38 | public class LocalFilesFragment extends Fragment implements View.OnClickListener {
39 | private static final String ARG_ALLOW_MULTIPLE_FILES = "multipleFiles";
40 | private static final int READ_REQUEST_CODE = RESULT_FIRST_USER;
41 | private static final String ARG_THEME = "theme";
42 |
43 | public static Fragment newInstance(boolean allowMultipleFiles, Theme theme) {
44 | Fragment fragment = new LocalFilesFragment();
45 | Bundle args = new Bundle();
46 | args.putBoolean(ARG_ALLOW_MULTIPLE_FILES, allowMultipleFiles);
47 | args.putParcelable(ARG_THEME, theme);
48 | fragment.setArguments(args);
49 | return fragment;
50 | }
51 |
52 | @Nullable
53 | @Override
54 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
55 | View view = inflater.inflate(R.layout.filestack__fragment_local_files, container, false);
56 | Button openGalleryButton = view.findViewById(R.id.select_gallery);
57 | openGalleryButton.setOnClickListener(this);
58 | Theme theme = getArguments().getParcelable(ARG_THEME);
59 | ViewCompat.setBackgroundTintList(openGalleryButton, ColorStateList.valueOf(theme.getAccentColor()));
60 | openGalleryButton.setTextColor(theme.getBackgroundColor());
61 | ImageViewCompat.setImageTintList((ImageView) view.findViewById(R.id.icon), ColorStateList.valueOf(theme.getTextColor()));
62 | return view;
63 | }
64 |
65 | @Override
66 | public void onPrepareOptionsMenu(Menu menu) {
67 | super.onPrepareOptionsMenu(menu);
68 | menu.findItem(R.id.action_logout).setVisible(false);
69 | menu.findItem(R.id.action_toggle_list_grid).setVisible(false);
70 | }
71 |
72 | @Override
73 | public void onClick(View view) {
74 | startFilePicker();
75 | }
76 |
77 | private void startFilePicker() {
78 | final Intent intent;
79 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
80 | intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
81 | intent.addCategory(Intent.CATEGORY_OPENABLE);
82 | boolean allowMultipleFiles = getArguments().getBoolean(ARG_ALLOW_MULTIPLE_FILES, true);
83 | intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, allowMultipleFiles);
84 | intent.setType("*/*");
85 |
86 | Intent launchIntent = getActivity().getIntent();
87 | String[] mimeTypes = launchIntent.getStringArrayExtra(FsConstants.EXTRA_MIME_TYPES);
88 | if (mimeTypes != null) {
89 | intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
90 | }
91 | startActivityForResult(intent, READ_REQUEST_CODE);
92 | } else {
93 | intent = new Intent(Intent.ACTION_GET_CONTENT);
94 | intent.setType("*/*");
95 | startActivityForResult(intent, READ_REQUEST_CODE);
96 | }
97 | }
98 |
99 | @Override
100 | public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
101 |
102 | if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
103 | ClipData clipData = resultData.getClipData();
104 | ArrayList uris = new ArrayList<>();
105 |
106 | if (clipData != null) {
107 | for (int i = 0; i < clipData.getItemCount(); i++) {
108 | uris.add(clipData.getItemAt(i).getUri());
109 | }
110 | } else {
111 | uris.add(resultData.getData());
112 | }
113 |
114 | for (Uri uri : uris) {
115 | Selection selection = processUri(uri);
116 | Util.getSelectionSaver().toggleItem(selection);
117 | }
118 | }
119 | }
120 |
121 | private Selection processUri(Uri uri) {
122 | ContentResolver resolver = getActivity().getContentResolver();
123 |
124 | Cursor cursor = null;
125 | try {
126 | cursor = resolver.query(uri, null, null, null, null, null);
127 | if (cursor != null && cursor.moveToFirst()) {
128 | int nameIndex = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
129 | int sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE);
130 |
131 | // We can't upload files without knowing the size
132 | if (cursor.isNull(sizeIndex)) {
133 | return null;
134 | }
135 |
136 | String name = cursor.getString(nameIndex);
137 | int size = cursor.getInt(sizeIndex);
138 | String mimeType = resolver.getType(uri);
139 | return SelectionFactory.from(uri, size, mimeType, name);
140 | } else {
141 | return null;
142 | }
143 | } finally {
144 | if (cursor != null) {
145 | cursor.close();
146 | }
147 | }
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SelectionFactory.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.net.Uri;
4 |
5 | import com.filestack.CloudItem;
6 | import com.filestack.Sources;
7 | import com.filestack.android.Selection;
8 |
9 | class SelectionFactory {
10 |
11 | public static Selection from(String sourceId, CloudItem cloudItem) {
12 | return new Selection(sourceId, cloudItem.getPath(), cloudItem.getMimetype(),
13 | cloudItem.getName());
14 | }
15 |
16 | public static Selection from(Uri uri, int size, String mimeType, String name) {
17 | return new Selection(Sources.DEVICE, uri, size, mimeType, name);
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SelectionSaver.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import com.filestack.android.Selection;
4 |
5 | import java.util.ArrayList;
6 |
7 | /** Manages a user's file selections. Used to save selections and notify others about changes. */
8 | public interface SelectionSaver {
9 | boolean toggleItem(Selection selection);
10 | boolean isSelected(Selection selection);
11 | void setItemChangeListener(Listener listener);
12 | ArrayList getItems();
13 | void clear();
14 | boolean isEmpty();
15 | interface Listener {
16 | void onEmptyChanged(boolean isEmpty);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/Selector.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import com.filestack.android.Selection;
4 |
5 | public interface Selector {
6 | boolean toggle(Selection selection);
7 | boolean isSelected(Selection selection);
8 |
9 | class Single implements Selector {
10 |
11 | private final SelectionSaver selectionSaver;
12 |
13 | public Single(SelectionSaver selectionSaver) {
14 | this.selectionSaver = selectionSaver;
15 | }
16 |
17 | @Override
18 | public boolean toggle(Selection selection) {
19 | if (selectionSaver.isEmpty()) {
20 | return selectionSaver.toggleItem(selection);
21 | } else if (selectionSaver.getItems().get(0).equals(selection)) {
22 | return selectionSaver.toggleItem(selection);
23 | }
24 | return false;
25 | }
26 |
27 | @Override
28 | public boolean isSelected(Selection selection) {
29 | return selectionSaver.isSelected(selection);
30 | }
31 | }
32 |
33 | class Multi implements Selector {
34 |
35 | private SelectionSaver selectionSaver;
36 |
37 | public Multi(SelectionSaver selectionSaver) {
38 | this.selectionSaver = selectionSaver;
39 | }
40 |
41 | @Override
42 | public boolean toggle(Selection selection) {
43 | return selectionSaver.toggleItem(selection);
44 | }
45 |
46 | @Override
47 | public boolean isSelected(Selection selection) {
48 | return selectionSaver.isSelected(selection);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SimpleSelectionSaver.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import com.filestack.android.Selection;
4 |
5 | import java.util.ArrayList;
6 |
7 | /**
8 | * Implementation of {{@link SelectionSaver}}. Just saves selections to an {{@link ArrayList}}.
9 | */
10 | public class SimpleSelectionSaver implements SelectionSaver {
11 | private ArrayList selections = new ArrayList<>();
12 | private Listener listener;
13 |
14 | @Override
15 | public void setItemChangeListener(Listener listener) {
16 | if (listener == null) {
17 | return;
18 | }
19 | this.listener = listener;
20 | this.listener.onEmptyChanged(isEmpty());
21 | }
22 |
23 | @Override
24 | public ArrayList getItems() {
25 | return selections;
26 | }
27 |
28 | @Override
29 | public void clear() {
30 | if (selections.size() != 0) {
31 | selections.clear();
32 | if (listener != null) {
33 | listener.onEmptyChanged(true);
34 | }
35 | }
36 | }
37 |
38 | @Override
39 | public boolean isEmpty() {
40 | return selections.size() == 0;
41 | }
42 |
43 | @Override
44 | public boolean toggleItem(Selection item) {
45 | boolean isSaved;
46 |
47 | boolean wasEmpty = isEmpty();
48 |
49 | if (isSelected(item)) {
50 | selections.remove(item);
51 | isSaved = false;
52 | } else {
53 | selections.add(item);
54 | isSaved = true;
55 | }
56 |
57 | boolean isEmpty = isEmpty();
58 |
59 | if (listener != null && wasEmpty != isEmpty) {
60 | listener.onEmptyChanged(isEmpty);
61 | }
62 |
63 | return isSaved;
64 | }
65 |
66 | @Override
67 | public boolean isSelected(Selection item) {
68 | return selections.contains(item);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SourceInfo.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | /** Holds res info about a "source" files can be selected from e.g. local, google, facebook. */
4 | public class SourceInfo {
5 | private String id;
6 | private int iconId;
7 | private int textId;
8 | private int colorId;
9 |
10 | SourceInfo(String id, int iconId, int textId, int colorId) {
11 | this.id = id;
12 | this.iconId = iconId;
13 | this.textId = textId;
14 | this.colorId = colorId;
15 | }
16 |
17 | public String getId() {
18 | return id;
19 | }
20 |
21 | public int getIconId() {
22 | return iconId;
23 | }
24 |
25 | public int getTextId() {
26 | return textId;
27 | }
28 |
29 | public int getColorId() {
30 | return colorId;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SpacingDecoration.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.graphics.Rect;
4 | import androidx.recyclerview.widget.GridLayoutManager;
5 | import androidx.recyclerview.widget.LinearLayoutManager;
6 | import androidx.recyclerview.widget.RecyclerView;
7 | import androidx.recyclerview.widget.StaggeredGridLayoutManager;
8 | import android.view.View;
9 |
10 | // Taken from https://stackoverflow.com/a/32971704/5121687
11 | // TODO Still needs tweaking, offsets aren't exactly correct
12 | // In a 3 column grid, the middle items are a few pixels larger than first and last
13 |
14 | /**
15 | * Adds spacing between items in a {@link RecyclerView}. Works with {@link LinearLayoutManager},
16 | * {@link GridLayoutManager}, and {@link StaggeredGridLayoutManager}. Only handles vertical
17 | * orientation.
18 | */
19 | class SpacingDecoration extends RecyclerView.ItemDecoration {
20 | private final int hSpacing;
21 | private final int vSpacing;
22 | private final boolean includeEdge;
23 |
24 | SpacingDecoration(int hSpacing, int vSpacing, boolean includeEdge) {
25 | this.hSpacing = hSpacing;
26 | this.vSpacing = vSpacing;
27 | this.includeEdge = includeEdge;
28 | }
29 |
30 | @Override
31 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
32 | RecyclerView.State state) {
33 |
34 | super.getItemOffsets(outRect, view, parent, state);
35 |
36 | int position = parent.getChildAdapterPosition(view);
37 | RecyclerView.LayoutManager manager = parent.getLayoutManager();
38 |
39 | if (manager instanceof GridLayoutManager) {
40 | GridLayoutManager gridManager = (GridLayoutManager) manager;
41 | int spanCount = gridManager.getSpanCount();
42 | int column = position % spanCount;
43 | getGridItemOffsets(outRect, position, column, spanCount);
44 |
45 | } else if (parent.getLayoutManager() instanceof StaggeredGridLayoutManager) {
46 | StaggeredGridLayoutManager staggeredManager = (StaggeredGridLayoutManager) manager;
47 | int spanCount = staggeredManager.getSpanCount();
48 | StaggeredGridLayoutManager.LayoutParams params;
49 | params = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
50 | int column = params.getSpanIndex();
51 | getGridItemOffsets(outRect, position, column, spanCount);
52 |
53 | } else if (manager instanceof LinearLayoutManager) {
54 | outRect.left = hSpacing;
55 | outRect.right = hSpacing;
56 |
57 | if (includeEdge) {
58 | if (position == 0) {
59 | outRect.top = vSpacing;
60 | }
61 | outRect.bottom = vSpacing;
62 | } else {
63 | if (position > 0) {
64 | outRect.top = vSpacing;
65 | }
66 | }
67 | }
68 | }
69 |
70 | private void getGridItemOffsets(Rect outRect, int position, int column, int spanCount) {
71 | if (includeEdge) {
72 | outRect.left = hSpacing * (spanCount - column) / spanCount;
73 | outRect.right = hSpacing * (column + 1) / spanCount;
74 | if (position < spanCount) {
75 | outRect.top = vSpacing;
76 | }
77 | outRect.bottom = vSpacing;
78 | } else {
79 | outRect.left = hSpacing * column / spanCount;
80 | outRect.right = hSpacing * (spanCount - 1 - column) / spanCount;
81 | if (position >= spanCount) {
82 | outRect.top = vSpacing;
83 | }
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/SquareImageView.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal;
2 |
3 | import android.content.Context;
4 | import androidx.appcompat.widget.AppCompatImageView;
5 | import android.util.AttributeSet;
6 |
7 | public class SquareImageView extends AppCompatImageView {
8 | public SquareImageView(Context context, AttributeSet attrs) {
9 | super(context, attrs);
10 | }
11 |
12 | @SuppressWarnings("SuspiciousNameCombination")
13 | @Override
14 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
15 | super.onMeasure(widthMeasureSpec, widthMeasureSpec);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /** Internal API. Not covered under versioning. */
2 | package com.filestack.android.internal;
--------------------------------------------------------------------------------
/filestack/src/main/java/com/filestack/android/package-info.java:
--------------------------------------------------------------------------------
1 | /** Filestack is an easy API for file uploading, conversion, and delivery. */
2 | package com.filestack.android;
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_done_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_done_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_fail_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_fail_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-hdpi/filestack__ic_menu_upload_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_done_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_done_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_fail_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_fail_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-mdpi/filestack__ic_menu_upload_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-v21/filestack__ic_menu_upload_done_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-v21/filestack__ic_menu_upload_fail_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-v21/filestack__ic_menu_upload_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_done_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_done_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_fail_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_fail_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xhdpi/filestack__ic_menu_upload_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_done_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_done_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_fail_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_fail_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxhdpi/filestack__ic_menu_upload_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_done_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_done_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_fail_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_fail_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/filestack/src/main/res/drawable-xxxhdpi/filestack__ic_menu_upload_white.png
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_list_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_grid_white.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_list_white.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_square_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_upload_done_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_upload_fail_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_menu_upload_white.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_amazon_drive.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_box.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_camera_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_dropbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_facebook.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_github.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_gmail.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_google_drive.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_google_photos.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_instagram.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__ic_source_onedrive.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/filestack/src/main/res/drawable/filestack__list_grid_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout-sw600dp/filestack__activity_filestack.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
21 |
22 |
23 |
24 |
29 |
30 |
37 |
38 |
45 |
46 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__activity_filestack.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
21 |
22 |
28 |
29 |
30 |
31 |
35 |
36 |
37 |
38 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__app_bar_filestack.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__cloud_grid_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__cloud_list_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
15 |
16 |
25 |
26 |
37 |
38 |
39 |
43 |
44 |
54 |
55 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__fragment_auth.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
23 |
24 |
37 |
38 |
49 |
50 |
59 |
60 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__fragment_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
29 |
30 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__fragment_cloud_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__fragment_local_files.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/filestack/src/main/res/layout/filestack__nav_header_filestack.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/filestack/src/main/res/menu/filestack__menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
12 |
19 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 48dp
4 | 5
5 |
6 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFE0B2
4 | #FF9800
5 | #F57C00
6 | #448AFF
7 | #89000000
8 |
9 |
10 | #212121
11 | @color/filestack__theme_source
12 | @color/filestack__theme_source
13 | @color/filestack__theme_source
14 | @color/filestack__theme_source
15 | @color/filestack__theme_source
16 | @color/filestack__theme_source
17 | @color/filestack__theme_source
18 | @color/filestack__theme_source
19 | @color/filestack__theme_source
20 | @color/filestack__theme_source
21 | @color/filestack__theme_source
22 | @color/filestack__theme_source
23 |
24 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 56dp
7 | 16dp
8 |
9 | 8dp
10 | 72dp
11 | 16dp
12 | 40dp
13 |
14 |
15 | 20dp
16 |
17 | 16dp
18 | 72dp
19 | 16dp
20 | 20dp
21 |
22 | 4dp
23 | 3
24 |
25 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values/public.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Filestack Picker
3 | Sources
4 |
5 | Open navigation drawer
6 | Close navigation drawer
7 |
8 | Camera
9 | Device
10 | Facebook
11 | Instagram
12 | Google Drive
13 | Dropbox
14 | Box
15 | GitHub
16 | Gmail
17 | Google Photos
18 | OneDrive
19 | Amazon Drive
20 |
21 | View as grid
22 | View as list
23 | Logout
24 | Upload
25 | About
26 |
27 | You need to authenticate with Cloud.\nWe only extract files and never modify or delete them.
28 | Select Files From Cloud
29 | Connect Cloud
30 | The browser will open to connect your account.
31 | Cloud Logo
32 | Cloud is Authorized
33 |
34 | Take Photo
35 | Take Video
36 |
37 | Select Local Files
38 |
39 | Upload Progress
40 | Progress updates for uploads
41 |
42 | filestack://done
43 |
44 |
--------------------------------------------------------------------------------
/filestack/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/filestack/src/test/java/com/filestack/android/internal/SelectorTest.kt:
--------------------------------------------------------------------------------
1 | package com.filestack.android.internal
2 |
3 | import com.filestack.android.Selection
4 | import org.junit.Assert
5 | import org.junit.Test
6 |
7 | import org.junit.Assert.*
8 |
9 | class SingleSelectorTest {
10 |
11 | val selector = Selector.Single(SimpleSelectionSaver())
12 |
13 | @Test
14 | fun `toggles only one item`() {
15 | val selections = listOf(
16 | selection("1"),
17 | selection("2"),
18 | selection("3"),
19 | selection("4")
20 | )
21 |
22 | selector.toggle(selections[0])
23 | selector.toggle(selections[1])
24 | selector.toggle(selections[2])
25 | selector.toggle(selections[3])
26 |
27 | assertTrue(selector.isSelected(selections[0]))
28 | assertFalse(selector.isSelected(selections[1]))
29 | assertFalse(selector.isSelected(selections[2]))
30 | assertFalse(selector.isSelected(selections[3]))
31 |
32 | selector.toggle(selections[0])
33 | assertFalse(selector.isSelected(selections[0]))
34 |
35 | selector.toggle(selections[1])
36 | assertTrue(selector.isSelected(selections[1]))
37 | }
38 | }
39 |
40 | class MultiSelectorTest {
41 |
42 | val selector = Selector.Multi(SimpleSelectionSaver())
43 |
44 | @Test
45 | fun `can toggle multiple items`() {
46 | val selections = listOf(
47 | selection("1"),
48 | selection("2"),
49 | selection("3"),
50 | selection("4")
51 | )
52 |
53 | selector.toggle(selections[0])
54 | selector.toggle(selections[1])
55 | selector.toggle(selections[2])
56 | selector.toggle(selections[3])
57 |
58 | assertTrue(selector.isSelected(selections[0]))
59 | assertTrue(selector.isSelected(selections[1]))
60 | assertTrue(selector.isSelected(selections[2]))
61 | assertTrue(selector.isSelected(selections[3]))
62 |
63 | selector.toggle(selections[0])
64 | assertFalse(selector.isSelected(selections[0]))
65 |
66 | selector.toggle(selections[1])
67 | assertFalse(selector.isSelected(selections[1]))
68 |
69 | selector.toggle(selections[0])
70 | assertTrue(selector.isSelected(selections[0]))
71 | }
72 | }
73 |
74 | private fun selection(id: String): Selection {
75 | return Selection("provider", "path", "mimeType", id)
76 | }
77 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | android.enableJetifier=false
13 | android.useAndroidX=true
14 | org.gradle.jvmargs=-Xmx1536m
15 |
16 | # When configured, Gradle will run in incubating parallel mode.
17 | # This option should only be used with decoupled projects. More details, visit
18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
19 | # org.gradle.parallel=true
20 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Aug 03 15:17:02 CEST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/logo.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Rectangle-356
5 | Created with Sketch.
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/samples/form/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/samples/form/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | credentials.xml
3 |
--------------------------------------------------------------------------------
/samples/form/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 33
5 | defaultConfig {
6 | applicationId "com.filestack.android.samples.form"
7 | minSdkVersion 19
8 | targetSdkVersion 33
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation 'com.filestack:filestack-android:5.0.0-0.3.0'
23 | implementation 'com.squareup.picasso:picasso:2.5.2'
24 |
25 | implementation fileTree(dir: 'libs', include: ['*.jar'])
26 | implementation 'com.android.support:appcompat-v7:27.1.1'
27 | implementation 'com.android.support.constraint:constraint-layout:1.1.0'
28 | testImplementation 'junit:junit:4.12'
29 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
30 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
31 | }
32 |
--------------------------------------------------------------------------------
/samples/form/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/samples/form/app/src/androidTest/java/com/filestack/android/samples/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.saten.filestackformdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
24 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/java/com/filestack/android/samples/form/CompleteFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples.form;
2 |
3 | import android.os.Bundle;
4 | import androidx.annotation.Nullable;
5 | import androidx.fragment.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.Button;
10 | import android.widget.TextView;
11 |
12 | // Shows a simple welcome screen to the user to indicate the create flow is complete
13 | public class CompleteFragment extends Fragment implements View.OnClickListener {
14 |
15 | private static final String KEY_NAME = "keyName";
16 |
17 |
18 |
19 |
20 | public static CompleteFragment create(String name) {
21 | Bundle args = new Bundle();
22 | args.putString(KEY_NAME, name);
23 | CompleteFragment fragment = new CompleteFragment();
24 | fragment.setArguments(args);
25 | return fragment;
26 | }
27 |
28 |
29 |
30 |
31 | @Nullable
32 | @Override
33 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
34 | View root = inflater.inflate(R.layout.fragment_complete, container, false);
35 |
36 | // Personalize the welcome message
37 | TextView messageView = root.findViewById(R.id.msg);
38 | String name = getArguments().getString(KEY_NAME);
39 | name = name.split(" ")[0];
40 | String message = String.format("Welcome to Acme %s!\nLet's get started!", name);
41 | messageView.setText(message);
42 |
43 | // Wire up the button
44 | Button button = root.findViewById(R.id.ok);
45 | button.setOnClickListener(this);
46 |
47 | return root;
48 | }
49 |
50 | @Override
51 | public void onClick(View v) {
52 | // Call out to the activity to reset state and swap fragments
53 | ((MainActivity) getActivity()).reset();
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/java/com/filestack/android/samples/form/EntryActivity.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples.form;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import androidx.appcompat.app.AppCompatActivity;
6 |
7 | public class EntryActivity extends AppCompatActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | // Check to see if this Activity is the root activity
12 | if (isTaskRoot()) {
13 | // This Activity is the only Activity, so
14 | // the app wasn't running. So start the app from the
15 | // beginning (redirect to MainActivity)
16 | Intent mainIntent = getIntent(); // Copy the Intent used to launch me
17 | // Launch the real root Activity (launch Intent)
18 | mainIntent.setClass(this, MainActivity.class);
19 | // I'm done now, so finish()
20 | startActivity(mainIntent);
21 | finish();
22 | } else {
23 | // App was already running, so just finish, which will drop the user
24 | // in to the activity that was at the top of the task stack
25 | finish();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/java/com/filestack/android/samples/form/FormFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples.form;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import androidx.annotation.Nullable;
7 | import androidx.fragment.app.Fragment;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.ImageView;
12 | import android.widget.TextView;
13 |
14 | import com.filestack.Config;
15 | import com.filestack.FileLink;
16 | import com.filestack.android.FsActivity;
17 | import com.filestack.android.FsConstants;
18 | import com.filestack.transforms.tasks.ResizeTask;
19 | import com.squareup.picasso.Picasso;
20 |
21 | // Contains a simple account creation form
22 | public class FormFragment extends Fragment implements View.OnClickListener {
23 |
24 | private ImageView imageView;
25 | private TextView nameView;
26 |
27 |
28 |
29 |
30 | @Nullable
31 | @Override
32 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
33 | View root = inflater.inflate(R.layout.fragment_form, container, false);
34 | imageView = root.findViewById(R.id.img);
35 | nameView = root.findViewById(R.id.name);
36 | root.findViewById(R.id.sel_img_btn).setOnClickListener(this);
37 | root.findViewById(R.id.crt_act_btn).setOnClickListener(this);
38 | return root;
39 | }
40 |
41 | @Override
42 | public void onResume() {
43 | super.onResume();
44 |
45 | // If MainActivity contains a FileLink when the fragment resumes, load the image from it
46 | // So in this case we check the activity for data, rather than have it push to the fragment
47 | FileLink fileLink = ((MainActivity) getActivity()).getFileLink();
48 | if (fileLink != null) {
49 | int dimen = getResources().getDimensionPixelSize(R.dimen.form_image);
50 | String url = getAdaptiveUrl(fileLink, dimen);
51 | Picasso.with(getContext()).load(url).into(imageView);
52 | }
53 | }
54 |
55 | @Override
56 | public void onClick(View v) {
57 | int id = v.getId();
58 |
59 | if (id == R.id.sel_img_btn) {
60 | selectImage();
61 | } else if (id == R.id.crt_act_btn) {
62 | createAccount();
63 | }
64 | }
65 |
66 |
67 |
68 |
69 | // Creates a URL to an image sized appropriately for the form ImageView
70 | private String getAdaptiveUrl(FileLink fileLink, int dimen) {
71 | ResizeTask resizeTask = new ResizeTask.Builder()
72 | .fit("crop")
73 | .align("center")
74 | .width(dimen)
75 | .height(dimen)
76 | .build();
77 |
78 | return fileLink.imageTransform().addTask(resizeTask).url();
79 | }
80 |
81 | // Handles user clicking select button, launches the picker UI
82 | private void selectImage() {
83 | // Start picker activity
84 |
85 | // For simplicity we're loading credentials from a string res, don't do this in production
86 | String apiKey = getString(R.string.filestack_api_key);
87 | if (apiKey.equals("")) {
88 | throw new RuntimeException("Create a string res value for \"filestack_api_key\"");
89 | }
90 |
91 | Config config = new Config(apiKey, "https://form.samples.android.filestack.com");
92 | Context context = getContext();
93 | Intent pickerIntent = new Intent(context, FsActivity.class);
94 | pickerIntent.putExtra(FsConstants.EXTRA_CONFIG, config);
95 | // Restrict file selections to just images
96 | String[] mimeTypes = {"image/*"};
97 | pickerIntent.putExtra(FsConstants.EXTRA_MIME_TYPES, mimeTypes);
98 | context.startActivity(pickerIntent);
99 |
100 | // Show loading progress spinner
101 | ((MainActivity) getActivity()).setLoading(true);
102 | }
103 |
104 | // Handles user clicking create button, calls on activity to handle swapping fragments
105 | private void createAccount() {
106 | // TODO Validate form data and send off request
107 |
108 | String name = nameView.getText().toString();
109 | ((MainActivity) getActivity()).setComplete(name);
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/java/com/filestack/android/samples/form/LoadingFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples.form;
2 |
3 | import android.os.Bundle;
4 | import androidx.annotation.Nullable;
5 | import androidx.fragment.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | // Just displays a loading spinner for use while waiting on network requests
11 | public class LoadingFragment extends Fragment {
12 |
13 | @Nullable
14 | @Override
15 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle state) {
16 | return inflater.inflate(R.layout.fragment_loading, container, false);
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/java/com/filestack/android/samples/form/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples.form;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.IntentFilter;
7 | import android.os.Bundle;
8 | import androidx.localbroadcastmanager.content.LocalBroadcastManager;
9 | import androidx.appcompat.app.AppCompatActivity;
10 |
11 | import com.filestack.FileLink;
12 | import com.filestack.android.FsConstants;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | private UploadReceiver uploadReceiver;
17 | private LoadingFragment loadingFragment;
18 | private FormFragment formFragment;
19 | private FileLink fileLink;
20 |
21 |
22 |
23 |
24 | // Receives upload broadcasts from SDK service
25 | public class UploadReceiver extends BroadcastReceiver {
26 |
27 | @Override
28 | public void onReceive(Context context, Intent intent) {
29 | fileLink = (FileLink) intent.getSerializableExtra(FsConstants.EXTRA_FILE_LINK);
30 | setLoading(false);
31 | }
32 | }
33 |
34 |
35 |
36 |
37 | // Swap between showing the form and loading fragments
38 | public void setLoading(boolean isLoading) {
39 | getSupportFragmentManager()
40 | .beginTransaction()
41 | .replace(R.id.root, isLoading ? loadingFragment : formFragment)
42 | .commit();
43 | }
44 |
45 | public FileLink getFileLink() {
46 | return fileLink;
47 | }
48 |
49 | // Show the complete fragment when an account has been created
50 | public void setComplete(String name) {
51 | CompleteFragment fragment = CompleteFragment.create(name);
52 |
53 | getSupportFragmentManager()
54 | .beginTransaction()
55 | .replace(R.id.root, fragment)
56 | .commit();
57 | }
58 |
59 | // Remove the complete fragment and show an empty form fragment
60 | public void reset() {
61 | fileLink = null;
62 | formFragment = new FormFragment();
63 | getSupportFragmentManager()
64 | .beginTransaction()
65 | .replace(R.id.root, formFragment)
66 | .commit();
67 | }
68 |
69 |
70 |
71 |
72 | @Override
73 | protected void onCreate(Bundle savedInstanceState) {
74 | super.onCreate(savedInstanceState);
75 | setContentView(R.layout.activity_main);
76 |
77 | // Create fragments
78 | loadingFragment = new LoadingFragment();
79 | formFragment = new FormFragment();
80 |
81 | // Register the receiver for upload broadcasts
82 | IntentFilter filter = new IntentFilter(FsConstants.BROADCAST_UPLOAD);
83 | uploadReceiver = new UploadReceiver();
84 | LocalBroadcastManager.getInstance(this).registerReceiver(uploadReceiver, filter);
85 |
86 | if (savedInstanceState == null) {
87 | // Initial attachment of the form fragment
88 | getSupportFragmentManager()
89 | .beginTransaction()
90 | .add(R.id.root, formFragment)
91 | .commit();
92 | }
93 | }
94 |
95 | @Override
96 | protected void onDestroy() {
97 | super.onDestroy();
98 | // Unregister the receiver to avoid leaking it outside tne activity context
99 | LocalBroadcastManager.getInstance(this).unregisterReceiver(uploadReceiver);
100 | }
101 |
102 | }
103 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/layout/fragment_complete.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/layout/fragment_form.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
13 |
14 |
17 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/layout/fragment_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #E91E63
4 | #880E4F
5 | #448AFF
6 |
7 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 150dp
4 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Acme.io App
3 |
4 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
16 |
17 |
22 |
23 |
28 |
29 |
33 |
34 |
38 |
39 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/samples/form/app/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/samples/form/app/src/test/java/com/filestack/android/samples/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.samples;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/samples/form/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.0'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/samples/form/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/samples/form/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/samples/form/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/samples/form/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 01 11:04:27 CDT 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
7 |
--------------------------------------------------------------------------------
/samples/form/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/samples/form/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/samples/form/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':filestack', ':tester'
2 |
--------------------------------------------------------------------------------
/tester/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | src/main/res/values/keys.xml
3 |
--------------------------------------------------------------------------------
/tester/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 33
5 |
6 | defaultConfig {
7 | applicationId "com.filestack.android.demo"
8 | minSdkVersion 16
9 | targetSdkVersion 33
10 | versionCode 1
11 | versionName "1.0"
12 | multiDexEnabled = true
13 |
14 | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
15 |
16 | }
17 |
18 | signingConfigs {
19 | testerRelease {
20 | keyAlias 'filestack'
21 | keyPassword 'filestack'
22 | storeFile file('filestack-tester.keystore')
23 | storePassword 'filestack'
24 | }
25 | }
26 |
27 | buildTypes {
28 | release {
29 | signingConfig signingConfigs.testerRelease
30 | minifyEnabled true
31 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
32 | }
33 | }
34 |
35 | }
36 |
37 | configurations.all {
38 | resolutionStrategy.force 'io.reactivex.rxjava2:rxjava:2.2.2'
39 | }
40 |
41 | repositories {
42 | maven { url "https://jitpack.io" }
43 | }
44 |
45 | dependencies {
46 | implementation fileTree(include: ['*.jar'], dir: 'libs')
47 | implementation project(':filestack')
48 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
49 | implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
50 |
51 | implementation 'androidx.appcompat:appcompat:1.6.1'
52 | implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
53 | implementation 'androidx.preference:preference:1.2.1'
54 | implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
55 |
56 | implementation 'com.github.kizitonwose.colorpreference:support:1.1.0'
57 |
58 | androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
59 | exclude group: 'com.android.support', module: 'support-annotations'
60 | })
61 | testImplementation 'junit:junit:4.13.2'
62 | }
63 |
--------------------------------------------------------------------------------
/tester/filestack-tester.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/filestack-tester.keystore
--------------------------------------------------------------------------------
/tester/media/recording.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/media/recording.gif
--------------------------------------------------------------------------------
/tester/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/saten/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/tester/src/androidTest/java/com/filestack/android/demo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.filestack.android.demo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/tester/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
25 |
26 |
31 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/tester/src/main/java/com/filestack/android/demo/EntryActivity.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import androidx.appcompat.app.AppCompatActivity;
6 |
7 | public class EntryActivity extends AppCompatActivity {
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | // Check to see if this Activity is the root activity
12 | if (isTaskRoot()) {
13 | // This Activity is the only Activity, so
14 | // the app wasn't running. So start the app from the
15 | // beginning (redirect to MainActivity)
16 | Intent mainIntent = getIntent(); // Copy the Intent used to launch me
17 | // Launch the real root Activity (launch Intent)
18 | mainIntent.setClass(this, MainActivity.class);
19 | // I'm done now, so finish()
20 | startActivity(mainIntent);
21 | finish();
22 | } else {
23 | // App was already running, so just finish, which will drop the user
24 | // in to the activity that was at the top of the task stack
25 | finish();
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tester/src/main/java/com/filestack/android/demo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import android.content.Intent;
4 | import android.content.IntentFilter;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import androidx.core.content.ContextCompat;
8 | import androidx.localbroadcastmanager.content.LocalBroadcastManager;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.preference.PreferenceManager;
11 | import android.util.Log;
12 | import android.view.View;
13 | import android.widget.ScrollView;
14 | import android.widget.TextView;
15 | import android.widget.Toast;
16 |
17 | import com.filestack.Config;
18 | import com.filestack.android.FilestackPicker;
19 | import com.filestack.android.FsConstants;
20 | import com.filestack.android.Selection;
21 | import com.filestack.android.Theme;
22 |
23 | import java.util.ArrayList;
24 | import java.util.Arrays;
25 | import java.util.Collections;
26 | import java.util.List;
27 | import java.util.Locale;
28 |
29 | public class MainActivity extends AppCompatActivity {
30 | private static final int REQUEST_FILESTACK = RESULT_FIRST_USER;
31 | private static final int REQUEST_SETTINGS = REQUEST_FILESTACK + 1;
32 | private static final String TAG = "MainActivity";
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_main);
38 |
39 | if (savedInstanceState == null) {
40 | IntentFilter intentFilter = new IntentFilter(FsConstants.BROADCAST_UPLOAD);
41 | ScrollView scrollView = findViewById(R.id.scrollView);
42 | TextView logView = findViewById(R.id.log);
43 | UploadStatusReceiver receiver = new UploadStatusReceiver(logView, scrollView);
44 | LocalBroadcastManager.getInstance(this).registerReceiver(receiver, intentFilter);
45 | }
46 |
47 | PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
48 | }
49 |
50 | @Override
51 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
52 | super.onActivityResult(requestCode, resultCode, data);
53 | if (FilestackPicker.canReadResult(requestCode, resultCode)) {
54 | Log.i(TAG, "received filestack selections");
55 | List selections = FilestackPicker.getSelectedFiles(data);
56 | for (int i = 0; i < selections.size(); i++) {
57 | Selection selection = selections.get(i);
58 | String msg = String.format(Locale.ROOT, "selection %d: %s", i, selection.getName());
59 | Log.i(TAG, msg);
60 | }
61 | }
62 | }
63 |
64 | public void settings(View view) {
65 | Intent intent = new Intent(this, SettingsActivity.class);
66 | startActivityForResult(intent, REQUEST_SETTINGS);
67 | }
68 |
69 | public void launch(View view) {
70 | SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
71 | String mimeFilter = sharedPref.getString("mime_filter", null);
72 | List mimeTypes = Arrays.asList(mimeFilter.split(","));
73 |
74 | String apiKey = sharedPref.getString("api_key", null);
75 | String policy = sharedPref.getString("policy", null);
76 | String signature = sharedPref.getString("signature", null);
77 |
78 | if (apiKey == null) {
79 | Toast.makeText(this, R.string.error_no_api_key, Toast.LENGTH_SHORT).show();
80 | return;
81 | }
82 | Config config = new Config(apiKey, getString(R.string.return_url), policy, signature);
83 |
84 | Theme theme = new Theme.Builder()
85 | .title(sharedPref.getString("theme_title", null))
86 | .accentColor(sharedPref.getInt("theme_accent", ContextCompat.getColor(this, R.color.colorAccent)))
87 | .backgroundColor(sharedPref.getInt("theme_background", ContextCompat.getColor(this, R.color.colorPrimary)))
88 | .textColor(sharedPref.getInt("theme_text", ContextCompat.getColor(this, R.color.text)))
89 | .build();
90 |
91 | FilestackPicker picker = new FilestackPicker.Builder()
92 | .config(config)
93 | .sources(new ArrayList<>(sharedPref.getStringSet("upload_sources", Collections.emptySet())))
94 | .autoUploadEnabled(sharedPref.getBoolean("auto_upload", false))
95 | .mimeTypes(mimeTypes)
96 | .multipleFilesSelectionEnabled(sharedPref.getBoolean("allow_multiple_files", true))
97 | .theme(theme)
98 | .build();
99 | picker.launch(this);
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/tester/src/main/java/com/filestack/android/demo/SettingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import android.os.Bundle;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | public class SettingsActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_settings);
12 | int id = com.filestack.android.R.string.filestack__auth_action;
13 | getFragmentManager().beginTransaction()
14 | .replace(R.id.fragment, new SettingsFragment())
15 | .commit();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/tester/src/main/java/com/filestack/android/demo/SettingsFragment.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import android.os.Bundle;
4 | import androidx.preference.PreferenceFragment;
5 |
6 | public class SettingsFragment extends PreferenceFragment {
7 |
8 | @Override
9 | public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
10 | // Load the preferences from an XML resource
11 | addPreferencesFromResource(R.xml.preferences);
12 | }
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/tester/src/main/java/com/filestack/android/demo/UploadStatusReceiver.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import static com.filestack.android.FsConstants.STATUS_IN_PROGRESS;
4 |
5 | import android.content.BroadcastReceiver;
6 | import android.content.Context;
7 | import android.content.Intent;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.widget.ScrollView;
11 | import android.widget.TextView;
12 |
13 | import com.filestack.FileLink;
14 | import com.filestack.android.FsConstants;
15 | import com.filestack.android.Selection;
16 |
17 | import java.util.Locale;
18 |
19 | public class UploadStatusReceiver extends BroadcastReceiver {
20 | private static final String TAG = "UploadStatusReceiver";
21 |
22 | private TextView logView;
23 | private ScrollView scrollView;
24 |
25 | public UploadStatusReceiver(TextView logView, ScrollView scrollView) {
26 | this.logView = logView;
27 | this.scrollView = scrollView;
28 | }
29 |
30 | @Override
31 | public void onReceive(Context context, Intent intent) {
32 | String status = intent.getStringExtra(FsConstants.EXTRA_STATUS);
33 | Selection selection = intent.getParcelableExtra(FsConstants.EXTRA_SELECTION);
34 | FileLink fileLink = (FileLink) intent.getSerializableExtra(FsConstants.EXTRA_FILE_LINK);
35 | String name = selection.getName();
36 | logView.append("========================\n");
37 | logView.append(status.toUpperCase() + "\n");
38 | logView.append(name + "\n");
39 | if (status.equals(STATUS_IN_PROGRESS)) {
40 | double percent = intent.getDoubleExtra(FsConstants.EXTRA_PERCENT, 100);
41 | logView.append(String.format("Percentage completed: %f%%\n", percent * 100));
42 | } else {
43 | String handle = fileLink != null ? fileLink.getHandle() : "n/a";
44 | logView.append("https://cdn.filestackcontent.com/" + handle + "\n");
45 | }
46 | logView.append("========================\n");
47 | scrollDown();
48 | }
49 |
50 | private void scrollDown() {
51 | scrollView.post(() -> scrollView.fullScroll(View.FOCUS_DOWN));
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/tester/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
24 |
25 |
26 |
27 |
35 |
36 |
44 |
45 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/tester/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/tester/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/filestack/filestack-android/ac9e5120560f90c9aad0985a13f297bce5282fdd/tester/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/tester/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000
4 | #F57C00
5 | #89000000
6 |
7 |
--------------------------------------------------------------------------------
/tester/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Filestack
3 | filestack://done
4 | Settings
5 | Open Picker
6 | API key must be set.
7 |
8 | Upload Sources
9 | Specify which upload sources to enable
10 |
11 | - Facebook
12 | - Instagram
13 | - Google Drive
14 | - Dropbox
15 | - Box
16 | - GitHub
17 | - Gmail
18 | - Google Photos
19 | - OneDrive
20 | - Amazon Drive
21 | - Camera
22 | - Device
23 |
24 |
25 | - facebook
26 | - instagram
27 | - googledrive
28 | - dropbox
29 | - box
30 | - github
31 | - gmail
32 | - picasa
33 | - onedrive
34 | - clouddrive
35 | - camera
36 | - device
37 |
38 |
39 | - camera
40 | - device
41 | - googledrive
42 | - facebook
43 | - instagram
44 | - dropbox
45 |
46 |
47 | Enable Auto Upload
48 | Automatically uploads files after picker closes
49 |
50 | Multiple file pick
51 | Allow multiple files to be selected
52 |
53 | MIME Filter
54 | Restricts the types of files that can be uploaded
55 | application/pdf,video/*,image/*
56 |
57 | Credentials
58 | API Key
59 | Policy
60 | Signature
61 |
62 |
63 |
--------------------------------------------------------------------------------
/tester/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tester/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/tester/src/main/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
17 |
18 |
23 |
24 |
30 |
31 |
33 |
34 |
38 |
39 |
43 |
44 |
48 |
49 |
50 |
51 |
53 |
54 |
59 |
60 |
64 |
65 |
69 |
70 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/tester/src/test/java/com/filestack/android/demo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.filestack.android.demo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------