From 79a709a76f85f5ed0b477e79592951400dbde657 Mon Sep 17 00:00:00 2001 From: zlzw <583819556@qq.com> Date: Thu, 20 Apr 2023 15:10:57 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=BC=80=E5=B1=8F=E8=BF=87=E5=BA=A6?= =?UTF-8?q?=E5=8A=A8=E7=94=BB=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shayu/phonelive/activity/LauncherActivity.java | 12 ++++++++---- .../src/main/java/com/yunbao/common/bean/AdBean.java | 9 +++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java index b8ac8a94a..31a5dfd4d 100644 --- a/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java +++ b/app/src/main/java/com/shayu/phonelive/activity/LauncherActivity.java @@ -276,10 +276,14 @@ public class LauncherActivity extends AppCompatActivity implements View.OnClickL } if (mImageViewList != null && mImageViewList.size() > 0) { Log.i(TAG, "forwardMainActivity: " + mImageViewList.size()); - intent.putExtra("ad_url", mAdList.get(0).getUrl()); - Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle(); - //Bundle bundle = ActivityOptionsCompat.makeScaleUpAnimation(mImageViewList.get(0),100,100, DpUtil.dp2px(400),DpUtil.dp2px(200)).toBundle(); - LauncherActivity.this.startActivity(intent, bundle); + AdBean bean = mAdList.get(0); + if (bean != null && bean.getAnimation() == 1) { + intent.putExtra("ad_url", mAdList.get(0).getUrl()); + Bundle bundle = ActivityOptionsCompat.makeSceneTransitionAnimation(LauncherActivity.this, mImageViewList.get(0), "ad_img_0").toBundle(); + LauncherActivity.this.startActivity(intent, bundle); + } else { + LauncherActivity.this.startActivity(intent); + } } else { LauncherActivity.this.startActivity(intent); } diff --git a/common/src/main/java/com/yunbao/common/bean/AdBean.java b/common/src/main/java/com/yunbao/common/bean/AdBean.java index 04228b08c..521d05731 100644 --- a/common/src/main/java/com/yunbao/common/bean/AdBean.java +++ b/common/src/main/java/com/yunbao/common/bean/AdBean.java @@ -9,6 +9,7 @@ import com.alibaba.fastjson.annotation.JSONField; public class AdBean { private String mUrl; private String mLink; + private int animation;//是否使用过度动画 @JSONField(name = "thumb") public String getUrl() { @@ -26,4 +27,12 @@ public class AdBean { public void setLink(String link) { mLink = link; } + @JSONField(name = "animation") + public int getAnimation() { + return animation; + } + @JSONField(name = "animation") + public void setAnimation(int animation) { + this.animation = animation; + } }