6.5.4礼物栏优化

This commit is contained in:
18401019693 2023-07-25 15:25:01 +08:00
parent 0646f245b6
commit a353e51ba8
9 changed files with 110 additions and 6 deletions

View File

@ -43,6 +43,30 @@ public class LiveGiftBean {
@JSONField(name = "gift_description")
private String giftDescription;
@JSONField(name = "operate_image")
private String operateImage;
@JSONField(name = "operate_url")
private String operateUrl;
public String getOperateImage() {
return operateImage;
}
public LiveGiftBean setOperateImage(String operateImage) {
this.operateImage = operateImage;
return this;
}
public String getOperateUrl() {
return operateUrl;
}
public LiveGiftBean setOperateUrl(String operateUrl) {
this.operateUrl = operateUrl;
return this;
}
public String getGiftDescription() {
return giftDescription;
}

View File

@ -6,6 +6,11 @@
android:layout_gravity="bottom"
android:orientation="vertical">
<ImageView
android:id="@+id/operate_image"
android:layout_width="122dp"
android:layout_height="50dp" />
<FrameLayout
android:id="@+id/blind_box"
android:layout_width="wrap_content"
@ -16,6 +21,8 @@
<include
layout="@layout/view_blind_box" />
</FrameLayout>
<RelativeLayout
@ -107,12 +114,12 @@
<com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/gift_description"
android:layout_width="0dp"
android:background="@drawable/background_gift_description"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="15dp"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:background="@drawable/background_gift_description"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
@ -297,6 +304,7 @@
android:layout_marginStart="6dp"
android:layout_marginEnd="10dp">
<TextView
android:id="@+id/live_wrap"
android:layout_width="wrap_content"
@ -305,6 +313,14 @@
android:text="@string/live_wrap"
android:textColor="#CCCDCE"
android:textSize="16sp" />
<View
android:id="@+id/red_point"
android:layout_width="6dp"
android:layout_height="6dp"
android:layout_gravity="end"
android:layout_marginEnd="6dp"
android:background="@drawable/bg_red_point" />
</FrameLayout>

View File

@ -1249,6 +1249,10 @@ Limited ride And limited avatar frame</string>
<string name="lucky_red_envelope">%s drew %s in the lucky red envelope</string>
<string name="lucky_red_envelope_amount">number</string>
<string name="red_envelope_released_successfully">Red successfully</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="nothing_in_the_package_yet">There\\\'s nothing in the package yet</string>
<string name="custom_quantity">Custom quantity</string>
</resources>

View File

@ -1244,4 +1244,8 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</string>
<string name="leveling_points">升級還需%s經驗值升至%s即可領取獎勵</string>
<string name="reach_the_top">恭喜,你已達到最高等級</string>
<string name="nothing_in_the_package_yet">包裹中暫無物品哦</string>
<string name="custom_quantity">自定義數量</string>
</resources>

View File

@ -1243,4 +1243,8 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</string>
<string name="leveling_points">升級還需%s經驗值升至%s即可領取獎勵</string>
<string name="reach_the_top">恭喜,你已達到最高等級</string>
<string name="nothing_in_the_package_yet">包裹中暫無物品哦</string>
<string name="custom_quantity">自定義數量</string>
</resources>

View File

@ -1244,6 +1244,10 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</string>
<string name="leveling_points">升級還需%s經驗值升至%s即可領取獎勵</string>
<string name="reach_the_top">恭喜,你已達到最高等級</string>
<string name="nothing_in_the_package_yet">包裹中暫無物品哦</string>
<string name="custom_quantity">自定義數量</string>
</resources>

View File

@ -1250,8 +1250,8 @@ Limited ride And limited avatar frame</string>
<string name="lucky_red_envelope">%s drew %s in the lucky red envelope</string>
<string name="lucky_red_envelope_amount">number</string>
<string name="red_envelope_released_successfully">>Red successfully</string>
<string name="leveling_points">升級還需%s經驗值升至%s即可領取獎勵</string>
<string name="nothing_in_the_package_yet">包裹中暫無物品哦</string>
<string name="reach_the_top">恭喜,你已達到最高等級</string>
<string name="custom_quantity">自定義數量</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="reach_the_top">You have reached the highest level!</string>
<string name="custom_quantity">Custom quantity</string>
</resources>

View File

@ -33,6 +33,15 @@ public class CoinModel extends BaseModel {
private String usersPackRedDot;
public String getCoin() {
long coinMoney = Long.parseLong(coin);
if (999999999 < coinMoney && coinMoney <= 999999999999L) {
coin = coin.substring(0, coin.length() - 2);
coin = coin + "k";
}
if (999999999999L < coinMoney && coinMoney <= 999999999999999L) {
coin = coin.substring(0, coin.length() - 2);
coin = coin + "M";
}
return coin;
}
@ -42,6 +51,15 @@ public class CoinModel extends BaseModel {
}
public String getGold() {
long goldMoney = Long.parseLong(gold);
if (999999999 < goldMoney && goldMoney <= 999999999999L) {
gold = gold.substring(0, gold.length() - 2);
gold = gold + "k";
}
if (999999999999L < goldMoney && goldMoney <= 999999999999999L) {
gold = gold.substring(0, gold.length() - 2);
gold = gold + "M";
}
return gold;
}

View File

@ -93,7 +93,7 @@ import java.util.List;
* 直播间新送礼弹窗
*/
public class LiveGiftPopup extends AbsDialogFragment {
private ImageView gitBackground, nobilityIcon, description, iconArrow;
private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage;
private JSONArray liveGiftList;
private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber;
private RecyclerView giftTitle;
@ -118,6 +118,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
private MarqueeTextView giftDescription;
private boolean isPk;
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
@ -167,6 +168,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
description = mRootView.findViewById(R.id.description);
lvStr = mRootView.findViewById(R.id.lv_str);
iconArrow = mRootView.findViewById(R.id.icon_arrow);
operateImage = mRootView.findViewById(R.id.operate_image);
leaveHint = mRootView.findViewById(R.id.leave_hint);
progressBar = mRootView.findViewById(R.id.progressBar);
levelingLayout = mRootView.findViewById(R.id.leveling_layout);
@ -184,6 +186,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
liveGiftSend.setEnabled(false);
giftNumberLayout.setVisibility(View.INVISIBLE);
giftDescription.setVisibility(View.GONE);
operateImage.setVisibility(View.GONE);
levelingLayout.setVisibility(View.VISIBLE);
//点击包裹
ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -282,6 +285,27 @@ public class LiveGiftPopup extends AbsDialogFragment {
ImgLoader.display(getContext(), R.mipmap.icon_arrow_down, iconArrow);
}
});
/**
* 礼物图片运营位跳转
*/
ViewClicksAntiShake.clicksAntiShake(operateImage, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
StringBuffer htmlUrl = new StringBuffer();
htmlUrl.append(CommonAppConfig.HOST)
.append(liveGiftModel.getOperateUrl())
.append(userInfo.getId())
.append("&token=")
.append(userInfo.getToken())
.append("&for");
Bundle bundle = new Bundle();
bundle.putString("url", htmlUrl.toString());
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
fragment.setArguments(bundle);
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
});
}
private void initDate() {
@ -421,6 +445,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
lvStr.setText("Lv." + coinModel.getUserLevel());
int nextLeve = Integer.parseInt(coinModel.getUserLevel());
int maxLeve = Integer.parseInt(coinModel.getUserLevelMax());
findViewById(R.id.red_point).setVisibility((!TextUtils.isEmpty(coinModel.getUsersPackRedDot())) &&
TextUtils.equals(coinModel.getUsersPackRedDot(), "1") ? View.VISIBLE : View.GONE);
if (maxLeve > nextLeve) {
String leveNext = String.valueOf(nextLeve + 1);
String userNextLevel = coinModel.getUserNextLevelRewards();
@ -646,6 +672,10 @@ public class LiveGiftPopup extends AbsDialogFragment {
giftDescription.setVisibility(View.VISIBLE);
levelingLayout.setVisibility(View.GONE);
}
if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) {
operateImage.setVisibility(View.VISIBLE);
ImgLoader.display(getContext(), liveGiftModel.getOperateUrl(), operateImage);
}
}
@Subscribe(threadMode = ThreadMode.MAIN)