Android Question Using Class Checklist

microbox

Active Member
Licensed User
Longtime User
Hello everyone, I'm having difficulty in modifying the placement of some views to my specific need. I'm using Informatrix' wonderful Class Checklist and Checklistdemo1. I need to make the text header and the label below it centered. Hope anyone can help me out.



Thank you in advance
 

microbox

Active Member
Licensed User
Longtime User
Use:

YourLabelName.Gravity = Gravity.Center
YourEditTextName.Gravity = Gravity.Center

Thank you LucaMs for the reply... I got it.
But I have another question, I placed a button that will add items manually as shown below

I'm trying to incorporate the SortItems function. So that when I add an item the latest added item stays on top of the list. But I'm having trouble using it in my code.
Basically this is the codes I have so far.
B4X:
Sub FillTheList(Title As String, WithCheckBox As Boolean)
    Activity.Title = Title
    'Dim b1, b2 As Bitmap
    Dim lbl As Label
    'b1.Initialize(File.DirAssets, "image1.png")
    'b2.Initialize(File.DirAssets, "image2.png")
    For i= 0 To z
                '---Add Header---              
                lst.AddHeader("Code " & i)
                lst.AddItemNoChkbx(i,"Teller #" & i, "", Null)
                          
    Next  
    z = z + 1  

    'lst.SortItems(lst.CreateIntegerList(2, z, lst.NumberOfItems - 1), z, lst.NumberOfItems - 1, False)  
  
    lst.ResizePanel
  
End Sub

I appreciate any help.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I have not used the sort function.

I'm looking at the code of the class.










CreateIntegerList need that ViewIndexInPanel but the AddItemNoChkbox routine does not creates a useful view for this purpose, I think.

Create your own list of indexes "manually" (adding a statement inside the loop).

In addition, in your example, the second parameter should be 0, not Z.

lst.SortItems(lst.CreateIntegerList(2, z, lst.NumberOfItems - 1), z, lst.NumberOfItems - 1, False)
lst.SortItems(lst.CreateIntegerList(2, z, lst.NumberOfItems - 1), 0, lst.NumberOfItems - 1, False)



I repeat, I have never used the sorting
 
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Hi, thank you for your reply...I will try it out.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…