2

I made a custom viewgroup, and I need to use view animation to rotate some views...

But they are misbehaving, no matter if I put the startanimation inside onDraw, onLayout or onMeasure, my views flicker (you see them briefly rotated, and then briefly non-rotated, and that pattern repeats).

How I fix that?

speeder
  • 6,197
  • 5
  • 34
  • 51

2 Answers2

0

see Android transfer animation of view in custom viewgroup and Animating Views

view.animate().rotation(180);
Community
  • 1
  • 1
eyeeye
  • 26
  • 1
  • 6
0

Does your animations work properly in a non-custom viewgroup?

I tried to use a custom ViewGroup in order to create an animated background, however, just like you, I had some strange behaviour. I solved it by simply using a FrameLayout and inserted two fill_parent views: a custom one and a LinearLayout. Then the LinearLayout which came on top of my custom view was working as expected.

Lumis
  • 21,517
  • 8
  • 63
  • 67
  • It works properly in non-custom viewgroup. But I need it to work inside the viewgroup. – speeder May 13 '11 at 16:42
  • I don't know if that is possible because the custom onDraw interferes with drawing of your View widgets children. – Lumis May 13 '11 at 16:52