android Programming Glossary: mrect
Android - How to make all lines in an edittext underlined? http://stackoverflow.com/questions/10361755/android-how-to-make-all-lines-in-an-edittext-underlined static class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater.. Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE.. void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds..
Android: Ruled/horizonal lines in Textview http://stackoverflow.com/questions/10748467/android-ruled-horizonal-lines-in-textview public class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater.. Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE.. void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds..
How to add pagelines to a EditText in android? http://stackoverflow.com/questions/10992411/how-to-add-pagelines-to-a-edittext-in-android public class LinedEditText extends EditText private Rect mRect private Paint mPaint public LinedEditText Context context AttributeSet.. Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE.. canvas int height canvas.getHeight int curHeight 0 Rect r mRect Paint paint mPaint int baseline getLineBounds 0 r for curHeight..
Android, change underline Color from an EditText dynamically http://stackoverflow.com/questions/13238298/android-change-underline-color-from-an-edittext-dynamically public class CustomEditText extends EditText private Rect mRect private Paint mPaint int widthMsSize int heightMsSize we need..
Custom ImageView with drop shadow http://stackoverflow.com/questions/3693234/custom-imageview-with-drop-shadow class ShadowImageView extends ImageView private Rect mRect private Paint mPaint public ShadowImageView Context context.. public ShadowImageView Context context super context mRect new Rect mPaint new Paint mPaint.setAntiAlias true mPaint.setShadowLayer.. @Override protected void onDraw Canvas canvas Rect r mRect Paint paint mPaint canvas.drawRect r paint super.onDraw canvas..
Android - edittext - underline http://stackoverflow.com/questions/4114859/android-edittext-underline static class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater.. Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE.. void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds..
Validation for a cell number in Android http://stackoverflow.com/questions/5958665/validation-for-a-cell-number-in-android
Drawing multiple lines in edittext e.g. notepad http://stackoverflow.com/questions/5972388/drawing-multiple-lines-in-edittext-e-g-notepad getLineCount Gets the global Rect and Paint objects Rect r mRect Paint paint mPaint Draws one line in the rectangle for every.. public class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater.. Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.FILL_AND_STROKE..
Android - How to make all lines in an edittext underlined? http://stackoverflow.com/questions/10361755/android-how-to-make-all-lines-in-an-edittext-underlined From the tutorial I have created the layout public static class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs.. need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE mPaint.setColor 0x80000000 @Override protected void onDraw.. mPaint.setColor 0x80000000 @Override protected void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds i r canvas.drawLine r.left baseline 1 r.right baseline..
Android: Ruled/horizonal lines in Textview http://stackoverflow.com/questions/10748467/android-ruled-horizonal-lines-in-textview that draws lines between each line of text that is displayed public class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs.. need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE mPaint.setColor 0x800000FF @Override protected void onDraw.. mPaint.setColor 0x800000FF @Override protected void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds i r canvas.drawLine r.left baseline 1 r.right baseline..
How to add pagelines to a EditText in android? http://stackoverflow.com/questions/10992411/how-to-add-pagelines-to-a-edittext-in-android android.util.AttributeSet import android.widget.EditText public class LinedEditText extends EditText private Rect mRect private Paint mPaint public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint.. private Rect mRect private Paint mPaint public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE mPaint.setColor 0xFF000000 This is called to draw the LinedEditText.. background is drawn. @Override protected void onDraw Canvas canvas int height canvas.getHeight int curHeight 0 Rect r mRect Paint paint mPaint int baseline getLineBounds 0 r for curHeight baseline 1 curHeight height curHeight getLineHeight ..
Android, change underline Color from an EditText dynamically http://stackoverflow.com/questions/13238298/android-change-underline-color-from-an-edittext-dynamically have to change mPaint.setColor Color.GREEN to another color public class CustomEditText extends EditText private Rect mRect private Paint mPaint int widthMsSize int heightMsSize we need this constructor for LayoutInflater public CustomEditText..
Custom ImageView with drop shadow http://stackoverflow.com/questions/3693234/custom-imageview-with-drop-shadow android.graphics.Rect import android.widget.ImageView public class ShadowImageView extends ImageView private Rect mRect private Paint mPaint public ShadowImageView Context context super context mRect new Rect mPaint new Paint mPaint.setAntiAlias.. extends ImageView private Rect mRect private Paint mPaint public ShadowImageView Context context super context mRect new Rect mPaint new Paint mPaint.setAntiAlias true mPaint.setShadowLayer 2f 1f 1f Color.BLACK @Override protected void onDraw.. true mPaint.setShadowLayer 2f 1f 1f Color.BLACK @Override protected void onDraw Canvas canvas Rect r mRect Paint paint mPaint canvas.drawRect r paint super.onDraw canvas @Override protected void onMeasure int w int h super.onMeasure..
Android - edittext - underline http://stackoverflow.com/questions/4114859/android-edittext-underline lines between each line of text that is displayed. public static class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs.. need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.STROKE mPaint.setColor 0x800000FF @Override protected void onDraw.. mPaint.setColor 0x800000FF @Override protected void onDraw Canvas canvas int count getLineCount Rect r mRect Paint paint mPaint for int i 0 i count i int baseline getLineBounds i r canvas.drawLine r.left baseline 1 r.right baseline..
Validation for a cell number in Android http://stackoverflow.com/questions/5958665/validation-for-a-cell-number-in-android
Drawing multiple lines in edittext e.g. notepad http://stackoverflow.com/questions/5972388/drawing-multiple-lines-in-edittext-e-g-notepad Gets the number of lines of text in the View. int count getLineCount Gets the global Rect and Paint objects Rect r mRect Paint paint mPaint Draws one line in the rectangle for every line of text in the EditText for int i 0 i count i Gets.. code based on jkhouws1 's suggestion and google's note editor public class LinedEditText extends EditText private Rect mRect private Paint mPaint we need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs.. need this constructor for LayoutInflater public LinedEditText Context context AttributeSet attrs super context attrs mRect new Rect mPaint new Paint mPaint.setStyle Paint.Style.FILL_AND_STROKE mPaint.setColor R.color.edit_note_line SET YOUR OWN..
|