Search in sources :

Example 1 with WindowAnimation_wallpaperCloseEnterAnimation

use of com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation in project android_frameworks_base by ParanoidAndroid.

the class AppTransition method loadAnimation.

Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int appWidth, int appHeight) {
    Animation a;
    if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
        a = loadAnimation(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" + " transit=" + transit + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
        a = createScaleUpAnimationLocked(transit, enter, appWidth, appHeight);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" + " transit=" + transit + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
        a = createThumbnailAnimationLocked(transit, enter, false, appWidth, appHeight);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + transit + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else {
        int animAttr = 0;
        switch(transit) {
            case TRANSIT_ACTIVITY_OPEN:
                animAttr = enter ? WindowAnimation_activityOpenEnterAnimation : WindowAnimation_activityOpenExitAnimation;
                break;
            case TRANSIT_ACTIVITY_CLOSE:
                animAttr = enter ? WindowAnimation_activityCloseEnterAnimation : WindowAnimation_activityCloseExitAnimation;
                break;
            case TRANSIT_TASK_OPEN:
                animAttr = enter ? WindowAnimation_taskOpenEnterAnimation : WindowAnimation_taskOpenExitAnimation;
                break;
            case TRANSIT_TASK_CLOSE:
                animAttr = enter ? WindowAnimation_taskCloseEnterAnimation : WindowAnimation_taskCloseExitAnimation;
                break;
            case TRANSIT_TASK_TO_FRONT:
                animAttr = enter ? WindowAnimation_taskToFrontEnterAnimation : WindowAnimation_taskToFrontExitAnimation;
                break;
            case TRANSIT_TASK_TO_BACK:
                animAttr = enter ? WindowAnimation_taskToBackEnterAnimation : WindowAnimation_taskToBackExitAnimation;
                break;
            case TRANSIT_WALLPAPER_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperOpenEnterAnimation : WindowAnimation_wallpaperOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperCloseEnterAnimation : WindowAnimation_wallpaperCloseExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperIntraOpenEnterAnimation : WindowAnimation_wallpaperIntraOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperIntraCloseEnterAnimation : WindowAnimation_wallpaperIntraCloseExitAnimation;
                break;
        }
        a = animAttr != 0 ? loadAnimation(lp, animAttr) : null;
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) + " transit=" + transit + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    }
    return a;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) WindowAnimation_wallpaperIntraCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation) WindowAnimation_taskToBackExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation) WindowAnimation_wallpaperCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation) WindowAnimation_activityOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation) WindowAnimation_wallpaperOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation) WindowAnimation_activityCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation) WindowAnimation_taskToBackEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation) WindowAnimation_activityOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation) WindowAnimation_taskCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation) WindowAnimation_taskOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation) Animation(android.view.animation.Animation) WindowAnimation_wallpaperIntraCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation) WindowAnimation_taskOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation) WindowAnimation_wallpaperOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation) WindowAnimation_activityCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation) WindowAnimation_taskToFrontEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation) WindowAnimation_wallpaperIntraOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation) WindowAnimation_taskCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation) WindowAnimation_wallpaperIntraOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) WindowAnimation_taskToFrontExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation) WindowAnimation_wallpaperCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation) Point(android.graphics.Point)

Example 2 with WindowAnimation_wallpaperCloseEnterAnimation

use of com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation in project platform_frameworks_base by android.

the class AppTransition method loadAnimation.

