Loading api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -1310,6 +1310,7 @@ package android { field public static final int viewportHeight = 16843805; // 0x101041d field public static final int viewportWidth = 16843804; // 0x101041c field public static final int visibility = 16842972; // 0x10100dc field public static final int visibilityMode = 16843902; // 0x101047e field public static final int visible = 16843156; // 0x1010194 field public static final int vmSafeMode = 16843448; // 0x10102b8 field public static final int voiceLanguage = 16843349; // 0x1010255 Loading Loading @@ -30687,6 +30688,9 @@ package android.transition { method public android.animation.Animator onAppear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues); method public android.animation.Animator onDisappear(android.view.ViewGroup, android.transition.TransitionValues, int, android.transition.TransitionValues, int); method public android.animation.Animator onDisappear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues); method public void setMode(int); field public static final int IN = 1; // 0x1 field public static final int OUT = 2; // 0x2 } public abstract class VisibilityPropagation extends android.transition.TransitionPropagation { core/java/android/transition/Fade.java +8 −15 Original line number Diff line number Diff line Loading @@ -63,23 +63,23 @@ public class Fade extends Visibility { /** * Fading mode used in {@link #Fade(int)} to make the transition * operate on targets that are appearing. Maybe be combined with * {@link #OUT} to fade both in and out. * {@link #OUT} to fade both in and out. Equivalent to * {@link Visibility#IN}. */ public static final int IN = 0x1; public static final int IN = Visibility.IN; /** * Fading mode used in {@link #Fade(int)} to make the transition * operate on targets that are disappearing. Maybe be combined with * {@link #IN} to fade both in and out. * {@link #IN} to fade both in and out. Equivalent to * {@link Visibility#OUT}. */ public static final int OUT = 0x2; private int mFadingMode; public static final int OUT = Visibility.OUT; /** * Constructs a Fade transition that will fade targets in and out. */ public Fade() { this(IN | OUT); } /** Loading @@ -90,7 +90,7 @@ public class Fade extends Visibility { * {@link #IN} and {@link #OUT}. */ public Fade(int fadingMode) { mFadingMode = fadingMode; setMode(fadingMode); } /** Loading @@ -115,9 +115,6 @@ public class Fade extends Visibility { public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) { if ((mFadingMode & IN) != IN || endValues == null) { return null; } if (DBG) { View startView = (startValues != null) ? startValues.view : null; Log.d(LOG_TAG, "Fade.onAppear: startView, startVis, endView, endVis = " + Loading @@ -129,10 +126,6 @@ public class Fade extends Visibility { @Override public Animator onDisappear(ViewGroup sceneRoot, final View view, TransitionValues startValues, TransitionValues endValues) { if ((mFadingMode & OUT) != OUT) { return null; } return createAnimation(view, 1, 0); } Loading core/java/android/transition/TransitionInflater.java +10 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,16 @@ public class TransitionInflater { transition.setMatchOrder(parseMatchOrder(matchOrder)); } a.recycle(); if (transition instanceof Visibility) { a = mContext.obtainStyledAttributes(attrs, com.android.internal.R.styleable.VisibilityTransition); int mode = a.getInt( com.android.internal.R.styleable.VisibilityTransition_visibilityMode, 0); a.recycle(); if (mode != 0) { ((Visibility)transition).setMode(mode); } } return transition; } Loading core/java/android/transition/Visibility.java +37 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,20 @@ public abstract class Visibility extends Transition { private static final String PROPNAME_PARENT = "android:visibility:parent"; private static final String PROPNAME_SCREEN_LOCATION = "android:visibility:screenLocation"; /** * Mode used in {@link #setMode(int)} to make the transition * operate on targets that are appearing. Maybe be combined with * {@link #OUT} to target Visibility changes both in and out. */ public static final int IN = 0x1; /** * Mode used in {@link #setMode(int)} to make the transition * operate on targets that are disappearing. Maybe be combined with * {@link #IN} to target Visibility changes both in and out. */ public static final int OUT = 0x2; private static final String[] sTransitionProperties = { PROPNAME_VISIBILITY, PROPNAME_PARENT, Loading @@ -58,6 +72,22 @@ public abstract class Visibility extends Transition { ViewGroup endParent; } private int mMode = IN | OUT; /** * Changes the transition to support appearing and/or disappearing Views, depending * on <code>mode</code>. * * @param mode The behavior supported by this transition, a combination of * {@link #IN} and {@link #OUT}. */ public void setMode(int mode) { if ((mode & ~(IN | OUT)) != 0) { throw new IllegalArgumentException("Only IN and OUT flags are allowed"); } mMode = mode; } @Override public String[] getTransitionProperties() { return sTransitionProperties; Loading Loading @@ -200,6 +230,9 @@ public abstract class Visibility extends Transition { public Animator onAppear(ViewGroup sceneRoot, TransitionValues startValues, int startVisibility, TransitionValues endValues, int endVisibility) { if ((mMode & IN) != IN || endValues == null) { return null; } return onAppear(sceneRoot, endValues.view, startValues, endValues); } Loading Loading @@ -260,6 +293,10 @@ public abstract class Visibility extends Transition { public Animator onDisappear(ViewGroup sceneRoot, TransitionValues startValues, int startVisibility, TransitionValues endValues, int endVisibility) { if ((mMode & OUT) != OUT) { return null; } View startView = (startValues != null) ? startValues.view : null; View endView = (endValues != null) ? endValues.view : null; View overlayView = null; Loading core/res/res/values/attrs.xml +17 −0 Original line number Diff line number Diff line Loading @@ -5338,6 +5338,8 @@ resource are available in addition to the specific attributes of Fade described here. --> <declare-styleable name="Fade"> <!-- Equivalent to <code>visibilityMode</code>, fadingMode works only with the Fade transition. --> <attr name="fadingMode"> <!-- Fade will only fade appearing items in. --> <enum name="fade_in" value="1" /> Loading Loading @@ -5366,6 +5368,21 @@ </attr> </declare-styleable> <!-- Use with {@link android.transition.Visibility} transitions, such as <code>slide</code>, <code>explode</code>, and <code>fade</code> to mark which views are supported. --> <declare-styleable name="VisibilityTransition"> <!-- Changes whether the transition supports appearing and/or disappearing Views. Corresponds to {@link android.transition.Visibility#setMode(int)}. --> <attr name="visibilityMode"> <!-- Only appearing Views will be supported. --> <enum name="mode_in" value="1" /> <!-- Only disappearing Views will be supported. --> <enum name="mode_out" value="2" /> <!-- Both appearing and disappearing views will be supported. --> <enum name="mode_in_out" value="3" /> </attr> </declare-styleable> <!-- Use <code>target</code> as the root tag of the XML resource that describes a {@link android.transition.Transition#addTarget(int) targetId} of a transition. There can be one or more targets inside Loading Loading
api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -1310,6 +1310,7 @@ package android { field public static final int viewportHeight = 16843805; // 0x101041d field public static final int viewportWidth = 16843804; // 0x101041c field public static final int visibility = 16842972; // 0x10100dc field public static final int visibilityMode = 16843902; // 0x101047e field public static final int visible = 16843156; // 0x1010194 field public static final int vmSafeMode = 16843448; // 0x10102b8 field public static final int voiceLanguage = 16843349; // 0x1010255 Loading Loading @@ -30687,6 +30688,9 @@ package android.transition { method public android.animation.Animator onAppear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues); method public android.animation.Animator onDisappear(android.view.ViewGroup, android.transition.TransitionValues, int, android.transition.TransitionValues, int); method public android.animation.Animator onDisappear(android.view.ViewGroup, android.view.View, android.transition.TransitionValues, android.transition.TransitionValues); method public void setMode(int); field public static final int IN = 1; // 0x1 field public static final int OUT = 2; // 0x2 } public abstract class VisibilityPropagation extends android.transition.TransitionPropagation {
core/java/android/transition/Fade.java +8 −15 Original line number Diff line number Diff line Loading @@ -63,23 +63,23 @@ public class Fade extends Visibility { /** * Fading mode used in {@link #Fade(int)} to make the transition * operate on targets that are appearing. Maybe be combined with * {@link #OUT} to fade both in and out. * {@link #OUT} to fade both in and out. Equivalent to * {@link Visibility#IN}. */ public static final int IN = 0x1; public static final int IN = Visibility.IN; /** * Fading mode used in {@link #Fade(int)} to make the transition * operate on targets that are disappearing. Maybe be combined with * {@link #IN} to fade both in and out. * {@link #IN} to fade both in and out. Equivalent to * {@link Visibility#OUT}. */ public static final int OUT = 0x2; private int mFadingMode; public static final int OUT = Visibility.OUT; /** * Constructs a Fade transition that will fade targets in and out. */ public Fade() { this(IN | OUT); } /** Loading @@ -90,7 +90,7 @@ public class Fade extends Visibility { * {@link #IN} and {@link #OUT}. */ public Fade(int fadingMode) { mFadingMode = fadingMode; setMode(fadingMode); } /** Loading @@ -115,9 +115,6 @@ public class Fade extends Visibility { public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) { if ((mFadingMode & IN) != IN || endValues == null) { return null; } if (DBG) { View startView = (startValues != null) ? startValues.view : null; Log.d(LOG_TAG, "Fade.onAppear: startView, startVis, endView, endVis = " + Loading @@ -129,10 +126,6 @@ public class Fade extends Visibility { @Override public Animator onDisappear(ViewGroup sceneRoot, final View view, TransitionValues startValues, TransitionValues endValues) { if ((mFadingMode & OUT) != OUT) { return null; } return createAnimation(view, 1, 0); } Loading
core/java/android/transition/TransitionInflater.java +10 −0 Original line number Diff line number Diff line Loading @@ -349,6 +349,16 @@ public class TransitionInflater { transition.setMatchOrder(parseMatchOrder(matchOrder)); } a.recycle(); if (transition instanceof Visibility) { a = mContext.obtainStyledAttributes(attrs, com.android.internal.R.styleable.VisibilityTransition); int mode = a.getInt( com.android.internal.R.styleable.VisibilityTransition_visibilityMode, 0); a.recycle(); if (mode != 0) { ((Visibility)transition).setMode(mode); } } return transition; } Loading
core/java/android/transition/Visibility.java +37 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,20 @@ public abstract class Visibility extends Transition { private static final String PROPNAME_PARENT = "android:visibility:parent"; private static final String PROPNAME_SCREEN_LOCATION = "android:visibility:screenLocation"; /** * Mode used in {@link #setMode(int)} to make the transition * operate on targets that are appearing. Maybe be combined with * {@link #OUT} to target Visibility changes both in and out. */ public static final int IN = 0x1; /** * Mode used in {@link #setMode(int)} to make the transition * operate on targets that are disappearing. Maybe be combined with * {@link #IN} to target Visibility changes both in and out. */ public static final int OUT = 0x2; private static final String[] sTransitionProperties = { PROPNAME_VISIBILITY, PROPNAME_PARENT, Loading @@ -58,6 +72,22 @@ public abstract class Visibility extends Transition { ViewGroup endParent; } private int mMode = IN | OUT; /** * Changes the transition to support appearing and/or disappearing Views, depending * on <code>mode</code>. * * @param mode The behavior supported by this transition, a combination of * {@link #IN} and {@link #OUT}. */ public void setMode(int mode) { if ((mode & ~(IN | OUT)) != 0) { throw new IllegalArgumentException("Only IN and OUT flags are allowed"); } mMode = mode; } @Override public String[] getTransitionProperties() { return sTransitionProperties; Loading Loading @@ -200,6 +230,9 @@ public abstract class Visibility extends Transition { public Animator onAppear(ViewGroup sceneRoot, TransitionValues startValues, int startVisibility, TransitionValues endValues, int endVisibility) { if ((mMode & IN) != IN || endValues == null) { return null; } return onAppear(sceneRoot, endValues.view, startValues, endValues); } Loading Loading @@ -260,6 +293,10 @@ public abstract class Visibility extends Transition { public Animator onDisappear(ViewGroup sceneRoot, TransitionValues startValues, int startVisibility, TransitionValues endValues, int endVisibility) { if ((mMode & OUT) != OUT) { return null; } View startView = (startValues != null) ? startValues.view : null; View endView = (endValues != null) ? endValues.view : null; View overlayView = null; Loading
core/res/res/values/attrs.xml +17 −0 Original line number Diff line number Diff line Loading @@ -5338,6 +5338,8 @@ resource are available in addition to the specific attributes of Fade described here. --> <declare-styleable name="Fade"> <!-- Equivalent to <code>visibilityMode</code>, fadingMode works only with the Fade transition. --> <attr name="fadingMode"> <!-- Fade will only fade appearing items in. --> <enum name="fade_in" value="1" /> Loading Loading @@ -5366,6 +5368,21 @@ </attr> </declare-styleable> <!-- Use with {@link android.transition.Visibility} transitions, such as <code>slide</code>, <code>explode</code>, and <code>fade</code> to mark which views are supported. --> <declare-styleable name="VisibilityTransition"> <!-- Changes whether the transition supports appearing and/or disappearing Views. Corresponds to {@link android.transition.Visibility#setMode(int)}. --> <attr name="visibilityMode"> <!-- Only appearing Views will be supported. --> <enum name="mode_in" value="1" /> <!-- Only disappearing Views will be supported. --> <enum name="mode_out" value="2" /> <!-- Both appearing and disappearing views will be supported. --> <enum name="mode_in_out" value="3" /> </attr> </declare-styleable> <!-- Use <code>target</code> as the root tag of the XML resource that describes a {@link android.transition.Transition#addTarget(int) targetId} of a transition. There can be one or more targets inside Loading