Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is the Google Maps layout animated?

I am trying to understand what animation is used in the Google Maps application.

The part I am trying to understand is when you click on the textbox in the toolbar. The layout animates to present a completely new screen with a few items sliding in from the bottom.

How is this done? Is it a bottom sheet becoming visible? Is it a new activity with shared element transitions?

like image 750
An SO User Avatar asked Feb 21 '16 14:02

An SO User


People also ask

Is Google Map 3D or 2D?

Google Maps provides 3D maps of the entire planet. Manipulating a 3D map can be pretty graphics intensive, however, so the default mode is usually 2D. If you want to view your maps in 3D, here's what you'll need to do.

How does Google create its Maps?

Google Maps works with 1,000 third party sources from around the world to collect the data necessary to create accurate maps. Plus, governments can upload data directly to Google Maps, meaning the information you see is constantly updated.


1 Answers

That is called activity transitions. Where you choose which layouts should been moved to a second activity. See also the official documentation about animations: http://developer.android.com/training/material/animations.html#Transitions

Another good point to start it the video talk from the Google Developers: https://www.youtube.com/watch?v=RhiPJByIMrM

Basically you need to modify the style like here:

<style name="BaseAppTheme" parent="android:Theme.Material">
  <!-- enable window content transitions -->
  <item name="android:android:windowActivityTransitions">true</item>

  <!-- specify enter and exit transitions -->
  <item name="android:windowEnterTransition">@transition/explode</item>
  <item name="android:windowExitTransition">@transition/explode</item>

  <!-- specify shared element transitions -->
  <item name="android:windowSharedElementEnterTransition">
    @transition/change_image_transform</item>
  <item name="android:windowSharedElementExitTransition">
    @transition/change_image_transform</item>
</style>

You also need to specify a special attribute called android:transitionName to say the system that you want to move that from one activity to a second one.

like image 198
rekire Avatar answered Oct 24 '22 16:10

rekire