你好,游客 登录 注册 搜索
背景:
阅读新闻

Android Launcher3应用列表修改透明背景

[日期:2015-07-11] 来源:Linux社区  作者:j086924 [字体:大 中 小]

将launcher3的应用列表背景修改为透明,与Launcher2略有不同,需要进行如下步骤:

1. 找到res/layout/apps_customize_pane.xml文件,将

<com.Android.launcher3.appscustomizetabhost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#FF000000">

修改为:

<com.android.launcher3.appscustomizetabhost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#00000000">

将动画部分

<frameLayout<br> android:id="@+id/animation_buffer"
 android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF000000"
android:visibility="gone" />

修改为:

<frameLayout<br> android:id="@+id/animation_buffer"
 android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:visibility="gone" />

2、找到AppsCustomizeTabHost.java类中的onTabChangedEnd()方法,如下:

 private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
        int bgAlpha = (int) (255 * (getResources().getInteger(
            R.integer.config_appsCustomizeSpringLoadedBgAlpha) / 100f));
        setBackgroundColor(Color.argb(bgAlpha, 0, 0, 0));
        mAppsCustomizePane.setContentType(type);
    }


其中bgAlpha为透明度的参数,将其改为你需要的透明度即可,255为不透明,以上1、2步骤完之后,保存,编译,即可达到需要的效果。

更多Android相关信息见Android 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=11

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-07/119758.htm

linux
相关资讯       Android透明背景  Android Launcher3 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款