Android Question [B4X] CustomListView - Ensure that the last item is fully visible

LucaMs

Expert
Licensed User
Longtime User
B4X:
'mCLV is a CustomListView, obviously'

    Dim pnlItem As B4XView
    pnlItem = mCLV.GetRawListItem(mCurrentSelectedIndex).Panel
    If pnlItem.Top + pnlItem.Height + mCLV.DividerSize > ??? Then
        Log("Not fully visible")
    End If

This is also a "Wish" about CLVs. It would be very useful if on touch (or selection, when using the CLVSelections class) the item was automatically repositioned so that it is fully visible.

I don't know if the code I posted is the right way and what to write instead of ???

P.S. Also, I haven't figured out what to write inside the "If" block yet; JumpTo wouldn't be "correct".
P.P.S. I'm hungry and I ran out of frozen pizza ? :confused:
 

Alexander Stolte

Expert
Licensed User
Longtime User
This is also a "Wish" about CLVs. It would be very useful if on touch (or selection, when using the CLVSelections class) the item was automatically repositioned so that it is fully visible.
something like this?
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
or look at this, it's a simple routine
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
or look at this, it's a simple routine
I'll try to study the code, as I don't need the functionality of the class.

A couple of general observations:

[B4X] SnapCLVAdvanced - Move to the nearest item - Instant snap​

I would much prefer that if someone adds functionality to the classes or libraries created by Erel, Erel implements/adds them, rather than having two different but very similar classes.
This is both to avoid having almost duplicate "objects", and because, above all, I believe that many members (including me) prefer to use official "stuff" (created by Erel), for some reasons.
I myself am modifying the CLVSelections class (so that it has a particular functionality for B4J and I could add the thread theme functionality, but the latter should not be in this class) but then I would prefer to submit the modified class to Erel and for him to accept changes, rather than publishing the class with a slightly different name.

It would be good if CLV had already incorporated these features.
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I'll try to study the code, as I don't need the functionality of the class.
because...
if on touch (or selection, when using the CLVSelections class)

It is quite different; not at the end of scrolling, but when the item is "selected" (touched, if you do not use the CLVSelections class. This functionality, the selection, single temporary or permanent, multiple, should also be part of the basic CLV, without having to use extension classes).
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
or look at this, it's a simple routine

Almost certainly (I have yet to try) I only needed this:

1722868201428.png
 
Upvote 0
Top