0

I cannot get a view outside the view hierarchy to update it's drawing state. I have a view that i handle the drawing and measuring of as i for a couple of reasons cannot let the container view do this. This works great until i start dealing with views that contain an animation. Even though i repeatedly draw the view it's animation does not change progress. Without knowing that much about the underlying view system i am guessing that this is because animations get updated during traversal of the view tree. because my view is not part of this tree it will not get updated.

The view i am talking about is the "sticky" view in this library https://github.com/emilsjolander/StickyListHeaders

The reason why i handle all drawing of this sticky view myself is because i cannot add i subview to the ListView. Wrapping the ListView together with the sticky view in a FrameLayout has also been tried (fixing this issue but causing other unwanted ones).

So what i want to know is if there is some way to manage all this myself, preferably without the use of reflection. I am also open to suggestions of how to let the underlying view system handle this view!

Emil Sjölander
  • 1,773
  • 4
  • 19
  • 27
  • animations are applied by a parent ViewGroup, thats why you see static views – pskink Jul 17 '13 at 12:05
  • Yeah, as i stated this was my guess. Any way to apply them myself? – Emil Sjölander Jul 17 '13 at 12:08
  • sure, see here how i animate Drawables: http://stackoverflow.com/questions/16729169/how-to-maintain-multi-layers-of-imageviews-and-keep-their-aspect-ratio-based-on – pskink Jul 17 '13 at 12:12
  • btw before starting anything can you add just a FrameLayout as a parent to your "orphan" view? – pskink Jul 17 '13 at 12:15
  • As i stated before, i have tried this but it caused a lot of other problems – Emil Sjölander Jul 17 '13 at 12:19
  • sorry, i misunderstood you, what about a custom ViewGroup then? what were those problems? – pskink Jul 17 '13 at 12:41
  • I cannot recall all of them but a big problem is that i want StickyListHeadersListView to be a listview subclass. 1. so it supports all the listview xml attributes and 2. so it can be used with existing listview code – Emil Sjölander Jul 17 '13 at 13:13
  • ok, so you probably do the animation stuff by yourself, did you find in my code where i do it? – pskink Jul 17 '13 at 13:32
  • I think so but don't really understand how this will help. I just have a reference to an arbitrary `View`. This view or any subview can have an active animation which i have no control over – Emil Sjölander Jul 17 '13 at 13:53
  • so like me, when you want to start the animation try to apply this animation to some Matrix and then set this Matrix to the Canvas you use to draw your view – pskink Jul 17 '13 at 15:22

0 Answers0