Code Monkey home page Code Monkey logo

android-file-dialog's Introduction

  • 👋 Hi, I’m @suryann
  • 👀 I’m interested in Mobile Application Development
  • 🌱 I’m currently learning Spring boot and node js
  • 💞️ I’m looking to collaborate on ...
  • 📫 How to reach me [email protected]

android-file-dialog's People

Watchers

 avatar

android-file-dialog's Issues

Show current path in titlebar

I've created a patch which uses the option "OPTION_CURRENT_PATH_IN_TITLEBAR", 
which allows you to hide the "myPath" view and use the activity titlebar 
instead.

usage:

chooseFile = new Intent(this.getBaseContext(), FileDialog.class);
chooseFile.putExtra(FileDialog.OPTION_CURRENT_PATH_IN_TITLEBAR, true);
startActivityForResult(chooseFile, ACTIVITY_CHOOSE_FILE);

Original issue reported on code.google.com by [email protected] on 10 Feb 2012 at 8:36

Attachments:

rotate the screen, the loacation come back to START_PATH

What steps will reproduce the problem?
1. open the filedialog with the START_PATH: /
2. select a directory, such as /etc
3. rotate the screen, the loacation come back to START_PATH

What is the expected output? What do you see instead?
The location should keep the same when the screen was rotated.
I see the loaction come back to START_PATH instead.

What version of the product are you using? On what operating system?
I found this problem in android 2.1, 2.2

Please provide any additional information below.
to fix this problem, the onPause method should be overrided.

    @Override
    protected void onPause() {
        String myPathStr = myPath.getText().toString();
        int idx = myPathStr.lastIndexOf(':');
        String currPath = myPathStr.substring(idx + 2);
        getIntent().putExtra(START_PATH, currPath);
        super.onPause();
    }






Original issue reported on code.google.com by [email protected] on 1 Aug 2011 at 12:49

filenames "false"

When I call this dialog, I can see the 'location' path on the top of the screen 
but all files are shown as "false". What am I doing wrong? Thanks!

Original issue reported on code.google.com by [email protected] on 27 Sep 2011 at 8:22

Padding for files list

I've increased some padding around the file and folder items so they don't look 
as squashed.

The padding size has also been changed to use "sp" rather than "dp", as SP is 
scaled depending on the screen density/size and also the user settings (ie. 
font size "bigger", etc)

Original issue reported on code.google.com by [email protected] on 10 Feb 2012 at 8:31

Exception in getDirImpl if the list of files in the start directory is empty

At least with Android 2.2, f.listFiles() returns null if there are no child 
files in the selected directory (for example "/sdcard" on the emulator.

So (File file : files) will fail with a NullPointerException in this case. You 
could add before a guard like: 
if (files != null) ...

Then the dialog will work OK. I don't know if the origin of this problem is an 
issue in Android 2.2 or just a protection worth to be added to the dialog.

In Java listFiles() returns an empty list (not null) if there is nothing in the 
directory, but I don't know if the "/sdcard" path exist on the emulator by 
default.

Original issue reported on code.google.com by [email protected] on 4 Aug 2011 at 8:49

File dialog crashes with NullPointerException

File dialog crashes with NullPointerException if dirPath does not exists.

03-10 18:15:17.289: ERROR/AndroidRuntime(1438): Caused by: 
java.lang.NullPointerException
03-10 18:15:17.289: ERROR/AndroidRuntime(1438):     at 
com.loudsoft.loudbook.FileDialog.getDirImpl(FileDialog.java:177)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438):     at 
com.loudsoft.loudbook.FileDialog.getDir(FileDialog.java:137)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438):     at 
com.loudsoft.loudbook.FileDialog.onCreate(FileDialog.java:125)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-10 18:15:17.289: ERROR/AndroidRuntime(1438):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)

I offer this solution:

    private void getDirImpl(String dirPath) {

        File f = new File(dirPath);
                // Use root directory if dirPath does not exists
        if(!f.exists())
        {
            Toast.makeText(context, "There is no such directory " + dirPath, duration).show();
            dirPath = root;
            f = new File(root);
        }

        myPath.setText(getText(R.string.location) + ": " + dirPath);
        currentPath = dirPath;

        item = new ArrayList<String>();
        path = new ArrayList<String>();
        mList = new ArrayList<HashMap<String, Object>>();

        File[] files = f.listFiles();

Такие дела =)

Original issue reported on code.google.com by [email protected] on 10 Mar 2011 at 3:31

File extension filter and Directory selection

I have implemented these funcionalities.
You can pass a parameter to the activity to make it show only files whose 
extension matches a list of extensions.
Also you can select a directory.

Im sorry for portuguese comments I left in the code.. Feel free to remove it.

I have edited the code in Linux, Im sorry for any encoding issue.

Thanks man!

Original issue reported on code.google.com by [email protected] on 19 Oct 2011 at 4:19

Attachments:

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.