Java Code Examples for android.widget.TextView.setRight()

The following are Jave code examples for showing how to use setRight() of the android.widget.TextView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: android-instant-apps   File: TextResize.java   View Source Code Vote up 5 votes
private static void setTextViewData(TextView view, TextResizeData data, float fontSize) {
    view.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
    view.setPadding(data.paddingLeft, data.paddingTop, data.paddingRight, data.paddingBottom);
    view.setRight(view.getLeft() + data.width);
    view.setBottom(view.getTop() + data.height);
    view.setTextColor(data.textColor);
    int widthSpec = View.MeasureSpec.makeMeasureSpec(view.getWidth(), View.MeasureSpec.EXACTLY);
    int heightSpec = View.MeasureSpec.makeMeasureSpec(view.getHeight(), View.MeasureSpec.EXACTLY);
    view.measure(widthSpec, heightSpec);
    view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
}
 
Example 2
Project: LoginConcept   File: TextSizeTransition.java   View Source Code Vote up 5 votes
private static void setTextViewData(TextView view, TextResizeData data, float fontSize) {
    view.setTextSize(TypedValue.COMPLEX_UNIT_PX, fontSize);
    view.setPadding(data.paddingLeft, data.paddingTop, data.paddingRight, data.paddingBottom);
    view.setRight(view.getLeft() + data.width);
    view.setBottom(view.getTop() + data.height);
    view.setTextColor(data.textColor);
    int widthSpec = View.MeasureSpec.makeMeasureSpec(view.getWidth(), View.MeasureSpec.EXACTLY);
    int heightSpec = View.MeasureSpec.makeMeasureSpec(view.getHeight(), View.MeasureSpec.EXACTLY);
    view.measure(widthSpec, heightSpec);
    view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
}