I have a widget that is using an alarmmanager to make frequent updates (when the phone is awake). Since the update requires hitting a local arduino webserver the update is being done in a service.
Based on the results want to set a TransitionDrawable to one layer or the other. Is there a way I can tell which layer is currently displayed so I can tell which direction and if I should transition at all?
I don't think there is something like that. you can try drawable.getLevel() and see if it helps. the transition drawable implementation in my experience doesn't offer more than start and the reset method, so i wouldn't put much effort into it.
if getLevel doesn't work just handle that with a flag marking your state, anyway you have to manually run it and there can only be 2 drawables set right?