Skip to content

Instantly share code, notes, and snippets.

@abhimuktheeswarar
Created August 7, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhimuktheeswarar/0c760635817cc790e2be0f49262086a7 to your computer and use it in GitHub Desktop.
Save abhimuktheeswarar/0c760635817cc790e2be0f49262086a7 to your computer and use it in GitHub Desktop.
Create a perfect square cardview
public class SquareCardView extends CardView {
public SquareCardView(Context context) {
super(context);
}
public SquareCardView(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