Giter Club home page Giter Club logo

android-filepicker's Introduction

Android-FilePicker (Androidx based)

Android Arsenal Latest Version

A filepicker which allows to select images and videos with flexibility. It also supports selection of files by specifying its file type. For using this library, you have to migrate your project to androidx or you can use older version(2.1.5). Check out app module for example.

For Android 10 devices using document picker, you will need to enable android:requestLegacyExternalStorage="true" option in your manifest file. This document picker will get deprecated soon over scoped storage and also, this flag will not work in when you target Android 11. :/

If your app

  • targets 28: Everything will work. Nothing required.

  • targets 29: You will need add android:requestLegacyExternalStorage="true" option in your manifest file. This will work for Android 11 devices also.

  • targets 30: Doc picker will not work in this case. Scope storage handling is required. Please suggest ideas here

    demo demo demo

Installation

  • As of now, It is only available in jCenter(), So just put this in your app dependencies:
    implementation 'com.droidninja:filepicker:2.2.5'

There is a method getFilePath in ContentUriUtils class through you can get the file path from Uri. e.g.

Java:

ContentUriUtils.INSTANCE.getFilePath(getContext(), uri);

Kotlin

ContentUriUtils.getFilePath(context, uri);

Note

This Filepicker is based on the MediaStore api provided by android. It checks MediaStore database for a file entry. If your file is not showing in the picker, it means that it is not inserted into MediaStore database yet.

Usage

Just include this in your onclick function:

  • For photopicker:
FilePickerBuilder.getInstance()
               .setMaxCount(5) //optional
               .setSelectedFiles(filePaths) //optional
               .setActivityTheme(R.style.LibAppTheme) //optional
               .pickPhoto(this);

If you want to use custom request code, you just have to like this:

FilePickerBuilder.getInstance()
               .setMaxCount(5) //optional
               .setSelectedFiles(filePaths) //optional
               .setActivityTheme(R.style.LibAppTheme) //optional
               .pickPhoto(this, CUSTOM_REQUEST_CODE);
  • For document picker:
 FilePickerBuilder.getInstance()
               .setMaxCount(10) //optional
               .setSelectedFiles(filePaths) //optional
               .setActivityTheme(R.style.LibAppTheme) //optional
               .pickFile(this);

If you want to use custom request code, you just have to like this:

FilePickerBuilder.getInstance()
               .setMaxCount(5) //optional
               .setSelectedFiles(filePaths) //optional
               .setActivityTheme(R.style.LibAppTheme) //optional
               .pickFile(this, CUSTOM_REQUEST_CODE);

After this, you will get list of file paths in activity result:

@Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
           switch (requestCode)
           {
               case FilePickerConst.REQUEST_CODE_PHOTO:
                   if(resultCode== Activity.RESULT_OK && data!=null)
                   {
                       photoPaths = new ArrayList<>();
                       photoPaths.addAll(data.getParcelableArrayListExtra<Uri>(FilePickerConst.KEY_SELECTED_MEDIA));
                   }
                   break;
               case FilePickerConst.REQUEST_CODE_DOC:
                   if(resultCode== Activity.RESULT_OK && data!=null)
                   {
                       docPaths = new ArrayList<>();
                       docPaths.addAll(data.getParcelableArrayListExtra<Uri>(FilePickerConst.KEY_SELECTED_DOCS));
                   }
                   break;
           }
           addThemToView(photoPaths,docPaths);
       }

Builder Methods

Android FilePicker now has more flexibility. Supported builder methods are:

