Question about time

EduardoElias

Active Member
Licensed User
Longtime User
Question about timer

Please,

I have read other timer related question but i could not find an answer for what is happening for me.

I have a class (in a library) that set a timer for a panel animation, moving the panel, when the panel is in the proper place it stops the timer, and it is working perfect.

Many subs call can happen meanwhile, and depends where the code goes there is a situation that the programs needs to do another panel animation.

For that, now, I am entering in a while doevents loop in a hope that the first animation stops and I can start the second.

The problem is that seems that the Timer is ticking anymore, i was expecting the tick event happen whatever the program could be doing. If i remove this need of waiting the timer ticks and the animation happens.

I know it will be suggested to make an event, when the first finish call when the animation is done giving a chance for the second start.

But in this case this is not possible, the code is far away in a context that it should not even care about that.

However, my question is: does timer depend on a loop event of something like that? Since it seems to stopping.

Just came a thought, could be the screen refresh? The timer executed and the views did not get the time for refresh it self, if based on a message loop?

Please, any hint?

Regards

Eduardo Elias
 
Last edited:

EduardoElias

Active Member
Licensed User
Longtime User
DoEvents only handle UI related messages. The Timer_Tick event will not fire until the loop ends. Such loops do not work.

Why don't you use the animation library to move the panel?

yeah, I was in doubt about the animation and doing it by the timer, got the wrong way. I will be moving back to animate soon on this case.

However I was not sure about the Timer, so it is not fired by interruption or something, is it based on some android core processing loop. That explain the behavior.

Thank you for the clarification, I could not find that on the forum by searching.

Eduardo
 
Upvote 0

EduardoElias

Active Member
Licensed User
Longtime User
DoEvents only handle UI related messages. The Timer_Tick event will not fire until the loop ends. Such loops do not work.

Why don't you use the animation library to move the panel?

please, is animation library dependent on event loop? Is it going to stop like timers if I enter in a processing loop?

Thank you
 
Upvote 0
Top