Android Question Effect CLV

MarcoRome

Expert
Licensed User
Longtime User
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 )

Thank you
Have a nice day


Screenshot_20210111-065346_Netflix.jpg
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1610349982122.png


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
SetAlpha: https://www.b4x.com/android/forum/t...iews-alpha-level-transparency.123209/#content
 

Attachments

  • 1.zip
    114.8 KB · Views: 142
Upvote 0

MarcoRome

Expert
Licensed User
Longtime User
Upvote 0

Mahares

Expert
Licensed User
Longtime User
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.
 
Upvote 0
Top