@@ -0,0 +1,2536 @@
+package com.yeungeek.hencoder.layout1.practice;%0A%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0Aimport android.view.ViewGroup;%0A%0Aimport static android.view.ViewGroup.LayoutParams.MATCH_PARENT;%0Aimport static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;%0A%0A/**%0A * @date 2019-04-29%0A */%0A%0Apublic class Practice03LayoutView extends ViewGroup %7B%0A    public Practice03LayoutView(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    public Practice03LayoutView(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    public Practice03LayoutView(Context context, AttributeSet attrs, int defStyleAttr) %7B%0A        super(context, attrs, defStyleAttr);%0A    %7D%0A%0A    //multi measure%0A    @Override%0A    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) %7B%0A        for (int i = 0; i %3C getChildCount(); i++) %7B%0A            View childView = getChildAt(i);%0A%0A            int childWidthSpce;%0A            int usedSize = 0;%0A            LayoutParams lp = childView.getLayoutParams();%0A            int selfWidthSpecMode = MeasureSpec.getMode(widthMeasureSpec);%0A            int selfWidthSpecSize = MeasureSpec.getSize(heightMeasureSpec);%0A%0A            switch (lp.width) %7B%0A                case MATCH_PARENT:%0A                    if (selfWidthSpecMode == MeasureSpec.EXACTLY %7C%7C selfWidthSpecMode == MeasureSpec.AT_MOST) %7B%0A                        childWidthSpce = MeasureSpec.makeMeasureSpec(selfWidthSpecSize - usedSize, MeasureSpec.EXACTLY);%0A                    %7D else %7B%0A                        childWidthSpce = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);%0A                    %7D%0A                    break;%0A                case WRAP_CONTENT:%0A                    if (selfWidthSpecMode == MeasureSpec.EXACTLY %7C%7C selfWidthSpecMode == MeasureSpec.AT_MOST) %7B%0A                        childWidthSpce = MeasureSpec.makeMeasureSpec(selfWidthSpecSize - usedSize, MeasureSpec.AT_MOST);%0A                    %7D else %7B%0A                        childWidthSpce = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);%0A                    %7D%0A                    break;%0A                default:%0A                    childWidthSpce = MeasureSpec.makeMeasureSpec(lp.width, MeasureSpec.EXACTLY);%0A                    break;%0A            %7D%0A%0A%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void onLayout(boolean changed, int l, int t, int r, int b) %7B%0A        for (int i = 0; i %3C getChildCount(); i++) %7B%0A            View childView = getChildAt(i);%0A//            childView.layout();%0A        %7D%0A    %7D%0A%7D%0A

add layout