How does android display the background of the main menu as a wallpaper?

Source: Internet
Author: User

How does android display the background of the main menu as a wallpaper?
ICS/ICS2:
1. Modify packages \ apps \ Launcher2 \ res \ layout \ apps_mimize_pane.xml
Xmlns: android = "http://schemas.android.com/apk/res/android"
Xmlns: launcher = "http://schemas.android.com/apk/res/com.android.launcher"
Android: background = "#00000000"> // The original value is # FF000000.

2. Modify the hideAppsCustomizeHelper (boolean animated, final boolean springLoaded) method of packages \ apps \ Launcher2 \ src \ com \ android \ launcher2 \ Launcher. java, as follows:
......
Setmediatsforzoom (fromView, scaleFactor );
UpdateWallpaperVisibility (true );
ShowHotseat (animated );
If (mDockDivider! = Null) {// add
MDockDivider. setVisibility (View. VISIBLE); // add
} // Add
......

3. Modify the showAppsCustomizeHelper (boolean animated, final boolean springLoaded) method of Launcher. java as follows:
......
// Shrink workspaces away if going to AppsCustomize from workspace
MWorkspace. changeState (Workspace. State. SMALL, animated );
// And hide hotseat and dock divider
HideHotseat (false); // add
If (mDockDivider! = Null) {// add
MDockDivider. setVisibility (View. INVISIBLE); // add
} // Add
If (mWorkspace! = Null) {// add
MWorkspace. setVisibility (View. INVISIBLE); // add
} // Add
......

4. Modify the Launcher. java file and comment out the updateWallpaperVisibility (false) in the showAppsCustomizeHelper (boolean animated, final boolean springLoaded) method.
The first is the end of the public void onAnimationEnd (Animator animation) method in this function.
The second is at the end of the showAppsCustomizeHelpe method.

5. Modify the enterSpringLoadedDragMode () method of Launcher. java as follows:
Void enterSpringLoadedDragMode (){
If (mState = State. mi_customize ){
MWorkspace. setVisibility (View. VISIBLE); // add
MWorkspace. changeState (Workspace. State. SPRING_LOADED );
HideAppsCustomizeHelper (true, true );
HideDockDivider ();
MState = State. APPS_CUSTOMIZE_SPRING_LOADED;
}
}

The ICS/ICS2 version can be modified as above. If it is a JB version, add the following modifications based on the above modifications:

6. Modify the disableWallpaperIfInAllApps () method in Launcher. java as follows:
Void disableWallpaperIfInAllApps (){
// Only disable it if we are in all apps
If (isallpolicvisible ()){
If (mAppsCustomizeTabHost! = Null &&
! MAppsCustomizeTabHost. isTransitioning ()){
UpdateWallpaperVisibility (true); // modify}
}
}


7. Modify the Control id of animation_buffer in packages \ apps \ Launcher2 \ res \ layout \ apps_mimize_pane.xml and set its android: background to #0000000

If the JB2/JB3 version needs to be modified as follows:

8. Modify the onResume () method of Launcher. java:
Set setWorkspaceBackground (mState = State. WORKSPACE );
Change
SetWorkspaceBackground (true );

After step 3 is modified, you may see the overlapping widgets of the widget and app in a short time when switching widgets and apps.
This is the animSet. playTogether (outAnim, inAnim) in the onTabChanged method of appsCustomizeTabHost. java. The specified effect can be modified on your own.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.