You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
TextView: get textSize from attributes
This commit is contained in:
@@ -35,7 +35,15 @@ public class TextView extends View {
|
||||
if (a.hasValue(com.android.internal.R.styleable.TextView_text)) {
|
||||
setText(a.getText(com.android.internal.R.styleable.TextView_text));
|
||||
}
|
||||
int ap = a.getResourceId(com.android.internal.R.styleable.TextView_textAppearance, -1);
|
||||
a.recycle();
|
||||
if (ap != -1) {
|
||||
a = context.obtainStyledAttributes(ap, com.android.internal.R.styleable.TextAppearance);
|
||||
if (a.hasValue(com.android.internal.R.styleable.TextAppearance_textSize)) {
|
||||
setTextSize(a.getDimensionPixelSize(com.android.internal.R.styleable.TextAppearance_textSize, 10));
|
||||
}
|
||||
a.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user