Good Search

Wednesday, April 11, 2012

Discovery about Launcher on Android 4.x (Ice Cream Sandwich) Part1-2

Launcher 1-2
A upper-layer Framework of Launcher

DragIcon : Read a graph and Describe your scenario

Scroll Pages : Read a graph and Describe your scenario


How to exchange the default wallpaper?
..\frameworks\base\core\res\res\drawable-nodpi\default_wallpaper.jpg
WallpaperManager.java (frameworks\base\core\java\android\app)
      private Bitmap getDefaultWallpaperLocked(Context context) {
      try {
             InputStream is = context.getResources().openRawResource(
             com.android.internal.R.drawable.default_wallpaper);
              ...

The icon matrix of launcher
You can define these parameters to decide the size of matrix.
0,0
1,0
2,0
3,0
0,1
1,1
2,1
3,1
0,2
1,2
2,2
3,2
0,3
1,3
2,3
3,3

public Workspace(Context context, AttributeSet attrs, int defStyle) {
       super(context, attrs, defStyle);
       …
       // if the value is manually specified, use that instead
       cellCountX = a.getInt(R.styleable.Workspace_cellCountX, cellCountX);
       cellCountY = a.getInt(R.styleable.Workspace_cellCountY, cellCountY);
       mDefaultPage = a.getInt(R.styleable.Workspace_defaultScreen, 1);
       public CellLayout(Context context, AttributeSet attrs, int defStyle) {
       … 
       mOriginalCellWidth =
       mCellWidth = a.getDimensionPixelSize(R.styleable.CellLayout_cellWidth, 10);
       mOriginalCellHeight =
       mCellHeight = a.getDimensionPixelSize(R.styleable.CellLayout_cellHeight, 10);

Part 1 is over
Thank you for your patient reading

No comments:

Post a Comment