@@ -0,0 +1,1403 @@
+%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0Aimport android.widget.RelativeLayout;%0A%0Apublic class SquareLayout extends RelativeLayout %7B%0A    public SquareLayout(Context context, AttributeSet attrs, int defStyle) %7B%0A        super(context, attrs, defStyle);%0A    %7D%0A%0A    public SquareLayout(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    public SquareLayout(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    @SuppressWarnings(%22unused%22)%0A    @Override%0A    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) %7B%0A        // For simple implementation, or internal size is always 0.%0A        // We depend on the container to specify the layout size of%0A        // our view. We can't really know what it is since we will be%0A        // adding and removing different arbitrary views and do not%0A        // want the layout to change as this happens.%0A        setMeasuredDimension(getDefaultSize(0, widthMeasureSpec), getDefaultSize(0, heightMeasureSpec));%0A%0A        // Children are just made to fill our space.%0A        int childWidthSize = getMeasuredWidth();%0A        int childHeightSize = getMeasuredHeight();%0A        //%E9%AB%98%E5%BA%A6%E5%92%8C%E5%AE%BD%E5%BA%A6%E4%B8%80%E6%A0%B7%0A        heightMeasureSpec = widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(childWidthSize, View.MeasureSpec.EXACTLY);%0A        super.onMeasure(widthMeasureSpec, heightMeasureSpec);%0A    %7D%0A%7D%0A

Create SquareLayout.java