Skip to main content

Posts

Showing posts with the label animation

Google I/O 2014: Rehash

All of the videos have been posted from the various sessions I was in this year. Here they are, along with links to the slides. What's new in Android A presentation with  +Dan Sandler  that provides a quick overview of some of the larger features and new APIs in the L Developer Preview release and other new bits in the recent Androidosphere. There's also a really good deep-dive into Notifications, since Dan's the non-local expert on the subject. Slides (PDF) Material science This session, presented with  +Adam Powell , provides an overview of the engineering side of the Material design system. Many of the other sessions at Google I/O this year discussed the design side; this presentation covers the technical details of the APIs and the capabilities exposed by the framework for Android developers. Slides (PDF) Material witness I was happy to be joined once again by former Android developer and UI Toolkit team lead  +Romain Guy  for this talk on some of the new Ma...

Android KitKat: Developer Info

We just released Android KitKat and posted lots of information about it: Developer highlights: http://developer.android.com/about/versions/kitkat.html Android Developers Blog: http://android-developers.blogspot.com/2013/10/android-44-kitkat-and-updated-developer.html Videos (an overview one plus lots of others that dive deeper into specific features): https://www.youtube.com/watch?v=sONcojECWXs&list=PLWz5rJ2EKKc-2quE-o0enpILZF3nBZg_K&index=1 I'll specifically call out the video on Transitions, which is something I recorded last week after finally finishing the feature. I hope that the API is another step toward making animations easier and more automatic in Android applications.

DevBytes: Cartoon Animation Techniques

This time, we wrap up the series on cartoon animation techniques with a demo that shows a few of the techniques in the context of a larger application. Because it's nice to know how to write the code, but you might also be wondering why you might want to. For some real-world context, you could also check out games such as Candy Crush Saga (a horribly addictive game I've gotten sucked into that's less like casual gaming and more like casual crack). It uses a veritable plethora of cartoon animation techniques to keep the player engaged with the game and disengaged from their life. This and other cartoon animation techniques were discussed in the talk A Moving Experience at Google I/O 2013 Code: http://developer.android.com/shareables/devbytes/ToonGame.zip YouTube: https://www.youtube.com/watch?v=8sG3bAPOhyw&list=PLWz5rJ2EKKc_XOgcRukSoKKjewFJZrKV0

DevBytes: Squash & Stretch

Cartoon animation uses a technique called "squash & stretch" for achieving different effects of objects interacting with their environment. This episode shows how we can use similar techniques to get more organic and lively animations in user interfaces. This and other cartoon animation techniques were discussed in the talk A Moving Experience at Google I/O 2013. Code: http://developer.android.com/shareables/devbytes/SquashAndStretch.zip YouTube: https://www.youtube.com/watch?v=wJL1oW6DlCc Or, in illustrated form:

DevBytes: Anticipation & Overshoot, Part 2

Like my previous DevBytes episode, Anticipation and Overshoot, Part I ," this episode covers cartoon animation techniques for making UI elements more engaging and playful. The code in this episode shows how to change and animate how a button is drawn to make it seem more alive and organic. This and other cartoon animation techniques were discussed in the talk A Moving Experience at Google I/O 2013. Code: http://developer.android.com/shareables/devbytes/Anticipation.zip YouTube: DevBytes: Anticipation and Overshoot - Part 2

New in Android 4.3: ViewOverlay

Since we just released Android 4.3 yesterday, I thought I'd wax poetic about one of the features I worked on in the release: Overlays. Android devs Come out to play: Use the new ViewOverlay. There are many ways to get custom graphics (drawables) to appear in a view. You can set a background drawable if that's what you want, or you can use an ImageView, or you can create a custom View subclass and override onDraw(). Or if you want to draw them over the children in a layout, you can override the layout and override dispatchDraw() to draw them after all of the children (after a call to super.dispatchDraw()). But sometimes you just want something simpler: ViewOverlay . Here's how it works: You call View.getOverlay() , which returns a ViewOverlay object. Then you call add(Drawable) on that overlay object... and that's it. You can also call remove(Drawable) to get rid of the drawable or clear() to get rid of everything in the overlay, but that's the entire API. The only o...

DevBytes: Anticipation and Overshoot, Part 1

Some principles of cartoon animation can be used to provide more engaging and more interactive experiences in applications. This episode demonstrates principles of anticipation and overshoot with a simple button click, showing how to animate changes in the button's appearance to make it interact more playfully with the user. This and other cartoon animation techniques were discussed in the talk A Moving Experience at Google I/O 2013 Code: http://developer.android.com/shareables/devbytes/LiveButton.zip YouTube: https://www.youtube.com/watch?v=uQ7PTe7QMQM

DevBytes: Curved Motion

This is a demo that +Romain Guy and I showed in our A Moving Experience talk at Google I/O this year, showing how to use the existing TypeEvaluator and Animator APIs to get curved motion for your animations. In the real world, things don't move in straight lines. Moving items around on the screen should feel as natural as possible; sometimes curved motion can help. This episode shows how to use the existing animation APIs to get easy curved motion for your UIs. The helper classes come from an article I posted on my blog last year: http://graphics-geek.blogspot.com/2012/01/curved-motion-in-android.html YouTube: https://www.youtube.com/watch?v=JVGg4zPRHNE Code: http://developer.android.com/shareables/devbytes/CurvedMotion.zip

DevBytes: Animating Multiple Properties in Parallel

Suppose you want to animate multiple properties in parallel on some target object. How would you do it? ValueAnimator? Multiple ObjectAnimators? This episode covers different ways of animating multiple properties, and specifically covers the use of the lesser-known PropertyValuesHolder class. YouTube: https://www.youtube.com/watch?v=WvCZcy3WGP4 Code: http://developer.android.com/shareables/devbytes/MultiPropertyAnimations.zip

