Android Question PreoptimizedCLV and SeekBar

gmachacek

Member
Licensed User
Longtime User
Hello,
I am using CLV with PCLV lazy loading. It works, but PCLV is creating a seek bar and I am not able to change it's properties nother get events fired.
If I try to initialize the seek bar like PCLV.B4XSeekBar1.Initialize(Me,"B4XSeekBar1") I get following error
B4X:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.Rect anywheresoftware.b4a.objects.B4XCanvas$B4XRect.toRect()' on a null object reference
This is my sub
B4X:
Sub fillPCLV()
    
    Try
        Dim isAlter As Boolean = True
        
        PCLV.Initialize(Me, "PCLV", lstCustInventurList)
        Do While PCLV.IsInitialized = False
        Loop
        PCLV.NumberOfSteps = 20
        
        For Each InventurPosi As InventurPosStruct In InventurPosList

            If SelectedInvPosItem.Id = InventurPosi.Id Then currInventurPosIndex = lstCustInventurList.Size
            
            If isAlter = True Then
                If InventurPosi.workedon = True Then
                    PCLV.AddItem(160dip, Colors.ARGB(255,235,255,255), InventurPosi)
                    isAlter = False
                Else
                    PCLV.AddItem(160dip, Colors.ARGB(245,255,255,255), InventurPosi)
                    isAlter = False
                End If
            Else
                If InventurPosi.workedon = True Then
                PCLV.AddItem(160dip, Colors.ARGB(255,235,255,255), InventurPosi)
                    isAlter = True
                Else
                    PCLV.AddItem(160dip, Colors.ARGB(255,255,255,255), InventurPosi)
                    isAlter = True
                End If
            End If
        Next
                        
        PCLV.Commit   
                
        PCLV.B4XSeekBar1.Initialize(Me,"B4XSeekBar1")
                
        ProgressDialogHide
    Catch
        Log(LastException.Message)
        ProgressDialogHide
    End Try
End Sub
Then I thought maybe it is initialized with PCLV like in some cases the disigner does it for objects. Does not look like!
Maybe somebody could help because I didn't find any example!
Thanks in advance
Georg
 

AnandGupta

Expert
Licensed User
Longtime User
Check Xui view version.

The b4xlib is a cross platform library. It depends on XUI Views v2.27+. XUI Views is an internal library and should be copied to the internal libraries folder.

Regards,

Anand
 
Upvote 0

gmachacek

Member
Licensed User
Longtime User
Hello Erel,
I know that this loop is not a nice solution but sometimes on first load i get no items loaded.
But this is not my main prob.

What I am trying is that the user could move up and down in the list with the slider. Scrolling is functioning perfect.
If I move the seekbar nothing happens to the list, just the seekbar marker is moved and the marker gets bigger during sliding.
Event is not fired
B4X:
Sub B4XSeekBar1_ValueChanged (Value As Int, UserChanged As Boolean)
Any other idea?
thx
Georg
 
Upvote 0

gmachacek

Member
Licensed User
Longtime User
Hello Erel,
you can close the thread.
Stoping to try initializing the seek bar solved the prob.
Thx you
Georg
 
Upvote 0
Top