diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index 4b77b27b8..daca96ade 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -1272,7 +1272,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL public void onSuccess(int code, String msg, String[] info) { List list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class); if(list.isEmpty()){ - openNewBuyGuardWindow(); + openNewBuyGuardWindow(true); }else { LiveNewGuardListDialogFragment fragment = new LiveNewGuardListDialogFragment(); fragment.setList(list); @@ -1340,7 +1340,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL /** * 打开购买新版守护的弹窗 */ - public void openNewBuyGuardWindow() { + public void openNewBuyGuardWindow(boolean isEmpty) { if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream) || mLiveGuardInfo == null) { return; } @@ -1353,6 +1353,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL bundle.putString(Constants.STREAM, mStream); bundle.putString(Constants.LIVE_ANCHER_ICON, mAncherIcon); bundle.putString(Constants.USER_ICON, CommonAppConfig.getInstance().getUserBean().getAvatar()); + bundle.putBoolean("guard",isEmpty); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment"); } diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java index ed0f4a67c..d7303b322 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGuardDialogFragment.java @@ -164,7 +164,7 @@ public class LiveGuardDialogFragment extends AbsDialogFragment implements View.O @Override public void onClick(View v) { dismiss(); - ((LiveActivity) mContext).openNewBuyGuardWindow(); + ((LiveActivity) mContext).openNewBuyGuardWindow(true); } @Override diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java index 597c92d82..2a5c34d46 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardBuyDialogFragment.java @@ -80,6 +80,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements private LiveNewGuardBuyItemsAdapter buyItemsAdapter; private GuardRightAdapter mGuardRightAdapter; + private boolean isEmpty; @Override @@ -163,6 +164,7 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements mUserIcon = bundle.getString(Constants.USER_ICON); String coinName = WordUtil.getString(R.string.diamond); mCoinName = coinName; + isEmpty=bundle.getBoolean("guard",true); // mCoinNameTextView.setText(WordUtil.getString(R.string.guard_my) + coinName + ":"); mCoinNameTextView.setText("快为您喜欢的主播开通守护吧"); anchorName.setText(String.format("成爲%s的守護", mAncherName)); @@ -201,11 +203,20 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements private void initView() { int guardType = mLiveGuardInfo.getMyGuardType(); if (guardType == Constants.GUARD_TYPE_NONE) { + if(isEmpty){ + iconCover.setImageResource(R.drawable.guardian_img_wings); + userIconOne.setVisibility(View.GONE); + userIconTwo.setVisibility(View.GONE); + }else{ + ImgLoader.display(mContext, mAncherIcon, userIconOne); + ImgLoader.display(mContext, mUserIcon, userIconTwo); + userIconOne.setVisibility(View.VISIBLE); + userIconTwo.setVisibility(View.VISIBLE); + + } // iconCover.setBackgroundResource(R.drawable.guardian_img_wings); - userIconOne.setVisibility(View.VISIBLE); - userIconTwo.setVisibility(View.VISIBLE); - ImgLoader.display(mContext, mAncherIcon, userIconOne); - ImgLoader.display(mContext, mUserIcon, userIconTwo); + + buy1.setVisibility(View.VISIBLE); buy2.setVisibility(View.GONE); } else { diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java index 43da6edc3..aef5b1af2 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveNewGuardListDialogFragment.java @@ -168,7 +168,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements @Override public void onClick(View view) { dismiss(); - ((LiveActivity) mContext).openNewBuyGuardWindow(); + ((LiveActivity) mContext).openNewBuyGuardWindow(list.isEmpty()); } @Override