Recreation of Custom scroll indicator like CRED app.
You can see origianl behaviour here
Recreation
Observe -> Think -> Initial Implementation -> Few iteration -> Finishing touch -> Refactoring -> Done
- One container view, three subviews which moves based on scroll view position (This is exactly how I did).
- There is also one shape (Diamond) which rotates based on scroll view position and also changes it's position. If you observe closely it rotates 360° from stat to end of scrolling.
- Outer view has gradient effect which changes when scroll view is being scrolled.
- All calculations are based on current scroll view offset position (in percentage).
Initial implementation was easy but took some effort to imeplement finishing touch, like,
- Managing gradient position while scrolling.
- Managing behaviour when overscrolling.
- Diamond rotation
NOTE: I created it for learning purpose because I felt it challenging when I saw it first time. The code represents only my thoughts on how it might have been done in the app, it does not reqpresent original implementation. Original credit goes to CRED app designer/devs.