Thursday, February 9, 2012

Hello World !

This is my first blogging activity ever and I feel so excited about it.

So, as a warm up, let's get our hands dirty in some ANDROID issue that confused me for a while.

SlidingDrawer is a very interesting and useful tool that acts the same as a desk drawer.

It contains a layout but the layout, and of course its contents, can't be seen except if the drawer is openned/dragged.

well, what I found out was that :

animateOpen() behaves the same as animateClose() and both behave the same as animateToggle(), meaning, for example, that if the drawer is already opened and animateOpen() is executed then the drawer will be closed and so on which is not supposed to be done.

the only difference that I could notice was the speed of the animation:

animateOpen(), the animation while opening is faster than the animation while closing.
animateClose(), the animation while closing is faster than the animation while opening.
animateToggle(), both speeds are equal.

So, to solve this, just check the state of the drawer using (isOpened()) before each animation.

That's it, don't hesitate to comment, to share your knowledge and to correct me.

0 comments:

Post a Comment