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: chain setText variants in the same direction as AOSP to fix behavior of classes which override it
This commit is contained in:
@@ -87,7 +87,15 @@ public class TextView extends View {
|
|||||||
@Override
|
@Override
|
||||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||||
|
|
||||||
|
public void setText(int resId) {
|
||||||
|
setText(getContext().getResources().getText(resId));
|
||||||
|
}
|
||||||
|
|
||||||
public void setText(CharSequence text) {
|
public void setText(CharSequence text) {
|
||||||
|
setText(text, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setText(CharSequence text, BufferType type) {
|
||||||
this.text = text;
|
this.text = text;
|
||||||
native_setText(text != null ? text.toString() : null);
|
native_setText(text != null ? text.toString() : null);
|
||||||
|
|
||||||
@@ -97,10 +105,6 @@ public class TextView extends View {
|
|||||||
requestLayout();
|
requestLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setText(int resId) {
|
|
||||||
setText(getContext().getResources().getText(resId));
|
|
||||||
}
|
|
||||||
|
|
||||||
private native final void native_set_markup(int bool);
|
private native final void native_set_markup(int bool);
|
||||||
|
|
||||||
public native final void native_setText(String text);
|
public native final void native_setText(String text);
|
||||||
@@ -264,10 +268,6 @@ public class TextView extends View {
|
|||||||
|
|
||||||
public void setTextIsSelectable(boolean selectable) {}
|
public void setTextIsSelectable(boolean selectable) {}
|
||||||
|
|
||||||
public void setText(CharSequence text, BufferType type) {
|
|
||||||
setText(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MovementMethod getMovementMethod() {
|
public MovementMethod getMovementMethod() {
|
||||||
return new BaseMovementMethod();
|
return new BaseMovementMethod();
|
||||||
}
|
}
|
||||||
@@ -368,6 +368,10 @@ public class TextView extends View {
|
|||||||
return 10; // FIXME
|
return 10; // FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxHeight() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isAllCaps() { return false; }
|
public boolean isAllCaps() { return false; }
|
||||||
|
|
||||||
public int getAutoSizeStepGranularity() {
|
public int getAutoSizeStepGranularity() {
|
||||||
|
|||||||
Reference in New Issue
Block a user