Method Use
setMaxCount(int maxCount) used to specify maximum count of media picks (dont use if you want no limit)
setActivityTheme(int theme) used to set theme for toolbar (must be an non-actionbar theme or use LibAppTheme)
setActivityTitle(String title) used to set title for toolbar
setSelectedFiles(ArrayList selectedPhotos) to show already selected items (optional)
enableVideoPicker(boolean status) added video picker alongside images
enableImagePicker(boolean status) added option to disable image picker
enableSelectAll(boolean status) added option to enable/disable select all feature(it will only work with no limit option)
setCameraPlaceholder(int drawable) set custom camera drawable
withOrientation(Orientation type) In case, if you want to set orientation, use ActivityInfo for constants (default=ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
showGifs(boolean status) to show gifs images in the picker
showFolderView(boolean status) if you want to show folder type pick view, enable this. (Enabled by default)
enableDocSupport(boolean status) If you want to enable/disable default document picker, use this method. (Enabled by default)
enableCameraSupport(boolean status) to show camera in the picker (Enabled by default)
addFileSupport(String title, String[] extensions, @DrawableRes int drawable) If you want to specify custom file type, use this method. (example below)
setSpan(spanType: FilePickerConst.SPAN_TYPE, count: Int) Set Span count for folder and detail screen ( [FilePickerConst.SPAN_TYPE.FOLDER_SPAN] or [FilePickerConst.SPAN_TYPE.DETAIL_SPAN]])

If you want to add custom file type picker(do not use . in extension types), use addFileSupport() method like this ( for zip support):

String zipTypes = {"zip","rar"};
   addFileSupport("ZIP",zipTypes, R.drawable.ic_zip_icon);

Styling

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

  • If you have dark theme colors, just use LibAppTheme.Dark
  • If you have light theme colors, just use LibAppTheme
<style name="LibAppTheme" parent="Theme.MaterialComponents.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@android:color/black</item>
        <item name="android:colorBackground">@android:color/background_light</item>
        <item name="android:windowBackground">@android:color/white</item>
        <item name="toolbarStyle">@style/ToolbarTheme</item>
        <item name="tabStyle">@style/PickerTabLayout</item>
    </style>

    <style name="LibAppTheme.Dark" parent="LibAppTheme">
        <!-- Customize your theme here. -->
        <item name="colorAccent">@android:color/white</item>
        <item name="toolbarStyle">@style/ToolbarTheme.Dark</item>
        <item name="tabStyle">@style/PickerTabLayout.Dark</item>
    </style>

    <style name="PickerTabLayout" parent="Widget.MaterialComponents.TabLayout">
           <!--        tab background-->
           <item name="tabBackground">@color/colorPrimary</item>
           <!--        tab text color selector : set selector accordingly to dark or light theme-->
           <item name="tabTextColor">@color/selector_tab_text_color</item>
           <!--        tab indicator color: set indicator color accordingly-->
           <item name="tabIndicatorColor">@android:color/black</item>
           <item name="tabGravity">fill</item>
           <item name="tabMaxWidth">0dp</item>
       </style>


       <style name="ToolbarTheme" parent="Widget.MaterialComponents.Toolbar.Primary">
               <item name="materialThemeOverlay">@style/ThemeOverlay.App.Toolbar.Light</item>
               <item name="android:theme">@style/ThemeOverlay.App.Toolbar.Light</item>
           </style>
    
    <style name="SmoothCheckBoxStyle">
            <item name="color_checked">@color/colorAccent</item>
            <item name="color_unchecked">@android:color/white</item>
            <item name="color_unchecked_stroke">@color/checkbox_unchecked_color</item>
            <item name="color_tick">@android:color/white</item>
        </style>

Proguard

# Glide
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep class * extends com.bumptech.glide.module.AppGlideModule {
 <init>(...);
}
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}
-keep class com.bumptech.glide.load.data.ParcelFileDescriptorRewinder$InternalRewinder {
  *** rewind();
}

# Uncomment for DexGuard only
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule

Donate

You guys are doing great job by filing bugs and sending pull requests. I am doing everything to maintain this project. If you want to support, your donation is highly appreciated (and I love food, coffee and beer). Thank you!

PayPal

  • Donate $5: Thank's for creating this project, here's a coffee (or some beer) for you!
  • Donate $10: Wow, I am stunned. Let me take you to the movies!
  • Donate $15: I really appreciate your work, let's grab some lunch!
  • Donate $25: That's some awesome stuff you did right there, dinner is on me!
  • Donate $50: I really really want to support this project, great job!
  • Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
  • Donate $2799: Go buddy, buy Macbook Pro for yourself! Of course, you can also choose what you want to donate, all donations are awesome!

