unify View construction and measurement

No longer allow constructing Views without Context.
Lets have only one onMeasure() method to unify behaviour
This commit is contained in:
Julian Winkler 2023-12-29 11:05:05 +01:00
parent 32f344c301
commit 757d689689
7 changed files with 25 additions and 54 deletions

View file

@ -22,10 +22,6 @@ import android.view.View;
public class TextView extends View {
public String text;
public TextView(int _id) { // FIXME
id = _id;
}
public TextView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
@ -50,6 +46,7 @@ public class TextView extends View {
}
a.recycle();
}
haveComplexMeasure = true;
}
@Override
@ -71,11 +68,6 @@ public class TextView extends View {
setText(getContext().getResources().getText(resId));
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
native_measure(widget, widthMeasureSpec, heightMeasureSpec, true);
}
private native final void native_set_markup(int bool);
public native final void native_setText(String text);