Android Question B4XSearchTemplate Light theme

Drago Bratko

Active Member
Licensed User
Longtime User
I'm trying to make search template in light theme. Have succeed in part of it, but missing last one. This is how it looks now:
Screenshot_20200606-085819.jpg


What I would like to do is color items with white background and black font color.

What I have tried are few options or ideas which came to my mind :
B4X:
    For a = 0 To SearchTemplate.CustomListView1.Size-1
        Dim pnl As B4XView
        pnl = SearchTemplate.CustomListView1.GetPanel(a)
        pnl.Color = Colors.White
        For Each ob As B4XView In pnl.GetAllViewsRecursive
            ob.Color = XUI.Color_Transparent
            ob.TextColor = TextColor
        Next
    Next
In this one, "SearchTemplate.CustomListView1.Size" is 0.

B4X:
    For Each pp As B4XView In SearchTemplate.mBase.GetAllViewsRecursive
        Try
            pp.Color = XUI.Color_Transparent
            pp.TextColor = TextColor ' teksta
        Catch
            Log(LastException)
        End Try
    Next
Have put TryCatch as it returns "Type does not match"

Any ideas ?
 

Drago Bratko

Active Member
Licensed User
Longtime User
For the record ... succeed to do it.
If anyone would need it :
B4X:
    Dim ItemsBackgroundColor As Int = XUI.Color_White
    Dim TextColor As Int = 0xFF5B5B5B
    Dim DividerColor As Int = 0xFFDFDFDF
    For Each clv As CustomListView In Array(SearchTemplate.CustomListView1)
        clv.sv.ScrollViewInnerPanel.Color = DividerColor
        clv.sv.Color = Dialog.BackgroundColor
        clv.DefaultTextBackgroundColor = ItemsBackgroundColor
        clv.DefaultTextColor = TextColor
    Next
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
For the record ... succeed to do it.
If anyone would need it :
You do not need to iterate or expose the sv. This is all you need for all your code:
B4X:
Dim ItemsBackgroundColor As Int = XUI.Color_White
Dim TextColor As Int = 0xFF5B5B5B        
SearchTemplate.CustomListView1.DefaultTextColor = TextColor
SearchTemplate.CustomListView1.DefaultTextBackgroundColor=ItemsBackgroundColor
 
Upvote 0
Top