修改热度加成逻辑展示方式

This commit is contained in:
18401019693 2023-04-11 14:14:42 +08:00
parent e99b18eec6
commit b305ba925b
10 changed files with 114 additions and 66 deletions

View File

@ -49,21 +49,13 @@ public class ReplacementHintCustomPopup extends CenterPopupView {
wishTab.setText(String.format("【%s】", getContext().getString(R.string.seasonal_wish))); wishTab.setText(String.format("【%s】", getContext().getString(R.string.seasonal_wish)));
break; break;
} }
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), new ViewClicksAntiShake.ViewClicksCallBack() { ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_cancel), () -> {
@Override if (callBack != null) {
public void onViewClicks() { callBack.onReplacement(type);
if (callBack != null) {
callBack.onReplacement(type);
}
dismiss();
}
});
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
dismiss();
} }
dismiss();
}); });
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_open_ok), this::dismiss);
} }
public interface ReplacementHintCallBack { public interface ReplacementHintCallBack {

View File

@ -1117,5 +1117,5 @@
<string name="live_language_setting">語言設定</string> <string name="live_language_setting">語言設定</string>
<string name="traditional_chinese">繁體中文</string> <string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string> <string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
</resources> </resources>

View File

@ -1117,5 +1117,5 @@
<string name="live_language_setting">語言設定</string> <string name="live_language_setting">語言設定</string>
<string name="traditional_chinese">繁體中文</string> <string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string> <string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
</resources> </resources>

View File

@ -1117,5 +1117,5 @@
<string name="live_language_setting">語言設定</string> <string name="live_language_setting">語言設定</string>
<string name="traditional_chinese">繁體中文</string> <string name="traditional_chinese">繁體中文</string>
<string name="add_gift2">添加禮物、貴族、守護心願</string> <string name="add_gift2">添加禮物、貴族、守護心願</string>
<string name="heat_add">热度加成</string>
</resources> </resources>

View File

@ -1124,5 +1124,6 @@ Limited ride And limited avatar frame</string>
<string name="unfollow_cancel">unfollow</string> <string name="unfollow_cancel">unfollow</string>
<string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string> <string name="unfollow"> Where is the host doing badly~\nBrother, are you sure you want to unfollow?</string>
<string name="unfollow_confrim">follow</string> <string name="unfollow_confrim">follow</string>
<string name="heat_add">Heat Add</string>
</resources> </resources>

View File

@ -1577,17 +1577,17 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
if (mLiveRyLinkMicPkPresenter != null) { if (mLiveRyLinkMicPkPresenter != null) {
mLiveRyLinkMicPkPresenter.leaveDRRoom(); mLiveRyLinkMicPkPresenter.leaveDRRoom();
} }
if (mLiveRoomViewHolder != null) { // if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.hotAddVisibility(false); // mLiveRoomViewHolder.hotAddVisibility(false);
} // }
break; break;
case LEAVE_PK_SCORE: case LEAVE_PK_SCORE:
if (mLiveRyLinkMicPkPresenter != null) { if (mLiveRyLinkMicPkPresenter != null) {
mLiveRyLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime()); mLiveRyLinkMicPkPresenter.upDataPkScore(event.getPkScores(), event.getUid(), event.getTime());
} }
if (mLiveRoomViewHolder != null) { // if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.hotAddVisibility(true); // mLiveRoomViewHolder.hotAddVisibility(true);
} // }
break; break;
case PK_TIME_COUNT: case PK_TIME_COUNT:
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {

View File

@ -235,8 +235,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public static int isAttention = 0;//是否关注 0=没关注, public static int isAttention = 0;//是否关注 0=没关注,
public static String mNameText; public static String mNameText;
public static String mAvatarUrl; public static String mAvatarUrl;
public static FrameLayout ft_hot_add; // public static FrameLayout ft_hot_add;
public static ImageView img_hot_gif, newMessage, atMessage; public static ImageView newMessage, atMessage;
//多人PK //多人PK
static TextView time; static TextView time;
@ -340,7 +340,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//接口整合新加参数 //接口整合新加参数
private GuardUserModel guardUserModel; private GuardUserModel guardUserModel;
private ViewFlipper flipper; private static ViewFlipper flipper;
private TextView mRandomPkTimer; private TextView mRandomPkTimer;
//全服通知 //全服通知
@ -649,10 +649,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private static boolean visibility = false; private static boolean visibility = false;
public void hotAddVisibility(boolean visibility) { // public void hotAddVisibility(boolean visibility) {
this.visibility = visibility; // this.visibility = visibility;
ft_hot_add.setVisibility(visibility ? View.GONE : View.VISIBLE); // ft_hot_add.setVisibility(visibility ? View.GONE : View.VISIBLE);
} // }
public void endDRGif() { public void endDRGif() {
if (dr_pk_end_gif.getVisibility() == View.GONE) { if (dr_pk_end_gif.getVisibility() == View.GONE) {
@ -1310,8 +1310,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
lt_pk_line = (RelativeLayout) findViewById(R.id.lt_pk_line); lt_pk_line = (RelativeLayout) findViewById(R.id.lt_pk_line);
clickAvatar(); clickAvatar();
ft_hot_add = (FrameLayout) findViewById(R.id.ft_hot_add); // ft_hot_add = (FrameLayout) findViewById(R.id.ft_hot_add);
img_hot_gif = (ImageView) findViewById(R.id.img_hot_gif); // img_hot_gif = (ImageView) findViewById(R.id.img_hot_gif);
findViewById(R.id.ft_hot_add).setOnClickListener(this); findViewById(R.id.ft_hot_add).setOnClickListener(this);
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.open_sidebar), () -> Bus.get().post(new LiveAudienceEvent() ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.open_sidebar), () -> Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.SIDEBAR))); .setType(LiveAudienceEvent.LiveAudienceType.SIDEBAR)));
@ -1904,7 +1904,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
textParams.leftMargin = DpUtil.dp2px(5); textParams.leftMargin = DpUtil.dp2px(5);
params.leftMargin = DpUtil.dp2px(5); params.leftMargin = DpUtil.dp2px(5);
View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
hotView.setTag("hotView");
View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null); View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
hourView.setTag("hourView");
ImageView hotPic = hotView.findViewById(R.id.wish_pic); ImageView hotPic = hotView.findViewById(R.id.wish_pic);
ImageView hourPic = hourView.findViewById(R.id.wish_pic); ImageView hourPic = hourView.findViewById(R.id.wish_pic);
mHotText = hotView.findViewById(R.id.wish_index); mHotText = hotView.findViewById(R.id.wish_index);
@ -1922,7 +1924,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
flipper.addView(hotView); flipper.addView(hotView);
flipper.addView(hourView); flipper.addView(hourView);
flipper.startFlipping(); flipper.startFlipping();
flipper.setOnClickListener(view -> { flipper.setOnClickListener(view -> {
ToastUtil.show(String.valueOf(flipper.getDisplayedChild()));
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
String path = model.getHourchartH5Url(); String path = model.getHourchartH5Url();
if (!path.startsWith("/")) { if (!path.startsWith("/")) {
@ -1978,23 +1982,22 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
flipper.addView(hotView); flipper.addView(hotView);
flipper.addView(hourView); flipper.addView(hourView);
flipper.startFlipping(); flipper.startFlipping();
flipper.setOnClickListener(view -> { // flipper.setOnClickListener(view -> {
Bundle bundle = new Bundle(); //
String path = info.get(0).getUrl(); // });
if (!path.startsWith("/")) { ViewClicksAntiShake.clicksAntiShake(hotView, new ViewClicksAntiShake.ViewClicksCallBack() {
path = "/" + path; @Override
public void onViewClicks() {
showUrlHDDialog(info.get(0).getUrl());
} }
String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);
bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0);
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}); });
ViewClicksAntiShake.clicksAntiShake(hourView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
showUrlHDDialog(info.get(0).getUrl());
}
});
} }
}, Throwable::printStackTrace) }, Throwable::printStackTrace)
@ -2002,6 +2005,23 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, hourRankLayout, "rectangle_new.png", 1); new LoadDian9TuUtil().loadDian9TuAssets2(mContext, hourRankLayout, "rectangle_new.png", 1);
} }
private void showUrlHDDialog(String path) {
Bundle bundle = new Bundle();
if (!path.startsWith("/")) {
path = "/" + path;
}
String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url);
bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0);
bundle.putString("roomId", mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((AbsActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
}
private void initPkRankView(PkRankBean bean) { private void initPkRankView(PkRankBean bean) {
if (pkRankVf.getTag() != null) { if (pkRankVf.getTag() != null) {
@ -3437,32 +3457,67 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
* 获取是否有热度卡加成 * 获取是否有热度卡加成
*/ */
public static void getIsHot() { public static void getIsHot() {
ImgLoader.display2(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16));
LiveHttpUtil.isHotCard(mLiveUid, new HttpCallback() { LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5);
params.leftMargin = DpUtil.dp2px(5);
View hotView = LayoutInflater.from(Contexts).inflate(R.layout.view_wish_list, null);
hotView.setTag("HeatAdd");
ImageView hotPic = hotView.findViewById(R.id.wish_pic);
TextView mHotText = hotView.findViewById(R.id.wish_index);
mHotText.setText(R.string.heat_add);
hotPic.setImageResource(R.drawable.icon_heat_2);
mHotText.setLayoutParams(textParams);
hotPic.setLayoutParams(params);
flipper.addView(hotView);
ViewClicksAntiShake.clicksAntiShake(hotView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override @Override
public void onSuccess(int code, String msg, String[] info) { public void onViewClicks() {
if (code == 0 && info.length > 0) { ((LiveActivity) Contexts).openHotListWindow(1);
if ("1".equals(info[0]) && !visibility) {
ft_hot_add.setVisibility(View.VISIBLE);
} else {
ft_hot_add.setVisibility(View.GONE);
}
}
} }
}); });
// ImgLoader.display2(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif);
// LiveHttpUtil.isHotCard(mLiveUid, new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0 && info.length > 0) {
// if ("1".equals(info[0]) && !visibility) {
// ft_hot_add.setVisibility(View.VISIBLE);
// } else {
// ft_hot_add.setVisibility(View.GONE);
// }
// }
// }
// });
} }
/** /**
* 获取是否有热度卡加成 * 获取是否有热度卡加成
*/ */
public void getIsHot(String isUseHotCard) { public void getIsHot(String isUseHotCard) {
ImgLoader.display2(Contexts, "https://downs.yaoulive.com/img_hot_gif.gif", img_hot_gif);
if ("1".equals(isUseHotCard) && !visibility) { if ("1".equals(isUseHotCard) && !visibility) {
ft_hot_add.setVisibility(View.VISIBLE); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16));
} else { LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
ft_hot_add.setVisibility(View.GONE); textParams.leftMargin = DpUtil.dp2px(5);
params.leftMargin = DpUtil.dp2px(5);
View hotView = LayoutInflater.from(Contexts).inflate(R.layout.view_wish_list, null);
hotView.setTag("HeatAdd");
ImageView hotPic = hotView.findViewById(R.id.wish_pic);
TextView mHotText = hotView.findViewById(R.id.wish_index);
mHotText.setText(R.string.heat_add);
hotPic.setImageResource(R.drawable.icon_heat_2);
mHotText.setLayoutParams(textParams);
hotPic.setLayoutParams(params);
flipper.addView(hotView);
ViewClicksAntiShake.clicksAntiShake(hotView, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
public void onViewClicks() {
((LiveActivity) Contexts).openHotListWindow(1);
}
});
} }
} }
public void resetUserListWidth(int width) { public void resetUserListWidth(int width) {
@ -4624,10 +4679,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
ImgLoader.display(mContext, preview.getStyleImage(), mAnchorSayImage); ImgLoader.display(mContext, preview.getStyleImage(), mAnchorSayImage);
if (preview.getIsShow() == 1) { if (preview.getIsShow() == 1) {
mAnchorSay.setVisibility(View.VISIBLE); mAnchorSay.setVisibility(View.VISIBLE);
}else{ } else {
mAnchorSay.setVisibility(View.INVISIBLE); mAnchorSay.setVisibility(View.INVISIBLE);
} }
}else{ } else {
mAnchorSay.setVisibility(View.INVISIBLE); mAnchorSay.setVisibility(View.INVISIBLE);
} }

View File

@ -1435,9 +1435,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
* @param isPk * @param isPk
*/ */
public void setPkStatus(boolean isPk) { public void setPkStatus(boolean isPk) {
if (mLiveRoomViewHolder != null) { // if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.hotAddVisibility(isPk); // mLiveRoomViewHolder.hotAddVisibility(isPk);
} // }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

View File

@ -227,7 +227,7 @@
<FrameLayout <FrameLayout
android:id="@+id/hour_rank_layout" android:id="@+id/hour_rank_layout"
android:layout_width="70dp" android:layout_width="80dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_below="@id/lin" android:layout_below="@id/lin"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"