为选择礼物时候为灰色

This commit is contained in:
ningwenqiang 2024-10-07 11:28:48 +08:00
parent 950bcee232
commit 949ff20317
8 changed files with 106 additions and 18 deletions

View File

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <selector xmlns:android="http://schemas.android.com/apk/res/android">
android:shape="rectangle"> <item android:state_selected="true">
<shape android:shape="rectangle">
<solid android:color="#FFF026" /> <solid android:color="#FFF026" />
<corners <corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
android:bottomLeftRadius="17dp"
android:bottomRightRadius="17dp"
android:topLeftRadius="17dp"
android:topRightRadius="17dp" />
</shape> </shape>
</item>
<item android:state_selected="false">
<shape android:shape="rectangle">
<solid android:color="#33ffffff" />
<corners android:bottomLeftRadius="17dp" android:bottomRightRadius="17dp" android:topLeftRadius="17dp" android:topRightRadius="17dp" />
</shape>
</item>
</selector>

View File

@ -74,7 +74,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
app:constraint_referenced_ids="giftSendBgV,liveGiftSend,liveGiftImg,liveGiftSendTv" app:constraint_referenced_ids="giftSendBgV,liveGiftImg,liveGiftSendTv"
tools:visibility="visible" /> tools:visibility="visible" />
<!--底部钻石数量 --> <!--底部钻石数量 -->

View File

@ -1261,7 +1261,7 @@ Limited ride And limited avatar frame</string>
<string name="main_anchor_live_notify_live">Watch</string> <string name="main_anchor_live_notify_live">Watch</string>
<string name="live_notify_settings">LiveNotify</string> <string name="live_notify_settings">LiveNotify</string>
<string name="leveling_points">%s experience upgrade,%s receive rewards</string> <string name="leveling_points">%s experience upgrade,%s receive rewards</string>
<string name="reach_the_top">You have reached the highest level!</string> <string name="reach_the_top">You level maxed out.</string>
<string name="nothing_in_the_package_yet">There\'s nothing in the package yet</string> <string name="nothing_in_the_package_yet">There\'s nothing in the package yet</string>
<string name="custom_quantity">Enter count</string> <string name="custom_quantity">Enter count</string>
<string name="gift_wall">Gift wall</string> <string name="gift_wall">Gift wall</string>

View File

@ -1087,7 +1087,7 @@ Limited ride And limited avatar frame</string>
<string name="live_notify_settings">LiveNotify</string> <string name="live_notify_settings">LiveNotify</string>
<string name="leveling_points">%s experience upgrade,%s receive rewards</string> <string name="leveling_points">%s experience upgrade,%s receive rewards</string>
<string name="nothing_in_the_package_yet">There\'s nothing in the package yet</string> <string name="nothing_in_the_package_yet">There\'s nothing in the package yet</string>
<string name="reach_the_top">You have reached the highest level!</string> <string name="reach_the_top">You level maxed out.</string>
<string name="custom_quantity">Enter count</string> <string name="custom_quantity">Enter count</string>
<string name="gift_wall">Gift Hall</string> <string name="gift_wall">Gift Hall</string>
<string name="has_been_lit">Has been lit %s</string> <string name="has_been_lit">Has been lit %s</string>

View File

