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; + } }