文件夹改成九宫格模式
This commit is contained in:
@@ -36,6 +36,7 @@ import android.graphics.RadialGradient;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
import android.graphics.Shader;
|
||||
import android.util.Log;
|
||||
import android.util.Property;
|
||||
import android.view.View;
|
||||
|
||||
@@ -210,12 +211,31 @@ public class PreviewBackground {
|
||||
return mDotColor;
|
||||
}
|
||||
|
||||
public void drawBackground(Canvas canvas) {
|
||||
public void drawBackground(Canvas canvas,Context context) {
|
||||
mPaint.setStyle(Paint.Style.FILL);
|
||||
mPaint.setColor(getBgColor());
|
||||
// Bitmap bitmap =BitmapFactory.decodeResource(context.getResources(), R.drawable.square);
|
||||
// float radius = getScaledRadius();
|
||||
// canvas.drawBitmap(bitmap,0 + getOffsetX(),0 + getOffsetY() ,mPaint);
|
||||
drawCircle(canvas, 0 /* deltaRadius */);
|
||||
// getShape().drawShape(canvas, getOffsetX(), getOffsetY(), getScaledRadius(), mPaint);
|
||||
// drawShadow(canvas);
|
||||
}
|
||||
|
||||
getShape().drawShape(canvas, getOffsetX(), getOffsetY(), getScaledRadius(), mPaint);
|
||||
drawShadow(canvas);
|
||||
private void drawCircle(Canvas canvas,float deltaRadius) {
|
||||
Log.e("fht", "drawCircle: previewSize:" + previewSize );
|
||||
Log.e("fht", "drawCircle: getScaledRadius:" + getScaledRadius() );
|
||||
Log.e("fht", "drawCircle: getOffsetX:" + getOffsetX());
|
||||
Log.e("fht", "drawCircle: getOffsetY:" + getOffsetY());
|
||||
float radius = getScaledRadius()-4;
|
||||
Log.e("fht", "drawCircle: radius:" + radius);
|
||||
|
||||
/* 20180702 modify begin */
|
||||
// canvas.drawCircle(radius + getOffsetX(), radius + getOffsetY(),
|
||||
// radius - deltaRadius, mPaint);
|
||||
mPaint.setAlpha(76);
|
||||
canvas.drawRoundRect(0 + getOffsetX() + 6, 0 + getOffsetY() + 6 , radius * 2 + getOffsetX() + 2,radius * 2 + getOffsetY() + 2, 30, 30, mPaint);
|
||||
/* 20180702 modify end */
|
||||
}
|
||||
|
||||
public void drawShadow(Canvas canvas) {
|
||||
|
||||
Reference in New Issue
Block a user