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
    124.4 KB · Views: 1,116
  • fs2.png
    37.5 KB · Views: 918
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
I think if you create a folder named [ftypes] in the [Files] folder and put the icons there, you can then change them. Here is a list of what the names should be:

 
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
How do you return the file path using this? (if a file isn't selected).

I've got a few buttons on the side of this activity (ie. create folder)

Oh, and can you use a long click on this fs? I'd like to use that to delete files...
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
I'd like just the path from that sub file_selected. Or I'd have to strip out the file name and attach the new file name to that whole string so I can pass it to the rename function that I found which uses the phone lib.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Thanks! What happens to the FS after the file is selected? It disappears?
 
Last edited:

merlin2049er

Well-Known Member
Licensed User
Longtime User
Hi, how would I handle a long click to a file or folder? I'd like to pop up a dialog and allow for file / folder deletion and maybe renaming.
 

margret

Well-Known Member
Licensed User
Longtime User
Make a copy of the FileSelect.jar file. Rename this copy to FileSelect.zip and open it. Copy the ftypes folder into the Files folder of your project. In the ftypes folder you will see all the icons and can change or copy a new one to the same name but you can not change the name. The library will then use the files in the ftypes folder from the Files folder of your project.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…