Add a sample showing the use of Transition along with AdapterViews
Change-Id: I14cc29445f511cb154b8a5dfd3ff3a10a898a039
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/AndroidManifest.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..01b414d
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/AndroidManifest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.example.android.adaptertransition"
+ android:versionCode="1"
+ android:versionName="1.0">
+
+ <uses-sdk
+ android:minSdkVersion="19"
+ android:targetSdkVersion="19"/>
+
+ <application
+ android:allowBackup="true"
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme">
+ <activity
+ android:name="com.example.android.adaptertransition.MainActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+ </application>
+
+</manifest>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/AdapterTransitionFragment.java b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/AdapterTransitionFragment.java
new file mode 100644
index 0000000..525ed40
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/AdapterTransitionFragment.java
@@ -0,0 +1,244 @@
+/*
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.adaptertransition;
+
+import android.os.Bundle;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.app.Fragment;
+import android.transition.AutoTransition;
+import android.transition.Scene;
+import android.transition.Transition;
+import android.transition.TransitionManager;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AbsListView;
+import android.widget.FrameLayout;
+import android.widget.GridView;
+import android.widget.ListView;
+
+/**
+ * Main screen for AdapterTransition sample.
+ */
+public class AdapterTransitionFragment extends Fragment implements Transition.TransitionListener {
+
+ /**
+ * Since the transition framework requires all relevant views in a view hierarchy to be marked
+ * with IDs, we use this ID to mark the root view.
+ */
+ private static final int ROOT_ID = 1;
+
+ /**
+ * This is where we place our AdapterView (ListView / GridView).
+ */
+ private FrameLayout mContent;
+
+ /**
+ * This is where we carry out the transition.
+ */
+ private FrameLayout mCover;
+
+ /**
+ * This list shows our contents. It can be ListView or GridView, and we toggle between them
+ * using the transition framework.
+ */
+ private AbsListView mAbsListView;
+
+ /**
+ * This is our contents.
+ */
+ private MeatAdapter mAdapter;
+
+ public static AdapterTransitionFragment newInstance() {
+ return new AdapterTransitionFragment();
+ }
+
+ public AdapterTransitionFragment() {
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ // We use a ListView at first
+ mAbsListView = (AbsListView) inflater.inflate(R.layout.fragment_meat_list, container, false);
+ mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
+ return inflater.inflate(R.layout.fragment_adapter_transition, container, false);
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ // Retaining references for FrameLayouts that we use later.
+ mContent = (FrameLayout) view.findViewById(R.id.content);
+ mCover = (FrameLayout) view.findViewById(R.id.cover);
+ // We are attaching the list to the screen here.
+ mAbsListView.setAdapter(mAdapter);
+ mContent.addView(mAbsListView);
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ inflater.inflate(R.menu.fragment_adapter_transition, menu);
+ }
+
+ @Override
+ public void onPrepareOptionsMenu(Menu menu) {
+ // We change the look of the icon every time the user toggles between list and grid.
+ MenuItem item = menu.findItem(R.id.action_toggle);
+ if (null != item) {
+ if (mAbsListView instanceof ListView) {
+ item.setIcon(R.drawable.ic_action_grid);
+ } else {
+ item.setIcon(R.drawable.ic_action_list);
+ }
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.action_toggle: {
+ toggle();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public void onTransitionStart(Transition transition) {
+ }
+
+ // BEGIN_INCLUDE(on_transition_end)
+ @Override
+ public void onTransitionEnd(Transition transition) {
+ // When the transition ends, we remove all the views from the overlay and hide it.
+ mCover.removeAllViews();
+ mCover.setVisibility(View.INVISIBLE);
+ }
+ // END_INCLUDE(on_transition_end)
+
+ @Override
+ public void onTransitionCancel(Transition transition) {
+ }
+
+ @Override
+ public void onTransitionPause(Transition transition) {
+ }
+
+ @Override
+ public void onTransitionResume(Transition transition) {
+ }
+
+ /**
+ * Toggle the UI between ListView and GridView.
+ */
+ private void toggle() {
+ // We use mCover as the overlay on which we carry out the transition.
+ mCover.setVisibility(View.VISIBLE);
+ // This FrameLayout holds all the visible views in the current list or grid. We use this as
+ // the starting Scene of the Transition later.
+ FrameLayout before = copyVisibleViews();
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
+ mCover.addView(before, params);
+ // Swap the actual list.
+ swapAbsListView();
+ // We also swap the icon for the toggle button.
+ ActivityCompat.invalidateOptionsMenu(getActivity());
+ // It is now ready to start the transition.
+ mAbsListView.post(new Runnable() {
+ @Override
+ public void run() {
+ // BEGIN_INCLUDE(transition_with_listener)
+ Scene scene = new Scene(mCover, copyVisibleViews());
+ Transition transition = new AutoTransition();
+ transition.addListener(AdapterTransitionFragment.this);
+ TransitionManager.go(scene, transition);
+ // END_INCLUDE(transition_with_listener)
+ }
+ });
+ }
+
+ /**
+ * Swap ListView with GridView, or GridView with ListView.
+ */
+ private void swapAbsListView() {
+ // We save the current scrolling position before removing the current list.
+ int first = mAbsListView.getFirstVisiblePosition();
+ // If the current list is a GridView, we replace it with a ListView. If it is a ListView,
+ // a GridView.
+ LayoutInflater inflater = LayoutInflater.from(getActivity());
+ if (mAbsListView instanceof GridView) {
+ mAbsListView = (AbsListView) inflater.inflate(
+ R.layout.fragment_meat_list, (ViewGroup) mAbsListView.getParent(), false);
+ mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
+ } else {
+ mAbsListView = (AbsListView) inflater.inflate(
+ R.layout.fragment_meat_grid, (ViewGroup) mAbsListView.getParent(), false);
+ mAdapter = new MeatAdapter(inflater, R.layout.item_meat_grid);
+ }
+ mAbsListView.setAdapter(mAdapter);
+ // We restore the scrolling position here.
+ mAbsListView.setSelection(first);
+ // The new list is ready, and we replace the existing one with it.
+ mContent.removeAllViews();
+ mContent.addView(mAbsListView);
+ }
+
+ /**
+ * Copy all the visible views in the mAbsListView into a new FrameLayout and return it.
+ *
+ * @return a FrameLayout with all the visible views inside.
+ */
+ private FrameLayout copyVisibleViews() {
+ // This is the FrameLayout we return afterwards.
+ FrameLayout layout = new FrameLayout(getActivity());
+ // The transition framework requires to set ID for all views to be animated.
+ layout.setId(ROOT_ID);
+ // We only copy visible views.
+ int first = mAbsListView.getFirstVisiblePosition();
+ int index = 0;
+ while (true) {
+ // This is one of the views that we copy. Note that the argument for getChildAt is a
+ // zero-oriented index, and it doesn't usually match with its position in the list.
+ View source = mAbsListView.getChildAt(index);
+ if (null == source) {
+ break;
+ }
+ // This is the copy of the original view.
+ View destination = mAdapter.getView(first + index, null, layout);
+ assert destination != null;
+ destination.setId(ROOT_ID + first + index);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(
+ source.getWidth(), source.getHeight());
+ params.leftMargin = (int) source.getX();
+ params.topMargin = (int) source.getY();
+ layout.addView(destination, params);
+ ++index;
+ }
+ return layout;
+ }
+
+}
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/Meat.java b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/Meat.java
new file mode 100644
index 0000000..bca1c5f
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/Meat.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.adaptertransition;
+
+/**
+ * Sample data.
+ */
+public class Meat {
+
+ public int resourceId;
+ public String title;
+
+ public Meat(int resourceId, String title) {
+ this.resourceId = resourceId;
+ this.title = title;
+ }
+
+ public static final Meat[] MEATS = {
+ new Meat(R.drawable.p1, "First"),
+ new Meat(R.drawable.p2, "Second"),
+ new Meat(R.drawable.p3, "Third"),
+ new Meat(R.drawable.p4, "Fourth"),
+ new Meat(R.drawable.p5, "Fifth"),
+ new Meat(R.drawable.p6, "Sixth"),
+ new Meat(R.drawable.p7, "Seventh"),
+ new Meat(R.drawable.p8, "Eighth"),
+ new Meat(R.drawable.p9, "Ninth"),
+ new Meat(R.drawable.p10, "Tenth"),
+ new Meat(R.drawable.p11, "Eleventh"),
+ };
+
+}
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/MeatAdapter.java b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/MeatAdapter.java
new file mode 100644
index 0000000..c7630ce
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/java/com/example/android/adaptertransition/MeatAdapter.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.adaptertransition;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+/**
+ * This class provides data as Views. It is designed to support both ListView and GridView by
+ * changing a layout resource file to inflate.
+ */
+public class MeatAdapter extends BaseAdapter {
+
+ private final LayoutInflater mLayoutInflater;
+ private final int mResourceId;
+
+ /**
+ * Create a new instance of {@link MeatAdapter}.
+ *
+ * @param inflater The layout inflater.
+ * @param resourceId The resource ID for the layout to be used. The layout should contain an
+ * ImageView with ID of "meat_image" and a TextView with ID of "meat_title".
+ */
+ public MeatAdapter(LayoutInflater inflater, int resourceId) {
+ mLayoutInflater = inflater;
+ mResourceId = resourceId;
+ }
+
+ @Override
+ public int getCount() {
+ return Meat.MEATS.length;
+ }
+
+ @Override
+ public Meat getItem(int position) {
+ return Meat.MEATS[position];
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return Meat.MEATS[position].resourceId;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ final View view;
+ final ViewHolder holder;
+ if (null == convertView) {
+ view = mLayoutInflater.inflate(mResourceId, parent, false);
+ holder = new ViewHolder();
+ assert view != null;
+ holder.image = (ImageView) view.findViewById(R.id.meat_image);
+ holder.title = (TextView) view.findViewById(R.id.meat_title);
+ view.setTag(holder);
+ } else {
+ view = convertView;
+ holder = (ViewHolder) view.getTag();
+ }
+ Meat meat = getItem(position);
+ holder.image.setImageResource(meat.resourceId);
+ holder.title.setText(meat.title);
+ return view;
+ }
+
+ private static class ViewHolder {
+ public ImageView image;
+ public TextView title;
+ }
+
+}
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_grid.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_grid.png
new file mode 100644
index 0000000..e04f4a7
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_grid.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_list.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_list.png
new file mode 100644
index 0000000..4131dba
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_action_list.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_launcher.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..b7a67c0
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_grid.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_grid.png
new file mode 100644
index 0000000..f2a83e3
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_grid.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_list.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_list.png
new file mode 100644
index 0000000..e248a48
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_action_list.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_launcher.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..1c9fc09
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p1.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p1.jpg
new file mode 100644
index 0000000..10f07ac
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p1.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p10.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p10.jpg
new file mode 100644
index 0000000..4272f4c
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p10.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p11.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p11.jpg
new file mode 100644
index 0000000..c5722b2
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p11.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p2.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p2.jpg
new file mode 100644
index 0000000..ca380ae
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p2.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p3.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p3.jpg
new file mode 100644
index 0000000..6fc71e7
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p3.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p4.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p4.jpg
new file mode 100644
index 0000000..153c1ff
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p4.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p5.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p5.jpg
new file mode 100644
index 0000000..46d6a13
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p5.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p6.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p6.jpg
new file mode 100644
index 0000000..89ccb83
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p6.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p7.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p7.jpg
new file mode 100644
index 0000000..7e9546d
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p7.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p8.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p8.jpg
new file mode 100644
index 0000000..21e25ba
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p8.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p9.jpg b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p9.jpg
new file mode 100644
index 0000000..79854cb
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-nodpi/p9.jpg
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_grid.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_grid.png
new file mode 100644
index 0000000..ecd39b5
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_grid.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_list.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_list.png
new file mode 100644
index 0000000..e7e510d
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_action_list.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_launcher.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..11b9928
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_grid.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_grid.png
new file mode 100644
index 0000000..3ba98fc
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_grid.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_list.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_list.png
new file mode 100644
index 0000000..d187732
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_action_list.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_launcher.png b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f136c9f
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_adapter_transition.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_adapter_transition.xml
new file mode 100644
index 0000000..22ec090
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_adapter_transition.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ tools:context="com.example.android.adaptertransition.AdapterTransitionFragment">
+
+ <FrameLayout
+ android:id="@+id/content"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
+ <FrameLayout
+ android:id="@+id/cover"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="#f3f3f3"
+ android:visibility="invisible"/>
+
+</FrameLayout>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_grid.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_grid.xml
new file mode 100644
index 0000000..9a4f7a1
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_grid.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<GridView
+ android:id="@+id/abs_list_view"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:clipToPadding="false"
+ android:columnWidth="150dp"
+ android:horizontalSpacing="1dp"
+ android:numColumns="auto_fit"
+ android:padding="1dp"
+ android:scrollbars="none"
+ android:stretchMode="columnWidth"
+ android:verticalSpacing="1dp"/>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_list.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_list.xml
new file mode 100644
index 0000000..4523b26
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/fragment_meat_list.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<ListView
+ android:id="@+id/abs_list_view"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_grid.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_grid.xml
new file mode 100644
index 0000000..d7fb77a
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_grid.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<RelativeLayout
+ android:id="@+id/meat_container"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="150dp">
+
+ <ImageView
+ android:id="@+id/meat_image"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scaleType="centerCrop"
+ tools:src="@drawable/p1"/>
+
+ <TextView
+ android:id="@+id/meat_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentEnd="true"
+ android:layout_gravity="bottom|end"
+ android:layout_marginEnd="16dp"
+ android:layout_marginStart="16dp"
+ android:gravity="center_horizontal"
+ android:shadowColor="#000000"
+ android:shadowDx="0"
+ android:shadowDy="0"
+ android:shadowRadius="10"
+ android:textColor="#ffffff"
+ android:textSize="24sp"
+ android:textStyle="bold"
+ tools:text="Hello"/>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_list.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_list.xml
new file mode 100644
index 0000000..8d75b90
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/layout/item_meat_list.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<RelativeLayout
+ android:id="@+id/meat_container"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart">
+
+ <ImageView
+ android:id="@+id/meat_image"
+ android:layout_width="64dp"
+ android:layout_height="64dp"
+ android:scaleType="centerCrop"
+ tools:src="@drawable/p1"/>
+
+ <TextView
+ android:id="@+id/meat_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:layout_marginStart="?android:attr/listPreferredItemPaddingStart"
+ android:layout_toEndOf="@id/meat_image"
+ android:layout_centerInParent="true"
+ android:gravity="center_vertical"
+ android:textSize="24sp"
+ tools:text="Title"/>
+
+</RelativeLayout>
\ No newline at end of file
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/menu/fragment_adapter_transition.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/menu/fragment_adapter_transition.xml
new file mode 100644
index 0000000..2a51b11
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/menu/fragment_adapter_transition.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Copyright 2014 The Android Open Source Project
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/action_toggle"
+ android:icon="@drawable/ic_action_grid"
+ android:showAsAction="always"
+ android:title="Toggle view"/>
+</menu>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values-w820dp/dimens.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values-w820dp/dimens.xml
new file mode 100644
index 0000000..63fc816
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values-w820dp/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+ <!-- Example customization of dimensions originally defined in res/values/dimens.xml
+ (such as screen margins) for screens with more than 820dp of available width. This
+ would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
+ <dimen name="activity_horizontal_margin">64dp</dimen>
+</resources>
diff --git a/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values/dimens.xml b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..a0171a7
--- /dev/null
+++ b/ui/transition/AdapterTransition/AdapterTransitionSample/src/main/res/values/dimens.xml
@@ -0,0 +1,6 @@
+<resources>
+ <!-- Default screen margins, per the Android Design guidelines. -->
+ <dimen name="activity_horizontal_margin">16dp</dimen>
+ <dimen name="activity_vertical_margin">16dp</dimen>
+
+ </resources>
diff --git a/ui/transition/AdapterTransition/build.gradle b/ui/transition/AdapterTransition/build.gradle
new file mode 100644
index 0000000..cca9ac3
--- /dev/null
+++ b/ui/transition/AdapterTransition/build.gradle
@@ -0,0 +1,10 @@
+// BEGIN_EXCLUDE
+import com.example.android.samples.build.SampleGenPlugin
+apply plugin: SampleGenPlugin
+
+samplegen {
+ pathToBuild "../../../../../build"
+ pathToSamplesCommon "../../../common"
+}
+apply from: "../../../../../build/build.gradle"
+// END_EXCLUDE
diff --git a/ui/transition/AdapterTransition/buildSrc/build.gradle b/ui/transition/AdapterTransition/buildSrc/build.gradle
new file mode 100644
index 0000000..e344a8c
--- /dev/null
+++ b/ui/transition/AdapterTransition/buildSrc/build.gradle
@@ -0,0 +1,18 @@
+
+
+
+repositories {
+ mavenCentral()
+}
+dependencies {
+ compile 'org.freemarker:freemarker:2.3.20'
+}
+
+sourceSets {
+ main {
+ groovy {
+ srcDir new File(rootDir, "../../../../../../build/buildSrc/src/main/groovy")
+ }
+ }
+}
+
diff --git a/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.jar b/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..8c0fb64
--- /dev/null
+++ b/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.properties b/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..4f5d419
--- /dev/null
+++ b/ui/transition/AdapterTransition/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Wed Apr 10 15:27:10 PDT 2013
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http://services.gradle.org/distributions/gradle-1.10-bin.zip
diff --git a/ui/transition/AdapterTransition/gradlew b/ui/transition/AdapterTransition/gradlew
new file mode 100755
index 0000000..91a7e26
--- /dev/null
+++ b/ui/transition/AdapterTransition/gradlew
@@ -0,0 +1,164 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >&-
+APP_HOME="`pwd -P`"
+cd "$SAVED" >&-
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/ui/transition/AdapterTransition/gradlew.bat b/ui/transition/AdapterTransition/gradlew.bat
new file mode 100644
index 0000000..aec9973
--- /dev/null
+++ b/ui/transition/AdapterTransition/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/ui/transition/AdapterTransition/settings.gradle b/ui/transition/AdapterTransition/settings.gradle
new file mode 100644
index 0000000..3284a23
--- /dev/null
+++ b/ui/transition/AdapterTransition/settings.gradle
@@ -0,0 +1,4 @@
+
+
+
+include 'AdapterTransitionSample'
diff --git a/ui/transition/AdapterTransition/template-params.xml b/ui/transition/AdapterTransition/template-params.xml
new file mode 100644
index 0000000..d31b532
--- /dev/null
+++ b/ui/transition/AdapterTransition/template-params.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2013 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+
+
+<sample>
+ <name>AdapterTransition</name>
+ <group>UI</group>
+ <package>com.example.android.adaptertransition</package>
+
+ <!-- change minSdk if needed-->
+ <minSdk>19</minSdk>
+
+
+ <strings>
+ <intro>
+ <![CDATA[
+ Transition cannot be directly applied to AdapterViews. In this sample, we demonstrate how to create a overlay layout and run a Transition on it.
+ ]]>
+ </intro>
+ </strings>
+
+ <template src="base"/>
+ <template src="FragmentView"/>
+ <common src="logger"/>
+ <common src="activities"/>
+ <common src="view"/>
+
+</sample>