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: make sure getPaint().getTextSize() returns the expected value
Using pango_font_description_set_absolute_size() now to prevent previous rounding errors when converting from pixels to points and back. This is needed to prevent androidx AppCompatTextViewAutoSizeHelper from constantly requesting a relayout.
This commit is contained in:
@@ -30,6 +30,7 @@ import android.view.View;
|
||||
public class TextView extends View {
|
||||
private ColorStateList colors = new ColorStateList(new int[][] {new int[0]}, new int[1]);
|
||||
private CharSequence text = "";
|
||||
private TextPaint paint = new TextPaint();
|
||||
|
||||
public TextView(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
@@ -158,7 +159,7 @@ public class TextView extends View {
|
||||
public static ColorStateList getTextColors(Context context, TypedArray attrs) { return new ColorStateList(new int[][] {new int[0]}, new int[1]); }
|
||||
|
||||
public TextPaint getPaint() {
|
||||
return new TextPaint();
|
||||
return paint;
|
||||
}
|
||||
|
||||
public void addTextChangedListener(TextWatcher watcher) {}
|
||||
|
||||
Reference in New Issue
Block a user