Android Question How to display customlistview with all borders black

Makumbi

Well-Known Member
Licensed User
Screenshot_1587050769.png


This is how i wanted it displayed with borders black
expected.png


Here is my code

B4X:
Sub Pastrecords_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int)
    Dim ExtraSize As Int = 25 'List size
    For i = Max(0, FirstIndex - ExtraSize) To Min(LastIndex + ExtraSize, pastrecords.Size - 1)
        Dim Pnl As B4XView = pastrecords.GetPanel(i)
        If i > FirstIndex - ExtraSize And i < LastIndex + ExtraSize Then
            If Pnl.NumberOfViews = 0 Then 'Add each item/layout to the list/main layout
                Dim AD As StudentDatacompare = pastrecords.GetValue(i)
                Pnl.LoadLayout("Displaycompare")
                Names.Text = AD.Names
                Subject.Text = AD.Subject
                First.Text= AD.First
                Second.Text = AD.Second
                Secagg.Text = AD.Secagg
                Firsagg.Text= AD.Firsagg
            '    Differenceagg.Text=AD.Differenceagg
            '    Differencemks.Text=AD.Differencemks
       
            End If
        Else 'Not visible
            If Pnl.NumberOfViews > 0 Then
                Pnl.RemoveAllViews 'Remove none visable item/layouts from the list/main layout
            End If
        End If
    Next
End Sub

Sub TxtSearchFilter_TextChanged (Old As String, New As String)

    '
    pastrecords.Clear
    Sleep(0)

    'admno: 19-07561
    'Dim SenderFilter As Object
    Dim accounts As String= "19-07561"

Log(accounts)

    Dim rs As ResultSet = Starter.SQL1.ExecQuery2("SELECT DISTINCT Names,Subject,First,Second,Firsagg,Secagg,Differencemks,Differenceagg,Categorymks,Categoryagg FROM AcademicsLoadCompare WHERE admno = ?", Array As String(accounts))



'    Wait For (SenderFilter) SQL_QueryComplete (Success As Boolean, rs As ResultSet)
'    If Success Then
    'Dim StartTime As Long = DateTime.Now
    Do While rs.NextRow
        Dim AD As StudentDatacompare
        AD.Initialize
        AD.Names    = rs.GetString("Names")
        AD.Subject = rs.GetString("Subject")
        AD.First    = rs.GetString("First")
        AD.Second = rs.GetString("Second")
        'AD.Subject= rs.GetString("Class")
        AD.Firsagg= rs.GetString("Firsagg")
        AD.Secagg= rs.GetString("Secagg")
        Names.Text=rs.GetString("Names")
    '    AD.Differencemks= rs.GetString("Differencemks")
        'AD.Differenceagg= rs.GetString("Differenceagg")
    '    AD.categorymks= rs.GetString("Categorymks")
        'AD.categoryagg= rs.GetString("Categoryagg")
        'AD.Sst= rs.GetString("sstscore")
        'AD.Science= rs.GetString("sciencescore")
        'AD.Division= rs.GetString("Division")
                   
        Dim Pnl As B4XView = xui.CreatePanel("")
        Pnl.SetLayoutAnimated(0, 0, 0, pastrecords.AsView.Width, 130dip) 'Panel height + 4 for drop shadow
        pastrecords.Add(Pnl, AD)
    Loop
    rs.Close
       
       
    'Else
    '    Log(LastException)
    'End If
   
End Sub
 
Top