Coder Social home page Coder Social logo

android-filepicker's People

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

android-filepicker's Issues

onSelectedFilePaths() returning deselected file paths

I have a requirement where user can select/deselect dirs paths. So after using dialog.markFiles(filePaths), and when the user is deselecting the path, still the onSelectedFilePaths() method returns deselected file paths along with selected paths.

Remove params from application in AndroidManifest.xml

Please remove

android:allowBackup="true"
android:supportsRtl="true"

from AndroidManifest.xml file. Every app has their own policy regarding using backup or RTL. No reason for such params in 3d party library.

Also remove

uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"

This parameter also should be controllable by the app itself. Not by 3d party library.

File name animation while scrolling

Hi
I really like your filepicker. It's simple to integrate and works without issues.
However there is one thing that's bothering me - the right-to-left animation of icons and file names while scrolling up or down. It does look nice and smooth, but it kind of doesn't fit in my app. My app is quite static and to suddenly have everything moving is a bit annoying.
Is there a simple way of switching these animations off?
Thanks.

Use colors from current theme

At the moment the library does not use colors for current app theme.
If I have the following theme assigned to the app

<resources>
    <style name="AppTheme.Dark.Cyan" parent="AppTheme.Dark">
        <item name="colorAccent">@color/material_cyan_300</item>
    </style>
</resources>

then filepicker still needs colorAccent in colors.xml to override button text.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorAccent">#ff9800</color>
<resources>

Check how this is done in android.support.v7.app.AlertDialog.

NullPointerException on back item

Hello, when the first listview is loaded with directories and files of the specified path, and you press the first element to return (...), the application ends with errors. An uncontrolled nullPointerException is thrown.

Conceal hidden files/folders

I would message you if I knew how to :( I am not sure if this is the appropriate place to do this. I am new to github.

Is there a way to set a property to not show hidden files? My users are not so 'tech-savy' and when they see the dialog open with so many files starting with a period they have a hard time finding their files.

Is there already a way to adjust this?

Add more customize display item values

It would be interesting to add personalization in the first and second line, showing the size or by a text pattern with variables:
%size% %size_b% %size_kb% %size_mb% %size_gb%...
%lastmod_24% %lastmod_12%
%path%
%name%

Sample:
app:patternFirstLine="%name%
app:patternSecondLine="%size_mb% - %lastmod_24h%
app:patternTime = "YYY/mm/dd"

small improvement in FilePickerDialog

BTW: Nice Work my Friend!! Love it!!
and here just an Idea for you i did it in my Fork:

in the File com.github.angads25.filepicker.view.FilePickerDialog:

@Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
        if (internalList.size() > i) {
            FileListItem fitem = internalList.get(i);
            if (fitem.isDirectory()) {
             ....
            }
            else {
                if (view != null) {
                    CheckBox checkBox = (CheckBox)view.findViewById(R.id.file_mark);
                    checkBox.performClick();
                }
            }
        }
    }

So you can also click on the FileName to select an Item... it's pretty handy .. for me :-)

Is it possible to show directiores based on the files present in it Eg show only directiories which have pdf files

Will it be possible to show Directory only if pdf, txt, image file is present in that folder. I mean by default it is showing system Directories as well. I need to show only those directories which have at least one of the required files like pdf,txt, image.
I saw the Dialog properties where we can hide files other than specified in ext array passed as below.

 String ext[] =new String[] {"jpg","jpeg","png","gif"};
        properties.extensions=ext;

But here the problem I am facing is , it is still showing the folders which don't contain the above extns.

Can not move to external storage from internal storage in some devices

Hi,

In htc u11, if I try to click ".." in the root of internal storage. It will show "Directory cannot be accessed". I guess it is because the root ("/") can not be read. This will lead to fail to move to external storage through internal storage.

I have worked for it to add a dropdown in dir_picture to direct the current directory to external sdcard without entering "/", look picture.

imgur

Any other good ideas?

Thanks.

Selecting a directory returns zero length array

The following code is used to select a directory:

DialogProperties properties=new DialogProperties();
properties.selection_mode= DialogConfigs.SINGLE_MODE;
properties.selection_type=DialogConfigs.DIR_SELECT;
properties.root=new File(DialogConfigs.DEFAULT_DIR);
properties.extensions=null;
fd = new FilePickerDialog(SettingsActivity.this, properties);
fd.setDialogSelectionListener(new DialogSelectionListener() {
    @Override
    public void onSelectedFilePaths(String[] files) {
        if(files == null){
            utility.doNothihng();
        }else if(files.length == 1){
            String sPathFolder = files[0];
        }
    }
});
fd.show();

