B4A Library [Class] File Explorer with visualization

Discussion in 'Additional libraries, classes and official updates' started by Informatix, Jun 24, 2012.

  1. Informatix

    Informatix Expert Licensed User

    Hi,

    I created this class because I was frustrated by the File Dialog in the (great) Dialogs lib. With that class, you can customize everything (since you have the source code) and add new functions like rename, delete, create folder, etc.
    Currently, the class can visualize picture and text files (or not if you set the option to false) when you select them.
    You can make multiple selections.

    If your activity contains a TabHost, loot at post #7.

    Add this permission to the manifest for Android v4+:
    AddPermission(android.permission.READ_EXTERNAL_STORAGE)


    Since September 1st 2014, this class is completely free.

    Enjoy,
    Fred
     

    Attached Files:

    Last edited: Sep 17, 2018
  2. Amalkotey

    Amalkotey Active Member Licensed User

    Thank you for publishing this class.
     
  3. Informatix

    Informatix Expert Licensed User

    I have an annoying problem with ICS. When you type in the EditText at the bottom of the dialog, all letter keys & number keys are redirected to another EditText, under the dialog. What a mess! I don't know how to prevent this. If someone find a way to fix it, or a workaround, please let me know.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    How can I reproduce it? Should I add another EditText?

    Tip: Set EditText.InputType to not show suggestions:
    Code:
    EditText.InputType = Bit.Or(EditText.InputType, 0x80000)
     
  5. Informatix

    Informatix Expert Licensed User

    I can't reproduce the problem outside my application. So I suppose it's in my app only.
     
  6. Informatix

    Informatix Expert Licensed User

    I found where's the problem. It's a bug in TabHost:
    It's easy to reproduce: put an EditText in a TabHost and open the file explorer. Try to type something. The focus always returns to the underlying EditText, even when you set it to not focusable (with the reflection lib) and disable the TabHost.
    I can't see a solution for now. I can only say: avoid TabHosts with this class.
     
  7. Informatix

    Informatix Expert Licensed User

    Finally, after reading its source code, I found a way to prevent a TabHost from stealing the focus.

    Code:
    Dim r as Reflector
    r.Target = TabHost1
    '0x00060000=FOCUS_BLOCK_DESCENDANTS
    r.RunMethod2("setDescendantFocusability"0x00060000"java.lang.int")
    Back to normal:
    Code:
    '0x00040000=FOCUS_AFTER_DESCENDANTS
    r.RunMethod2("setDescendantFocusability"0x00040000"java.lang.int")
    TabHost1.RequestFocus
    Happy Fred
     
    Last edited: Jun 25, 2012
    jmon likes this.
  8. Informatix

    Informatix Expert Licensed User

    New version:
    - I fixed the bug in mode OnlyFolders
    - I added a fourth panel at the bottom to separate the OK button from the list
    - Keys are now intercepted properly (TrapKeys is not needed anymore)
    - The code is globally more robust
    - Suggestions are no longer displayed (thanks to Erel)

    See post #1
     
    Last edited: Jun 26, 2012
  9. Informatix

    Informatix Expert Licensed User

    v1.11: I fixed a bug with Key_Up on some devices

    See post #1
     
  10. Informatix

    Informatix Expert Licensed User

    v1.12: I fixed a bug, again (the EditText wasn't resetted after changing folder)
    Shame on me. Where is my mind ?

    See post #1
     
  11. duneplodder

    duneplodder Active Member Licensed User

    Hi Fred
    I get an "Invalid Attachment" error when I try to download v1.11
    Regards,
    Robert
     
  12. Informatix

    Informatix Expert Licensed User

    I suppose you tried when I was uploading the new version. You should retry with the v1.12.

    Regards.
     
  13. duneplodder

    duneplodder Active Member Licensed User

    Obviously that was the problem!
    Now downloaded successfully.
    Robert
     
  14. Informatix

    Informatix Expert Licensed User

    v1.2:
    - I fixed a bug with the root folder
    - I added a new function: "Explorer2". Use it if you want to apply the default android themes (dark or light) to mimic a standard dialog. "Explorer" is still there for customized colors.

    Fred
     
  15. Jost aus Soest

    Jost aus Soest Active Member Licensed User

    Thanx a lot for your nice work!
     
    Last edited: Jun 27, 2012
  16. nypaulie

    nypaulie Member Licensed User

    Need a location.

    In the original post there is the following:
    "PS: you need the Reflection lib"

    When I tried to compile/run I got a missing library reference error, so how do I find where to locate and reference this lib file? Thanks for helping this noob!
     
  17. Informatix

    Informatix Expert Licensed User

    Reflection library v2.20
     
  18. nypaulie

    nypaulie Member Licensed User

    Originally Posted by nypaulie
    In the original post there is the following:
    "PS: you need the Reflection lib"
    When I tried to compile/run I got a missing library reference error, so how do I find where to locate and reference this lib file? Thanks for helping this noob!
    Downloaded the Reflection lib file, unzipped it and put both the jar and xml files into my Librairies directory (and set the path to find them) but still get the error.
     
  19. boastrike

    boastrike Member Licensed User

    On the IDE screen bottom right. Select the tab libs and check the reflection library to include it in your app. -boa
     
  20. nypaulie

    nypaulie Member Licensed User

    That corner of my IDE was out of view until I resized the window. Duhh... Thank you for this!
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice