mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-04-29 04:37:58 +03:00
implement TextView.setCompoundDrawables()
This adds an additional GtkBox for every TextView
This commit is contained in:
parent
849701c5c4
commit
ae58d2b319
7 changed files with 84 additions and 21 deletions
|
@ -67,16 +67,12 @@ public class TextView extends View {
|
|||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
|
||||
public void setText(CharSequence text) {
|
||||
if (text == null) {
|
||||
native_setText("NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
native_setText(text.toString());
|
||||
native_setText(text != null ? text.toString() : null);
|
||||
|
||||
if (text instanceof android.text.Spanned)
|
||||
native_set_markup(1);
|
||||
requestLayout();
|
||||
if (!isLayoutRequested())
|
||||
requestLayout();
|
||||
}
|
||||
|
||||
public void setText(int resId) {
|
||||
|
@ -158,7 +154,15 @@ public class TextView extends View {
|
|||
|
||||
public void setCompoundDrawablePadding(int pad) {}
|
||||
|
||||
public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {}
|
||||
protected native void native_setCompoundDrawables(long widget, long left, long top, long right, long bottom);
|
||||
|
||||
public void setCompoundDrawables(Drawable left, Drawable top, Drawable right, Drawable bottom) {
|
||||
native_setCompoundDrawables(widget,
|
||||
left != null ? left.paintable : 0,
|
||||
top != null ? top.paintable : 0,
|
||||
right != null ? right.paintable : 0,
|
||||
bottom != null ? bottom.paintable : 0);
|
||||
}
|
||||
|
||||
public void setAllCaps(boolean allCaps) {}
|
||||
|
||||
|
@ -178,7 +182,9 @@ public class TextView extends View {
|
|||
|
||||
public int getMaxLines() {return -1;}
|
||||
|
||||
public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) {}
|
||||
public void setCompoundDrawablesRelative(Drawable start, Drawable top, Drawable end, Drawable bottom) {
|
||||
setCompoundDrawables(start, top, end, bottom);
|
||||
}
|
||||
|
||||
public int getLineCount() {return 1;}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue