//celllayout
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
public static final float INIT_REDUCE_FINAL_VALUE = 0.6f;
public static final float REDUCE_FINAL_VALUE = 0.9f;
public static final float BLOWUP_FINAL_VALUE = 1.0f;
public static final float SCALE_INCREMENT_VALUE = 0.01f;
public static final long SLEEP_TIME = 25;
public static final long INIT_SLEEP_TIME = 25;
public static final long FINISH_ZOOM_OUT_SLEEP_TIME = SLEEP_TIME;
public static final long FINISH_ZOOM_IN_SLEEP_TIME = SLEEP_TIME;
private Matrix matrix = new Matrix();
private AnimationThread at;
private boolean havaOpenFolder;
private boolean dragZoomOutAnimation;
private boolean needScaleCenterImg;
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
final LayoutParams cellParams = (LayoutParams) params;
cellParams.regenerateId = true;
if (cellParams.cellHSpan == mLongAxisCells && cellParams.cellVSpan == mShortAxisCells
&& child instanceof Folder) {
havaOpenFolder = true;
}
super.addView(child, index, params);
}
public int getCellWidth() {
return mCellWidth;
}
public int getCellHeight() {
return mCellHeight;
}
public int getShortAxisCells() {
return mShortAxisCells;
}
public int getLongAxisCells() {
return mLongAxisCells;
}
public int getWidthGap() {
return mWidthGap;
}
public int getHeightGap() {
return mHeightGap;
}
public boolean isOpenFolder() {
return havaOpenFolder;
}
@Override
public void dispatchDraw(Canvas canvas) {
if (isOpenFolder()) {
super.dispatchDraw(canvas);
return;
}
if (DragLayer.isDragging()) {
if (at == null) {
startAnimation(BLOWUP_FINAL_VALUE, REDUCE_FINAL_VALUE, SCALE_INCREMENT_VALUE, SLEEP_TIME); // narrow animation.
}
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
public static final float INIT_REDUCE_FINAL_VALUE = 0.6f;
public static final float REDUCE_FINAL_VALUE = 0.9f;
public static final float BLOWUP_FINAL_VALUE = 1.0f;
public static final float SCALE_INCREMENT_VALUE = 0.01f;
public static final long SLEEP_TIME = 25;
public static final long INIT_SLEEP_TIME = 25;
public static final long FINISH_ZOOM_OUT_SLEEP_TIME = SLEEP_TIME;
public static final long FINISH_ZOOM_IN_SLEEP_TIME = SLEEP_TIME;
private Matrix matrix = new Matrix();
private AnimationThread at;
private boolean havaOpenFolder;
private boolean dragZoomOutAnimation;
private boolean needScaleCenterImg;
@Override
public void addView(View child, int index, ViewGroup.LayoutParams params) {
final LayoutParams cellParams = (LayoutParams) params;
cellParams.regenerateId = true;
if (cellParams.cellHSpan == mLongAxisCells && cellParams.cellVSpan == mShortAxisCells
&& child instanceof Folder) {
havaOpenFolder = true;
}
super.addView(child, index, params);
}
public int getCellWidth() {
return mCellWidth;
}
public int getCellHeight() {
return mCellHeight;
}
public int getShortAxisCells() {
return mShortAxisCells;
}
public int getLongAxisCells() {
return mLongAxisCells;
}
public int getWidthGap() {
return mWidthGap;
}
public int getHeightGap() {
return mHeightGap;
}
public boolean isOpenFolder() {
return havaOpenFolder;
}
@Override
public void dispatchDraw(Canvas canvas) {
if (isOpenFolder()) {
super.dispatchDraw(canvas);
return;
}
if (DragLayer.isDragging()) {
if (at == null) {
startAnimation(BLOWUP_FINAL_VALUE, REDUCE_FINAL_VALUE, SCALE_INCREMENT_VALUE, SLEEP_TIME); // narrow animation.
}