com.haishidaxue.ding.testcreateandroidproject;
android.content.Context;
android.graphics.Canvas;
android.util.AttributeSet;
android.util.Log;
android.view.MotionEvent;
android.widget.LinearLayout;
MyLinearLayout LinearLayout {
MyLinearLayout(Context context) {
(context);
}
MyLinearLayout(Context context, AttributeSet attrs) {
(context, attrs);
}
MyLinearLayout(Context context, AttributeSet attrs, defStyleAttr) {
(context, attrs, defStyleAttr);
}
onInterceptTouchEvent(MotionEvent ev) {
.onInterceptTouchEvent(ev);
}
onTouchEvent(MotionEvent event) {
(event.getAction()) {
MotionEvent.:
Log.(, );
;
MotionEvent.:
Log.(, );
;
MotionEvent.:
Log.(, );
;
}
s = .onTouchEvent(event);
Log.(, s + );
s;
}
onLayout(changed, left, top, right, bottom) {
.onLayout(changed, left, top, right, bottom);
Log.(, + + changed + + left + + top + + right + + bottom);
}
onMeasure(widthMeasureSpec, heightMeasureSpec) {
.onMeasure(widthMeasureSpec, heightMeasureSpec);
specModeWidth = MeasureSpec.(widthMeasureSpec);
specSizeWidth = MeasureSpec.(widthMeasureSpec);
specModeHeight = MeasureSpec.(heightMeasureSpec);
specSizeHeight = MeasureSpec.(heightMeasureSpec);
Log.(, + specModeHeight + + specSizeHeight+ + specModeWidth++ specSizeWidth);
Log.(, + + getWidth() + + getHeight());
}
onDraw(Canvas canvas) {
.onDraw(canvas);
Log.(, );
}
}
转载于:https://my.oschina.net/u/1177694/blog/552969