提交 e4f1308b 编写于 作者: T Takeshi Hagikura

Merge pull request #54 from google/suppress_object_creation_for_boolean_array

Suppress the creation of the boolean array
...@@ -31,6 +31,7 @@ import android.widget.RelativeLayout; ...@@ -31,6 +31,7 @@ import android.widget.RelativeLayout;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
...@@ -258,8 +259,9 @@ public class FlexboxLayout extends ViewGroup { ...@@ -258,8 +259,9 @@ public class FlexboxLayout extends ViewGroup {
if (isOrderChangedFromLastMeasurement()) { if (isOrderChangedFromLastMeasurement()) {
mReorderedIndices = createReorderedIndices(); mReorderedIndices = createReorderedIndices();
} }
// TODO: Move the object allocation to other methods instead of onMeasure if (mChildrenFrozen == null || mChildrenFrozen.length < getChildCount()) {
mChildrenFrozen = new boolean[getChildCount()]; mChildrenFrozen = new boolean[getChildCount()];
}
// TODO: Only calculate the children views which are affected from the last measure. // TODO: Only calculate the children views which are affected from the last measure.
...@@ -276,6 +278,8 @@ public class FlexboxLayout extends ViewGroup { ...@@ -276,6 +278,8 @@ public class FlexboxLayout extends ViewGroup {
throw new IllegalStateException( throw new IllegalStateException(
"Invalid value for the flex direction is set: " + mFlexDirection); "Invalid value for the flex direction is set: " + mFlexDirection);
} }
Arrays.fill(mChildrenFrozen, false);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册