/**
     *
     * @param frame These are the bounds of the window when it finishes the animation. This is where
     *              the animation must usually finish in entrance animation, as the next frame will
     *              display the window at these coordinates. In case of exit animation, this is
     *              where the animation must start, as the frame before the animation is displaying
     *              the window at these bounds.
     * @param insets Knowing where the window will be positioned is not enough. Some parts of the
     *               window might be obscured, usually by the system windows (status bar and
     *               navigation bar) and we use content insets to convey that information. This
     *               usually affects the animation aspects vertically, as the system decoration is
     *               at the top and the bottom. For example when we animate from full screen to
     *               recents, we want to exclude the covered parts, because they won't match the
     *               thumbnail after the last frame is executed.
     * @param surfaceInsets In rare situation the surface is larger than the content and we need to
     *                      know about this to make the animation frames match. We currently use
     *                      this for freeform windows, which have larger surfaces to display
     *                      shadows. When we animate them from recents, we want to match the content
     *                      to the recents thumbnail and hence need to account for the surface being
     *                      bigger.
     */
Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int uiMode, int orientation, Rect frame, Rect displayFrame, Rect insets, @Nullable Rect surfaceInsets, boolean isVoiceInteraction, boolean freeform, int taskId) {
    Animation a;
    if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_open_enter : com.android.internal.R.anim.voice_activity_open_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_CLOSE || transit == TRANSIT_TASK_CLOSE || transit == TRANSIT_TASK_TO_BACK)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_close_enter : com.android.internal.R.anim.voice_activity_close_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (transit == TRANSIT_ACTIVITY_RELAUNCH) {
        a = createRelaunchAnimation(frame, insets);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + mNextAppTransition + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
        a = loadAnimationRes(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
        a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) {
        a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
        a = createScaleUpAnimationLocked(transit, enter, frame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
        a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), frame, transit, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP);
        a = createAspectScaledThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), uiMode, orientation, transit, frame, insets, surfaceInsets, freeform, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else {
        int animAttr = 0;
        switch(transit) {
            case TRANSIT_ACTIVITY_OPEN:
                animAttr = enter ? WindowAnimation_activityOpenEnterAnimation : WindowAnimation_activityOpenExitAnimation;
                break;
            case TRANSIT_ACTIVITY_CLOSE:
                animAttr = enter ? WindowAnimation_activityCloseEnterAnimation : WindowAnimation_activityCloseExitAnimation;
                break;
            case TRANSIT_DOCK_TASK_FROM_RECENTS:
            case TRANSIT_TASK_OPEN:
                animAttr = enter ? WindowAnimation_taskOpenEnterAnimation : WindowAnimation_taskOpenExitAnimation;
                break;
            case TRANSIT_TASK_CLOSE:
                animAttr = enter ? WindowAnimation_taskCloseEnterAnimation : WindowAnimation_taskCloseExitAnimation;
                break;
            case TRANSIT_TASK_TO_FRONT:
                animAttr = enter ? WindowAnimation_taskToFrontEnterAnimation : WindowAnimation_taskToFrontExitAnimation;
                break;
            case TRANSIT_TASK_TO_BACK:
                animAttr = enter ? WindowAnimation_taskToBackEnterAnimation : WindowAnimation_taskToBackExitAnimation;
                break;
            case TRANSIT_WALLPAPER_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperOpenEnterAnimation : WindowAnimation_wallpaperOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperCloseEnterAnimation : WindowAnimation_wallpaperCloseExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperIntraOpenEnterAnimation : WindowAnimation_wallpaperIntraOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperIntraCloseEnterAnimation : WindowAnimation_wallpaperIntraCloseExitAnimation;
                break;
            case TRANSIT_TASK_OPEN_BEHIND:
                animAttr = enter ? WindowAnimation_launchTaskBehindSourceAnimation : WindowAnimation_launchTaskBehindTargetAnimation;
        }
        a = animAttr != 0 ? loadAnimationAttr(lp, animAttr) : null;
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    }
    return a;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) WindowAnimation_wallpaperCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation) CurvedTranslateAnimation(com.android.server.wm.animation.CurvedTranslateAnimation) WindowAnimation_activityOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation) WindowAnimation_wallpaperOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation) WindowAnimation_taskToBackEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation) WindowAnimation_activityOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) ClipRectAnimation(android.view.animation.ClipRectAnimation) WindowAnimation_wallpaperOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation) WindowAnimation_launchTaskBehindTargetAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation) WindowAnimation_launchTaskBehindSourceAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindSourceAnimation) WindowAnimation_taskCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) WindowAnimation_wallpaperIntraCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation) WindowAnimation_taskToBackExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation) WindowAnimation_activityCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation) WindowAnimation_taskCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation) WindowAnimation_taskOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation) WindowAnimation_wallpaperIntraCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation) ClipRectTBAnimation(com.android.server.wm.animation.ClipRectTBAnimation) WindowAnimation_taskOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation) ClipRectLRAnimation(com.android.server.wm.animation.ClipRectLRAnimation) WindowAnimation_activityCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation) WindowAnimation_taskToFrontEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation) WindowAnimation_wallpaperIntraOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation) WindowAnimation_wallpaperIntraOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation) WindowAnimation_taskToFrontExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation) WindowAnimation_wallpaperCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)

Example 3 with WindowAnimation_wallpaperCloseEnterAnimation

