Add preview like HTC for launcher (open source, with source code)

Source: Internet
Author: User

By he minggui (http://blog.csdn.net/hmg25) reprint please indicate the source

The native preview of Android is not very nice. I like HTC very much. I saw that the preview also exists on the ADW, So I extracted it and put it into the native android2.2. If you don't want to talk about it, you can directly view the truth in a diagram:

Native, not modified version: (By HE minggui, please indicate the source)

 

After modification, like HTC:

 

The main changes are the workspace. Java and launcher. java files. The accompanying source code only contains these two files.

You only need to overwrite the workspace. Java and launcher. java files at http://download.csdn.net/source/3142047 ~~

 

The operation is to press the Allapp button at the bottom of the dock ~~

 

There are too many codes to explain. The source code is the king!

Source code: http://download.csdn.net/source/3142406

 

Note: thanks to the aaa2832 and whshuai11 kids shoes, one of the bugs found is that when you click a preview window, the desktop icon disappears when you jump back to the original interface, clicking the original window will become stuck. The solution is as follows:

BUG 1: Add the following in onTouchEvent of workspase:

If (mLauncher. isallpolicvisible () | mSensemode)

{

Return true;

}

Public boolean onTouchEvent (MotionEvent ev ){

If (mLauncher. isallpolicvisible () | mSensemode) // add for bug

 

 

{

Return true;

}......

 

BUG 2: The Stuck Problem is actually caused by not refreshing the interface. You only need to add

Else {

MLauncher. dismissPreviews ();

PostInvalidate (); // add for bug

}

 

 

 

 

 


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.