鎖屏的一些動畫


緊急呼救或者鎖屏相機按返回鍵返回鎖屏時,播放的動畫是wallpaper_open_exit,如下:

    private boolean setKeyguardOccludedLw(boolean isOccluded) {
        boolean wasOccluded = mKeyguardOccluded;
        boolean showing = mKeyguardDelegate.isShowing();
        if (wasOccluded && !isOccluded && showing) {
            mKeyguardOccluded = false;
            mKeyguardDelegate.setOccluded(false, true /* animate */);
            mStatusBar.getAttrs().privateFlags |= PRIVATE_FLAG_KEYGUARD;
            if (!mKeyguardDelegate.hasLockscreenWallpaper()) {
                mStatusBar.getAttrs().flags |= FLAG_SHOW_WALLPAPER;
            }
            Animation anim = AnimationUtils.loadAnimation(mContext,
                    com.android.internal.R.anim.wallpaper_open_exit);
            mWindowManagerFuncs.overridePlayingAppAnimationsLw(anim);
            return true;
        } else if (!wasOccluded && isOccluded && showing) {
            mKeyguardOccluded = true;
            mKeyguardDelegate.setOccluded(true, false /* animate */);
            mStatusBar.getAttrs().privateFlags &= ~PRIVATE_FLAG_KEYGUARD;
            mStatusBar.getAttrs().flags &= ~FLAG_SHOW_WALLPAPER;
            return true;
        } else {
            return false;
        }
    }

  如果返回過程中會閃現桌面壁紙,可更改該動畫,如下:將位移動畫注釋掉

<set xmlns:android="http://schemas.android.com/apk/res/android"
        android:shareInterpolator="false" android:zAdjustment="top">
<!--gome add by jwb-->
    <alpha android:fromAlpha="1.0" android:toAlpha="1.0"
            android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
            android:interpolator="@interpolator/accelerate_quad"
            android:startOffset="250"
            android:duration="500"/>

    <!--<translate android:fromYDelta="0" android:toYDelta="110%"
            android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
            android:interpolator="@interpolator/fast_out_linear_in"
            android:duration="225"/>

    <scale android:fromXScale="1.0" android:toXScale="1.0"
            android:fromYScale="1.0" android:toYScale="1.0"
            android:fillEnabled="true" android:fillBefore="true" android:fillAfter="true"
            android:pivotX="50%p" android:pivotY="50%p"
            android:interpolator="@interpolator/fast_out_slow_in"
            android:duration="225" />-->
</set>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM