├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── misc.xml ├── modules.xml ├── scopes │ └── scope_settings.xml └── vcs.xml ├── README.md ├── TransitionExample.iml ├── TransitionExample ├── .gitignore ├── TransitionExample-TransitionExample.iml ├── build.gradle ├── proguard-rules.txt └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── bignerdranch │ │ └── android │ │ └── transitionexample │ │ ├── TransitionActivity.java │ │ └── TransitionFragment.java │ └── res │ ├── drawable-hdpi │ ├── bnr_hat.png │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── activity_transition.xml │ ├── fragment_transition_scene_1.xml │ └── fragment_transition_scene_2.xml │ ├── menu │ └── transition.xml │ ├── transition │ ├── slow_auto_transition.xml │ └── transition_manager.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | TransitionExample -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 21 | 22 | 23 | 24 | Android API 19 Platform 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | Android API 19 Platform 37 | 38 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/scopes/scope_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | AndroidTransitionExample 2 | ======================== 3 | 4 | This project demonstrates use of android.transition framework. 5 | An earlier version of this project was presented on January 16, 2014 at the Dutch Android User Group event 6 | [Hands-on with Android KitKat and Google Play Services](http://www.meetup.com/dutch-aug/events/154627662/). 7 | Blog post soon at [Big Nerd Ranch Blog](http://blog.bignerdranch.com). 8 | -------------------------------------------------------------------------------- /TransitionExample.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /TransitionExample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /TransitionExample/TransitionExample-TransitionExample.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /TransitionExample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'android' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion "19.0.1" 6 | 7 | defaultConfig { 8 | minSdkVersion 19 9 | targetSdkVersion 19 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | runProguard false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | } 20 | 21 | dependencies { 22 | } 23 | -------------------------------------------------------------------------------- /TransitionExample/proguard-rules.txt: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the ProGuard 5 | # include property in project.properties. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} -------------------------------------------------------------------------------- /TransitionExample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /TransitionExample/src/main/java/com/bignerdranch/android/transitionexample/TransitionActivity.java: -------------------------------------------------------------------------------- 1 | package com.bignerdranch.android.transitionexample; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.transition.Scene; 6 | import android.transition.TransitionInflater; 7 | import android.transition.TransitionManager; 8 | import android.view.Menu; 9 | import android.view.MenuItem; 10 | import android.view.View; 11 | import android.view.ViewGroup; 12 | 13 | public class TransitionActivity extends Activity { 14 | private TransitionManager mTransitionManager; 15 | private Scene mScene1; 16 | private Scene mScene2; 17 | 18 | @Override 19 | protected void onCreate(Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | setContentView(R.layout.activity_transition); 22 | 23 | if (savedInstanceState == null) { 24 | getFragmentManager().beginTransaction() 25 | .add(R.id.container, new TransitionFragment()) 26 | .commit(); 27 | } 28 | ViewGroup container = (ViewGroup)findViewById(R.id.container); 29 | TransitionInflater transitionInflater = TransitionInflater.from(this); 30 | mTransitionManager = transitionInflater.inflateTransitionManager(R.transition.transition_manager, container); 31 | mScene1 = Scene.getSceneForLayout(container, R.layout.fragment_transition_scene_1, this); 32 | mScene2 = Scene.getSceneForLayout(container, R.layout.fragment_transition_scene_2, this); 33 | } 34 | 35 | public void goToScene1(View view) { 36 | mTransitionManager.transitionTo(mScene1); 37 | } 38 | 39 | public void goToScene2(View view) { 40 | mTransitionManager.transitionTo(mScene2); 41 | } 42 | 43 | @Override 44 | public boolean onCreateOptionsMenu(Menu menu) { 45 | 46 | // Inflate the menu; this adds items to the action bar if it is present. 47 | getMenuInflater().inflate(R.menu.transition, menu); 48 | return true; 49 | } 50 | 51 | @Override 52 | public boolean onOptionsItemSelected(MenuItem item) { 53 | // Handle action bar item clicks here. The action bar will 54 | // automatically handle clicks on the Home/Up button, so long 55 | // as you specify a parent activity in AndroidManifest.xml. 56 | int id = item.getItemId(); 57 | if (id == R.id.action_settings) { 58 | return true; 59 | } 60 | return super.onOptionsItemSelected(item); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /TransitionExample/src/main/java/com/bignerdranch/android/transitionexample/TransitionFragment.java: -------------------------------------------------------------------------------- 1 | package com.bignerdranch.android.transitionexample; 2 | 3 | import android.app.Fragment; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | /** 10 | * A placeholder fragment containing a simple view. 11 | */ 12 | public class TransitionFragment extends Fragment { 13 | 14 | public TransitionFragment() { 15 | } 16 | 17 | @Override 18 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 19 | Bundle savedInstanceState) { 20 | View rootView = inflater.inflate(R.layout.fragment_transition_scene_1, container, false); 21 | return rootView; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /TransitionExample/src/main/res/drawable-hdpi/bnr_hat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bolot/AndroidTransitionExample/cc4087352b28a8b590076953da6d2246df2383be/TransitionExample/src/main/res/drawable-hdpi/bnr_hat.png -------------------------------------------------------------------------------- /TransitionExample/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bolot/AndroidTransitionExample/cc4087352b28a8b590076953da6d2246df2383be/TransitionExample/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /TransitionExample/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bolot/AndroidTransitionExample/cc4087352b28a8b590076953da6d2246df2383be/TransitionExample/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /TransitionExample/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bolot/AndroidTransitionExample/cc4087352b28a8b590076953da6d2246df2383be/TransitionExample/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /TransitionExample/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bolot/AndroidTransitionExample/cc4087352b28a8b590076953da6d2246df2383be/TransitionExample/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /TransitionExample/src/main/res/layout/activity_transition.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /TransitionExample/src/main/res/layout/fragment_transition_scene_1.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 23 | 24 |