package dk.silverbullet.telemed.questionnaire.element; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.widget.TextView; public class MyTextView extends TextView { public MyTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public MyTextView(Context context, AttributeSet attrs) { super(context, attrs); } public MyTextView(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Rect rect = new Rect(); Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); paint.setColor(Color.WHITE); paint.setStrokeWidth(3); getLocalVisibleRect(rect); canvas.drawRect(rect, paint); } }