9. ViewFlipper+ GestureDetector
+Animations
Lots of things to do here!
0. Create an object which extends from ViewFlipper.
1. In order to recognize gestures, we need an object which
extends GestureDetector.
2. Also we need gestureListener interface to recognize when
user has touched the screen.
3. From each XML file, we define 4 animations( left intro, left
outro, right intro, right outro ).
4. Create a class which extends from SimpleOnGestureListener,
then add business logic to start an animation based on fling
direction.
5. Last, we define a ViewFlipper element from XML which
contains layouts that gets animated based in business logic.
jueves, 23 de enero de 14
8
14. PageAdapter + ViewPager
Lots of fun to enjoy here!
0. We create a class which extends PageAdapter, then
assign the amount of existing elements to swipe and inflate
them.
1. Create an element in XML which extends from
android.support.v4.view.ViewPager.
2. Assign our PageAdapter to a ViewPager object in our
main Activity.
3. We create each resource through XML.
4. Theres no step 4.
13
jueves, 23 de enero de 14
19. Resume
0. Use the latest API
level, because theres
lots of awesome APIs
to write less code and
DO MORE.
1. Simple is better.
2. Think users first and
last.
3. Keep calm and
Gagnam Style
jueves, 23 de enero de 14
18