مشخصات کتاب
-
Alex Shaw
-
2011
-
انگلیسی
-
2243
-
477
-
1
Android 3.0 Animations
Preface 1
Chapter 1: Animation Techniques on Android 7
An animated application: counting calculator 8
Time for action – learning to count with the counting calculator 8
Frame animation 10
Time for action – playing with the frames 11
Fancy frame animations 13
Simple fades using transition animations 14
Tweening 14
Time for action – finding tweens 15
The tween jazz band 15
Interpolations—meet the drummer 16
Animation sets—meet the conductor 16
Tweening elements in XML 16
What are tweens good at? 17
Animators – new in Android 3.0! 17
Beyond views: high-speed animating in 2 dimensions 19
Drawing loops 19
Doing your own housekeeping is hard 20
Where to use surfaces 21
What do views do anyway? 21
Time for action – let's draw views 21
Animating awesome 3D 27
Want to go faster? 28
Making a better application 30
Always be helpful 30
Small and powered by batteries 30
Summary 32
Chapter 2: Frame Animations 33
Making a frame animation 34
Time for action – the funky stick man 34
The anatomy of a frame animation 38
XML elements 38
<animation-list> 39
<item> 39
Timing 40
Images and Drawables 40
Screen size 41
Sometimes you run out of memory 41
Making frame animations in Java 43
Time for action – making the stick man interactive 43
Controlling frame animations 48
start() and stop() 48
AnimationDrawable.setVisible(true,true) 48
Creating new animations 48
Time for action – programmatically defined animation 48
More neat methods on AnimationDrawable 52
Working properly in the GUI thread 53
Animating a transition between frames 55
Time for action – make the transition 55
Writing XML for a transitionDrawable 59
<transition> 59
<item> 59
Working with other useful methods 60
startTransition(int duration) 60
reverseTransition(int duration) 60
resetTransition() 60
Summary 62
Chapter 3: Tweening and Using Animators 63
Greeting the tween 63
Time for action – making a tower of Hanoi puzzle 64
Defining starts and ends 67
Assembling the building blocks of a tween 68
Time for action – composing a tween animation 68
Taking a look at the different types of tween animation 74
<translate> 74
<rotate> 74
<alpha> 75
<scale> 75
Common attributes 76
Declaring tweens in the correct order 76
Making tweens that last for ever 77
Time for action – creating an everlasting tween 77
Animating layouts 81
Time for action – laying out blocks 81
Receiving animation events 83
Time for action – receiving animation events 84
Interpolating animations 86
Time for action – changing the rhythm with interpolators 86
Using the interpolators provided by Android 88
Linear interpolator 88
Accelerate interpolator 88
Decelerate interpolator 88
Accelerate-decelerate interpolator 88
Bounce interpolator 89
Anticipate interpolator 89
Overshoot interpolator 89
Anticipate overshoot interpolator 89
Cycle interpolator 89
Sharing interpolators 89
android:sharedInterpolator="true" 90
android:sharedInterpolator="false" 90
Creating and parameterizing interpolators 90
Finding out more 91
Summary 92
Chapter 4: Animating Properties and Tweening Pages 93
Note for developers using versions of Android before 3.0 94
Turning pages with a ViewFlipper 94
Time for action – making an interactive book 94
Creating tween animations in Java 103
Time for action – creating a tween in Java 104
Writing the SlideAndScale animation in Java 107
Writing the SlideAndScale animation In XML 107
Animating with ObjectAnimator 108
Time for action – animating the rolling ball 109
Constructing ObjectAnimators 111
Breaking down the construction of ballRoller 111
Getting and setting with ObjectAnimators 112
Animating values with ValueAnimator 113
Time for action – making a ball bounce 113
Updating the frame rate 117
Changing the interpolator 117
Time for action – improving our bouncing ball 117
Comparing animators and tweens 119
Advantages of animators 119
Advantages of tweens 119
Things that are common between animators and tweens 119
Summary 119
Chapter 5: Creating Classes for Tween Animation 121
Creating multi-variable Animators 121
Time for action – making an animated Orrery 122
The structure of the Orrery 129
Animating LayerDrawables 129
PropertyValuesHolder 130
Helpful ValueAnimator parameters 130
Using objects as parameters for value animations 130
Time for action – animating between objects 131
Using a TypeEvaluator 135
Setting Keyframes 135
Time for action – defining fixed points with Keyframes 136
Using the Keyframe 137
Keyframe timing 138
Combining Fragments and XML Animators 139
Time for action – adding a Description Pane 140
Declaring ObjectAnimator attributes 143
Customizing the interpolator classes 144
What do interpolators do? 144
Time for action – making a teleport interpolator 145
Interpolator value ranges 148
Summary 149
Chapter 6: Using 3D Visual Techniques 151
Understanding 3D graphics 151
Showing depth with 3D effects 153
Raising elements 153
Time for action – making a jigsaw with lifting pieces 153
Laying out the jigsaw 161
Special classes we created to help animation 162
Scaling the image with ScalableImageView.SetDepth 162
Moving pieces with PieceSwapper 162
Completing the animation with PieceSwapper.onAnimationEnd 163
Adding drop shadows 163
Time for action – using shadows with our jigsaw 163
Conjuring up a change in focus 167
Time for action – changing the focus of the jigsaw 167
Setting the image focus on a RaisableImageView 170
Applying image focus to the whole jigsaw 170
Creating 3D rotations 171
Time for action – spinning jigsaws 172
Examining Rotate3DAnimation.java 174
Extending a tween animation 176
initialize (int width, int height, int parentWidth, int parentHeight) 176
applyTransformation (float interpolatedTime, Transformation t) 176
Describing transformations with a Matrix (android.graphics.Matrix) 176
Doing 3D transformations with a Camera (android.graphics.Camera) 177
rotateX (float), rotateY (float), rotateZ (float) 177
translate (float x, float y, float z) 177
save() and restore() 177
Summary 179
Chapter 7: 2D Graphics with Surfaces 181
Introducing game loops 182
Drawing a surface on the screen 182
Time for action – animating bubbles on a surface 183
The design of the Bubbles application 193
Investigating Bubble.java 193
Investigating BubblesView.java 194
Seeing the game loop in action 195
Using a SurfaceView 196
Using a SurfaceHolder 196
lockCanvas 196
unlockCanvasAndPost 196
Using a SurfaceHolder.Callback 197
surfaceCreated (SurfaceHolder holder) 197
surfaceDestroyed(SurfaceHolder holder) 198
surfaceChanged(SurfaceHolder holder, int format, int width, int height) 198
Using the Canvas as an animation tool 199
Time for action – making more realistic bubbles 199
Getting to know the drawing tools in Canvas 204
drawBitmap and drawPicture 205
drawCircle 205
drawColor and drawPaint 205
drawLine and drawLines 205
drawOval and drawArc 205
drawPath 205
drawRect and drawRoundRect 205
drawText and drawTextOnPath 205
Using Paint effects 206
setAlpha 206
setAntiAlias 206
setColor 206
setStrokeCap 206
setStrokeWidth 206
setStyle 206
setTextAlign 207
setTextScaleX 207
setTextSize 207
setTypeface 207
Frame scheduling 207
Time for action – creating smooth game loops 207
Adjusting the frame duration 210
Taking the wait out of the game loop 210
Summary 212
Chapter 8: Live Wallpapers 213
Creating a live wallpaper 213
Time for action – making our first live wallpaper 214
Declaring a live wallpaper 219
How live wallpapers appear 219
Understanding services 220
WallpaperService 220
Adding interactivity to live wallpaper 223
Time for action – making soapy fingers 223
Enabling WallpaperService.Engine interaction 228
Registering live wallpaper interaction 228
Using live wallpaper preferences 230
Time for action – configuring a live wallpaper 231
Updating preferences as soon as they are set 237
Time for action – updating live wallpaper configuration 237
Connecting our wallpaper to our prefereces 239
Disconnecting our preferences when our wallpaper exits 239
How the user will see preferences 239
Storing preferences with SharedPreferences 240
Reading from SharedPreferences 240
Writing to SharedPreferences 240
OnSharedPreferenceChangedListener 241
Composing preference XML 241
Defining preferences in XML 241
Setting attributes on XML preferences 242
Summary 244
Chapter 9: Practicing Good Practice and Style 245
Using focus and metaphor 246
Looking at focus 247
Time for action – don't confuse me with animation! 247
Getting to grips with metaphors 250
Time for action – getting messages from houses 251
Focus, redux 254
Maintaining consistency within an application 254
Reducing power usage 255
Time for action – measuring battery usage with PowerTutor 256
Precise estimation 258
Changing the Application Viewer Timespan 258
PowerTutor-supported devices 258
Optimizing an animation for power 259
Looking for problems 259
Time for action – identifying a problem 259
Finding the power hogs 260
Time for action – tracing to find optimizations 261
Removing the gremlin 264
Time for action – squashing gremlins that use too much power 264
Optimizing using an easy recipe 267
Summary 270
Appendix: Pop Quiz Answers 271
Chapter 1: Animation Techniques on Android 271
View animations and Drawable animations 271
Putting it all together 271
Chapter 2: Frame Animations 272
Making frame animations 272
Controlling frame animations 272
Transition Drawables 272
Chapter 3: Tweening and Using Animators 272
All those tweens! 272
AnimationListeners 273
Interpolators 273
Chapter 4: Animating Properties and Tweening Pages 273
ViewFlippers 273
Java tweens 273
ObjectAnimators 273
Value Animators 273
Chapter 5: Creating Classes for Tween Animation 274
PropertyValueHolders, ObjectAnimators, and TypeEvaluators 274
Fragment Animation and XML Animators 274
Custom interpolators 274
Chapter 6: Using 3D Visual Techniques 274
Depth effects 274
3D rotations 274
Chapter 7: 2D Graphics with Surfaces 275
Surface animations 275
Chapter 8: Live Wallpapers 275
Live wallpapers 275
Interactivity 275
Preferences for live wallpapers 275
Chapter 9: Practicing Good Practice and Style 276
Usability 276
Power usage 276
Index 277
دانلود کتاب Beginning android 4
امروزه اندروید در بیشتر دستگاه ها ازجمله گوشی ، تبلت و کلا دستگاه هایی که با اندروید و زیرمجموعه Google میباشند همچنین اتومبیل ها ،صنایع هوایی در هواپیماها و روبات ها به کار گرفته شده است.به هرحال شکل ظاهری دستگاه هایی که با اندروید کار میکنند میتوانند به صورت دستگاه هایی با صفحه کوچک و یا بدون صفحه کلید (keyboard) باشند.
نویسنده: Grant Allen, Mark Murphy
زبان: انگلیسی