launcher3桌面阴影和systemUI阴影

来源:互联网 发布:光环国际大数据开发 编辑:程序博客网 时间:2024/05/17 02:43

  

workspace_bg.9.png资源图片

packages\apps\Launcher3\src\com\android\launcher3\Launcher.java

mWorkspaceBackgroundDrawable = getResources().getDrawable(R.drawable.workspace_bg);

  private void setWorkspaceBackground(boolean workspace) {

        mLauncherView.setBackground(workspace ?
        null : null);  //modified  delete the shawdown
              //  mWorkspaceBackgroundDrawable : null);

    }

设置为 null 即可。这是launcher桌面的设置。

其实在桌面的时候   还是看到上下游阴影,这是SystemUI 的 状态栏和导航栏,如果也想去掉,就把status_background.9.png 和nav_background.9.png 换成你想要的颜色。

你也可以用XML文件替换过,比如, 参考http://www.cnblogs.com/xiaoQLu/archive/2011/09/14/2176359.html

frameworks\base\packages\SystemUI\res\drawable\status_bar_background_launcher.xml

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <!--gradient 
        android:startColor="#809933cc"
        android:endColor="#80ffffff"
        android:angle="270"
        /-->
        <solid android:color="#00ffffff"/>
</shape>

然后在

frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\PhoneStatusBarTransitions.java

    public PhoneStatusBarTransitions(PhoneStatusBarView view) {
        //super(view, R.drawable.status_background);
        super(view, R.drawable.status_bar_background_launcher); //modified by 
        mView = view;
        final Resources res = mView.getContext().getResources();
        mIconAlphaWhenOpaque = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1);
    }

替换即可。


0 0
原创粉丝点击