DevBytes: Animating ListView Deletion: Now on Gingerbread!

In this episode, I tried to anticipate the question I knew would come up on my previous show about animating ListView deletion: "But how would I do this on Gingerbread?" Here's how. YouTube: https://www.youtube.com/watch?v=PeuVuoa13S8&list=PLWz5rJ2EKKc_XOgcRukSoKKjewFJZrKV0&index=1 Code: http://developer.android.com/shareables/devbytes/ListViewItemAnimations.zip

DevBytes: Animating ListView Deletion

It's Friday: must be time for another DevBytes episode. Finally, here is the DevBytes episode around the ListView animation demo in the talk A Moving Experience that I gave with Romain Guy at Google I/O last month. The code is nearly the same as that in the I/O talk, except I tweaked it to make it more general-purpose. Specifically, it no longer depends on the setHasTransientState() method (introduced in Jellybean 4.1) to keep the views around while fiddling with layout. Instead, it uses an adapter with stable itemIds, and uses those Ids to track where the content is before and after layout. As written, the code is still dependent on Android 4.1, but that's only because of the use of ViewPropertyAnimator.withEndAction() method, which is really just syntactic sugar around adding a listener and running the end-action code in the onAnimationEnd() callback. So you could totally port this code all the way back to Android 3.1 (when ViewPropertyAnimator was introduced) or even 3.0 (...

DevBytes: Custom Activity Animations

It's Friday: time for another DevBytes. It's been a while, but they're back. At least until the queue runs out again and I write another glut of demos to talk about. This episode, and most of the upcoming ones (teaser alert!) are around demos/code that we showed in A Moving Experience, the animation talk that +Romain Guy and I gave at Google I/O 2013. Custom Activity Animations : Window animations provide an easy way to animate transitions between activities. The animations can be customized to some extent, but there's only so much interaction between the launching and launched activities that you can take advantage of with the standard window animations. This episode covers a different technique for fully customizable animations. Video: http://www.youtube.com/watch?v=CPxkoe2MraA Code: http://developer.android.com/shareables/devbytes/ActivityAnimations.zip

Google I/O Presentations Now Live

Romain Guy and I gave two talks at Google I/O yesterday which are now live on YouTube: Android Graphics Performance: http://www.youtube.com/watch?v=vQZFaec9NpA Slides for Android Graphics Performance are posted on Romain's blog . A Moving Experience: http://www.youtube.com/watch?v=ihzZrS69i_s A Moving Experience Slides: Keynote PDF PDF with speaker notes The code from the animation demos will be posted soon, probably in conjunction with future DevBytes episodes.

DevBytes: Layout Transitions

The LayoutTransition class (added in Android 3.0) enables easy fade/move/resize animations when items are added to or removed from a ViewGroup, usually with just one line of code. This video shows how this works and also shows the new ability added in JellyBean (Android 4.1) to animate other changes to the layout as well, not limited to items being added or removed. YouTube: https://www.youtube.com/watch?v=55wLsaWpQ4g Code: http://developer.android.com/shareables/devbytes/LayoutTransChanging.zip

DevBytes: PictureViewer

PictureViewer: How to use ViewPropertyAnimator to get a cross-fade effect as new bitmaps get installed in an ImageView. TransitionDrawable is a handy and easy facility for cross-fading between two drawables. But if you want to cross-fade between an arbitrary set of images, you might want something more general-purpose. Here's one approach. YouTube: https://www.youtube.com/watch?v=9XbKMUtVnJA Code: http://developer.android.com/shareables/devbytes/PictureViewer.zip

DevBytes: ListView Deletion

How animating ListView views can lead to artifacts if those views are recycled before you animate them. YouTube: https://www.youtube.com/watch?v=NewCSg2JKLk Code: http://developer.android.com/shareables/devbytes/ListViewDeletion.zip

DevBytes: ListView Animations

How animating ListView items can lead to problems as views are recycled, and how to perform these types of animations correctly with new API added in Jellybean. Code: http://developer.android.com/shareables/devbytes/ListViewAnimations.zip YouTube: https://www.youtube.com/watch?v=8MIfSxgsHIs

DevBytes: KeyFrame Animations

How to use AnimationDrawable to construct a keyframe animation where each frame is shown for a specified duration. YouTube: http://www.youtube.com/watch?v=V3ksidLf7vA Code: http://developer.android.com/shareables/devbytes/KeyframeAnimation.zip

DevBytes: Bounce Animations

Simple uses of ValueAnimator, ObjectAnimator, and interpolators to control how a shape is moved around on the screen. Code:  http://developer.android.com/shareables/devbytes/Bouncer.zip Video:  https://www.youtube.com/watch?v=vCTcmPIKgpM

DevBytes: Short, Focused Android Tutorials

The Android team has just rolled out the first four shows in a new series called DevBytes, which is intended to be very short, focused tutorials on specific developer topics. A quick explanation, maybe a demo, and a few lines of code to walk through and it's done. Taking a break from work? Want to learn something new? Or just wonder how a specific piece of technology works on the platform? Tune into one of the DevBytes episodes to get a quick deep dive into that exact topic (well, assuming we've done a show on that topic. Maybe we could interest you in one of the shows that we've actually filmed yet instead?) The first few of these feature ... me! (Surprise, surprise!) I'll be doing many of these tutorials over time, especially in the areas of animation, graphics, and UI development, starting with this first set: ViewAnimations : This show covers the basics of creating and running pre-3.0 Animations on View objects. PropertyAnimations : This show parallels the ViewAnima...