use of com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation in project android_frameworks_base by DirtyUnicorns.

the class AppTransition method loadAnimation.

/**
     *
     * @param frame These are the bounds of the window when it finishes the animation. This is where
     *              the animation must usually finish in entrance animation, as the next frame will
     *              display the window at these coordinates. In case of exit animation, this is
     *              where the animation must start, as the frame before the animation is displaying
     *              the window at these bounds.
     * @param insets Knowing where the window will be positioned is not enough. Some parts of the
     *               window might be obscured, usually by the system windows (status bar and
     *               navigation bar) and we use content insets to convey that information. This
     *               usually affects the animation aspects vertically, as the system decoration is
     *               at the top and the bottom. For example when we animate from full screen to
     *               recents, we want to exclude the covered parts, because they won't match the
     *               thumbnail after the last frame is executed.
     * @param surfaceInsets In rare situation the surface is larger than the content and we need to
     *                      know about this to make the animation frames match. We currently use
     *                      this for freeform windows, which have larger surfaces to display
     *                      shadows. When we animate them from recents, we want to match the content
     *                      to the recents thumbnail and hence need to account for the surface being
     *                      bigger.
     */
Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int uiMode, int orientation, Rect frame, Rect displayFrame, Rect insets, @Nullable Rect surfaceInsets, boolean isVoiceInteraction, boolean freeform, int taskId) {
    Animation a;
    if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_open_enter : com.android.internal.R.anim.voice_activity_open_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_CLOSE || transit == TRANSIT_TASK_CLOSE || transit == TRANSIT_TASK_TO_BACK)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_close_enter : com.android.internal.R.anim.voice_activity_close_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (transit == TRANSIT_ACTIVITY_RELAUNCH) {
        a = createRelaunchAnimation(frame, insets);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + mNextAppTransition + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
        a = loadAnimationRes(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
        a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) {
        a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
        a = createScaleUpAnimationLocked(transit, enter, frame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
        a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), frame, transit, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP);
        a = createAspectScaledThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), uiMode, orientation, transit, frame, insets, surfaceInsets, freeform, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else {
        int animAttr = 0;
        switch(transit) {
            case TRANSIT_ACTIVITY_OPEN:
                animAttr = enter ? WindowAnimation_activityOpenEnterAnimation : WindowAnimation_activityOpenExitAnimation;
                break;
            case TRANSIT_ACTIVITY_CLOSE:
                animAttr = enter ? WindowAnimation_activityCloseEnterAnimation : WindowAnimation_activityCloseExitAnimation;
                break;
            case TRANSIT_DOCK_TASK_FROM_RECENTS:
            case TRANSIT_TASK_OPEN:
                animAttr = enter ? WindowAnimation_taskOpenEnterAnimation : WindowAnimation_taskOpenExitAnimation;
                break;
            case TRANSIT_TASK_CLOSE:
                animAttr = enter ? WindowAnimation_taskCloseEnterAnimation : WindowAnimation_taskCloseExitAnimation;
                break;
            case TRANSIT_TASK_TO_FRONT:
                animAttr = enter ? WindowAnimation_taskToFrontEnterAnimation : WindowAnimation_taskToFrontExitAnimation;
                break;
            case TRANSIT_TASK_TO_BACK:
                animAttr = enter ? WindowAnimation_taskToBackEnterAnimation : WindowAnimation_taskToBackExitAnimation;
                break;
            case TRANSIT_WALLPAPER_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperOpenEnterAnimation : WindowAnimation_wallpaperOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperCloseEnterAnimation : WindowAnimation_wallpaperCloseExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_OPEN:
                animAttr = enter ? WindowAnimation_wallpaperIntraOpenEnterAnimation : WindowAnimation_wallpaperIntraOpenExitAnimation;
                break;
            case TRANSIT_WALLPAPER_INTRA_CLOSE:
                animAttr = enter ? WindowAnimation_wallpaperIntraCloseEnterAnimation : WindowAnimation_wallpaperIntraCloseExitAnimation;
                break;
            case TRANSIT_TASK_OPEN_BEHIND:
                animAttr = enter ? WindowAnimation_launchTaskBehindSourceAnimation : WindowAnimation_launchTaskBehindTargetAnimation;
        }
        a = animAttr != 0 ? loadAnimationAttr(lp, animAttr) : null;
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    }
    return a;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) WindowAnimation_wallpaperCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation) CurvedTranslateAnimation(com.android.server.wm.animation.CurvedTranslateAnimation) WindowAnimation_activityOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation) WindowAnimation_wallpaperOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation) WindowAnimation_taskToBackEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation) WindowAnimation_activityOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) ClipRectAnimation(android.view.animation.ClipRectAnimation) WindowAnimation_wallpaperOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation) WindowAnimation_launchTaskBehindTargetAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation) WindowAnimation_launchTaskBehindSourceAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindSourceAnimation) WindowAnimation_taskCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) WindowAnimation_wallpaperIntraCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation) WindowAnimation_taskToBackExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation) WindowAnimation_activityCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation) WindowAnimation_taskCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation) WindowAnimation_taskOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation) WindowAnimation_wallpaperIntraCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation) ClipRectTBAnimation(com.android.server.wm.animation.ClipRectTBAnimation) WindowAnimation_taskOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation) ClipRectLRAnimation(com.android.server.wm.animation.ClipRectLRAnimation) WindowAnimation_activityCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation) WindowAnimation_taskToFrontEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation) WindowAnimation_wallpaperIntraOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation) WindowAnimation_wallpaperIntraOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation) WindowAnimation_taskToFrontExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation) WindowAnimation_wallpaperCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)

