Skip to content

Instantly share code, notes, and snippets.

@extralam
Created June 28, 2013 02:20
Show Gist options
  • Save extralam/5881992 to your computer and use it in GitHub Desktop.
Save extralam/5881992 to your computer and use it in GitHub Desktop.
SquareView - create View Container with square Size
package com.kirin.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
/**
* SquareView - create View Container with square Size
* @author 阿目
* ViewGroup can be Relativelayout,Linearlayout as you like
*/
public class SquareView extends ViewGroup {
public SquareView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, widthMeasureSpec);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment