From 5c29d2d29731e179f970cfc6667662628746d8bf Mon Sep 17 00:00:00 2001 From: Mis012 Date: Wed, 26 Mar 2025 20:13:32 +0100 Subject: [PATCH] TextView: chain setText variants in the same direction as AOSP to fix behavior of classes which override it --- src/api-impl/android/widget/TextView.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/api-impl/android/widget/TextView.java b/src/api-impl/android/widget/TextView.java index 1b4c5728..3467a3e5 100644 --- a/src/api-impl/android/widget/TextView.java +++ b/src/api-impl/android/widget/TextView.java @@ -87,7 +87,15 @@ public class TextView extends View { @Override protected native long native_constructor(Context context, AttributeSet attrs); + public void setText(int resId) { + setText(getContext().getResources().getText(resId)); + } + public void setText(CharSequence text) { + setText(text, null); + } + + public void setText(CharSequence text, BufferType type) { this.text = text; native_setText(text != null ? text.toString() : null); @@ -97,10 +105,6 @@ public class TextView extends View { requestLayout(); } - public void setText(int resId) { - setText(getContext().getResources().getText(resId)); - } - private native final void native_set_markup(int bool); public native final void native_setText(String text); @@ -264,10 +268,6 @@ public class TextView extends View { public void setTextIsSelectable(boolean selectable) {} - public void setText(CharSequence text, BufferType type) { - setText(text); - } - public MovementMethod getMovementMethod() { return new BaseMovementMethod(); } @@ -368,6 +368,10 @@ public class TextView extends View { return 10; // FIXME } + public int getMaxHeight() { + return -1; + } + public boolean isAllCaps() { return false; } public int getAutoSizeStepGranularity() {