Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Material design transitions

I want to replicate the transitions as explained in Material design by Google. This is the link for the preview, but basically the videos I care about are those two:

  1. http://material-design.storage.googleapis.com/videos/animations-meaningfultransitions-hierarchical_transitions_topLevel_large_xhdpi.webm
  2. http://material-design.storage.googleapis.com/videos/animation-meaningfultransitions-view_contact_large_xhdpi.webm

My question is what is the container of the UI? Is this a new Activity which onCreate has animations for each element or is it a fragment?

In particular on the second example there is some movement on the 1st Activity so inside the onClick is there an animation which also creates a 2nd activity? (note that the clicked name also moves, so this should not be a new activity)

In other words what the layout (+Activities, fragments) should be if I want to replicate this?

like image 769
Diolor Avatar asked Jul 28 '14 13:07

Diolor


People also ask

What is transition in Android?

Android's transition framework allows you to animate all kinds of motion in your UI by simply providing the starting layout and the ending layout.

Does Android use material design?

Android provides the following features to help you build material design apps: A material design app theme to style all your UI widgets. Widgets for complex views such as lists and cards. New APIs for custom shadows and animations.

Is there a need for transitions in navigation explain your answer?

They help users orient themselves by expressing your app's hierarchy, using movement... Navigation transitions use motion to guide users between two screens in your app. They help users orient themselves by expressing your app's hierarchy, using movement to indicate how elements are related to one another.


3 Answers

Maybe too late but I have found support library contains ActivityOptionsCompat: https://developer.android.com/reference/android/support/v4/app/package-summary.html
It contains activity animations like scale up animations. Hope this helps.

like image 95
sagus_helgy Avatar answered Oct 21 '22 00:10

sagus_helgy


This one have transitions.

Hope you'll extract transitions from there.

Guide - http://antonioleiva.com/material-design-everywhere/
Code - https://github.com/antoniolg/MaterialEverywhere

like image 5
Inoy Avatar answered Oct 20 '22 22:10

Inoy


I guess they could be implemented with fragments but I might suspect they would be separate activities. Android L introduces Activity Transitions as part of the Animation framework. In particular, there transitions can contain shared UI elements, which indicate mappings between "corresponding" views in the caller and called activities. The transition is then included as part of the ActivityOptions object passed to startActivity().

The idea is to achieve the visual effect in those videos (i.e. of particular views changing positions or dimensions as part of an activity transition). The canonical example would be a Gallery app, when transitioning from the grid that shows all images to displaying a particular one.

This could be achieved before (please check this answer or this DevBytes video by Chet Haase) but it was rather complex/hacky so it was included as a standard resource in Android L.

Check the documentation for Activity Transitions in the L preview documentation, or the ActivitySceneTransitionBasic included as part of the android-L samples (also remember that you can download the L reference preview from here to get the documentation for the new methods).

like image 4
matiash Avatar answered Oct 20 '22 23:10

matiash