際際滷

際際滷Share a Scribd company logo
How Android APIs
evolved
Powered by

0
jueves, 23 de enero de 14
Index
+ Who i am?
+ The problem
+
+ Demo
+ Resumen
+Q&A
1
jueves, 23 de enero de 14
Who i am?

2
jueves, 23 de enero de 14
Enrique D鱈az
GDG AndroidTitlan founder
Android Hacker

3
jueves, 23 de enero de 14
The problem

4
jueves, 23 de enero de 14
The problem

5
jueves, 23 de enero de 14
Aha!

6
jueves, 23 de enero de 14
How we implement
HomeScreen-like
functionality?

7
jueves, 23 de enero de 14
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
Demo

9
jueves, 23 de enero de 14
Yes, it hurts

Worse, its not
what i want
ed

10
jueves, 23 de enero de 14
Download the code
here:
https://github.com/nRike/
Swipe-with-ViewFlip--.git

11
jueves, 23 de enero de 14
How we implement
HomeScreen-like
functionality?

12
jueves, 23 de enero de 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
Demo

14
jueves, 23 de enero de 14
Yes, it doesnt
hurts

it is what i
wanted!

15
jueves, 23 de enero de 14
Download the code
here:
https://github.com/nRike/
SimpleViewPager.git

16
jueves, 23 de enero de 14
Q&A

17
jueves, 23 de enero de 14
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
How Android APIs
evolved

Thank you!

19
jueves, 23 de enero de 14

More Related Content

How Android API's evolved: Viewflipper vs ViewPager