diff --git a/core/java/android/transition/Scene.java b/core/java/android/transition/Scene.java index d798abec5a33b..5800bd586bd03 100644 --- a/core/java/android/transition/Scene.java +++ b/core/java/android/transition/Scene.java @@ -36,27 +36,28 @@ public final class Scene { private ViewGroup mSceneRoot; private ViewGroup mLayout; // alternative to layoutId Runnable mEnterAction, mExitAction; - private static ThreadLocal> sScenes = new ThreadLocal>(); /** * Returns a Scene described by the resource file associated with the given - * layoutId parameter. If such a Scene has already been created, - * that same Scene will be returned. This caching of layoutId-based scenes enables - * sharing of common scenes between those created in code and those referenced - * by {@link TransitionManager} XML resource files. + * layoutId parameter. If such a Scene has already been created for + * the given sceneRoot, that same Scene will be returned. + * This caching of layoutId-based scenes enables sharing of common scenes + * between those created in code and those referenced by {@link TransitionManager} + * XML resource files. * * @param sceneRoot The root of the hierarchy in which scene changes * and transitions will take place. * @param layoutId The id of a standard layout resource file. * @param context The context used in the process of inflating * the layout resource. - * @return + * @return The scene for the given root and layout id */ public static Scene getSceneForLayout(ViewGroup sceneRoot, int layoutId, Context context) { - SparseArray scenes = sScenes.get(); + SparseArray scenes = (SparseArray) sceneRoot.getTag( + com.android.internal.R.id.scene_layoutid_cache); if (scenes == null) { scenes = new SparseArray(); - sScenes.set(scenes); + sceneRoot.setTag(com.android.internal.R.id.scene_layoutid_cache, scenes); } Scene scene = scenes.get(layoutId); if (scene != null) { diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml index 15df295e57847..5c0baaa4998f8 100644 --- a/core/res/res/values/ids.xml +++ b/core/res/res/values/ids.xml @@ -81,4 +81,5 @@ + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index e17b650ff969f..dc0841ab1041d 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -55,6 +55,7 @@ +