Launcher3源码分析(CellLayout)

CellLayout是workspace的屏幕。
CellLayout中的一些重要属性:

int mCellWidth;
int mCellHeight;
//每一个屏幕的行列数
int mCountX;//每一行的item个数
int mCountY;//每一列的item个数
//item之间的距离
int mWidthGap;//item之间的宽度
int mHeightGap;//item之间的高度

构造方法

public CellLayout(Context context, AttributeSet attrs, int defStyle){
    super(context,attrs,defStyle){
        setWillNotDraw(false);
        setClipToPadding(false);
        mLauncher = (Launcher)context;

        DeviceProfile grid = mLauncher.getDeviceProfile();
        TypedArray a = context.obtainStyledAttributes(attrs,R.styleable.CellLayout,defStyle,0<

你可能感兴趣的:(Launcher3源码分析(CellLayout))