Skip to content

dynamicItemOpacity sometimes does not work on Android device #18

Description

@suhirotaka

Hello,

I really like your plugin, thank you!

I found dynamicItemOpacity sometimes does not work on Android device.
After some digging, I found difference in calculateOpacity is very small non-zero value (1.8189894035458565e-12) in case of dynamicItemOpacity not working, whereas difference is zero in normal case.

double calculateOpacity(int index) {
//scroll-pixel position for index to be at the center of ScrollSnapList
double intendedPixel = index * widget.itemSize;
double difference = intendedPixel - currentPixel;
return (difference == 0) ? 1.0 : widget.dynamicItemOpacity ?? 1.0;
}

Here are screenshot videos which show different opacity behavior of the last item.

OK:

2021-08-19.16.43.01.mov

not OK:

2021-08-19.16.44.31.mov

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions