romainpiel / Shimmer-android

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

Can this work with arbitrary views? #1

Closed yuchi closed 10 years ago

yuchi commented 10 years ago

Currently the Shimmer is just a TextView on Steroids. Couldn’t it support any view and views hierarchy as the original iOS version does?

romainpiel commented 10 years ago

Not sure how the iOS version works but I don't see any other way to do that on android without custom views. So I could add classes for button and edittext if you want.

yuchi commented 10 years ago

In iOS I can put inner views in the Shimmer view and they will be shimmed too. If you provided a simple View I could put whatever I want inside it and make them shimmed.

Hint: I’m not developing on Android, but on Titanium SDK, which has its own Button/TextView etc.

romainpiel commented 10 years ago

Ok I have an idea to solve that but I'm not sure you'll be able to apply that to titanium as you need at least a paint to apply the effect to. I'll see that next week.

yuchi commented 10 years ago

Actually I made it work. https://github.com/yuchi/TiShimmer/blob/master/Android/src/it/ti/shimmer/ShimmerView.java#L199 As you can see it is also possible to actually shim the view without using an overlay.

romainpiel commented 10 years ago

Looking good mate. I'm going to leave the focus on the TextView and add a way to apply the effect on arbitrary views. Thanks anyway

yuchi commented 10 years ago

The only problem I’m facing is that it shims away the whole canvas, also the underlaying (parent) views…

romainpiel commented 10 years ago

Added ShimmerButton in version 1.2.0 if you need a custom view. I won't add a more complex way for this purpose.

yuchi commented 10 years ago

Don’t worry, already solved this re-inventing the wheel :) That’s a shame that Android does not have a separate concept for views-hierarchy and rendering-tree, on iOS it’s way easier.