ChangeClipBoundspublic class ChangeClipBounds extends Transition ChangeClipBounds captures the {@link android.view.View#getClipBounds()} before and after the
scene change and animates those changes during the transition. |
Fields Summary |
---|
private static final String | TAG | private static final String | PROPNAME_CLIP | private static final String | PROPNAME_BOUNDS | private static final String[] | sTransitionProperties |
Methods Summary |
---|
public void | captureEndValues(TransitionValues transitionValues)
captureValues(transitionValues);
| public void | captureStartValues(TransitionValues transitionValues)
captureValues(transitionValues);
| private void | captureValues(TransitionValues values)
View view = values.view;
if (view.getVisibility() == View.GONE) {
return;
}
Rect clip = view.getClipBounds();
values.values.put(PROPNAME_CLIP, clip);
if (clip == null) {
Rect bounds = new Rect(0, 0, view.getWidth(), view.getHeight());
values.values.put(PROPNAME_BOUNDS, bounds);
}
| public android.animation.Animator | createAnimator(android.view.ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues)
if (startValues == null || endValues == null
|| !startValues.values.containsKey(PROPNAME_CLIP)
|| !endValues.values.containsKey(PROPNAME_CLIP)) {
return null;
}
Rect start = (Rect) startValues.values.get(PROPNAME_CLIP);
Rect end = (Rect) endValues.values.get(PROPNAME_CLIP);
if (start == null && end == null) {
return null; // No animation required since there is no clip.
}
if (start == null) {
start = (Rect) startValues.values.get(PROPNAME_BOUNDS);
} else if (end == null) {
end = (Rect) endValues.values.get(PROPNAME_BOUNDS);
}
if (start.equals(end)) {
return null;
}
endValues.view.setClipBounds(start);
RectEvaluator evaluator = new RectEvaluator(new Rect());
return ObjectAnimator.ofObject(endValues.view, "clipBounds", evaluator, start, end);
| public java.lang.String[] | getTransitionProperties()
return sTransitionProperties;
|
|