|
|
@@ -1727,19 +1727,22 @@ public class ViewUtil {
|
|
|
AdHelper.stat(advertising.getAd_id(), 1);
|
|
|
if (advertising.isImage()) {
|
|
|
RequestBuilder<Drawable> builder = Glide.with(activity).load(advertising.getAd_img());
|
|
|
-// if (TextUtils.isEmpty(advertising.getName())) {//没有标题时 去掉下面的边距 并给图片左下理右下添加图角
|
|
|
- builder.apply(new RequestOptions().transform(new RoundedCornersTransformation(activity.getResources().getDimensionPixelSize(R.dimen.content_padding_36), 0, RoundedCornersTransformation.CornerType.BOTTOM)));
|
|
|
- dialog_center_ll.setPadding(0, activity.getResources().getDimensionPixelSize(R.dimen.content_padding_54), 0, 0);
|
|
|
- ViewGroup parent = (ViewGroup) dialog_center_ll.getParent();
|
|
|
- ((FrameLayout.LayoutParams) parent.getLayoutParams()).setMargins(0, 0, 0, 0);
|
|
|
- Window win = dialog.getWindow();
|
|
|
- win.getDecorView().setPadding(0, 0, 0, 0);
|
|
|
- WindowManager.LayoutParams lp = win.getAttributes();
|
|
|
- lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
- lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
- win.setAttributes(lp);
|
|
|
-// }
|
|
|
+ builder.apply(new RequestOptions().transform(new RoundedCornersTransformation(activity.getResources().getDimensionPixelSize(R.dimen.content_padding_36), 0, RoundedCornersTransformation.CornerType.BOTTOM)));
|
|
|
builder.into(ad_iv);
|
|
|
+ if(advertising.getAd_img().toLowerCase().endsWith("gif")){
|
|
|
+ ViewUtil.setGif(ad_iv, advertising.getAd_img());
|
|
|
+ } else {
|
|
|
+ ViewUtil.setImage(ad_iv, advertising.getAd_img());
|
|
|
+ }
|
|
|
+ dialog_center_ll.setPadding(0, activity.getResources().getDimensionPixelSize(R.dimen.content_padding_54), 0, 0);
|
|
|
+ ViewGroup parent = (ViewGroup) dialog_center_ll.getParent();
|
|
|
+ ((FrameLayout.LayoutParams) parent.getLayoutParams()).setMargins(0, 0, 0, 0);
|
|
|
+ Window win = dialog.getWindow();
|
|
|
+ win.getDecorView().setPadding(0, 0, 0, 0);
|
|
|
+ WindowManager.LayoutParams lp = win.getAttributes();
|
|
|
+ lp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
|
|
+ lp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
|
|
+ win.setAttributes(lp);
|
|
|
ad_video_view.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
Uri uri = Uri.parse(advertising.getAd_img());
|
|
|
@@ -1796,11 +1799,11 @@ public class ViewUtil {
|
|
|
});
|
|
|
setVisibility(ad_flag, advertising.getUser_type() == 2);
|
|
|
// if (TextUtils.isEmpty(advertising.getName())) {
|
|
|
- ViewUtil.setVisibility(ad_msg, false);
|
|
|
- //3.4.7添加 -- 不显示标题栏,不显示背景 start
|
|
|
- ViewUtil.setVisibility(dialog_title, false);
|
|
|
- dialog_center_ll.setBackgroundColor(Color.TRANSPARENT);
|
|
|
- //3.4.7添加 -- 不显示标题栏,不显示背景 end
|
|
|
+ ViewUtil.setVisibility(ad_msg, false);
|
|
|
+ //3.4.7添加 -- 不显示标题栏,不显示背景 start
|
|
|
+ ViewUtil.setVisibility(dialog_title, false);
|
|
|
+ dialog_center_ll.setBackgroundColor(Color.TRANSPARENT);
|
|
|
+ //3.4.7添加 -- 不显示标题栏,不显示背景 end
|
|
|
// } else {
|
|
|
// ad_msg.setText(advertising.getName());
|
|
|
// }
|
|
|
@@ -2021,6 +2024,14 @@ public class ViewUtil {
|
|
|
.into(imageView);
|
|
|
}
|
|
|
|
|
|
+ public static void setGif(ImageView imageView, String url) {
|
|
|
+ GlideApp.with(imageView)
|
|
|
+ .asGif()
|
|
|
+ .load(url)
|
|
|
+ .format(DecodeFormat.PREFER_ARGB_8888)
|
|
|
+ .into(imageView);
|
|
|
+ }
|
|
|
+
|
|
|
public static void setImage(ImageView imageView, Object object) {
|
|
|
if (imageView != null) {
|
|
|
if (object instanceof String) {
|