首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

4.2 锁屏小元件亮屏时不显示边框

2013-12-04 
4.2 锁屏小部件亮屏时不显示边框?先说明下,这是android4.2锁屏的界面。左边是4.2的新特性,可以添加WIDGET。

4.2 锁屏小部件亮屏时不显示边框

?

先说明下,这是android4.2锁屏的界面。左边是4.2的新特性,可以添加WIDGET。

问题:唤醒屏时不应该有这个显示

?

首先,了解下为什么会有“这个”显示

代码在:

frameworks/base/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewStateManager.java

    void hideOutlinesAndSidePages() {        animateOutlinesAndSidePages(false);    }    void animateOutlinesAndSidePages(final boolean show) {        animateOutlinesAndSidePages(show, -1);    }void animateOutlinesAndSidePages(final boolean show, int duration) {        if (mChildrenOutlineFadeAnimation != null) {            mChildrenOutlineFadeAnimation.cancel();            mChildrenOutlineFadeAnimation = null;        }        int count = getChildCount();        PropertyValuesHolder alpha;        ArrayList<Animator> anims = new ArrayList<Animator>();        if (duration == -1) {            duration = show ? CHILDREN_OUTLINE_FADE_IN_DURATION :                CHILDREN_OUTLINE_FADE_OUT_DURATION;        }        int curPage = getNextPage();        for (int i = 0; i < count; i++) {            float finalContentAlpha;            if (show) {                finalContentAlpha = getAlphaForPage(mScreenCenter, i, true);            } else if (!show && i == curPage) {                finalContentAlpha = 1f;            } else {                finalContentAlpha = 0f;            }            KeyguardWidgetFrame child = getWidgetPageAt(i);            alpha = PropertyValuesHolder.ofFloat("contentAlpha", finalContentAlpha);            ObjectAnimator a = ObjectAnimator.ofPropertyValuesHolder(child, alpha);            anims.add(a);            float finalOutlineAlpha = show ? getOutlineAlphaForPage(mScreenCenter, i, true) : 0f;            child.fadeFrame(this, show, finalOutlineAlpha, duration);        }        mChildrenOutlineFadeAnimation = new AnimatorSet();        mChildrenOutlineFadeAnimation.playTogether(anims);        mChildrenOutlineFadeAnimation.setDuration(duration);        mChildrenOutlineFadeAnimation.addListener(new AnimatorListenerAdapter() {            @Override            public void onAnimationStart(Animator animation) {                if (show) {                    enablePageContentLayers();                }            }            @Override            public void onAnimationEnd(Animator animation) {                if (!show) {                    disablePageContentLayers();                    KeyguardWidgetFrame frame = getWidgetPageAt(mWidgetToResetAfterFadeOut);                    if (frame != null && !(frame == getWidgetPageAt(mCurrentPage) &&                            mViewStateManager.isChallengeOverlapping())) {                        frame.resetSize();                    }                    mWidgetToResetAfterFadeOut = -1;                    mShowingInitialHints = false;                }                updateWidgetFramesImportantForAccessibility();            }        });        mChildrenOutlineFadeAnimation.start();    }

?

没什么特别的,就是改了下显示的时间,把延迟改为0。

是功能是BUG,大家一看就明了。

?

?

热点排行