Back to project page picasso.
The source code is released under:
Apache License
If you think the Android project picasso listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.picasso; // ww w. j av a 2 s . co m import android.content.Context; import android.util.AttributeSet; import android.widget.ImageView; /** An image view which always remains square with respect to its width. */ final class SquaredImageView extends ImageView { public SquaredImageView(Context context) { super(context); } public SquaredImageView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); setMeasuredDimension(getMeasuredWidth(), getMeasuredWidth()); } }