Android Question How to make customerlistview wider than this automatically on different phones

Makumbi

Well-Known Member
Licensed User
B4X:
CLVHeader1.Initialize(Me, "CLVHeader1", pnlTop, CustomListView1)
        CLVHeader1.MaxHeaderHeight = 150dip
        CLVHeader1.Resize(100%x, 100%y)
        CustomListView1.DefaultTextBackgroundColor = Colors.blue
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE145)).PopAll.Append("Profile").PopAll,"1")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE190)).PopAll.Append("Change Number").PopAll,"2")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE84F)).PopAll.Append("Check Balance").PopAll,"3")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF007)).PopAll.Append("NoticeBoard").PopAll,"13")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE2C4)).PopAll.Append("Homework Download").PopAll,"9")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF27B)).PopAll.Append("SimpleChat(Communication Book)").PopAll,"4")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF19D)).PopAll.Append("Academics(Current Performance)").PopAll,"5")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF19D)).PopAll.Append("PastRecords").PopAll,"6")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF19D)).PopAll.Append("PerformanceCurve").PopAll,"14")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF0C0)).PopAll.Append("New Admissions").PopAll,"7")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE84F)).PopAll.Append("Account Statement").PopAll,"8")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE887)).PopAll.Append("Help").PopAll,"10")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF071)).PopAll.Append("MUST READ").PopAll,"11")
        CustomListView1.AddTextItem(cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF007)).PopAll.Append("GetClassTeacherContacts").PopAll,"12")

B4X:
Sub CustomListView1_ScrollChanged (Offset As Int)
    CLVHeader1.ScrollChanged(Offset)
End Sub

Sub CLVHeader1_UpdateHeaderHeight (Height As Int, Fraction As Float)
    If Fraction = 1 Then
        ImageView1.Height = Height
    End If
    lblHeader.SetLayoutAnimated(0, 0, 0, pnlTop.Width, pnlTop.Height)
    lblHeader.TextSize = 20 + 20 * Fraction
    lblHeader.Color = xui.Color_ARGB(255 * (1 - Fraction), 0, 100, 0)
End Sub


Sub pnlTop_Click
    CustomListView1.ScrollToItem(0)
End Sub
 

Attachments

DonManfred

Expert
Licensed User
Do you have any example that I can follow thanks in advance
 
Top