From 949ff203173de64e82a710e3b75dc3c82962d4b3 Mon Sep 17 00:00:00 2001 From: ningwenqiang Date: Mon, 7 Oct 2024 11:28:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=80=89=E6=8B=A9=E7=A4=BC=E7=89=A9?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=BA=E7=81=B0=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/res/drawable/bg_gift_send_btn.xml | 23 +++--- .../res/layout/dialog_live_gift_popup2.xml | 2 +- common/src/main/res/values-en-rUS/strings.xml | 2 +- common/src/main/res/values/strings.xml | 2 +- .../live/activity/LiveReportActivity.java | 3 +- .../live/adapter/LiveReportAdapter.java | 70 +++++++++++++++++++ .../yunbao/live/dialog/LiveGiftPopup2.java | 18 ++++- live/src/main/res/layout/view_live_room.xml | 4 +- 8 files changed, 106 insertions(+), 18 deletions(-) diff --git a/common/src/main/res/drawable/bg_gift_send_btn.xml b/common/src/main/res/drawable/bg_gift_send_btn.xml index c906b59b0..c4b04d999 100644 --- a/common/src/main/res/drawable/bg_gift_send_btn.xml +++ b/common/src/main/res/drawable/bg_gift_send_btn.xml @@ -1,10 +1,15 @@ - - - - \ No newline at end of file + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/src/main/res/layout/dialog_live_gift_popup2.xml b/common/src/main/res/layout/dialog_live_gift_popup2.xml index 5920e7ef8..2b69b1c36 100644 --- a/common/src/main/res/layout/dialog_live_gift_popup2.xml +++ b/common/src/main/res/layout/dialog_live_gift_popup2.xml @@ -74,7 +74,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" - app:constraint_referenced_ids="giftSendBgV,liveGiftSend,liveGiftImg,liveGiftSendTv" + app:constraint_referenced_ids="giftSendBgV,liveGiftImg,liveGiftSendTv" tools:visibility="visible" /> diff --git a/common/src/main/res/values-en-rUS/strings.xml b/common/src/main/res/values-en-rUS/strings.xml index 8ee8d0ef7..34e581bcb 100644 --- a/common/src/main/res/values-en-rUS/strings.xml +++ b/common/src/main/res/values-en-rUS/strings.xml @@ -1261,7 +1261,7 @@ Limited ride And limited avatar frame Watch LiveNotify %s experience upgrade,%s receive rewards - You have reached the highest level! + You level maxed out. There\'s nothing in the package yet Enter count Gift wall diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 6e09c3b4b..bc245db51 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -1087,7 +1087,7 @@ Limited ride And limited avatar frame LiveNotify %s experience upgrade,%s receive rewards There\'s nothing in the package yet - You have reached the highest level! + You level maxed out. Enter count Gift Hall Has been lit %s diff --git a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java index 6be9e8cf9..bf3443d8b 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveReportActivity.java @@ -80,12 +80,13 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter mRecyclerView.setHasFixedSize(true); mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); mKeyBoardHeightUtil = new KeyBoardHeightUtil(mContext, findViewById(android.R.id.content), this); + mAdapter = new LiveReportAdapter(mContext); LiveHttpUtil.getLiveReportList(new HttpCallback() { @Override public void onSuccess(int code, String msg, String[] info) { if (code == 0) { List list = JSON.parseArray(Arrays.toString(info), LiveReportBean.class); - mAdapter = new LiveReportAdapter(mContext, list); + mAdapter.setDataListFirst(list); mAdapter.setActionListener(LiveReportActivity.this); if (mRecyclerView != null) { mRecyclerView.setAdapter(mAdapter); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java index 052e063fa..3ca9fd142 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveReportAdapter.java @@ -24,6 +24,8 @@ import com.yunbao.live.bean.LiveReportBean; import java.io.File; import java.util.List; +import io.rong.imlib.NativeObject; + /** * Created by cxf on 2018/12/15. * 增加功能:可以上传3张图片 @@ -52,6 +54,74 @@ public class LiveReportAdapter extends RecyclerView.Adapter { private int photoIndex = 0; private File mFile1, mFile2, mFile3; + public LiveReportAdapter(Context context) { + mContext = context; + mInflater = LayoutInflater.from(mContext); + mCheckedDrawable = ContextCompat.getDrawable(mContext, R.mipmap.icon_cash_radio_1); + mUnCheckedDrawable = ContextCompat.getDrawable(mContext, R.mipmap.icon_cash_radio_0); + imageUtilInit(); + mOnClickListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + Object tag = v.getTag(); + if (tag == null) { + return; + } + int position = (int) tag; + LiveReportBean bean = mList.get(position - 1); + if (mCheckedPosition == position) { + bean.setChecked(false); + notifyItemChanged(position, Constants.PAYLOAD); + mCheckedPosition = -1; + mCurVideoReportBean = null; + } else { + if (mCheckedPosition >= 0) { + mList.get(mCheckedPosition - 1).setChecked(false); + notifyItemChanged(mCheckedPosition, Constants.PAYLOAD); + } + bean.setChecked(true); + notifyItemChanged(position, Constants.PAYLOAD); + mCheckedPosition = position; + mCurVideoReportBean = bean; + } + } + }; + mReportListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + if (v.getId() == R.id.btn_report){ + if (mFootVh != null) { + mFootVh.submit(); + } + }else if (v.getId() == R.id.photo1){ + photoIndex = 0; + if (mFootVh != null) { + mFootVh.showAddPhoto(); + } + } + else if (v.getId() == R.id.photo2){ + photoIndex = 1; + if (mFootVh != null) { + mFootVh.showAddPhoto(); + } + } + else if (v.getId() == R.id.photo3){ + photoIndex = 2; + if (mFootVh != null) { + mFootVh.showAddPhoto(); + } + } + + } + }; + } + + public void setDataListFirst(List list) { + mList = list; + mCheckedPosition = -1; + } + + public LiveReportAdapter(Context context, List list) { mContext = context; mList = list; diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java index 6c7c0718c..7b1cf5daa 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup2.java @@ -310,6 +310,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { giftWrapTv.setAlpha(0.5f); liveGiftSend.setEnabled(false); giftSendGroup.setVisibility(View.INVISIBLE); + liveGiftSend.setSelected(false); giftDescription.setVisibility(View.GONE); operateImage.setVisibility(View.GONE); giftLevelGroup.setVisibility(View.VISIBLE); @@ -362,6 +363,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.feea36)); isWrap = true; giftSendGroup.setVisibility(View.INVISIBLE); + liveGiftSend.setSelected(false); GiftCacheUtil.getInstance().addDownloadList(mWrapGiftList); //礼物过滤掉数量为0的礼物 @@ -392,6 +394,9 @@ public class LiveGiftPopup2 extends AbsDialogFragment { // liveGiftSendTv.setText(1+""); // liveGiftModel= mWrapGiftList.get(0); hideLianBtn(); + giftSendGroup.setVisibility(View.INVISIBLE); + liveGiftSend.setSelected(false); + liveGiftImg.setVisibility(View.INVISIBLE); } else { emptyGroup.setVisibility(View.VISIBLE); Log.i("LiveGiftPopup2", "包裹为空"); @@ -531,7 +536,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { ViewClicksAntiShake.clicksAntiShake(giftSendBgV, new ViewClicksAntiShake.ViewClicksCallBack() { @Override public void onViewClicks() { - if (liveGiftModel.getType() == 7) return; + if (liveGiftModel.getType() == 7 || isWrap) return; new XPopup.Builder(getContext()) .enableDrag(false) .asCustom(new GiftNumberPopup(getContext())) @@ -905,6 +910,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { continuousClicksBg.removeCallbacks(newLianSongRunnable); continuousClickGroup.setVisibility(View.VISIBLE); giftSendGroup.setVisibility(View.INVISIBLE); + liveGiftSend.setSelected(false); mLianCountDownCount = 5; continuousClicksBg.post(newLianSongRunnable); } @@ -915,6 +921,10 @@ public class LiveGiftPopup2 extends AbsDialogFragment { private void hideLianBtn() { continuousClickGroup.setVisibility(View.INVISIBLE); giftSendGroup.setVisibility(View.VISIBLE); + liveGiftSend.setSelected(true); + if (isWrap){ + liveGiftImg.setVisibility(View.INVISIBLE); + } continuousClicksBg.removeCallbacks(newLianSongRunnable); getCoin(); if (liveGiftModel != null) { @@ -1210,7 +1220,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment { hideLianBtn(); } giftSendGroup.setVisibility(View.INVISIBLE); - + liveGiftSend.setSelected(false); mCount = DEFAULT_COUNT; liveGiftSendTv.setText(mCount); giftDescription.setVisibility(View.GONE); @@ -1287,6 +1297,10 @@ public class LiveGiftPopup2 extends AbsDialogFragment { } liveGiftSend.setEnabled(true); giftSendGroup.setVisibility(View.VISIBLE); + liveGiftSend.setSelected(true); + if (isWrap){ + liveGiftImg.setVisibility(View.INVISIBLE); + } mCount = DEFAULT_COUNT; liveGiftSendTv.setText(mCount); if (giftSendGroup.getVisibility() == View.INVISIBLE) { diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index d31385eaf..b39cd6f84 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -1869,10 +1869,8 @@