1.android4.4 默认主菜单是黑色,如果想变成透明,就是显示壁纸,更改
packages\apps\Launcher3\src\com\android\launcher3\AppsCustomizeTabHost.java1)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的值,0到255,255为不透明,也可以改config_appsCustomizeSpringLoadedBgAlpha的值,100为不透明
2) packages\apps\Launcher3\res\layout\apps_customize_pane.xml
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3"
android:background="#00000000"> //默认是#FF000000
。。。
<FrameLayout
android:id="@+id/animation_buffer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000" //默认是#FF000000
android:visibility="gone" />
2. 如果想让主菜单显示自己的背景,
private void onTabChangedEnd(AppsCustomizePagedView.ContentType type) {
int bgAlpha = (int) (255 * (getResources().getInteger(
R.integer.config_appsCustomizeSpringLoadedBgAlpha) / 100f));
//del and add by lc 150514
-- setBackgroundColor(Color.argb(bgAlpha, 0, 0, 0));
++ setBackgroundResource(R.drawable.app_backgound); //app_backgound这个图片资源放到drawable里面
mAppsCustomizePane.setContentType(type);
}
感谢高手的解答