romainpiel / Shimmer-android

(DEPRECATED) An Android TextView with a shimmering effect
2k stars 438 forks source link

added onSizeChanged() in Button/TextView to make sure the LinearGradient will be reset #8

Closed Keanu closed 10 years ago

Keanu commented 10 years ago

Hi, I added onSizeChanged() in both Button and TextView components to make sure the ineargradient property will be reset properly.

If the Button/TextView changed visibility from GONE to VISIBLE, should call resetLinearGradient() again.

romainpiel commented 10 years ago

Thanks for changing branch.

I think we can remove what we have in onAttachedToWindow(). Your code will call callback.onSetupAnimation() twice when the view is built.

Keanu commented 10 years ago

Hi, I think the onAttachedToWindow() could be removed.

Whatever the view is GONE or INVISIBLE, it will finally go through onSizeChanged() when the view is "ready" with VISIBLE, so we can just call callback in onSizeChanged().

romainpiel commented 10 years ago

yep. I guess it would make sense you add that to the pull request as it comes with your change. I'll merge after that. cheers!

Keanu commented 10 years ago

Hi, just updated changes for this pull request, please check that, thanks.