Good Search

Thursday, April 12, 2012

Discovery about Launcher on Android 4.x (Ice Cream Sandwich) Part4


Launcher part 4

Layout Simple Overview
<com.android.launcher2.AppsCustomizeTabHost>
          <LinearLayout>
               <FrameLayout>
                    <com.android.launcher2.FocusOnlyTabWidget/>
               <include android:id="@+id/market_button"/>(TextView)
           </FrameLayout>
           <FrameLayout>
               <com.android.launcher2.AppsCustomizePagedView/>
           </FrameLayout>
     </LinearLayout>
</com.android.launcher2.AppsCustomizeTabHost>
The mapping between user view and actual code

How to add an new app icon into the application list in launcher ? Or what is the process ?
Following my habit : See the map of call-stacks !


Special Case/Idea

Do you want to replace the position of ap icon in Application List ?
Original Rule of Order is by the rank of Letters.
But, you can …swap the position of the first icon with the second one.(Red Part)
AppsCustomizePagedView.java (..\packages\apps\launcher2\src\com\android\launcher2)
public void setApps(ArrayList<ApplicationInfo> list) {
mApps = list;
ApplicationInfo list1 = mApps.get(0);
mApps.set(0, mApps.get(1)); // 0 -> 1
mApps.set(1, list1); // 1 -> 0
}
P.S this just is one of methods to achieve it.

The ScreenShot before modifying:



The ScreenShot After modifying:



Part 4 is over
The discovery about Launcher is really finished!!!
Thank you for your patient reading

No comments:

Post a Comment