1 package com.android.gallery3d.filtershow.category; 2 3 import android.content.Context; 4 import android.graphics.Canvas; 5 import android.graphics.Color; 6 import android.graphics.Paint; 7 import android.util.AttributeSet; 8 import android.view.View; 9 10 import com.android.gallery3d.R; 11 12 public class CategorySelected extends View { 13 private Paint mPaint = new Paint(); 14 private int mMargin = 20; 15 16 public CategorySelected(Context context, AttributeSet attrs) { 17 super(context, attrs); 18 mMargin = getResources().getDimensionPixelSize(R.dimen.touch_circle_size); 19 } 20 21 public void onDraw(Canvas canvas) { 22 mPaint.reset(); 23 mPaint.setStrokeWidth(mMargin); 24 mPaint.setAntiAlias(true); 25 mPaint.setStyle(Paint.Style.STROKE); 26 mPaint.setColor(Color.argb(128, 128, 128, 128)); 27 canvas.drawCircle(getWidth()/2, getHeight()/2, 28 getWidth()/2 - mMargin, mPaint); 29 } 30 31 } 32