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
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:
@@ -12,38 +12,23 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
public int id;
|
||||
public ArrayList<View> children;
|
||||
|
||||
public ViewGroup() {
|
||||
children = new ArrayList<View>();
|
||||
}
|
||||
|
||||
public ViewGroup(Context context) {
|
||||
super(context);
|
||||
|
||||
children = new ArrayList<View>();
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public ViewGroup(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
children = new ArrayList<View>();
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public ViewGroup(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs);
|
||||
|
||||
children = new ArrayList<View>();
|
||||
this(context, attrs, defStyleAttr, 0);
|
||||
}
|
||||
|
||||
public ViewGroup(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
|
||||
children = new ArrayList<View>();
|
||||
}
|
||||
|
||||
public ViewGroup(int _id) { // FIXME
|
||||
children = new ArrayList<View>();
|
||||
|
||||
id = _id;
|
||||
haveComplexMeasure = true;
|
||||
}
|
||||
|
||||
public void addView(View child) {
|
||||
@@ -128,11 +113,6 @@ public class ViewGroup extends View implements ViewParent, ViewManager {
|
||||
removeView(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected native long native_constructor(Context context, AttributeSet attrs);
|
||||
protected native void native_addView(long widget, long child, int index, LayoutParams params);
|
||||
|
||||
Reference in New Issue
Block a user