|
|
@@ -1450,74 +1450,106 @@ public class ViewUtil {
|
|
|
}
|
|
|
|
|
|
public static void centerImage(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.centerImage(imageView, pictures);
|
|
|
}
|
|
|
- GlideImageLoader.centerImage(imageView, pictures);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setAvatar(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setAvatar(imageView, pictures);
|
|
|
}
|
|
|
- GlideImageLoader.setAvatar(imageView, pictures);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setBlur(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setBlur(imageView, pictures);
|
|
|
}
|
|
|
- GlideImageLoader.setBlur(imageView, pictures);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setImage(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setImage(imageView, pictures);
|
|
|
}
|
|
|
- GlideImageLoader.setImage(imageView, pictures);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setImageLoading(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setImage(imageView, pictures, R.drawable.loading_01);
|
|
|
}
|
|
|
- GlideImageLoader.setImage(imageView, pictures, R.drawable.loading_01);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setImage(ImageView imageView, String pictures, int radius) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.roundedCornersImage(imageView, pictures, radius);
|
|
|
}
|
|
|
- GlideImageLoader.roundedCornersImage(imageView, pictures, radius);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setGameImage(ImageView imageView, String pictures) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setGameImage(imageView, pictures);
|
|
|
}
|
|
|
- GlideImageLoader.setGameImage(imageView, pictures);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public static void setGameImage(ImageView imageView, String pictures, int radius) {
|
|
|
- if (imageView != null && !TextUtils.isEmpty(pictures)) {
|
|
|
- if (pictures.contains(";")) {
|
|
|
- pictures = pictures.split(";")[0];
|
|
|
+ if (imageView != null){
|
|
|
+ if(TextUtils.isEmpty(pictures)) {
|
|
|
+ imageView.setImageResource(R.mipmap.icon);
|
|
|
+ } else {
|
|
|
+ if (pictures.contains(";")) {
|
|
|
+ pictures = pictures.split(";")[0];
|
|
|
+ }
|
|
|
+ GlideImageLoader.setGameImage(imageView, pictures, radius);
|
|
|
}
|
|
|
- GlideImageLoader.setGameImage(imageView, pictures, radius);
|
|
|
}
|
|
|
}
|
|
|
|