@ -80,12 +80,13 @@ public class LiveReportActivity extends AbsActivity implements LiveReportAdapter
mRecyclerView.setHasFixedSize(true); mRecyclerView.setHasFixedSize(true);
mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); mRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
mKeyBoardHeightUtil = new KeyBoardHeightUtil(mContext, findViewById(android.R.id.content), this); mKeyBoardHeightUtil = new KeyBoardHeightUtil(mContext, findViewById(android.R.id.content), this);
mAdapter = new LiveReportAdapter(mContext);
LiveHttpUtil.getLiveReportList(new HttpCallback() { LiveHttpUtil.getLiveReportList(new HttpCallback() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onSuccess(int code, String msg, String[] info) {
if (code == 0) { if (code == 0) {
List<LiveReportBean> list = JSON.parseArray(Arrays.toString(info), LiveReportBean.class); List<LiveReportBean> list = JSON.parseArray(Arrays.toString(info), LiveReportBean.class);
mAdapter = new LiveReportAdapter(mContext, list); mAdapter.setDataListFirst(list);
mAdapter.setActionListener(LiveReportActivity.this); mAdapter.setActionListener(LiveReportActivity.this);
if (mRecyclerView != null) { if (mRecyclerView != null) {
mRecyclerView.setAdapter(mAdapter); mRecyclerView.setAdapter(mAdapter);

View File

@ -24,6 +24,8 @@ import com.yunbao.live.bean.LiveReportBean;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import io.rong.imlib.NativeObject;
/** /**
* Created by cxf on 2018/12/15. * Created by cxf on 2018/12/15.
* 增加功能可以上传3张图片 * 增加功能可以上传3张图片
@ -52,6 +54,74 @@ public class LiveReportAdapter extends RecyclerView.Adapter {
private int photoIndex = 0; private int photoIndex = 0;
private File mFile1, mFile2, mFile3; 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<LiveReportBean> list) {
mList = list;
mCheckedPosition = -1;
}
public LiveReportAdapter(Context context, List<LiveReportBean> list) { public LiveReportAdapter(Context context, List<LiveReportBean> list) {
mContext = context; mContext = context;
mList = list; mList = list;

View File

@ -310,6 +310,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
giftWrapTv.setAlpha(0.5f); giftWrapTv.setAlpha(0.5f);
liveGiftSend.setEnabled(false); liveGiftSend.setEnabled(false);
giftSendGroup.setVisibility(View.INVISIBLE); giftSendGroup.setVisibility(View.INVISIBLE);
liveGiftSend.setSelected(false);
giftDescription.setVisibility(View.GONE); giftDescription.setVisibility(View.GONE);
operateImage.setVisibility(View.GONE); operateImage.setVisibility(View.GONE);
giftLevelGroup.setVisibility(View.VISIBLE); giftLevelGroup.setVisibility(View.VISIBLE);
@ -362,6 +363,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.feea36)); giftWrapTv.setTextColor(ContextCompat.getColor(mContext, com.yunbao.live.R.color.feea36));
isWrap = true; isWrap = true;
giftSendGroup.setVisibility(View.INVISIBLE); giftSendGroup.setVisibility(View.INVISIBLE);
liveGiftSend.setSelected(false);
GiftCacheUtil.getInstance().addDownloadList(mWrapGiftList); GiftCacheUtil.getInstance().addDownloadList(mWrapGiftList);
//礼物过滤掉数量为0的礼物 //礼物过滤掉数量为0的礼物
@ -392,6 +394,9 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
// liveGiftSendTv.setText(1+""); // liveGiftSendTv.setText(1+"");
// liveGiftModel= mWrapGiftList.get(0); // liveGiftModel= mWrapGiftList.get(0);
hideLianBtn(); hideLianBtn();
giftSendGroup.setVisibility(View.INVISIBLE);
liveGiftSend.setSelected(false);
liveGiftImg.setVisibility(View.INVISIBLE);
} else { } else {
emptyGroup.setVisibility(View.VISIBLE); emptyGroup.setVisibility(View.VISIBLE);
Log.i("LiveGiftPopup2", "包裹为空"); Log.i("LiveGiftPopup2", "包裹为空");
@ -531,7 +536,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
ViewClicksAntiShake.clicksAntiShake(giftSendBgV, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(giftSendBgV, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onViewClicks() { public void onViewClicks() {
if (liveGiftModel.getType() == 7) return; if (liveGiftModel.getType() == 7 || isWrap) return;
new XPopup.Builder(getContext()) new XPopup.Builder(getContext())
.enableDrag(false) .enableDrag(false)
.asCustom(new GiftNumberPopup(getContext())) .asCustom(new GiftNumberPopup(getContext()))
@ -905,6 +910,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
continuousClicksBg.removeCallbacks(newLianSongRunnable); continuousClicksBg.removeCallbacks(newLianSongRunnable);
continuousClickGroup.setVisibility(View.VISIBLE); continuousClickGroup.setVisibility(View.VISIBLE);
giftSendGroup.setVisibility(View.INVISIBLE); giftSendGroup.setVisibility(View.INVISIBLE);
liveGiftSend.setSelected(false);
mLianCountDownCount = 5; mLianCountDownCount = 5;
continuousClicksBg.post(newLianSongRunnable); continuousClicksBg.post(newLianSongRunnable);
} }
@ -915,6 +921,10 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
private void hideLianBtn() { private void hideLianBtn() {
continuousClickGroup.setVisibility(View.INVISIBLE); continuousClickGroup.setVisibility(View.INVISIBLE);
giftSendGroup.setVisibility(View.VISIBLE); giftSendGroup.setVisibility(View.VISIBLE);
liveGiftSend.setSelected(true);
if (isWrap){
liveGiftImg.setVisibility(View.INVISIBLE);
}
continuousClicksBg.removeCallbacks(newLianSongRunnable); continuousClicksBg.removeCallbacks(newLianSongRunnable);
getCoin(); getCoin();
if (liveGiftModel != null) { if (liveGiftModel != null) {
@ -1210,7 +1220,7 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
hideLianBtn(); hideLianBtn();
} }
giftSendGroup.setVisibility(View.INVISIBLE); giftSendGroup.setVisibility(View.INVISIBLE);
liveGiftSend.setSelected(false);
mCount = DEFAULT_COUNT; mCount = DEFAULT_COUNT;
liveGiftSendTv.setText(mCount); liveGiftSendTv.setText(mCount);
giftDescription.setVisibility(View.GONE); giftDescription.setVisibility(View.GONE);
@ -1287,6 +1297,10 @@ public class LiveGiftPopup2 extends AbsDialogFragment {
} }
liveGiftSend.setEnabled(true); liveGiftSend.setEnabled(true);
giftSendGroup.setVisibility(View.VISIBLE); giftSendGroup.setVisibility(View.VISIBLE);
liveGiftSend.setSelected(true);
if (isWrap){
liveGiftImg.setVisibility(View.INVISIBLE);
}
mCount = DEFAULT_COUNT; mCount = DEFAULT_COUNT;
liveGiftSendTv.setText(mCount); liveGiftSendTv.setText(mCount);
if (giftSendGroup.getVisibility() == View.INVISIBLE) { if (giftSendGroup.getVisibility() == View.INVISIBLE) {

View File

@ -1869,10 +1869,8 @@
<com.makeramen.roundedimageview.RoundedImageView <com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/avatar_l3" android:id="@+id/avatar_l3"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="match_parent"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:riv_oval="true" /> app:riv_oval="true" />