Credits

Inspired by PhotoPicker

SmoothCheckbox

Youtube Demo

Demo

License

Copyright 2016 Arun Sharma

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-filepicker's People

Contributors

aneophyte avatar droidninja avatar gaumala avatar hamen avatar jamshidrostami avatar johnernest02 avatar marcauberer avatar mhzdev avatar mrsurana avatar rajnish23 avatar subhrajyotisen avatar verticalakash avatar vnavarro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-filepicker's Issues

Has a bug

FileListAdapter-->onBindViewHolder()-->holder.fileSizeTextView.setText
(Formatter.formatShortFileSize(context, Long.parseLong(document.getSize())));
document.getSize() has bean a nullpointerexception

You should that document.getSize()==null?"0":document.getSize());

Orientation issue

Hello,

The library dont support the view orientation. It's fixed to portait mode.

Have you a reason to do that ?

Sb

Demo App

Hi, i think there should be a demo app for your great project.

Need improve when setMaxtCount is 1

When I pick a photo and set maxCount is 1, then I touch to select a photo. And if I want to change select photo, I need to uncheck the photo I checked before first. It should automatically uncheck the old one and select new one. Hope you fix this issue.

Pick a folder

It would be useful to have an api to pick a folder.

tools not found in manifiest

Hello Team,

Library seems very nice. i am getting this error while working with Manifiest.

Error:The prefix "tools" for attribute "tools:replace" associated with an element type "application" is not bound.

Tab names aren't visible

Hey! Thanks for making the Android-FilePicker. I used it for my Demo App for testing my module.

I was testing the Demo App in my Fire Tablet, which has Android 5.1. And I noticed that the tab names weren't shown for the document picker. I was able to swipe through the PDF and other tabs. But the names of the tabs weren't visible.

What is this bug ? I don't get it. And I haven't tried it on any other device, since I don't have any other than my Tablet

Crash If I doesnt add this method .setSelectedFiles()

