diff --git a/common/src/main/res/drawable/background_skip_unselect_button.png b/common/src/main/res/drawable/background_skip_unselect_button.png new file mode 100644 index 000000000..0b0bb68b7 Binary files /dev/null and b/common/src/main/res/drawable/background_skip_unselect_button.png differ diff --git a/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java index e0c8e79dd..e07a3d1a3 100644 --- a/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java +++ b/live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java @@ -2,6 +2,7 @@ package com.yunbao.live.dialog; import android.content.Context; +import android.graphics.Color; import android.widget.ImageView; import android.widget.TextView; @@ -9,6 +10,7 @@ import androidx.annotation.NonNull; import androidx.cardview.widget.CardView; import com.lxj.xpopup.core.CenterPopupView; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.bean.GiftWallGiftDetail; import com.yunbao.common.bean.GiftWallModel; @@ -28,6 +30,7 @@ public class GiftWallItemPopup extends CenterPopupView { private GiftWallModel giftWallModel; private boolean unlit; private String mLiveUid, mStream; + private boolean isAnchor = false; public GiftWallItemPopup(@NonNull Context context, GiftWallModel giftWallModel, boolean unlit, String mLiveUid, String mStream) { @@ -36,6 +39,9 @@ public class GiftWallItemPopup extends CenterPopupView { this.unlit = unlit; this.mLiveUid = mLiveUid; this.mStream = mStream; + if (this.mLiveUid.equals(CommonAppConfig.getInstance().getUid())) { + isAnchor = true; + } } @Override @@ -60,6 +66,11 @@ public class GiftWallItemPopup extends CenterPopupView { } else { giftDetailsBtn.setText(getContext().getText(R.string.instant_light)); } + if(isAnchor){ + giftDetailsBtn.setBackgroundResource(R.drawable.background_skip_unselect_button); + giftDetailsBtn.setEnabled(false); + giftDetailsBtn.setTextColor(Color.parseColor("#F2F2F2")); + } ImgLoader.display(getContext(), giftWallModel.getGifticon(), giftImg); giftDetails.setText(giftWallModel.getGiftname()); price.setText(giftWallModel.getNeedcoin()); diff --git a/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java index 0eb6d30d1..060ab069a 100644 --- a/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java +++ b/live/src/main/java/com/yunbao/live/views/GiftAlreadyWallFragment.java @@ -1,5 +1,6 @@ package com.yunbao.live.views; +import android.graphics.Color; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; @@ -11,6 +12,7 @@ import android.widget.TextView; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.yunbao.common.CommonAppConfig; import com.yunbao.common.R; import com.yunbao.common.adapter.GiftAlreadyWallAdapter; import com.yunbao.common.bean.GiftAlreadyWallModel; @@ -60,6 +62,11 @@ public class GiftAlreadyWallFragment extends BaseFragment { alreadyWallAdapter = new GiftAlreadyWallAdapter(); alreadyList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false)); alreadyList.setAdapter(alreadyWallAdapter); + if(mLiveUid.equals(CommonAppConfig.getInstance().getUid())){ + instantLight.setBackgroundResource(R.drawable.background_skip_unselect_button); + instantLight.setEnabled(false); + instantLight.setTextColor(Color.parseColor("#F2F2F2")); + } if (isAnchor) { unlitIconHint.setText(getContext().getString(R.string.unlit_icon_hint)); } else {