第一次发博客,不知道写些什么,直接上代码,有不好的地方请大家指出
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/***
*
* @author FengLiang
*
*/
public class CustomKeyBoard extends View {
private Paint textPaint = new Paint();
private Paint linePaint = new Paint();
private Paint linePaint2 = new Paint();
private int mWidth = 0;
private int mHeight = 0;
private int select = -2;
// 松开数字
private static final int SELECT_NUMBER = -2;
// 松开状态
private static final int SELECT_STATE = 1;
public OnKeyBoardClickLitener onKeyBoardClickLitener;
public CustomKeyBoard(Context context) {
super(context);
}
public CustomKeyBoard(Context context, AttributeSet attrs) {
super(context, attrs);
}
public CustomKeyBoard(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mWidth = getMeasuredWidt