public class Scale extends Visibility
Visibility transition implementation that tracks changes to the visibility of target
views in the start and end scenes and scales up or down views in the scene. Visibility is
determined by the View.setVisibility(int) state of the views.
Scale transition can be described in a resource file by using the transition tag with
class attribute set to universum.studios.android.transition.Scale, along with
Xml attributes referenced below.
Scale Attributes| Modifier and Type | Class and Description |
|---|---|
static interface |
Scale.ScaleMode
Defines an annotation for determining set of allowed modes for Scale transition.
|
Transition.EpicenterCallback, Transition.TransitionListener| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_SCALE_X
Name of the view's property used to scale size of a specific view along its x axis.
|
static String |
PROPERTY_SCALE_Y
Name of the view's property used to scale size of a specific view along its y axis.
|
MODE_IN, MODE_OUTMATCH_ID, MATCH_INSTANCE, MATCH_ITEM_ID, MATCH_NAME| Constructor and Description |
|---|
Scale()
|
Scale(Context context,
AttributeSet attrs)
Creates a new instance of Scale transition with animation property values set from the
specified attrs.
|
Scale(int mode)
Creates a new instance of Scale transition with the specified mode.
|
| Modifier and Type | Method and Description |
|---|---|
static Animator |
createAnimator(View view,
float startScale,
float endScale)
Creates a new instance of scale Animator for the specified view.
|
Float |
getPivotX()
Returns the x coordinate for pivot of the scale animation.
|
float |
getPivotXFraction()
Returns the fraction of the pivot x coordinate.
|
Float |
getPivotY()
Returns the y coordinate for pivot of the scale animation.
|
float |
getPivotYFraction()
Returns the fraction of the pivot y coordinate.
|
Animator |
onAppear(ViewGroup sceneRoot,
View view,
TransitionValues startValues,
TransitionValues endValues) |
Animator |
onDisappear(ViewGroup sceneRoot,
View view,
TransitionValues startValues,
TransitionValues endValues) |
void |
setPivotX(Float pivotX)
Sets a pivot x coordinate for scale animation.
|
void |
setPivotXFraction(float fractionX)
Sets a fraction for the pivot x coordinate.
|
void |
setPivotY(Float pivotY)
Sets a pivot y coordinate for scale animation.
|
void |
setPivotYFraction(float fractionY)
Sets a fraction for the pivot y coordinate.
|
captureEndValues, captureStartValues, createAnimator, getMode, getTransitionProperties, isTransitionRequired, isVisible, onAppear, onDisappear, setModeaddListener, addTarget, addTarget, addTarget, addTarget, canRemoveViews, clone, excludeChildren, excludeChildren, excludeChildren, excludeTarget, excludeTarget, excludeTarget, excludeTarget, getDuration, getEpicenter, getEpicenterCallback, getInterpolator, getName, getPathMotion, getPropagation, getStartDelay, getTargetIds, getTargetNames, getTargets, getTargetTypes, getTransitionValues, removeListener, removeTarget, removeTarget, removeTarget, removeTarget, setDuration, setEpicenterCallback, setInterpolator, setMatchOrder, setPathMotion, setPropagation, setStartDelay, toStringpublic static final String PROPERTY_SCALE_X
public static final String PROPERTY_SCALE_Y
public Scale()
public Scale(int mode)
mode - One of Visibility.MODE_IN or Visibility.MODE_OUT or theirs combination.public Scale(@NonNull Context context, @NonNull AttributeSet attrs)
context - Context used to obtain values from the specified attrs.attrs - Set of attributes from which to obtain animation property values for the scale
animation.@NonNull public static Animator createAnimator(@NonNull View view, float startScale, float endScale)
view - The view for which to create the requested animator.startScale - Scale from which to start the animation.endScale - Scale at which should the animation end.public void setPivotX(@Nullable Float pivotX)
Default value: null
pivotX - The desired pivot x coordinate in pixels. May be null to use pivot
fraction specified via setPivotXFraction(float) instead.getPivotX(),
setPivotXFraction(float),
setPivotY(Float)@Nullable public Float getPivotX()
null if no pivot has been specified.setPivotX(Float)public void setPivotY(@Nullable Float pivotY)
Default value: null
pivotY - The desired pivot y coordinate in pixels. May be null to use pivot
fraction specified via setPivotYFraction(float) instead.getPivotY(),
setPivotYFraction(float),
setPivotX(Float)@Nullable public Float getPivotY()
null if no pivot has been specified.setPivotY(Float)public void setPivotXFraction(float fractionX)
setPivotX(Float).
Default value: 0.5
fractionX - The desired fraction from the [0.0, 1.0] range.getPivotYFraction(),
setPivotXFraction(float),
setPivotX(Float)public float getPivotXFraction()
[0.0, 1.0] range.setPivotXFraction(float)public void setPivotYFraction(float fractionY)
setPivotY(Float).
Default value: 0.5
fractionY - The desired fraction from the [0.0, 1.0] range.getPivotXFraction(),
setPivotYFraction(float),
setPivotY(Float)public float getPivotYFraction()
[0.0, 1.0] range.setPivotYFraction(float)public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
onAppear in class Visibilitypublic Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues)
onDisappear in class Visibility