The result is that files.length = 0. The selected folder is Download.

BTW, thanks a lot for this great tool.

Seemed there was a bug when selecting the file

could you please help me,
when I tried to select a file from the dialog file-listing it seemed a bit unresponsive.

here is the screenshot.

ezgif-632323787

and another question, is it possible to disable the animation when selecting files (the fly-in animation)?
and I also I want to make the selection by clicking the list item instead of the checkbox

Thank you

No path return when I use DIR_SELECT

I have these config:

                DialogProperties properties = new DialogProperties();
                properties.selection_mode = DialogConfigs.SINGLE_MODE;
                properties.selection_type = DialogConfigs.DIR_SELECT;
                properties.root = new File("/sdcard/facedetect");
                properties.extensions=null;

                FilePickerDialog dialog = new FilePickerDialog(MainActivity.this, properties);
                dialog.setDialogSelectionListener(new DialogSelectionListener() {
                    @Override
                    public void onSelectedFilePaths(String[] files) {

                    }
                });
                dialog.show();

I have noticed that if I use DIR_SELECT , I cannot get the path from String[] files. Following is the screenshot

image

Filetype filtering

Is a filter for filetypes (e.g. RegEx based) planned? I need a file picker that only shows SVG files :)

didn't find how to allways set the up path

hello,
the path given at instantiation is the root node for the dialog, meaning you can navigate up and down from there, but you can't get up....

now i give that path, from a stored variable, so as to move the user to a section of the filesystem where his files are supposed to be....

but once set, he can't escape the actual project to go to the next.... anyway to set a top-most root and an actual position ?

Return Directory Without Checkbox

I am using the FilePicker as a download file path selector. The user navigates to the directory they would like to save their files in and selects that folder. However, in the current implementation, that behavior does not work. Instead, the user is required to select their desired directory using the checkbox button.

I think that the library should return the file path the user navigated to without the checkbox requirement.

Animations and Theme

After switching to 1.0.3 I think I might switch back to 1.0.2. The animations are a bit too much. They definitely look cool, but my users aren't going to like it. It's hard to scroll quickly and find things and my app needs quick lookups :-/

Also when you select a file and stuff starts flying all over the screen it is too much. It almost looks like a glitch. Is it supposed to be doing all that just from hitting a checkbox? Is there a way for me to make just the check box "check" and "uncheck" without anything else moving?

One final question; can I change the colors? I need to make them match my app.

Thanks Angad.

OnCancelListener is not called

Code:

myFilePickDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
    @Override
    public void onCancel(DialogInterface dialogInterface) {
        ...
    }
});

It does not seem to be called when Cancel is selected..

Single selection mode checkbox state

If I tap only if checkboxes or only on elements everything is ok.

But if I tap first on checkbox and after that I tap on other element, that element is not checked only if tap it once again.

Same thing if I check and element and after that a checkbox from other element.

So in those cases the selected state is interchanged somehow.

Can't select file

In the files listview, clicking on a directory will open the directory, but clicking on a file does nothing unless you click on the checkbox next to file. This makes user experience very inconvenient.

Is there any work-around to this or could you please fix this?

Can't grant the permission (Screen Overlay Detected)

When I tried to grant the storage permission, android system's dialog is poped.

It says "Screen overlay detected - To change this permission setting you first have to turn off the screen overlay from Settings > Apps".

Usually this problem is caused by screen filter application but I don't use any of them.

Anyway I found that is caused by toast message.
[ FilePickerDialog.onShow() - Line203]
Toast.makeText(context,"Application needs you permission to access SD Card",Toast.LENGTH_LONG).show();

If I wait until the message disappears then I can get the app's storage permission.

Different method would be necessary to inform about permission.

Changing color

Hi
How to change colors or style of FilePickerDialog in code?
Getting color this way should help for changing themes:

int[] attrs = new int[] { R.attr.colorPrimary/* index 0 */}; TypedArray ta = obtainStyledAttributes(attrs); ta.getColor(0,0); ta.recycle();

Thank you
Love that lib :)

Attribute title conflict with Android Toolbar

Hi,

Thanks for previous updates.

Currently theres a conflict with the title attribute on FilePickerPreference, I refer to the following compilation error:

Error:(271) Attribute "title" has already been defined
Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Applications/Android/sdk/build-tools/23.0.3/aapt'' finished with non-zero exit value 1

This seems to be an internal Android flaw as mentioned here:
http://stackoverflow.com/questions/18617413/attribute-title-has-already-been-defined-after-adding-after-adding-android-s

