Ashok Varma

My Resume

Ripple Drawable

By Ashok | September 19, 2015 | 0 Comment

Ripple Drawable Topics Programmatically create Ripple Drawable   Programmatically create Ripple Drawable :- It comes in handy many times, to set Ripple Drawables programatically. public static Drawable getAdaptiveRippleDrawable(int normalColor, int pressedColor) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return new RippleDrawable(ColorStateList.valueOf(pressedColor), null, getRippleMask(normalColor)); } else {  return getStateListDrawable(normalColor, pressedColor); }  }    private static Drawable getRippleMask(int […]

Continue Reading

TextView

By Ashok | August 11, 2015 | 0 Comment

Topics Find No of Lines in a TextView Usage Find no of lines in a textview There are different ways to find no of lines in a textview. First method : TextView.getLineCount(); Simple but might lead to errors. Because this can be only used in when the view is rendered (i.e after your textview onDraw is called). […]

Continue Reading