ReVanced / revanced-manager

💊 Application to use ReVanced on Android
https://revanced.app
GNU General Public License v3.0
18.24k stars 748 forks source link

feat(Refresh Animation): Improve the refreshing animation #1568

Open ILoveOpenSourceApplications opened 11 months ago

ILoveOpenSourceApplications commented 11 months ago

Feature description

When refreshing Dashboard, the refresh animation that shows up is an incomplete circle animation instead of the traditional circling cycle animation on every other apps. (Don't judge me for phrasing it this way.)

What ReVanced Manager does:

https://github.com/ReVanced/revanced-manager/assets/117499019/b3601f3e-d398-4cf9-96e0-965141a7fbd8

What it should be doing:

https://github.com/ReVanced/revanced-manager/assets/117499019/d8a8207f-e3e0-4345-a464-f486c29fe7bc

Also, the refresh icon starts showing up all the way from the notification shade instead of showing up within the manager. It should start from the point in the Dashboard where the padding is when scrolling down.

Without scrolling: Screenshot_20231213_114911_ReVanced Manager

When scrolled down a bit: Screenshot_20231213_114730_ReVanced Manager

The refresh icon should start after the padded area of Dashboard, like it's coming from underneath the padded area.

Motivation

I checked out the examples provided in the repository and MaterialClassicHeader seems to be the one which was implemented in ReVanced Manager (or looks like what was intended). Correct me if I'm wrong. P.S: Attaching the gif for further clarity material_classic

Additional context

No response

Acknowledgements

ILoveOpenSourceApplications commented 7 months ago

@Domenic-MZS, maybe you can look into this one?

Domenic-MZS commented 7 months ago

Sorry for the delay, @ILoveOpenSourceApplications. I've been a bit busy lately.

Yup, I'd like to try this one. Let me handle this issue.

TL;DR The issue seems to be with the current layout, where the refresh indicator wraps the AppBar and Content, causing the subsequent overscroll to show the indicator over the scrollable app bar and content.

Long Version I think the ReVanced dashboard is using the `[RefreshIndicator]` widget which needs to wrap a scrollable, that when overscrolls shows a refresh jndicator, in this case it is a `[CustomScroll]` child having the `[SliverAppbar]` and then the `[SliverChildList]`, which is the reason for the "issue." Because the RefreshIndicator by default wraps the custom scroll in its extent, and has an edge property of 0 (which starts showing the indicator in that position), the indicator starts at the start, on the topmost position of the custom scroll (having the appbar and content )

It should be relatively easy to fix; it just needs a gap on the edge property (from which starts showing the refresh indicator) or by changing the layout.