I think the conflict is because I am using android.support.v7.widget.Toolbar.

Please assist in getting a work around going.

Kind Regards

Willem

nullpointer on dir select

I am on version 1.02 and still getting a null pointer exception when I try to choose a directory:

java.lang.NullPointerException at com.github.angads25.filepicker.view.FilePickerDialog$1.onClick(FilePickerDialog.java:100)

This is my code:

DialogProperties properties = new DialogProperties();

        properties.selection_mode = DialogConfigs.SINGLE_MODE;
        properties.selection_type = DialogConfigs.DIR_SELECT;
        properties.root = new File(DialogConfigs.STORAGE_DIR);
        properties.extensions = null;
        FilePickerDialog dialog = new FilePickerDialog(getActivity(), properties);
        dialog.setDialogSelectionListener(new DialogSelectionListener() {
            @Override
            public void onSelectedFilePaths(String[] files) {
                Log.d(TAG, "onSelectedFilePaths: " + files.length);
                if (files.length > 0) {
                    //stuff
                }
            }
        });
        dialog.show();`

select file by touching the full row

now if you touch the row (filename) it just lights up shortly and nothing else happens.
can you make an option so that this will select the file?
this would be the natural way people select things

Allow to switch internal / external card

It seems that I can't find any options on your wiki to allow switch to internal / external card.
So it would be nice if you add this feature to this library.

Thanks :)

java.lang.NullPointerException: Attempt to get length of null array

type=1400 audit(0.0:4262): avc: denied { read } for name="/" dev="rootfs" ino=2 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:rootfs:s0 tclass=dir permissive=0 ppid=2834 pcomm="main" pgid=2834 pgcomm="main"

08-01 12:08:17.129 W/System.err(30056): java.lang.NullPointerException: Attempt to get length of null array
08-01 12:08:17.129 W/System.err(30056): 	at com.github.angads25.filepicker.filepicker.utils.Utility(SourceFile:72)
08-01 12:08:17.129 W/System.err(30056): 	at com.github.angads25.filepicker.view.FilePickerDialog.onStart(SourceFile:240)
08-01 12:08:17.129 W/System.err(30056): 	at android.app.Dialog.show(Dialog.java:302)
08-01 12:08:17.129 W/System.err(30056): 	at com.github.angads25.filepicker.view.FilePickerDialog.show(SourceFile:417)

Android: 7.1.1 (API: 25)
Manufacturer: Sony
Model: G8142
Device: G8142
Board: msm8998
Brand: Sony
Product: G8142
Screen: 1080x1776 (403dpi, xxhdpi)

Use color from provided theme

To help users of you Dialog dealing with the theme, you could as well simply implement a constructor of FilePickerDialog that gets the parameters of Dialog : public Dialog(@nonnull Context context, @StyleRes int themeResId) si that they can modifiy the theme.
Very simple to put in place : add this constructor :
public FilePickerDialog(Context context, DialogProperties properties, @StyleRes int themeResId) {
super(context, themeResId);
this.context = context;
this.properties = properties;
filter = new ExtensionFilter(properties);
internalList = new ArrayList<>();
}
and it's done !

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String java.io.File.getAbsolutePath()’ on a null object reference

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method ‘java.lang.String java.io.File.getAbsolutePath()’ on a null object reference
at com.github.angads25.filepicker.view.FilePickerDialog.onItemClick(SourceFile:213)
at android.widget.AdapterView.performItemClick(AdapterView.java:334)
at android.widget.AbsListView.performItemClick(AbsListView.java:1531)
at android.widget.AbsListView$PerformClick.run(AbsListView.java:3664)
at android.widget.AbsListView$3.run(AbsListView.java:5585)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

Checkboxes not visible unless checked

My users do not like the behavior of the check boxes. They do not look like the screenshots. The check boxes are invisible until checked. It actually took us a while to realize we could even touch in that area to select a file.

I recommend you make the check boxes visible even when not checked. Either that or make the selection by clicking the file, but that would mess with the directory selection. Easiest way is to make all check boxes visible.

I know how to do it, but I am not sure how to recompile the library with my changes. I messed with android studio all day today and can't figure it out.

If you do this change then I would LOVE to use your library.

EDIT:
I should probably have mentioned... GREAT WORK!!! This library is awesome either way and looks great. It will be a huge time saver for me and looks better than some other ones I have seen. Just need this ooooooone tiny thing changed.

header text background

For some reason if I set the background color in my app, header looks weird (filepicker/src/main/res/layout/dialog_header.xml).

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.