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") @JSONField(name = "gift_description")
private String giftDescription; 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() { public String getGiftDescription() {
return giftDescription; return giftDescription;
} }

View File

@ -6,6 +6,11 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:orientation="vertical"> android:orientation="vertical">
<ImageView
android:id="@+id/operate_image"
android:layout_width="122dp"
android:layout_height="50dp" />
<FrameLayout <FrameLayout
android:id="@+id/blind_box" android:id="@+id/blind_box"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -16,6 +21,8 @@
<include <include
layout="@layout/view_blind_box" /> layout="@layout/view_blind_box" />
</FrameLayout> </FrameLayout>
<RelativeLayout <RelativeLayout
@ -107,12 +114,12 @@
<com.yunbao.common.views.weight.MarqueeTextView <com.yunbao.common.views.weight.MarqueeTextView
android:id="@+id/gift_description" android:id="@+id/gift_description"
android:layout_width="0dp" android:layout_width="0dp"
android:background="@drawable/background_gift_description"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/background_gift_description"
android:ellipsize="marquee" android:ellipsize="marquee"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
@ -297,6 +304,7 @@
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="10dp"> android:layout_marginEnd="10dp">
<TextView <TextView
android:id="@+id/live_wrap" android:id="@+id/live_wrap"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -305,6 +313,14 @@
android:text="@string/live_wrap" android:text="@string/live_wrap"
android:textColor="#CCCDCE" android:textColor="#CCCDCE"
android:textSize="16sp" /> 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> </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">%s drew %s in the lucky red envelope</string>
<string name="lucky_red_envelope_amount">number</string> <string name="lucky_red_envelope_amount">number</string>
<string name="red_envelope_released_successfully">Red successfully</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> </resources>

View File

@ -1244,4 +1244,8 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string> <string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string> <string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</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> </resources>

View File

@ -1243,4 +1243,8 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string> <string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string> <string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</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> </resources>

View File

@ -1244,6 +1244,10 @@
<string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string> <string name="lucky_red_envelope">" %s 在 好運紅包 中抽到了 %s"</string>
<string name="lucky_red_envelope_amount">数量</string> <string name="lucky_red_envelope_amount">数量</string>
<string name="red_envelope_released_successfully">红包发布成功</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> </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">%s drew %s in the lucky red envelope</string>
<string name="lucky_red_envelope_amount">number</string> <string name="lucky_red_envelope_amount">number</string>
<string name="red_envelope_released_successfully">>Red successfully</string> <string name="red_envelope_released_successfully">>Red successfully</string>
<string name="leveling_points">升級還需%s經驗值升至%s即可領取獎勵</string> <string name="leveling_points">%s experience upgrade,%s receive rewards</string>
<string name="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">恭喜,你已達到最高等級</string> <string name="reach_the_top">You have reached the highest level!</string>
<string name="custom_quantity">自定義數量</string> <string name="custom_quantity">Custom quantity</string>
</resources> </resources>

View File

@ -33,6 +33,15 @@ public class CoinModel extends BaseModel {
private String usersPackRedDot; private String usersPackRedDot;
public String getCoin() { 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; return coin;
} }
@ -42,6 +51,15 @@ public class CoinModel extends BaseModel {
} }
public String getGold() { 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; return gold;
} }

View File

@ -93,7 +93,7 @@ import java.util.List;
* 直播间新送礼弹窗 * 直播间新送礼弹窗
*/ */
public class LiveGiftPopup extends AbsDialogFragment { public class LiveGiftPopup extends AbsDialogFragment {
private ImageView gitBackground, nobilityIcon, description, iconArrow; private ImageView gitBackground, nobilityIcon, description, iconArrow, operateImage;
private JSONArray liveGiftList; private JSONArray liveGiftList;
private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber; private TextView diamondText, goldText, liveWrap, vipGoldDesc, vipGoldTitle, giftNumber;
private RecyclerView giftTitle; private RecyclerView giftTitle;
@ -118,6 +118,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
private MarqueeTextView giftDescription; private MarqueeTextView giftDescription;
private boolean isPk; private boolean isPk;
@Override @Override
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
@ -167,6 +168,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
description = mRootView.findViewById(R.id.description); description = mRootView.findViewById(R.id.description);
lvStr = mRootView.findViewById(R.id.lv_str); lvStr = mRootView.findViewById(R.id.lv_str);
iconArrow = mRootView.findViewById(R.id.icon_arrow); iconArrow = mRootView.findViewById(R.id.icon_arrow);
operateImage = mRootView.findViewById(R.id.operate_image);
leaveHint = mRootView.findViewById(R.id.leave_hint); leaveHint = mRootView.findViewById(R.id.leave_hint);
progressBar = mRootView.findViewById(R.id.progressBar); progressBar = mRootView.findViewById(R.id.progressBar);
levelingLayout = mRootView.findViewById(R.id.leveling_layout); levelingLayout = mRootView.findViewById(R.id.leveling_layout);
@ -184,6 +186,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
liveGiftSend.setEnabled(false); liveGiftSend.setEnabled(false);
giftNumberLayout.setVisibility(View.INVISIBLE); giftNumberLayout.setVisibility(View.INVISIBLE);
giftDescription.setVisibility(View.GONE); giftDescription.setVisibility(View.GONE);
operateImage.setVisibility(View.GONE);
levelingLayout.setVisibility(View.VISIBLE); levelingLayout.setVisibility(View.VISIBLE);
//点击包裹 //点击包裹
ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(liveWrap, new ViewClicksAntiShake.ViewClicksCallBack() {
@ -282,6 +285,27 @@ public class LiveGiftPopup extends AbsDialogFragment {
ImgLoader.display(getContext(), R.mipmap.icon_arrow_down, iconArrow); 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() { private void initDate() {
@ -421,6 +445,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
lvStr.setText("Lv." + coinModel.getUserLevel()); lvStr.setText("Lv." + coinModel.getUserLevel());
int nextLeve = Integer.parseInt(coinModel.getUserLevel()); int nextLeve = Integer.parseInt(coinModel.getUserLevel());
int maxLeve = Integer.parseInt(coinModel.getUserLevelMax()); 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) { if (maxLeve > nextLeve) {
String leveNext = String.valueOf(nextLeve + 1); String leveNext = String.valueOf(nextLeve + 1);
String userNextLevel = coinModel.getUserNextLevelRewards(); String userNextLevel = coinModel.getUserNextLevelRewards();
@ -646,6 +672,10 @@ public class LiveGiftPopup extends AbsDialogFragment {
giftDescription.setVisibility(View.VISIBLE); giftDescription.setVisibility(View.VISIBLE);
levelingLayout.setVisibility(View.GONE); levelingLayout.setVisibility(View.GONE);
} }
if (!TextUtils.isEmpty(liveGiftModel.getOperateImage())) {
operateImage.setVisibility(View.VISIBLE);
ImgLoader.display(getContext(), liveGiftModel.getOperateUrl(), operateImage);
}
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)