Original address: http://blog.csdn.net/ly0904010214/article/details/42805363
The Seekbar provided by the Android system are straight-line. But sometimes we need to use the seekbar of other shapes, then we need to customize the view to implement. Here just implements a ring-shaped, similar to the other shapes.
The effect diagram is as follows
Circleseekbar files are as follows [Java] View plain copy print? package com.lee.circleseekbar.view; import com.lee.circleseekbar.r; import android.content.context; import android.content.res.typedarray; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.rectf; import android.graphics.drawable.drawable; import android.util.attributeset; import android.util.log; import android.view.motionevent; import android.view.View; /** * * CircleSeekBar * * @author lee * */ public class circleseekbar extends view { private final boolean debug = true; private final String TAG = "Circleseekbar"; private Context mContext = null; private Drawable mThumbDrawable = null; private int mThumbHeight = 0; private int mThumbWidth = 0; private int[] mThumbNormal = null; private int[] mthumbpressed = null; private int mSeekBarMax = 0; private Paint Mseekbarbackgroundpaint = null;