Example 4 with WindowAnimation_wallpaperCloseEnterAnimation

use of com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation in project android_frameworks_base by crdroidandroid.

the class AppTransition method loadAnimation.

/**
     *
     * @param frame These are the bounds of the window when it finishes the animation. This is where
     *              the animation must usually finish in entrance animation, as the next frame will
     *              display the window at these coordinates. In case of exit animation, this is
     *              where the animation must start, as the frame before the animation is displaying
     *              the window at these bounds.
     * @param insets Knowing where the window will be positioned is not enough. Some parts of the
     *               window might be obscured, usually by the system windows (status bar and
     *               navigation bar) and we use content insets to convey that information. This
     *               usually affects the animation aspects vertically, as the system decoration is
     *               at the top and the bottom. For example when we animate from full screen to
     *               recents, we want to exclude the covered parts, because they won't match the
     *               thumbnail after the last frame is executed.
     * @param surfaceInsets In rare situation the surface is larger than the content and we need to
     *                      know about this to make the animation frames match. We currently use
     *                      this for freeform windows, which have larger surfaces to display
     *                      shadows. When we animate them from recents, we want to match the content
     *                      to the recents thumbnail and hence need to account for the surface being
     *                      bigger.
     */
Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int uiMode, int orientation, Rect frame, Rect displayFrame, Rect insets, @Nullable Rect surfaceInsets, boolean isVoiceInteraction, boolean freeform, int taskId) {
    mIsResId = false;
    Animation a;
    if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_open_enter : com.android.internal.R.anim.voice_activity_open_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_CLOSE || transit == TRANSIT_TASK_CLOSE || transit == TRANSIT_TASK_TO_BACK)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_close_enter : com.android.internal.R.anim.voice_activity_close_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (transit == TRANSIT_ACTIVITY_RELAUNCH) {
        a = createRelaunchAnimation(frame, insets);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + mNextAppTransition + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
        a = loadAnimationRes(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
        a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) {
        a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
        a = createScaleUpAnimationLocked(transit, enter, frame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
        a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), frame, transit, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP);
        a = createAspectScaledThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), uiMode, orientation, transit, frame, insets, surfaceInsets, freeform, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else {
        int animAttr = 0;
        switch(transit) {
            case TRANSIT_ACTIVITY_OPEN:
                if (mActivityAnimations[0] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[0]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_activityOpenEnterAnimation : WindowAnimation_activityOpenExitAnimation;
                }
                break;
            case TRANSIT_ACTIVITY_CLOSE:
                if (mActivityAnimations[1] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[1]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_activityCloseEnterAnimation : WindowAnimation_activityCloseExitAnimation;
                }
                break;
            case TRANSIT_DOCK_TASK_FROM_RECENTS:
            case TRANSIT_TASK_OPEN:
                if (mActivityAnimations[2] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[2]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskOpenEnterAnimation : WindowAnimation_taskOpenExitAnimation;
                }
                break;
            case TRANSIT_TASK_CLOSE:
                if (mActivityAnimations[3] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[3]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskCloseEnterAnimation : WindowAnimation_taskCloseExitAnimation;
                }
                break;
            case TRANSIT_TASK_TO_FRONT:
                if (mActivityAnimations[4] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[4]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskToFrontEnterAnimation : WindowAnimation_taskToFrontExitAnimation;
                }
                break;
            case TRANSIT_TASK_TO_BACK:
                if (mActivityAnimations[5] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[5]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskToBackEnterAnimation : WindowAnimation_taskToBackExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_OPEN:
                if (mActivityAnimations[6] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[6]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperOpenEnterAnimation : WindowAnimation_wallpaperOpenExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_CLOSE:
                if (mActivityAnimations[7] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[7]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperCloseEnterAnimation : WindowAnimation_wallpaperCloseExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_INTRA_OPEN:
                if (mActivityAnimations[8] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[8]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperIntraOpenEnterAnimation : WindowAnimation_wallpaperIntraOpenExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_INTRA_CLOSE:
                if (mActivityAnimations[9] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[9]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperIntraCloseEnterAnimation : WindowAnimation_wallpaperIntraCloseExitAnimation;
                }
                break;
            case TRANSIT_TASK_OPEN_BEHIND:
                if (mActivityAnimations[10] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[10]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_launchTaskBehindSourceAnimation : WindowAnimation_launchTaskBehindTargetAnimation;
                }
        }
        a = animAttr != 0 ? loadAnimationAttr(lp, animAttr) : null;
        if (a != null) {
            if (mAnimationDuration > 0) {
                a.setDuration(mAnimationDuration);
            }
        }
        mIsResId = false;
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    }
    return a;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) WindowAnimation_wallpaperCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation) CurvedTranslateAnimation(com.android.server.wm.animation.CurvedTranslateAnimation) WindowAnimation_activityOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation) WindowAnimation_wallpaperOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation) WindowAnimation_taskToBackEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation) WindowAnimation_activityOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) ClipRectAnimation(android.view.animation.ClipRectAnimation) WindowAnimation_wallpaperOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation) WindowAnimation_launchTaskBehindTargetAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation) WindowAnimation_launchTaskBehindSourceAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindSourceAnimation) WindowAnimation_taskCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) WindowAnimation_wallpaperIntraCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation) WindowAnimation_taskToBackExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation) WindowAnimation_activityCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation) WindowAnimation_taskCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation) WindowAnimation_taskOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation) WindowAnimation_wallpaperIntraCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation) ClipRectTBAnimation(com.android.server.wm.animation.ClipRectTBAnimation) WindowAnimation_taskOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation) ClipRectLRAnimation(com.android.server.wm.animation.ClipRectLRAnimation) WindowAnimation_activityCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation) WindowAnimation_taskToFrontEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation) WindowAnimation_wallpaperIntraOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation) WindowAnimation_wallpaperIntraOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation) WindowAnimation_taskToFrontExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation) WindowAnimation_wallpaperCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)

