|
@@ -1,6 +1,9 @@
|
|
|
package com.yingyangfly.moca.widget;
|
|
|
|
|
|
import android.content.Context;
|
|
|
+import android.graphics.Canvas;
|
|
|
+import android.graphics.Color;
|
|
|
+import android.graphics.Paint;
|
|
|
import android.util.AttributeSet;
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
|
@@ -9,24 +12,34 @@ import androidx.annotation.Nullable;
|
|
|
|
|
|
public class LinkLineView extends RelativeLayout {
|
|
|
|
|
|
- private Context context;
|
|
|
+ Paint linePaint = new Paint();
|
|
|
|
|
|
- public LinkLineView(@NonNull Context context) {
|
|
|
- super(context);
|
|
|
- init(context);
|
|
|
+ public LinkLineView(Context context) {
|
|
|
+ this(context, null);
|
|
|
}
|
|
|
|
|
|
public LinkLineView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
|
|
- super(context, attrs);
|
|
|
- init(context);
|
|
|
+ this(context, attrs, 0);
|
|
|
}
|
|
|
|
|
|
public LinkLineView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
|
|
super(context, attrs, defStyleAttr);
|
|
|
- init(context);
|
|
|
+ initLinePaint();
|
|
|
}
|
|
|
|
|
|
- private void init(Context context) {
|
|
|
- this.context = context;
|
|
|
+ private void initLinePaint() {
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ linePaint.setColor(Color.BLUE);
|
|
|
+ linePaint.setStrokeWidth(2);
|
|
|
+ linePaint.setAntiAlias(true);
|
|
|
+ linePaint.setStrokeCap(Paint.Cap.ROUND);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ protected void dispatchDraw(Canvas canvas) {
|
|
|
+ super.dispatchDraw(canvas);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|