| | |
| | | import android.graphics.PorterDuffXfermode; |
| | | import android.graphics.Rect; |
| | | import android.graphics.RectF; |
| | | import android.text.TextUtils; |
| | | import android.widget.ImageView; |
| | | |
| | | import androidx.annotation.Nullable; |
| | |
| | | import com.bumptech.glide.request.RequestOptions; |
| | | import com.bumptech.glide.request.target.Target; |
| | | import com.hdl.photovoltaic.R; |
| | | import com.hdl.photovoltaic.other.HdlLogLogic; |
| | | import com.hdl.photovoltaic.other.HdlThreadLogic; |
| | | |
| | | import java.io.InputStream; |
| | |
| | | * @param imageview 显示图片组件 |
| | | */ |
| | | public static void getGeneralImage(Context context, String url, ImageView imageview) { |
| | | if (TextUtils.isEmpty(url) || !url.startsWith("http://")) { |
| | | return; |
| | | } |
| | | Glide.with(context) |
| | | .load(url) |
| | | .apply(getRequestOptions(false)) |
| | |
| | | * @param granularRoundedCorners 设置图片角度 |
| | | */ |
| | | public static void getGranularRoundedCornersImage(Context context, String url, ImageView imageview, GranularRoundedCorners granularRoundedCorners) { |
| | | if (TextUtils.isEmpty(url) || !url.startsWith("http://")) { |
| | | return; |
| | | } |
| | | Glide.with(context) |
| | | .load(url) |
| | | .apply(getRequestOptions(false)) |
| | |
| | | * @param roundedCorners 设置图片角度值 |
| | | */ |
| | | public static void getRoundedCornersImage(Context context, String url, ImageView imageview, RoundedCorners roundedCorners, boolean userImage) { |
| | | if (TextUtils.isEmpty(url) || !url.startsWith("http://")) { |
| | | return; |
| | | } |
| | | Glide.with(context) |
| | | .load(url) |
| | | .apply(getRequestOptions(userImage)) |
| | |
| | | * @param url 图片地址 |
| | | * @param imageview 显示图片组件 |
| | | */ |
| | | public static void getCircleCropImage(Context context, String url, ImageView imageview) { |
| | | public static void getCircleCropImage(Context context, String url, ImageView imageview, boolean userImage) { |
| | | if (TextUtils.isEmpty(url) || !url.startsWith("http://")) { |
| | | return; |
| | | } |
| | | Glide.with(context) |
| | | .load(url) |
| | | .apply(getRequestOptions(false)) |
| | | .apply(getRequestOptions(userImage)) |
| | | .transform(new CircleCrop()) |
| | | .into(imageview); |
| | | } |