Android Question xCustomListView usage for ask?

teddybear

Well-Known Member
Licensed User
I want to do a sidemenu with xCustomListView 1.73 ,

my code is

B4X:
Sub Class_Globals
    Private Root As B4XView
    Private xui As XUI
    Private clv1 As CustomListView
    Private lblIcon As B4XView
    Private lblItem As B4XView
    Private pnlClv1 As B4XView
End Sub

Public Sub Initialize
'    B4XPages.GetManager.LogEvents = True
End Sub

'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    Dim p As Panel
    Dim l,t As Object
    
    l = clv1.AsView.Width
    t = 80dip

    clv1.Clear
    For I = 0 To 19
        p = MenuIconListItem("Menu:" & (I+1),l,t,Chr(0xF1B9))
        clv1.Add(p,"submenu" & I)
    Next
End Sub

Sub MenuIconListItem(Text As String, W As Int, H As Int, Icon As String) As Panel
    Dim p As Panel
    p.Initialize("")
    p.SetLayout(0,0,W,H)
    p.LoadLayout("itemlist")
    lblIcon.Text = Icon
    lblItem.Text=Text
    Return p
End Sub

My questions are :

1. after a menu item was selected, how to keep it on the pressed color?

2. the Icon which Icon picker got can't be showed, it is X

3. does it have the function set the focus of itemlist,or can I set highlight item? I want to use it on TV.
 

Mahares

Expert
Licensed User
Longtime User
I want to do a sidemenu with xCustomListView 1.73 ,
Are you looking for something like this: Either way, when you post lots of code with layouts with many views, you are better off exportind your project so you can get help. People are not going to figure out what your layouts look like. Post your project and explain what you want

1644516679312.png
 
Upvote 0

teddybear

Well-Known Member
Licensed User
Thanks a lot for your advice. I will post a project.zip on my next question.
This thread have been solved with xCustomListView 1.52.

Two attributes HighLight Selected Item and HighLight Selected Color have been removed in xCustomListView1.73, I wonder what substitute they have.
 
Upvote 0
Top