Hi All. It would be nice to insert this effect, that is that when a clv slides, the lower part "turns on" and the upper part "turns off", and vice versa, going down the upper part "turns on" the lower part "turns off". Any idea. ( Already tried with panels 50% of the screen, they do not give the same effect )
You need to add a semi-transparent panel over each item and make it transparent when the item is in the middle. You should use the ScrollChanged event for this.
Better implementation based on incremental changes to the alpha level.
B4X:
Private Sub CLV1_ScrollChanged (Offset As Int)
For i = 0 To CLV1.Size - 1
Dim item As CLVItem = CLV1.GetRawListItem(i)
Dim a As Float = Max(0, Min(1, 1 - Abs(item.Offset - Offset) / (0.8 * CLV1.AsView.Height)))
Log(a)
SetAlpha(item.Panel, a)
Next
End Sub
Better implementation based on incremental changes to the alpha level.
B4X:
Private Sub CLV1_ScrollChanged (Offset As Int)
For i = 0 To CLV1.Size - 1
Dim item As CLVItem = CLV1.GetRawListItem(i)
Dim a As Float = Max(0, Min(1, 1 - Abs(item.Offset - Offset) / (0.8 * CLV1.AsView.Height)))
Log(a)
SetAlpha(item.Panel, a)
Next
End Sub
I tested with a PreoptimizedCLV. It works well even in debug mode. I placed the call here:
B4X:
CLV1_ScrollChanged(0) 'placed call here
PCLV.Commit
The only issue is , you cannot use: Sub PCLV_HintRequested (Index As Int) As Object
When you scroll using the hint requested, you get a blank screen, no items display whether in debug or release mode.