Example 5 with WindowAnimation_wallpaperCloseEnterAnimation

use of com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation in project android_frameworks_base by ResurrectionRemix.

the class AppTransition method loadAnimation.

/**
     *
     * @param frame These are the bounds of the window when it finishes the animation. This is where
     *              the animation must usually finish in entrance animation, as the next frame will
     *              display the window at these coordinates. In case of exit animation, this is
     *              where the animation must start, as the frame before the animation is displaying
     *              the window at these bounds.
     * @param insets Knowing where the window will be positioned is not enough. Some parts of the
     *               window might be obscured, usually by the system windows (status bar and
     *               navigation bar) and we use content insets to convey that information. This
     *               usually affects the animation aspects vertically, as the system decoration is
     *               at the top and the bottom. For example when we animate from full screen to
     *               recents, we want to exclude the covered parts, because they won't match the
     *               thumbnail after the last frame is executed.
     * @param surfaceInsets In rare situation the surface is larger than the content and we need to
     *                      know about this to make the animation frames match. We currently use
     *                      this for freeform windows, which have larger surfaces to display
     *                      shadows. When we animate them from recents, we want to match the content
     *                      to the recents thumbnail and hence need to account for the surface being
     *                      bigger.
     */
Animation loadAnimation(WindowManager.LayoutParams lp, int transit, boolean enter, int uiMode, int orientation, Rect frame, Rect displayFrame, Rect insets, @Nullable Rect surfaceInsets, boolean isVoiceInteraction, boolean freeform, int taskId) {
    mIsResId = false;
    Animation a;
    if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_OPEN || transit == TRANSIT_TASK_OPEN || transit == TRANSIT_TASK_TO_FRONT)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_open_enter : com.android.internal.R.anim.voice_activity_open_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (isVoiceInteraction && (transit == TRANSIT_ACTIVITY_CLOSE || transit == TRANSIT_TASK_CLOSE || transit == TRANSIT_TASK_TO_BACK)) {
        a = loadAnimationRes(lp, enter ? com.android.internal.R.anim.voice_activity_close_enter : com.android.internal.R.anim.voice_activity_close_exit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation voice:" + " anim=" + a + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (transit == TRANSIT_ACTIVITY_RELAUNCH) {
        a = createRelaunchAnimation(frame, insets);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + mNextAppTransition + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM) {
        a = loadAnimationRes(mNextAppTransitionPackage, enter ? mNextAppTransitionEnter : mNextAppTransitionExit);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CUSTOM_IN_PLACE) {
        a = loadAnimationRes(mNextAppTransitionPackage, mNextAppTransitionInPlace);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CUSTOM_IN_PLACE" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_CLIP_REVEAL) {
        a = createClipRevealAnimationLocked(transit, enter, frame, displayFrame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_CLIP_REVEAL" + " transit=" + appTransitionToString(transit) + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_SCALE_UP) {
        a = createScaleUpAnimationLocked(transit, enter, frame);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=ANIM_SCALE_UP" + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP);
        a = createThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), frame, transit, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_SCALE_UP" : "ANIM_THUMBNAIL_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else if (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP || mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_DOWN) {
        mNextAppTransitionScaleUp = (mNextAppTransitionType == NEXT_TRANSIT_TYPE_THUMBNAIL_ASPECT_SCALE_UP);
        a = createAspectScaledThumbnailEnterExitAnimationLocked(getThumbnailTransitionState(enter), uiMode, orientation, transit, frame, insets, surfaceInsets, freeform, taskId);
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM) {
            String animName = mNextAppTransitionScaleUp ? "ANIM_THUMBNAIL_ASPECT_SCALE_UP" : "ANIM_THUMBNAIL_ASPECT_SCALE_DOWN";
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " nextAppTransition=" + animName + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
        }
    } else {
        int animAttr = 0;
        switch(transit) {
            case TRANSIT_ACTIVITY_OPEN:
                if (mActivityAnimations[0] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[0]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_activityOpenEnterAnimation : WindowAnimation_activityOpenExitAnimation;
                }
                break;
            case TRANSIT_ACTIVITY_CLOSE:
                if (mActivityAnimations[1] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[1]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_activityCloseEnterAnimation : WindowAnimation_activityCloseExitAnimation;
                }
                break;
            case TRANSIT_DOCK_TASK_FROM_RECENTS:
            case TRANSIT_TASK_OPEN:
                if (mActivityAnimations[2] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[2]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskOpenEnterAnimation : WindowAnimation_taskOpenExitAnimation;
                }
                break;
            case TRANSIT_TASK_CLOSE:
                if (mActivityAnimations[3] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[3]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskCloseEnterAnimation : WindowAnimation_taskCloseExitAnimation;
                }
                break;
            case TRANSIT_TASK_TO_FRONT:
                if (mActivityAnimations[4] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[4]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskToFrontEnterAnimation : WindowAnimation_taskToFrontExitAnimation;
                }
                break;
            case TRANSIT_TASK_TO_BACK:
                if (mActivityAnimations[5] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[5]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_taskToBackEnterAnimation : WindowAnimation_taskToBackExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_OPEN:
                if (mActivityAnimations[6] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[6]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperOpenEnterAnimation : WindowAnimation_wallpaperOpenExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_CLOSE:
                if (mActivityAnimations[7] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[7]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperCloseEnterAnimation : WindowAnimation_wallpaperCloseExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_INTRA_OPEN:
                if (mActivityAnimations[8] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[8]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperIntraOpenEnterAnimation : WindowAnimation_wallpaperIntraOpenExitAnimation;
                }
                break;
            case TRANSIT_WALLPAPER_INTRA_CLOSE:
                if (mActivityAnimations[9] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[9]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_wallpaperIntraCloseEnterAnimation : WindowAnimation_wallpaperIntraCloseExitAnimation;
                }
                break;
            case TRANSIT_TASK_OPEN_BEHIND:
                if (mActivityAnimations[10] != 0) {
                    mIsResId = true;
                    int[] animArray = AwesomeAnimationHelper.getAnimations(mActivityAnimations[10]);
                    animAttr = enter ? animArray[1] : animArray[0];
                } else {
                    animAttr = enter ? WindowAnimation_launchTaskBehindSourceAnimation : WindowAnimation_launchTaskBehindTargetAnimation;
                }
        }
        a = animAttr != 0 ? loadAnimationAttr(lp, animAttr) : null;
        if (a != null) {
            if (mAnimationDuration > 0) {
                a.setDuration(mAnimationDuration);
            }
        }
        mIsResId = false;
        if (DEBUG_APP_TRANSITIONS || DEBUG_ANIM)
            Slog.v(TAG, "applyAnimation:" + " anim=" + a + " animAttr=0x" + Integer.toHexString(animAttr) + " transit=" + appTransitionToString(transit) + " isEntrance=" + enter + " Callers=" + Debug.getCallers(3));
    }
    return a;
}
Also used : ScaleAnimation(android.view.animation.ScaleAnimation) WindowAnimation_wallpaperCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation) CurvedTranslateAnimation(com.android.server.wm.animation.CurvedTranslateAnimation) WindowAnimation_activityOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation) WindowAnimation_wallpaperOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenExitAnimation) WindowAnimation_taskToBackEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation) WindowAnimation_activityOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation) TranslateAnimation(android.view.animation.TranslateAnimation) Animation(android.view.animation.Animation) ClipRectAnimation(android.view.animation.ClipRectAnimation) WindowAnimation_wallpaperOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperOpenEnterAnimation) WindowAnimation_launchTaskBehindTargetAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindTargetAnimation) WindowAnimation_launchTaskBehindSourceAnimation(com.android.internal.R.styleable.WindowAnimation_launchTaskBehindSourceAnimation) WindowAnimation_taskCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation) AlphaAnimation(android.view.animation.AlphaAnimation) WindowAnimation_wallpaperIntraCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation) WindowAnimation_taskToBackExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation) WindowAnimation_activityCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation) WindowAnimation_taskCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation) WindowAnimation_taskOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation) WindowAnimation_wallpaperIntraCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation) ClipRectTBAnimation(com.android.server.wm.animation.ClipRectTBAnimation) WindowAnimation_taskOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation) ClipRectLRAnimation(com.android.server.wm.animation.ClipRectLRAnimation) WindowAnimation_activityCloseExitAnimation(com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation) WindowAnimation_taskToFrontEnterAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation) WindowAnimation_wallpaperIntraOpenEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation) WindowAnimation_wallpaperIntraOpenExitAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenExitAnimation) WindowAnimation_taskToFrontExitAnimation(com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation) WindowAnimation_wallpaperCloseEnterAnimation(com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)

