Download app/src/main/java/com/example/open/diffusion/SquareImageView.java from Androidonnxfork/test: direct link, hf CLI and curl.
- Browser
- Download file 889 Bytes
-
https://huggingface.co/Androidonnxfork/test/resolve/0a8f09fd84d0f09bdf431cb731779133085a61ba/app/src/main/java/com/example/open/diffusion/SquareImageView.java
- Command line
-
hf download hf://Androidonnxfork/test@0a8f09fd84d0f09bdf431cb731779133085a61ba/app/src/main/java/com/example/open/diffusion/SquareImageView.java
-
curl -L -o SquareImageView.java https://huggingface.co/Androidonnxfork/test/resolve/0a8f09fd84d0f09bdf431cb731779133085a61ba/app/src/main/java/com/example/open/diffusion/SquareImageView.java
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( Context context) { | |
| this(context, null); | |
| } | |
| public SquareImageView( Context context, AttributeSet attrs) { | |
| super(context, attrs); | |
| } | |
| protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { | |
| int widthSize = MeasureSpec.getSize(widthMeasureSpec); | |
| heightMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, MeasureSpec.EXACTLY); | |
| super.onMeasure(widthMeasureSpec, heightMeasureSpec); | |
| } | |
| } | |