Java Code Examples for android.transition.Transition#clone()

The following examples show how to use android.transition.Transition#clone() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActivityTransitionCoordinator.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
protected Transition configureTransition(Transition transition,
        boolean includeTransitioningViews) {
    if (transition != null) {
        transition = transition.clone();
        transition.setEpicenterCallback(mEpicenterCallback);
        transition = setTargets(transition, includeTransitioningViews);
    }
    noLayoutSuppressionForVisibilityTransitions(transition);
    return transition;
}
 
Example 2
Source File: FragmentTransition.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Returns a clone of a transition or null if it is null
 */
private static Transition cloneTransition(Transition transition) {
    if (transition != null) {
        transition = transition.clone();
    }
    return transition;
}
 
Example 3
Source File: PopupWindow.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
/**
 * <p>Create a new, empty, non focusable popup window of dimension (0,0).</p>
 *
 * <p>The popup does not provide a background.</p>
 */
public PopupWindow(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
    mContext = context;
    mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);

    final TypedArray a = context.obtainStyledAttributes(
            attrs, R.styleable.PopupWindow, defStyleAttr, defStyleRes);
    final Drawable bg = a.getDrawable(R.styleable.PopupWindow_popupBackground);
    mElevation = a.getDimension(R.styleable.PopupWindow_popupElevation, 0);
    mOverlapAnchor = a.getBoolean(R.styleable.PopupWindow_overlapAnchor, false);

    // Preserve default behavior from Gingerbread. If the animation is
    // undefined or explicitly specifies the Gingerbread animation style,
    // use a sentinel value.
    if (a.hasValueOrEmpty(R.styleable.PopupWindow_popupAnimationStyle)) {
        final int animStyle = a.getResourceId(R.styleable.PopupWindow_popupAnimationStyle, 0);
        if (animStyle == R.style.Animation_PopupWindow) {
            mAnimationStyle = ANIMATION_STYLE_DEFAULT;
        } else {
            mAnimationStyle = animStyle;
        }
    } else {
        mAnimationStyle = ANIMATION_STYLE_DEFAULT;
    }

    final Transition enterTransition = getTransition(a.getResourceId(
            R.styleable.PopupWindow_popupEnterTransition, 0));
    final Transition exitTransition;
    if (a.hasValueOrEmpty(R.styleable.PopupWindow_popupExitTransition)) {
        exitTransition = getTransition(a.getResourceId(
                R.styleable.PopupWindow_popupExitTransition, 0));
    } else {
        exitTransition = enterTransition == null ? null : enterTransition.clone();
    }

    a.recycle();

    setEnterTransition(enterTransition);
    setExitTransition(exitTransition);
    setBackgroundDrawable(bg);
}