Aggregations

AlphaAnimation (android.view.animation.AlphaAnimation)5 Animation (android.view.animation.Animation)5 ScaleAnimation (android.view.animation.ScaleAnimation)5 WindowAnimation_activityCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseEnterAnimation)5 WindowAnimation_activityCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityCloseExitAnimation)5 WindowAnimation_activityOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenEnterAnimation)5 WindowAnimation_activityOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_activityOpenExitAnimation)5 WindowAnimation_taskCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseEnterAnimation)5 WindowAnimation_taskCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskCloseExitAnimation)5 WindowAnimation_taskOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenEnterAnimation)5 WindowAnimation_taskOpenExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskOpenExitAnimation)5 WindowAnimation_taskToBackEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackEnterAnimation)5 WindowAnimation_taskToBackExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToBackExitAnimation)5 WindowAnimation_taskToFrontEnterAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontEnterAnimation)5 WindowAnimation_taskToFrontExitAnimation (com.android.internal.R.styleable.WindowAnimation_taskToFrontExitAnimation)5 WindowAnimation_wallpaperCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseEnterAnimation)5 WindowAnimation_wallpaperCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperCloseExitAnimation)5 WindowAnimation_wallpaperIntraCloseEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseEnterAnimation)5 WindowAnimation_wallpaperIntraCloseExitAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperIntraCloseExitAnimation)5 WindowAnimation_wallpaperIntraOpenEnterAnimation (com.android.internal.R.styleable.WindowAnimation_wallpaperIntraOpenEnterAnimation)5