Android Question Change Fonts in PreferenceDialog

Mahares

Expert
Licensed User
Longtime User
change the font of the edittext and title of the [B4X] PreferenceDialog
Below is how you change the dialog title font, But I could not figure out how to change the font of the edittext boxes. I leave that to someone more knowledgeable:
B4X:
prefdialog.Dialog.TitleBarHeight=75dip
    prefdialog.Dialog.TitleBarFont=xui.CreateDefaultBoldFont(32)
or:
B4X:
Dim fnt As B4XFont = xui.CreateFont(Typeface.SANS_SERIF, 36)
    prefdialog.Dialog.TitleBarFont=fnt
 
Upvote 0

XbNnX_507

Active Member
Licensed User
Longtime User
Below is how you change the dialog title font, But I could not figure out how to change the font of the edittext boxes. I leave that to someone more knowledgeable:
B4X:
prefdialog.Dialog.TitleBarHeight=75dip
    prefdialog.Dialog.TitleBarFont=xui.CreateDefaultBoldFont(32)
or:
B4X:
Dim fnt As B4XFont = xui.CreateFont(Typeface.SANS_SERIF, 36)
    prefdialog.Dialog.TitleBarFont=fnt
Thanks @Mahares but i'm talking about this.
1584148369369.png

i don't see that property prefdialog.Dialog. ?
 
Upvote 0

asales

Expert
Licensed User
Longtime User
i don't see that property prefdialog.Dialog. ?
If you don't see this property, there is a problem. Put your code.

This is the code to change the typeface of the font to bold:
B4X:
    Dim sf As Object = prefdialog.ShowDialog(Options1, "OK", "CANCEL")
    For i = 0 To prefdialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
            Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
            ft.TextField.Font = xui.CreateDefaultBoldFont(20)
        End If
    Next
 
    Wait For (sf) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        PrintOptions(Options1, TextArea1)
    End If

Based in the code from @Erel :
 
Upvote 0

XbNnX_507

Active Member
Licensed User
Longtime User
If you don't see this property, there is a problem. Put your code.

This is the code to change the typeface of the font to bold:
B4X:
    Dim sf As Object = prefdialog.ShowDialog(Options1, "OK", "CANCEL")
    For i = 0 To prefdialog.PrefItems.Size - 1
        Dim pi As B4XPrefItem = prefdialog.PrefItems.Get(i)
            Dim ft As B4XFloatTextField = prefdialog.CustomListView1.GetPanel(i).GetView(0).Tag
            ft.TextField.Font = xui.CreateDefaultBoldFont(20)
        End If
    Next

    Wait For (sf) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        PrintOptions(Options1, TextArea1)
    End If

Based in the code from @Erel :
Thanks @asales that's what i needed. :cool:
 
Upvote 0
Top