Androidonnxfork's picture
Upload folder using huggingface_hub
eb310cb
raw
history blame
889 Bytes
package com.example.open.diffusion;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatImageView;
/**
* Created by ZTMIDGO 2023/4/1
*/
public class SquareImageView extends AppCompatImageView {
public SquareImageView(@NonNull Context context) {
this(context, null);
}
public SquareImageView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
heightMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
}