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:
@@ -814,14 +814,11 @@ public class View extends Object {
|
||||
private int oldWidth;
|
||||
private int oldHeight;
|
||||
private boolean haveCustomMeasure;
|
||||
protected boolean haveComplexMeasure = false;
|
||||
|
||||
private int visibility = View.VISIBLE;
|
||||
private float alpha = 1.0f;
|
||||
|
||||
public View() {
|
||||
this(Context.this_application);
|
||||
} // FIXME
|
||||
|
||||
public View(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
@@ -970,7 +967,7 @@ public class View extends Object {
|
||||
if (haveCustomMeasure) // calling native_measure here would create infinite loop
|
||||
setMeasuredDimension(getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec), getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec));
|
||||
else
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, false);
|
||||
native_measure(widget, widthMeasureSpec, heightMeasureSpec, haveComplexMeasure);
|
||||
}
|
||||
|
||||
public void setPressed(boolean pressed) {
|
||||
|
||||
Reference in New Issue
Block a user