Android Question Light Theme for XUI Dialogs

chefe82

Member
Licensed User
Longtime User
Hello everybody,

is it also possible for the XUIDialog to include / set a bright theme as in preferences dialog?


thx
 

chefe82

Member
Licensed User
Longtime User
Hi,
I think I'm too stupid for that.
I want the normal message box in a light design.
Background color is not the font color.
What am I doing wrong?


B4X:
Sub MessageBox
    
    Dim Dialog As B4XDialog
    Dim Base As B4XView
    
    Base = Activity
    Dialog.Initialize (Base)
    
    Dialog.TitleBarColor = XUI.Color_White
    Dialog.ButtonsTextColor = XUI.Color_Red
    Dialog.BorderWidth = 0
    Dialog.BorderColor = XUI.Color_Transparent
    Dialog.ButtonsColor = XUI.Color_Transparent
    Dialog.BackgroundColor = XUI.Color_White
    Dialog.Title = "Messagebox"
    
    Wait For (Dialog.Show("Test", "OK", "", "")) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then
        'ExitApplication
    End If
    
End Sub
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
What am I doing wrong?
1. Don't call ExitApplication.

2. Better to initialize the Dialog object once and reuse it.

3. The default title text color is white. You need to change it:
B4X:
Dialog.TitleBarTextColor = xui.Color_Red

4. The default body text color is white. Currently this property is not exposed. It will be exposed in the next update of XUI Views.
You can use CSBuilder to change it instead:
B4X:
Dim Body As CSBuilder
Body.Initialize.Color(xui.Color_Blue).Append("Test").PopAll
Wait For (Dialog.Show(Body, "OK", "", "")) Complete (Result As Int)
 
Upvote 0
Top