I dont want to set selected Files. If I doesnt add this method The app crashed.
java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2452)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5481)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference
at droidninja.filepicker.PickerManager.add(PickerManager.java:83)
at droidninja.filepicker.FilePickerActivity.initView(FilePickerActivity.java:60)
at droidninja.filepicker.FilePickerActivity.onCreate(FilePickerActivity.java:45)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 
at android.app.ActivityThread.-wrap11(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1376) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5481) 
at java.lang.reflect.Method.invoke(Native Method

Get file path and file size

I want to get the file path of selected document and also want size of that document.
How would i get it ?
Any help ?

Hide default tabs

I want to hide some default tabs on the document picker, like PPT, DOC, TXT. How would I do that?

Toolbar options not visible

My app theme is Theme.AppCompat.Light.NoActionBar and by this theme ,the picker toolbar items such as back button, title and done button is not visible. But when I set a specific theme for file picker such as Theme.AppCompat.Light.DarkActionBar my main toolbar is visible below the theme toolbar.

screenshot_20161113-123803

another issue is I want to change the toolbar title and done button texts.

UpperCase file names.

Hi, in not quite sure how should i marge into your files.
But i found interesting problem, some devices use uppercase names in files.
So i think you should change
Utils class function:
public static boolean contains(String[] types, String path) {
for (String string : types) {
if (path.endsWith(string)) return true;
}
return false;
}
into
public static boolean contains(String[] types, String path) {
for (String string : types) {
if (path.toLowerCase().endsWith(string)) return true;
}
return false;
}

FilePicker Changed my demo app's name

after i add compile ... to "build.gradle"

my demo app's name changed to "FilePicker"
[when i debug it on my phone]

i know there's some conflects in res folder

is it a bug or did i use it in a wrong way ?

Problem when set Max count is 1

At version 1.0.7, when setMaxCount(1), it auto back to the activity when pick an image ( no need to click "Done"), but latest version (2.0.0), the issue is happened. Please make the behavior like old version. Thank you

Set Max count issue

I found a big issue on set Max Count.
Follow these step:

  1. Set Max Count is 4
  2. Select 4 file
  3. Stay on this screen, I can be able to select more file by double click to a file.

Selection count in docs picker is improper

When I set docs max count to five and I select the files one by one till five selection count is increasing properly.When I do sixth selection count is reducing to four and further selection of any file makes the count in negative value.

LeakCanary reports a memory leak at FilePickerActivity

The following is a detailed message

Android version 7.0

In com.shiyan.netdisk_android:1.0:1.

  • droidninja.filepicker.FilePickerActivity has leaked:

  • GC ROOT static droidninja.filepicker.PickerManager.ourInstance

  • references droidninja.filepicker.PickerManager.pickerManagerListener

  • leaks droidninja.filepicker.FilePickerActivity instance

  • Retaining: 35 KB.

  • Reference Key: a59d7d50-a8c1-4f9c-885f-72cf96a60d1b

  • Device: samsung samsung SM-G9350 hero2qltezc

  • Android Version: 7.0 API: 24 LeakCanary: 1.5 00f37f5

  • Durations: watch=5026ms, gc=131ms, heap dump=2120ms, analysis=60082ms

  • Details:

  • Class droidninja.filepicker.PickerManager
    | static $classOverhead = byte[852]@319163393 (0x13060c01)
    | static ourInstance = droidninja.filepicker.PickerManager@319097872 (0x13050c10)

  • Instance of droidninja.filepicker.PickerManager
    | static $classOverhead = byte[852]@319163393 (0x13060c01)
    | static ourInstance = droidninja.filepicker.PickerManager@319097872 (0x13050c10)
    | alreadySelectedFiles = null
    | currentCount = 0
    | docFiles = java.util.ArrayList@319149824 (0x1305d700)
    | docSupport = true
    | enableCamera = true
    | enableOrientation = false
    | fileTypes = java.util.ArrayList@319149848 (0x1305d718)
    | maxCount = 3
    | mediaFiles = java.util.ArrayList@319149800 (0x1305d6e8)
    | pickerManagerListener = droidninja.filepicker.FilePickerActivity@319243456 (0x130744c0)
    | providerAuthorities = java.lang.String@315786288 (0x12d28430)
    | showFolderView = true
    | showGif = false
    | showVideos = true
    | theme = 2131361960
    | shadow$klass = droidninja.filepicker.PickerManager
    | shadow$monitor = 0

  • Instance of droidninja.filepicker.FilePickerActivity
    | static TAG = java.lang.String@319098768 (0x13050f90)
    | static $classOverhead = byte[4692]@319193089 (0x13068001)
    | type = 18
    | mDelegate = android.support.v7.app.AppCompatDelegateImplN@315482752 (0x12cde280)
    | mEatKeyUpEvent = false
    | mResources = null
    | mThemeId = 2131361960
    | mCreated = true
    | mFragments = android.support.v4.app.FragmentController@315157536 (0x12c8ec20)
    | mHandler = android.support.v4.app.FragmentActivity$1@320115104 (0x131491a0)
    | mNextCandidateRequestIndex = 0
    | mOptionsMenuInvalidated = false
    | mPendingFragmentActivityResults = android.support.v4.util.SparseArrayCompat@315201136 (0x12c99670)
    | mReallyStopped = true
    | mRequestedPermissionsFromFragment = false
    | mResumed = false
    | mRetaining = false
    | mStopped = true
    | mStartedActivityFromFragment = false
    | mStartedIntentSenderFromFragment = false
    | mExtraDataMap = android.support.v4.util.SimpleArrayMap@315130664 (0x12c88328)
    | mActionBar = null
    | mActionModeTypeStarting = 0
    | mActivityInfo = android.content.pm.ActivityInfo@315787872 (0x12d28a60)
    | mActivityTransitionState = android.app.ActivityTransitionState@315056072 (0x12c75fc8)
    | mAppLockCheckRunnable = android.app.Activity$1@315157296 (0x12c8eb30)
    | mAppLockIsInMultiWindowMode = false
    | mApplication = com.shiyan.netdisk_android.SecuDiskApplication@315811552 (0x12d2e6e0)
    | mCalled = true
    | mChangeCanvasToTranslucent = false
    | mChangingConfigurations = false
    | mComponent = android.content.ComponentName@315383776 (0x12cc5fe0)
    | mConfigChangeFlags = 0
    | mCurrentConfig = android.content.res.Configuration@315402968 (0x12ccaad8)
    | mDecor = null
    | mDefaultKeyMode = 0
    | mDefaultKeySsb = null
    | mDestroyed = true
    | mDoReportFullyDrawn = false
    | mEatKeyUpEvent = false
    | mEmbeddedID = null
    | mEnableDefaultActionBarUp = false
    | mEnterTransitionListener = android.app.SharedElementCallback$1@1883687040 (0x7046c880)
    | mExitTransitionListener = android.app.SharedElementCallback$1@1883687040 (0x7046c880)
    | mFinished = true
    | mFlipfont = 0
    | mFragments = android.app.FragmentController@315157152 (0x12c8eaa0)
    | mHandler = android.os.Handler@320115040 (0x13149160)
    | mHasCurrentPermissionsRequest = false
    | mIdent = 138615481
    | mInstanceTracker = android.os.StrictMode$InstanceTracker@315157184 (0x12c8eac0)
    | mInstrumentation = android.app.Instrumentation@315596512 (0x12cf9ee0)
    | mIntent = android.content.I

ntent@315445952 (0x12cd52c0)
| mLastNonConfigurationInstances = null
| mMainThread = android.app.ActivityThread@315618048 (0x12cff300)
| mManagedCursors = java.util.ArrayList@315130688 (0x12c88340)
| mManagedDialogs = null
| mMenuInflater = null
| mParent = null
| mPolicyManager = android.net.NetworkPolicyManager@315157824 (0x12c8ed40)
| mReferrer = java.lang.String@315083720 (0x12c7cbc8)
| mResultCode = 0
| mResultData = null
| mResumed = false
| mScreenChangeListener = null
| mSearchEvent = null
| mSearchManager = null
| mStartedActivity = false
| mStopped = true
| mTaskDescription = android.app.ActivityManager$TaskDescription@320115072 (0x13149180)
| mTemporaryPause = false
| mTitle = java.lang.String@316482016 (0x12dd21e0)
| mTitleColor = 0
| mTitleReady = true
| mToken = android.os.BinderProxy@315183040 (0x12c94fc0)
| mTranslucentCallback = null
| mUiThread = java.lang.Thread@1991870256 (0x76b98730)
| mVisibleBehind = false
| mVisibleFromClient = true
| mVisibleFromServer = true
| mVoiceInteractor = null
| mWindow = com.android.internal.policy.PhoneWindow@319550960 (0x130bf5f0)
| mWindowAdded = true
| mWindowManager = android.view.WindowManagerImpl@315203152 (0x12c99e50)
| mInflater = com.android.internal.policy.PhoneLayoutInflater@314614928 (0x12c0a490)
| mOverrideConfiguration = null
| mResources = android.content.res.Resources@315386624 (0x12cc6b00)
| mTheme = android.content.res.Resources$Theme@315158256 (0x12c8eef0)
| mThemeResource = 2131361960
| mBase = android.app.ContextImpl@315481552 (0x12cdddd0)
| shadow$klass = droidninja.filepicker.FilePickerActivity
| shadow$monitor = 1073742660

  • Excluded Refs:
    | Field: android.view.Choreographer$FrameDisplayEventReceiver.mMessageQueue (always)
    | Thread:FinalizerWatchdogDaemon (always)
    | Thread:main (always)
    | Thread:LeakCanary-Heap-Dump (always)
    | Class:java.lang.ref.WeakReference (always)
    | Class:java.lang.ref.SoftReference (always)
    | Class:java.lang.ref.PhantomReference (always)
    | Class:java.lang.ref.Finalizer (always)
    | Class:java.lang.ref.FinalizerReference (always)

On custom toolbar done button not show

Hello @DroidNinja,
Thanks for great lib for file picker.
I am using it in my android app for image picking. In my app there is custom toolbar with NoActionbar style it will not show me action bar in attachment activity. Is there any option for custom toolbar, show the done button within.

'addVideoPicker' method should get boolean to enable or disable.

Problem exactly is when we call FilePickerBuilder with addVideoPicker included for the first time in the app and then in some part of application I don't need video tab. In such case I don't have that option to disable where the video tab continuously shown since I initialised addVideoPicker first time in the app using getInstance.

onActivityResult is never called on the Fragment when the chooser is activated from a fragment

In order to onActivityResult be called on the fragment, startActivityForResult should be called from the fragment (as far as I know). However, the library calls the startActivityForResult on behalf of the application in FilePickerBuilder

private void start(Activity context)
    {
        Intent intent = new Intent(context, FilePickerActivity.class);
        intent.putExtras(mPickerOptionsBundle);
        context.startActivityForResult(intent,FilePickerConst.REQUEST_CODE);
    }

It accepts a one parameter, context of type Activity. In order to call the method in a fragment, one would use getActivity() since it returns it's parent activity. But startActivityForResult is called on the activity rather than on the fragment. The fragment never receives the onActivityResult callback.

Custom icons not displaying

FilePickerBuilder.getInstance().setMaxCount(20) .setActivityTheme(R.style.AppTheme) .addFileSupport("ALL EBOOKS",extensions) .addFileSupport("EPUB",new String[]{".epub"},R.drawable.epub) .addFileSupport("MOBI",new String[]{".mobi"},R.drawable.mobi) .addFileSupport("AZW",new String[]{".azw"}) .addFileSupport("PDF",new String[]{".pdf"},R.drawable.pdf) .addFileSupport("DOC",new String[]{".doc",".docx"},R.drawable.doc) .addFileSupport("ZIP",new String[]{".zip"}) .enableDocSupport(false) .addFileSupport("OTHER",new String[]{".txt",".odt",".szw",".rtf"}) .pickFile(this);

The custom drawables aren't being set.
The resultant picker shows the default gray file icon

screenshot_20170506-141835

.showGifs(false) not working

FilePickerBuilder.getInstance().setMaxCount(maxCount)
.setSelectedFiles(photoPaths)
.setActivityTheme(R.style.FilePickerTheme)
.addVideoPicker()
.enableCameraSupport(true)
.showGifs(false)
.showFolderView(true)
.pickPhoto(this);

When i pick image and set .showGifs(false) but gif files show in picker unable to avoid gif files

Can't show custom file

I want to show the tab for zip files but when I run this code I don't see them anywhere. I'm running version 2.2 of your library.

String[] fileTypes = new String[]{".zip"};
        FilePickerBuilder.getInstance()
                .addFileSupport("Zip", fileTypes)
                .setMaxCount(5)
             .setActivityTheme(android.support.v7.appcompat.R.style.Base_Theme_AppCompat_Light)
                .setSelectedFiles(filePaths)
                .enableDocSupport(true)
                .pickFile(this);

Binary XML file line #6: Error inflating class com.facebook.drawee.view.SimpleDraweeView

FATAL EXCEPTION: main
Process: com.yuehu.cola.projectcola, PID: 6757
android.view.InflateException: Binary XML file line #6: Error inflating class com.facebook.drawee.view.SimpleDraweeView
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at droidninja.filepicker.adapters.PhotoGridAdapter.onCreateViewHolder(PhotoGridAdapter.java:42)
at droidninja.filepicker.adapters.PhotoGridAdapter.onCreateViewHolder(PhotoGridAdapter.java:24)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5833)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5057)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4967)
at android.support.v7.widget.LayoutState.next(LayoutState.java:100)
at android.support.v7.widget.StaggeredGridLayoutManager.fill(StaggeredGridLayoutManager.java:1556)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:666)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:598)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3315)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3124)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3568)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1703)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1557)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1466)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2086)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.
08

can't select ssl certificate file

i have a ssl certificate file with extension .p12 and am not able to view and select it
is there anyway you can add a filter for the extension we want to display ?

Translating text

Activity where I can pick files by this lib has some texts in english. How it is possible to translate them to russian?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.