A window into transitions - Google I/O 2016

Android Developers · 31K views · 2016 · 39:55

Open on YouTube

Software (other)UX & UI designtalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering questions about Android shared element transitions, especially scaling a TextView and the overlay and clipping behavior of shared elements.

Recommended by 5 people across 5 different months, 2014 to 2020.

What it is

A Google I/O 2016 session from the Android Developers channel giving a deep dive into Android's transition APIs, covering content transitions and shared element transitions. It shows how to use the framework's built-in transitions and how to write custom ones, such as a text-resizing transition.

What people said

Recommends Alex Lockwood · 2014-11 · Stack Overflow · on “How can I scale textviews using shared element transitions?”

Edit: As pointed out by Kiryl Tkach in the comments below, there is a better solution described in this Google I/O talk [this video] . You can create a custom transition that animates a TextView 's text size as follows: public class TextSizeTransition extends Transition { private static final String PROPNAME_TEXT_SIZE = "alexjlockwood:transition:textsize"; private static final String[] TRANSITION_PROPERTIES = { PROPNAME_TEXT_SIZE }; private static final Property<TextView, Float> TEXT_SIZE_PROPERTY = new Property<TextView, Float>(Float.class, "textSize") { @Override public Float get(TextView textView) { return textView.getTextSize(); } @Override public void set(TextView textView, Float textSizePix

Recommends Alexander Perfilyev · 2016-12 · Stack Overflow · on “Reveal animation when open dialog like Whatsapp?”

Take a look at this open source library FabDialogMorph [LINK] Here's [this video] Nick Butcher explains mechanics behind it.

Recommends odiggity · 2017-07 · Stack Overflow · on “How can I scale textviews using shared element transitions?”

This was covered in one of the Google I/O 2016 talks [this video] . The source for the transition which you can copy into your code is found here [LINK] . If your IDE complains the addTarget(TextView.class); requires API 21, just remove the constructor and add the target either dynamically or in your xml. i.e. (note this is in Kotlin) val textResizeTransition = TextResize().addTarget(view.findViewById(R.id.text_view))

Recommends Kiryl Tkach · 2017-11 · Stack Overflow · on “How can I scale textviews using shared element transitions?”

Don't think that this code is correct because of the thrashing font cache. It is told here [this video] . This code will create a lot of cache with font size like 15.025 or 17.356, which will be never used in the future. The right way to do this is to swap text with drawable and after animation swap it back. Everything is told in this [this video] video.

Recommends Kamer358 · 2018-04 · Stack Overflow · on “shared element return wrong position when turn on "Dont keep activities" option in Setting”

Check out this video from Google I/O [this video] , and sample app on GitHub [LINK] DetailSharedElementEnterCallback [LINK] contains remapping

Cites ixx · 2018-07 · Stack Overflow · on “Shared element transition not showing on top”

I'm trying to run a shared element transition from a recycler view to a detail view containing a pager. Pretty much the same as in this blog post [LINK] . Everything works, except that the back-from-detail-to-overview animation is clipped to the overview recycler view cells. After watching this talk [this video] , I learned, that unless setSharedElementsUseOverlay is set to false on the activity's window, the transitions will run on an overlay that's on top of everything - the whole content of the activity if I understood correctly. So it should not be possible that the transition is hidden or clipped. I searched both for setSharedElementsUseOverlay and windowSharedElementsUseOverlay in my projec

Cites Shandor Hachimann · 2020-07 · Stack Overflow · on “How to properly scale TextView using Shared Element Transition like in Google I/O 2016 talk?”

I tried to make a transition between the two activities using a shared TextView as shown in Google I/O [this video] 2016, but it works strangely since the text doesn't seem to fit into some container and its edges get cut off when the animation plays, though nothing should interfere with its scaling. I was putting it in other containers and tried different combinations, but the result was exactly the same. That said, when I go back from the second activity to the first, everything works as it should. A class for scaling text, TextResize.java [LINK] , has also been added to the project and included in shared element transition set between two activities. How can I fix incorrect text scaling animat