android 4.1.2 launcher2实现应用列表背景透明
2013-09-10 19:05
357 查看
由于做android系统开发,在研发的平板上希望将launcher2的应用列表背景由黑色修改为透明,苦闷了几天,终于算是完美实现了,在此直接说方法,希望对想要此功能的人有用。
1.将launcher2的源码从packages/apps/Launcher2/下倒入到eclipse中,具体方法见:http://blog.csdn.net/singleton1900/article/details/8806978
2.待成功能编译出Launcher2后,开始修改代码。
3.找到res/layout/apps_customize_pane.xml文件,将
<com.android.launcher.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.launcher.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#00000000">
4.打开com/android/launcher/Launcher.java代码,将其中的对updateWallpaperVisibility函数的调用参数都修改为true.
5.编译运行,即可看到应用列表背景变为透明。
diff
--git a/packages/apps/Launcher2/res/layout/apps_customize_pane.xml b/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
index 41ba9e2..c83b5da 100644
--- a/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
+++ b/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- android:background="#FF000000">
+ android:background="#00000000">
<LinearLayout
android:id="@+id/apps_customize_content"
android:orientation="vertical"
diff --git a/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java b/packages/apps/Launcher2/src/com/android/launcher2/Launcher.jav
index 433b0ba..ccfbc44 100755
--- a/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
+++ b/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
@@ -2420,7 +2420,7 @@ public final class Launcher extends Activity
if (isAllAppsVisible()) {
if (mAppsCustomizeTabHost != null &&
!mAppsCustomizeTabHost.isTransitioning()) {
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
}
}
@@ -2599,7 +2599,7 @@ public final class Launcher extends Activity
hideDockDivider();
}
if (!animationCancelled) {
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
// Hide the search bar
@@ -2693,7 +2693,7 @@ public final class Launcher extends Activity
dispatchOnLauncherTransitionPrepare(toView, animated, false);
dispatchOnLauncherTransitionStart(toView, animated, false);
dispatchOnLauncherTransitionEnd(toView, animated, false);
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
}
1.将launcher2的源码从packages/apps/Launcher2/下倒入到eclipse中,具体方法见:http://blog.csdn.net/singleton1900/article/details/8806978
2.待成功能编译出Launcher2后,开始修改代码。
3.找到res/layout/apps_customize_pane.xml文件,将
<com.android.launcher.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.launcher.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
android:background="#00000000">
4.打开com/android/launcher/Launcher.java代码,将其中的对updateWallpaperVisibility函数的调用参数都修改为true.
5.编译运行,即可看到应用列表背景变为透明。
diff
--git a/packages/apps/Launcher2/res/layout/apps_customize_pane.xml b/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
index 41ba9e2..c83b5da 100644
--- a/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
+++ b/packages/apps/Launcher2/res/layout/apps_customize_pane.xml
@@ -16,7 +16,7 @@
<com.android.launcher2.AppsCustomizeTabHost
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
- android:background="#FF000000">
+ android:background="#00000000">
<LinearLayout
android:id="@+id/apps_customize_content"
android:orientation="vertical"
diff --git a/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java b/packages/apps/Launcher2/src/com/android/launcher2/Launcher.jav
index 433b0ba..ccfbc44 100755
--- a/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
+++ b/packages/apps/Launcher2/src/com/android/launcher2/Launcher.java
@@ -2420,7 +2420,7 @@ public final class Launcher extends Activity
if (isAllAppsVisible()) {
if (mAppsCustomizeTabHost != null &&
!mAppsCustomizeTabHost.isTransitioning()) {
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
}
}
@@ -2599,7 +2599,7 @@ public final class Launcher extends Activity
hideDockDivider();
}
if (!animationCancelled) {
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
// Hide the search bar
@@ -2693,7 +2693,7 @@ public final class Launcher extends Activity
dispatchOnLauncherTransitionPrepare(toView, animated, false);
dispatchOnLauncherTransitionStart(toView, animated, false);
dispatchOnLauncherTransitionEnd(toView, animated, false);
- updateWallpaperVisibility(false);
+ updateWallpaperVisibility(true);
}
}
相关文章推荐
- android 4.1.2 launcher2实现应用列表背景透明
- 转niutao:android 4.1.2 launcher2实现应用列表背景透明
- android 4.1.2 launcher2实现像4.4launcher3应用列表背景透明的效果
- Android开发实现Launcher3应用列表修改透明背景的方法
- Launcher实现应用列表透明背景
- android Launcher3应用列表修改透明背景
- Android launcher2 应用列表背景透明/透明壁纸
- android4.4 launcher2实现应用列表背景透明
- 【android开发】手机应用管理器的实现之获取应用列表(一)
- java代码中实现android背景选择的selector-StateListDrawable的应用
- Android实现获取系统应用列表
- Android实现获取系统应用列表(转)
- java代码中实现android背景选择的selector-StateListDrawable的应用
- Android实现获取系统应用列表
- Android使用系统Intent实现分享功能及将应用加入分享列表
- java代码中实现android背景选择的selector-StateListDrawable的应用
- 【Android前端】Bing每日图片列表应用制作记录——2.列表的实现
- Android实现暗透明背景的页面
- Android编程实现对话框Dialog背景透明功能示例
- android 实现应用起动界面上有一层透明的功能指导界面