B4A Library Dialogs library

Discussion in 'Additional libraries, classes and official updates' started by agraham, Dec 7, 2010.

Thread Status:
Not open for further replies.
  1. ivan.tellez

    ivan.tellez Active Member Licensed User

    Wow, great job, really useful.

    I just want to contribute with some suggestions..

    On the Input box
    • wen it opens, the edit has the focus, but the keyboard dont appear until you click the edit, it shoud appear when the dialog opens.
    • will be useful having a "MaxLenght" property
    • Stetic: I think it will look better if you add a little space between the edit and the area of the buttons.

    Thanks :)
  2. fabio.guerrazzi

    fabio.guerrazzi Member Licensed User


    Core 3.80
    Dialogs 2.92

    Compiling log below:

    Parsing code. 0.00
    Compiling code. 0.30
    Compiling layouts code. 0.00
    Generating R file. 0.02
    Compiling generated Java code. 0.78
    Convert byte code - optimized dex. 0.57
    Packaging files. 0.11
    Copying libraries resources Error
    Impossibile trovare il file 'C:\0\MyExamle\Objects\bin\temp.ap_.521.tmp'.

    If I remove the reference to Dialogs lib everything work fine
    Thank you for answers
  3. Erel

    Erel Administrator Staff Member Licensed User

    Try Tools - Clean Project.
  4. fabio.guerrazzi

    fabio.guerrazzi Member Licensed User

    No, thanks but saddly it doesnt solve the problem.
    I've 2 windows pc where I'm used to code.

    a notebook Win8 64 and emulator
    another one tower pc with Win7 64 and Samsung S2 throught wireless.

    on Win7 works all fine, on Win8 only if I disable and comment Dialogs references

    on Win8 "Test Compilation" ends succesfully

    I re-copied Dialogs.jar and xml to \libraries assuming that files might have been corrupted.. no way

    any other clue?
  5. Erel

    Erel Administrator Staff Member Licensed User

    Might be related to your antivirus software.
  6. Douglas Farias

    Douglas Farias Expert Licensed User

    hi man can you add the options on filedialog?
    -Change Text Colors
    -Change BGColors
    -Change (..) to any other string (Back) for exemple
    -Remove ↓Files ↓

    -in the Holo.Light theme the text is white and the bg is white too *-* cant see files to click

  7. mat2175

    mat2175 Member Licensed User

    I totally agree. The filedialog would be more user friendly if these options were added.
    Please update the library @agraham

    Thanks :)
    Last edited: Aug 20, 2014
  8. Touch

    Touch Active Member Licensed User

    Hi agraham,
    I use the Theme: Theme.Holo.Light
    SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")
    I insert in my app your library for use FileDialog, but the file selection window displays the text color as the background color.
    It is possible change the text color?
  9. Informatix

    Informatix Expert Licensed User

    There's a file explorer class that can replace this file dialog, if needed. And starting from September, the donationware version will be free.
  10. Touch

    Touch Active Member Licensed User

    Hello Informatix, I tried your class, but I can not change the background color of the text box. Where do you see the result of the choice.
  11. Informatix

    Informatix Expert Licensed User

    There's an example provided with the class that shows a background with a custom color. You just have to do the same.
  12. Touch

    Touch Active Member Licensed User

  13. Gary Milne

    Gary Milne Active Member Licensed User

    Hi, I tried using the Color Picker Demo project (in Landscape mode) and on my Nexus 5 (4.4.4) the bottom part of the color bars is truncated and I can only see Red and part of the Green and then the buttons appear as normal. #SupportedOrientations: unspecified so I assumed it was intended to work on both. My Nexus 7 works fine.

    P.S. I like the HSV dialog, I think it's the simplest for users to pick a color from (when you want a range). I think a nice addition would be the ability to specify the input parameters in RGB and have the dialog convert that to HSV (for the purpose of showing an existing color). B4A is predominantly weighted towards RGB and having to work with multiple color conversions is a pain.

    Good work.
  14. merlin2049er

    merlin2049er Well-Known Member Licensed User

    Thanks, the color dialogs came in handy!
  15. warwound

    warwound Expert Licensed User


    Would you be prepared to let me have the source code for the Dialogs library so that i can attempt to fix the problem with the FileDialog file list text and background colors?


  16. agraham

    agraham Expert Licensed User

    Here you are

    Attached Files:

    moster67, Erel and thedesolatesoul like this.
  17. warwound

    warwound Expert Licensed User

    Thanks to @agraham for letting me have the Dialogs library source.

    Here is Dialogs version 2.93, i have added a new method to the FileDialog:

    GetSingleLineLayout As SingleLineLayout
    Gets the SingleLineLayout that will be used to populate the files list.
    The SingleLineLayout defines the appearance and layout of the file list items.
    See the ListView documentation for info about using the SingleLineLayout.

    The ListView documentation can be found here: http://www.b4x.com/android/forum/threads/listview-tutorial.6537/.
    Read the section Customizing each type in post #1 of that thread for more info.

    This update will be useful to those that use a theme such as Holo.Light.
    Without this update the items in the files list will have a light background color and a light text color, making it next to impossible to read the item text.
    Look at the attached 'before' and 'after' screenshots.
    These are both taken from a project where the application theme is Holo.Light.

    Usage of the new method is simple, just get the SingleLineLayout from the FilesDialog and set background and/or text color so that your file list items are readable:

    Sub btnFile_Click
    Dim FileDialog1 As FileDialog
        FileDialog1.FastScroll = 
        FileDialog1.FilePath = 
        FileDialog1.ShowOnlyFolders = 
    '    set the file list style
    Dim Icon As Bitmap
    File.DirAssets, "android48.png")
    Dim Action As Int = FileDialog1.Show("Select backup location:""OK""Cancel""", Icon)
    Select Action
    Case DialogResponse.CANCEL
    ToastMessageShow("Backup cancelled"True)
    Case DialogResponse.POSITIVE
    ToastMessageShow("Backup to: "&FileDialog1.FilePath, True)
    End Select
    End Sub
    I've attached library version 2.93 to this post, if agraham wants to add it to post #1 in this thread then i'll remove it from this post to keep the thread tidy.
    Also attached in the source code for version 2.93.


    Attached Files:

    shashkiranr, iz0ndg, moster67 and 3 others like this.
  18. warwound

    warwound Expert Licensed User


    I forgot to mention in my previous post that when the FileDialog ShowOnlyFolders property is set to True, the EditText used for file name input is hidden.

  19. deantangNYP

    deantangNYP Active Member Licensed User

    May i know if its possible to do auto file filtering?
    Example: if user input "xyz" into the edit box on the FileDialog, only filenames with "xyz" will appear.
    Please help. thanks.
  20. warwound

    warwound Expert Licensed User

    That's not currently implemented.
Thread Status:
Not open for further replies.
  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