Loading api/current.txt +11 −15 Original line number Diff line number Diff line Loading @@ -345,7 +345,7 @@ package android { field public static final int canRetrieveWindowContent = 16843653; // 0x1010385 field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230 field public static final deprecated int capitalize = 16843113; // 0x1010169 field public static final int castsShadow = 16843777; // 0x1010401 field public static final int castsShadow = 16843775; // 0x10103ff field public static final int category = 16843752; // 0x10103e8 field public static final int centerBright = 16842956; // 0x10100cc field public static final int centerColor = 16843275; // 0x101020b Loading Loading @@ -542,7 +542,6 @@ package android { field public static final int fromAlpha = 16843210; // 0x10101ca field public static final int fromDegrees = 16843187; // 0x10101b3 field public static final int fromScene = 16843741; // 0x10103dd field public static final int fromSceneName = 16843773; // 0x10103fd field public static final int fromXDelta = 16843206; // 0x10101c6 field public static final int fromXScale = 16843202; // 0x10101c2 field public static final int fromYDelta = 16843208; // 0x10101c8 Loading Loading @@ -890,7 +889,7 @@ package android { field public static final int required = 16843406; // 0x101028e field public static final int requiredAccountType = 16843734; // 0x10103d6 field public static final int requiredForAllUsers = 16843728; // 0x10103d0 field public static final int requiredForProfile = 16843778; // 0x1010402 field public static final int requiredForProfile = 16843776; // 0x1010400 field public static final int requiresFadingEdge = 16843685; // 0x10103a5 field public static final int requiresSmallestWidthDp = 16843620; // 0x1010364 field public static final int resizeMode = 16843619; // 0x1010363 Loading Loading @@ -961,7 +960,7 @@ package android { field public static final int shadowRadius = 16843108; // 0x1010164 field public static final int shape = 16843162; // 0x101019a field public static final int shareInterpolator = 16843195; // 0x10101bb field public static final int sharedElementName = 16843775; // 0x10103ff field public static final int sharedElementName = 16843773; // 0x10103fd field public static final int sharedUserId = 16842763; // 0x101000b field public static final int sharedUserLabel = 16843361; // 0x1010261 field public static final int shouldDisableView = 16843246; // 0x10101ee Loading Loading @@ -1145,7 +1144,6 @@ package android { field public static final int toAlpha = 16843211; // 0x10101cb field public static final int toDegrees = 16843188; // 0x10101b4 field public static final int toScene = 16843742; // 0x10103de field public static final int toSceneName = 16843774; // 0x10103fe field public static final int toXDelta = 16843207; // 0x10101c7 field public static final int toXScale = 16843203; // 0x10101c3 field public static final int toYDelta = 16843209; // 0x10101c9 Loading @@ -1161,7 +1159,7 @@ package android { field public static final int transformPivotX = 16843552; // 0x1010320 field public static final int transformPivotY = 16843553; // 0x1010321 field public static final int transition = 16843743; // 0x10103df field public static final int transitionGroup = 16843776; // 0x1010400 field public static final int transitionGroup = 16843774; // 0x10103fe field public static final int transitionOrdering = 16843744; // 0x10103e0 field public static final int translationX = 16843554; // 0x1010322 field public static final int translationY = 16843555; // 0x1010323 Loading Loading @@ -3041,7 +3039,6 @@ package android.app { method public int getTaskId(); method public final java.lang.CharSequence getTitle(); method public final int getTitleColor(); method public android.os.Bundle getTransitionArgs(); method public final int getVolumeControlStream(); method public android.view.Window getWindow(); method public android.view.WindowManager getWindowManager(); Loading @@ -3063,6 +3060,8 @@ package android.app { method public void onAttachFragment(android.app.Fragment); method public void onAttachedToWindow(); method public void onBackPressed(); method public void onCaptureSharedElementEnd(); method public void onCaptureSharedElementStart(android.transition.Transition); method protected void onChildTitleChanged(android.app.Activity, java.lang.CharSequence); method public void onConfigurationChanged(android.content.res.Configuration); method public void onContentChanged(); Loading Loading @@ -3137,7 +3136,6 @@ package android.app { method public void setContentView(android.view.View); method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public final void setDefaultKeyMode(int); method public void setEarlyBackgroundTransition(boolean); method public final void setFeatureDrawable(int, android.graphics.drawable.Drawable); method public final void setFeatureDrawableAlpha(int, int); method public final void setFeatureDrawableResource(int, int); Loading Loading @@ -3178,7 +3176,6 @@ package android.app { method public boolean startNextMatchingActivity(android.content.Intent); method public boolean startNextMatchingActivity(android.content.Intent, android.os.Bundle); method public void startSearch(java.lang.String, boolean, android.os.Bundle, boolean); method protected void startSharedElementTransition(android.os.Bundle); method public deprecated void stopManagingCursor(android.database.Cursor); method public void takeKeyEvents(boolean); method public void triggerSearch(java.lang.String, android.os.Bundle); Loading Loading @@ -3349,7 +3346,8 @@ package android.app { public class ActivityOptions { method public static android.app.ActivityOptions makeCustomAnimation(android.content.Context, int, int); method public static android.app.ActivityOptions makeScaleUpAnimation(android.view.View, int, int, int, int); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.os.Bundle); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.view.View, java.lang.String); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.util.Pair<android.view.View, java.lang.String>...); method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); Loading Loading @@ -26829,15 +26827,11 @@ package android.transition { ctor public TransitionManager(); method public static void beginDelayedTransition(android.view.ViewGroup); method public static void beginDelayedTransition(android.view.ViewGroup, android.transition.Transition); method public android.transition.Transition getNamedTransition(java.lang.String, android.transition.Scene); method public android.transition.Transition getNamedTransition(android.transition.Scene, java.lang.String); method public java.lang.String[] getTargetSceneNames(android.transition.Scene); method public static void go(android.transition.Scene); method public static void go(android.transition.Scene, android.transition.Transition); method public void setExitTransition(android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, java.lang.String, android.transition.Transition); method public void setTransition(java.lang.String, android.transition.Scene, android.transition.Transition); method public void transitionTo(android.transition.Scene); } Loading Loading @@ -29808,6 +29802,7 @@ package android.view { method public abstract boolean isFloating(); method public abstract boolean isShortcutKey(int, android.view.KeyEvent); method public final void makeActive(); method public void mapTransitionTargets(java.util.Map<java.lang.String, java.lang.String>); method protected abstract void onActive(); method public abstract void onConfigurationChanged(android.content.res.Configuration); method public abstract void openPanel(int, android.view.KeyEvent); Loading Loading @@ -29846,6 +29841,7 @@ package android.view { method public abstract void setTitle(java.lang.CharSequence); method public abstract deprecated void setTitleColor(int); method public void setTransitionManager(android.transition.TransitionManager); method public void setTriggerEarlyEnterTransition(boolean); method public void setType(int); method public void setUiOptions(int); method public void setUiOptions(int, int); core/java/android/app/Activity.java +38 −55 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.app; import android.annotation.NonNull; import android.transition.Scene; import android.transition.Transition; import android.transition.TransitionManager; import android.util.ArrayMap; import android.util.SuperNotCalledException; Loading Loading @@ -3446,7 +3447,11 @@ public class Activity extends ContextThemeWrapper * @see #startActivity */ public void startActivityForResult(Intent intent, int requestCode) { startActivityForResult(intent, requestCode, null); Bundle options = null; if (mWindow.hasFeature(Window.FEATURE_CONTENT_TRANSITIONS)) { options = ActivityOptions.makeSceneTransitionAnimation(null).toBundle(); } startActivityForResult(intent, requestCode, options); } /** Loading Loading @@ -3484,12 +3489,15 @@ public class Activity extends ContextThemeWrapper * @see #startActivity */ public void startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options) { TransitionManager tm = getContentTransitionManager(); if (tm != null && options != null) { if (options != null) { ActivityOptions activityOptions = new ActivityOptions(options); if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { getWindow().startExitTransition(activityOptions); options = activityOptions.toBundle(); if (mActionBar != null) { ArrayMap<String, View> sharedElementMap = new ArrayMap<String, View>(); mActionBar.captureSharedElements(sharedElementMap); activityOptions.addSharedElements(sharedElementMap); } options = mWindow.startExitTransition(activityOptions); } } if (mParent == null) { Loading Loading @@ -3664,7 +3672,7 @@ public class Activity extends ContextThemeWrapper */ @Override public void startActivity(Intent intent) { startActivity(intent, null); this.startActivity(intent, null); } /** Loading Loading @@ -4720,7 +4728,8 @@ public class Activity extends ContextThemeWrapper */ public final void setProgressBarIndeterminate(boolean indeterminate) { getWindow().setFeatureInt(Window.FEATURE_PROGRESS, indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF); indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF); } /** Loading Loading @@ -5329,12 +5338,6 @@ public class Activity extends ContextThemeWrapper if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { mTransitionActivityOptions = activityOptions; sceneTransitionListener = new Window.SceneTransitionListener() { @Override public void enterSharedElement(Bundle transitionArgs) { startSharedElementTransition(transitionArgs); mTransitionActivityOptions = null; } @Override public void nullPendingTransition() { overridePendingTransition(0, 0); Loading @@ -5349,6 +5352,16 @@ public class Activity extends ContextThemeWrapper public void convertToTranslucent() { Activity.this.convertToTranslucent(null); } @Override public void sharedElementStart(Transition transition) { Activity.this.onCaptureSharedElementStart(transition); } @Override public void sharedElementEnd() { Activity.this.onCaptureSharedElementEnd(); } }; } Loading Loading @@ -5542,53 +5555,23 @@ public class Activity extends ContextThemeWrapper } /** * Gets the entering Activity transition args. Will be null if * {@link android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle)} was * not used to pass a Bundle to startActivity. The Bundle passed to that method in the * calling Activity is returned here. * <p>After startSharedElementTransition is called, this method will return null.</p> * * @return The Bundle passed into Bundle parameter of * {@link android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle)} * in the calling Activity. */ public Bundle getTransitionArgs() { if (mTransitionActivityOptions == null) { return null; } return mTransitionActivityOptions.getSceneTransitionArgs(); } /** * Override to transfer a shared element from a calling Activity to this Activity. * Shared elements will be made VISIBLE before this call. The Activity is responsible * for transitioning the shared elements from their location to the eventual destination. * The shared element will be laid out a the destination when this method is called. * Called when setting up Activity Scene transitions when the start state for shared * elements has been captured. Override this method to modify the start position of shared * elements for the entry Transition. * * @param transitionArgs The same as returned from {@link #getTransitionArgs()}, this should * contain information from the calling Activity to tell where the * shared element should be placed. * @param transition The <code>Transition</code> being used to change * bounds of shared elements in the source Activity to * the bounds defined by the entering Scene. */ protected void startSharedElementTransition(Bundle transitionArgs) { public void onCaptureSharedElementStart(Transition transition) { } /** * Controls how the background fade is triggered when there is an entering Activity transition. * If fadeEarly is true, the Window background will fade in as soon as the shared elements are * ready to switch. If fadeEarly is false, the background will fade only after the calling * Activity's exit transition completes. By default, the Window will fade in when the calling * Activity's exit transition completes. * * @param fadeEarly Set to true to fade out the exiting Activity as soon as the shared elements * are transferred. Set to false to fade out the exiting Activity as soon as * the shared element is transferred. * @see android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle) * Called when setting up Activity Scene transitions when the final state for * shared elements state has been captured. Override this method to modify the destination * position of shared elements for the entry Transition. */ public void setEarlyBackgroundTransition(boolean fadeEarly) { if (mTransitionActivityOptions == null) { return; } mWindow.setEarlyBackgroundTransition(fadeEarly); public void onCaptureSharedElementEnd() { } /** Loading core/java/android/app/ActivityOptions.java +130 −100 File changed.Preview size limit exceeded, changes collapsed. Show changes core/java/android/transition/Transition.java +23 −22 Original line number Diff line number Diff line Loading @@ -552,8 +552,7 @@ public abstract class Transition implements Cloneable { return false; } /** @hide */ public static ArrayMap<Animator, AnimationInfo> getRunningAnimators() { private static ArrayMap<Animator, AnimationInfo> getRunningAnimators() { ArrayMap<Animator, AnimationInfo> runningAnimators = sRunningAnimators.get(); if (runningAnimators == null) { runningAnimators = new ArrayMap<Animator, AnimationInfo>(); Loading Loading @@ -1113,6 +1112,7 @@ public abstract class Transition implements Cloneable { } } } if (view.getParent() instanceof ViewGroup) { TransitionValues values = new TransitionValues(); values.view = view; if (start) { Loading @@ -1139,6 +1139,7 @@ public abstract class Transition implements Cloneable { mEndValues.itemIdValues.put(itemId, values); } } } if (view instanceof ViewGroup) { // Don't traverse child hierarchy if there are any child-excludes on this view if (mTargetIdChildExcludes != null && mTargetIdChildExcludes.contains(id)) { Loading core/java/android/transition/TransitionInflater.java +12 −31 Original line number Diff line number Diff line Loading @@ -285,46 +285,27 @@ public class TransitionInflater { com.android.internal.R.styleable.TransitionManager); int transitionId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_transition, -1); Scene fromScene = null, toScene = null; int fromId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_fromScene, -1); if (fromId >= 0) fromScene = Scene.getSceneForLayout(sceneRoot, fromId, mContext); Scene fromScene = (fromId < 0) ? null: Scene.getSceneForLayout(sceneRoot, fromId, mContext); int toId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_toScene, -1); if (toId >= 0) toScene = Scene.getSceneForLayout(sceneRoot, toId, mContext); String fromName = a.getString( com.android.internal.R.styleable.TransitionManager_fromSceneName); String toName = a.getString( com.android.internal.R.styleable.TransitionManager_toSceneName); Scene toScene = (toId < 0) ? null : Scene.getSceneForLayout(sceneRoot, toId, mContext); if (transitionId >= 0) { Transition transition = inflateTransition(transitionId); if (transition != null) { if (fromScene != null) { boolean hasDest = false; if (toScene != null) { transitionManager.setTransition(fromScene, toScene, transition); hasDest = true; } if (!TextUtils.isEmpty(toName)) { transitionManager.setTransition(fromScene, toName, transition); hasDest = true; } if (!hasDest) { throw new RuntimeException("No matching toScene or toSceneName for given " + "fromScene for transition ID " + transitionId); } } else if (toId >= 0) { if (fromScene == null) { if (toScene == null) { throw new RuntimeException("No matching fromScene or toScene " + "for transition ID " + transitionId); } else { transitionManager.setTransition(toScene, transition); } if (fromName != null) { if (toScene != null) { transitionManager.setTransition(fromName, toScene, transition); } else if (toScene == null) { transitionManager.setExitTransition(fromScene, transition); } else { throw new RuntimeException("No matching toScene for given fromSceneName " + "for transition ID " + transitionId); } transitionManager.setTransition(fromScene, toScene, transition); } } } Loading Loading
api/current.txt +11 −15 Original line number Diff line number Diff line Loading @@ -345,7 +345,7 @@ package android { field public static final int canRetrieveWindowContent = 16843653; // 0x1010385 field public static final int candidatesTextStyleSpans = 16843312; // 0x1010230 field public static final deprecated int capitalize = 16843113; // 0x1010169 field public static final int castsShadow = 16843777; // 0x1010401 field public static final int castsShadow = 16843775; // 0x10103ff field public static final int category = 16843752; // 0x10103e8 field public static final int centerBright = 16842956; // 0x10100cc field public static final int centerColor = 16843275; // 0x101020b Loading Loading @@ -542,7 +542,6 @@ package android { field public static final int fromAlpha = 16843210; // 0x10101ca field public static final int fromDegrees = 16843187; // 0x10101b3 field public static final int fromScene = 16843741; // 0x10103dd field public static final int fromSceneName = 16843773; // 0x10103fd field public static final int fromXDelta = 16843206; // 0x10101c6 field public static final int fromXScale = 16843202; // 0x10101c2 field public static final int fromYDelta = 16843208; // 0x10101c8 Loading Loading @@ -890,7 +889,7 @@ package android { field public static final int required = 16843406; // 0x101028e field public static final int requiredAccountType = 16843734; // 0x10103d6 field public static final int requiredForAllUsers = 16843728; // 0x10103d0 field public static final int requiredForProfile = 16843778; // 0x1010402 field public static final int requiredForProfile = 16843776; // 0x1010400 field public static final int requiresFadingEdge = 16843685; // 0x10103a5 field public static final int requiresSmallestWidthDp = 16843620; // 0x1010364 field public static final int resizeMode = 16843619; // 0x1010363 Loading Loading @@ -961,7 +960,7 @@ package android { field public static final int shadowRadius = 16843108; // 0x1010164 field public static final int shape = 16843162; // 0x101019a field public static final int shareInterpolator = 16843195; // 0x10101bb field public static final int sharedElementName = 16843775; // 0x10103ff field public static final int sharedElementName = 16843773; // 0x10103fd field public static final int sharedUserId = 16842763; // 0x101000b field public static final int sharedUserLabel = 16843361; // 0x1010261 field public static final int shouldDisableView = 16843246; // 0x10101ee Loading Loading @@ -1145,7 +1144,6 @@ package android { field public static final int toAlpha = 16843211; // 0x10101cb field public static final int toDegrees = 16843188; // 0x10101b4 field public static final int toScene = 16843742; // 0x10103de field public static final int toSceneName = 16843774; // 0x10103fe field public static final int toXDelta = 16843207; // 0x10101c7 field public static final int toXScale = 16843203; // 0x10101c3 field public static final int toYDelta = 16843209; // 0x10101c9 Loading @@ -1161,7 +1159,7 @@ package android { field public static final int transformPivotX = 16843552; // 0x1010320 field public static final int transformPivotY = 16843553; // 0x1010321 field public static final int transition = 16843743; // 0x10103df field public static final int transitionGroup = 16843776; // 0x1010400 field public static final int transitionGroup = 16843774; // 0x10103fe field public static final int transitionOrdering = 16843744; // 0x10103e0 field public static final int translationX = 16843554; // 0x1010322 field public static final int translationY = 16843555; // 0x1010323 Loading Loading @@ -3041,7 +3039,6 @@ package android.app { method public int getTaskId(); method public final java.lang.CharSequence getTitle(); method public final int getTitleColor(); method public android.os.Bundle getTransitionArgs(); method public final int getVolumeControlStream(); method public android.view.Window getWindow(); method public android.view.WindowManager getWindowManager(); Loading @@ -3063,6 +3060,8 @@ package android.app { method public void onAttachFragment(android.app.Fragment); method public void onAttachedToWindow(); method public void onBackPressed(); method public void onCaptureSharedElementEnd(); method public void onCaptureSharedElementStart(android.transition.Transition); method protected void onChildTitleChanged(android.app.Activity, java.lang.CharSequence); method public void onConfigurationChanged(android.content.res.Configuration); method public void onContentChanged(); Loading Loading @@ -3137,7 +3136,6 @@ package android.app { method public void setContentView(android.view.View); method public void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public final void setDefaultKeyMode(int); method public void setEarlyBackgroundTransition(boolean); method public final void setFeatureDrawable(int, android.graphics.drawable.Drawable); method public final void setFeatureDrawableAlpha(int, int); method public final void setFeatureDrawableResource(int, int); Loading Loading @@ -3178,7 +3176,6 @@ package android.app { method public boolean startNextMatchingActivity(android.content.Intent); method public boolean startNextMatchingActivity(android.content.Intent, android.os.Bundle); method public void startSearch(java.lang.String, boolean, android.os.Bundle, boolean); method protected void startSharedElementTransition(android.os.Bundle); method public deprecated void stopManagingCursor(android.database.Cursor); method public void takeKeyEvents(boolean); method public void triggerSearch(java.lang.String, android.os.Bundle); Loading Loading @@ -3349,7 +3346,8 @@ package android.app { public class ActivityOptions { method public static android.app.ActivityOptions makeCustomAnimation(android.content.Context, int, int); method public static android.app.ActivityOptions makeScaleUpAnimation(android.view.View, int, int, int, int); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.os.Bundle); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.view.View, java.lang.String); method public static android.app.ActivityOptions makeSceneTransitionAnimation(android.util.Pair<android.view.View, java.lang.String>...); method public static android.app.ActivityOptions makeThumbnailScaleUpAnimation(android.view.View, android.graphics.Bitmap, int, int); method public android.os.Bundle toBundle(); method public void update(android.app.ActivityOptions); Loading Loading @@ -26829,15 +26827,11 @@ package android.transition { ctor public TransitionManager(); method public static void beginDelayedTransition(android.view.ViewGroup); method public static void beginDelayedTransition(android.view.ViewGroup, android.transition.Transition); method public android.transition.Transition getNamedTransition(java.lang.String, android.transition.Scene); method public android.transition.Transition getNamedTransition(android.transition.Scene, java.lang.String); method public java.lang.String[] getTargetSceneNames(android.transition.Scene); method public static void go(android.transition.Scene); method public static void go(android.transition.Scene, android.transition.Transition); method public void setExitTransition(android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, android.transition.Scene, android.transition.Transition); method public void setTransition(android.transition.Scene, java.lang.String, android.transition.Transition); method public void setTransition(java.lang.String, android.transition.Scene, android.transition.Transition); method public void transitionTo(android.transition.Scene); } Loading Loading @@ -29808,6 +29802,7 @@ package android.view { method public abstract boolean isFloating(); method public abstract boolean isShortcutKey(int, android.view.KeyEvent); method public final void makeActive(); method public void mapTransitionTargets(java.util.Map<java.lang.String, java.lang.String>); method protected abstract void onActive(); method public abstract void onConfigurationChanged(android.content.res.Configuration); method public abstract void openPanel(int, android.view.KeyEvent); Loading Loading @@ -29846,6 +29841,7 @@ package android.view { method public abstract void setTitle(java.lang.CharSequence); method public abstract deprecated void setTitleColor(int); method public void setTransitionManager(android.transition.TransitionManager); method public void setTriggerEarlyEnterTransition(boolean); method public void setType(int); method public void setUiOptions(int); method public void setUiOptions(int, int);
core/java/android/app/Activity.java +38 −55 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.app; import android.annotation.NonNull; import android.transition.Scene; import android.transition.Transition; import android.transition.TransitionManager; import android.util.ArrayMap; import android.util.SuperNotCalledException; Loading Loading @@ -3446,7 +3447,11 @@ public class Activity extends ContextThemeWrapper * @see #startActivity */ public void startActivityForResult(Intent intent, int requestCode) { startActivityForResult(intent, requestCode, null); Bundle options = null; if (mWindow.hasFeature(Window.FEATURE_CONTENT_TRANSITIONS)) { options = ActivityOptions.makeSceneTransitionAnimation(null).toBundle(); } startActivityForResult(intent, requestCode, options); } /** Loading Loading @@ -3484,12 +3489,15 @@ public class Activity extends ContextThemeWrapper * @see #startActivity */ public void startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options) { TransitionManager tm = getContentTransitionManager(); if (tm != null && options != null) { if (options != null) { ActivityOptions activityOptions = new ActivityOptions(options); if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { getWindow().startExitTransition(activityOptions); options = activityOptions.toBundle(); if (mActionBar != null) { ArrayMap<String, View> sharedElementMap = new ArrayMap<String, View>(); mActionBar.captureSharedElements(sharedElementMap); activityOptions.addSharedElements(sharedElementMap); } options = mWindow.startExitTransition(activityOptions); } } if (mParent == null) { Loading Loading @@ -3664,7 +3672,7 @@ public class Activity extends ContextThemeWrapper */ @Override public void startActivity(Intent intent) { startActivity(intent, null); this.startActivity(intent, null); } /** Loading Loading @@ -4720,7 +4728,8 @@ public class Activity extends ContextThemeWrapper */ public final void setProgressBarIndeterminate(boolean indeterminate) { getWindow().setFeatureInt(Window.FEATURE_PROGRESS, indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF); indeterminate ? Window.PROGRESS_INDETERMINATE_ON : Window.PROGRESS_INDETERMINATE_OFF); } /** Loading Loading @@ -5329,12 +5338,6 @@ public class Activity extends ContextThemeWrapper if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { mTransitionActivityOptions = activityOptions; sceneTransitionListener = new Window.SceneTransitionListener() { @Override public void enterSharedElement(Bundle transitionArgs) { startSharedElementTransition(transitionArgs); mTransitionActivityOptions = null; } @Override public void nullPendingTransition() { overridePendingTransition(0, 0); Loading @@ -5349,6 +5352,16 @@ public class Activity extends ContextThemeWrapper public void convertToTranslucent() { Activity.this.convertToTranslucent(null); } @Override public void sharedElementStart(Transition transition) { Activity.this.onCaptureSharedElementStart(transition); } @Override public void sharedElementEnd() { Activity.this.onCaptureSharedElementEnd(); } }; } Loading Loading @@ -5542,53 +5555,23 @@ public class Activity extends ContextThemeWrapper } /** * Gets the entering Activity transition args. Will be null if * {@link android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle)} was * not used to pass a Bundle to startActivity. The Bundle passed to that method in the * calling Activity is returned here. * <p>After startSharedElementTransition is called, this method will return null.</p> * * @return The Bundle passed into Bundle parameter of * {@link android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle)} * in the calling Activity. */ public Bundle getTransitionArgs() { if (mTransitionActivityOptions == null) { return null; } return mTransitionActivityOptions.getSceneTransitionArgs(); } /** * Override to transfer a shared element from a calling Activity to this Activity. * Shared elements will be made VISIBLE before this call. The Activity is responsible * for transitioning the shared elements from their location to the eventual destination. * The shared element will be laid out a the destination when this method is called. * Called when setting up Activity Scene transitions when the start state for shared * elements has been captured. Override this method to modify the start position of shared * elements for the entry Transition. * * @param transitionArgs The same as returned from {@link #getTransitionArgs()}, this should * contain information from the calling Activity to tell where the * shared element should be placed. * @param transition The <code>Transition</code> being used to change * bounds of shared elements in the source Activity to * the bounds defined by the entering Scene. */ protected void startSharedElementTransition(Bundle transitionArgs) { public void onCaptureSharedElementStart(Transition transition) { } /** * Controls how the background fade is triggered when there is an entering Activity transition. * If fadeEarly is true, the Window background will fade in as soon as the shared elements are * ready to switch. If fadeEarly is false, the background will fade only after the calling * Activity's exit transition completes. By default, the Window will fade in when the calling * Activity's exit transition completes. * * @param fadeEarly Set to true to fade out the exiting Activity as soon as the shared elements * are transferred. Set to false to fade out the exiting Activity as soon as * the shared element is transferred. * @see android.app.ActivityOptions#makeSceneTransitionAnimation(android.os.Bundle) * Called when setting up Activity Scene transitions when the final state for * shared elements state has been captured. Override this method to modify the destination * position of shared elements for the entry Transition. */ public void setEarlyBackgroundTransition(boolean fadeEarly) { if (mTransitionActivityOptions == null) { return; } mWindow.setEarlyBackgroundTransition(fadeEarly); public void onCaptureSharedElementEnd() { } /** Loading
core/java/android/app/ActivityOptions.java +130 −100 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/java/android/transition/Transition.java +23 −22 Original line number Diff line number Diff line Loading @@ -552,8 +552,7 @@ public abstract class Transition implements Cloneable { return false; } /** @hide */ public static ArrayMap<Animator, AnimationInfo> getRunningAnimators() { private static ArrayMap<Animator, AnimationInfo> getRunningAnimators() { ArrayMap<Animator, AnimationInfo> runningAnimators = sRunningAnimators.get(); if (runningAnimators == null) { runningAnimators = new ArrayMap<Animator, AnimationInfo>(); Loading Loading @@ -1113,6 +1112,7 @@ public abstract class Transition implements Cloneable { } } } if (view.getParent() instanceof ViewGroup) { TransitionValues values = new TransitionValues(); values.view = view; if (start) { Loading @@ -1139,6 +1139,7 @@ public abstract class Transition implements Cloneable { mEndValues.itemIdValues.put(itemId, values); } } } if (view instanceof ViewGroup) { // Don't traverse child hierarchy if there are any child-excludes on this view if (mTargetIdChildExcludes != null && mTargetIdChildExcludes.contains(id)) { Loading
core/java/android/transition/TransitionInflater.java +12 −31 Original line number Diff line number Diff line Loading @@ -285,46 +285,27 @@ public class TransitionInflater { com.android.internal.R.styleable.TransitionManager); int transitionId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_transition, -1); Scene fromScene = null, toScene = null; int fromId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_fromScene, -1); if (fromId >= 0) fromScene = Scene.getSceneForLayout(sceneRoot, fromId, mContext); Scene fromScene = (fromId < 0) ? null: Scene.getSceneForLayout(sceneRoot, fromId, mContext); int toId = a.getResourceId( com.android.internal.R.styleable.TransitionManager_toScene, -1); if (toId >= 0) toScene = Scene.getSceneForLayout(sceneRoot, toId, mContext); String fromName = a.getString( com.android.internal.R.styleable.TransitionManager_fromSceneName); String toName = a.getString( com.android.internal.R.styleable.TransitionManager_toSceneName); Scene toScene = (toId < 0) ? null : Scene.getSceneForLayout(sceneRoot, toId, mContext); if (transitionId >= 0) { Transition transition = inflateTransition(transitionId); if (transition != null) { if (fromScene != null) { boolean hasDest = false; if (toScene != null) { transitionManager.setTransition(fromScene, toScene, transition); hasDest = true; } if (!TextUtils.isEmpty(toName)) { transitionManager.setTransition(fromScene, toName, transition); hasDest = true; } if (!hasDest) { throw new RuntimeException("No matching toScene or toSceneName for given " + "fromScene for transition ID " + transitionId); } } else if (toId >= 0) { if (fromScene == null) { if (toScene == null) { throw new RuntimeException("No matching fromScene or toScene " + "for transition ID " + transitionId); } else { transitionManager.setTransition(toScene, transition); } if (fromName != null) { if (toScene != null) { transitionManager.setTransition(fromName, toScene, transition); } else if (toScene == null) { transitionManager.setExitTransition(fromScene, transition); } else { throw new RuntimeException("No matching toScene for given fromSceneName " + "for transition ID " + transitionId); } transitionManager.setTransition(fromScene, toScene, transition); } } } Loading