B4A Library FileSelect Library With Type Icons

Attached is Version 1.02 of my File Selecting library. It includes type icons for most every type of file, creates a selection list which can be collected and produces thumbnails on the fly of image files. Copy the .jar and .xml file to your XtraLibs folder.

Requires: Reflections Library 2.4+, the Reflection lib does not need to be checked in the Libs tab but must be included in your XtraLibs folder or whatever path you have set for them.

Thanks to Stevel05 it moves more swiftly throughout!

Below are a few screen shots and some sample code.

B4X:
Sub Globals
    Dim FS As FileSelect
    FS.Initialize(Activity, Me, True, 0dip, 0dip, 500dip, 600dip)
End Sub
Sub Activity_Create(FirstTime As Boolean)
    FS.ShowFiles("/mnt")
End Sub
 
'Be sure to include this sub in your Activity. This sub
'is called by the Library once a file is selected.
Sub File_Selected(FileName As String, PathAndFile As String)
    Msgbox(FileName, PathAndFile)
End Sub
 

Attachments

  • FileSelect Ver. 1.02.zip
    193.5 KB · Views: 1,030
  • fs1.png
    fs1.png
    124.4 KB · Views: 1,115
  • fs2.png
    fs2.png
    37.5 KB · Views: 918
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
Ok, unfortunately I loose the PathAndFile when I switch to the long click.

File_Selected(FileName As String, PathAndFile As String) -->

File_Selected_LongClick(FileName As String, IsDirectory As Boolean)
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Almost done. I had to move a few things around (from the single click event to long click). I've got to split my path and filename apart.

I also need to get a destination folder, for my copy and cut commands ( I might use long click on a folder to paste into).
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Hi Margret:

Tying FileSelect and kind of works fine. Is there ANY I can pass the file extension. I tried passing "*.db" at the end of my path but keep getting an error that this is not a path.

I don't want to list all the files in the path just a specific type. Can I do this? I am using 1.03

Also on a side not seems to take a long time to start now I do the FS.Initialize and FS.ShowFiles when a button is clicked.

Thanks for any help

BobVal
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I noticed the path is right there in the title bar. Is there any way to use that?
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hmm, would it be possible to map keyboard (up / down) arrows to navigate that file select listing?
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Almost done, now stuck on paths and filenames with spaces in them. :(

I tried using quotes around FS.LongClickSelection , like this "'" & FS.LongClickSelection & "'", but that didn't help with my file commands (cp and rm).

Any suggestions?
 
Top