update 礼物墙
This commit is contained in:
parent
96c45820b0
commit
7a6dfe5a3d
@ -98,7 +98,7 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
tv_rename = itemView.findViewById(R.id.tv_rename);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
avatar2 = itemView.findViewById(R.id.avatar2);
|
||||
anchor_name = itemView.findViewById(R.id.anchor_name);
|
||||
anchor_name = itemView.findViewById(R.id.item_anchor_name);
|
||||
}
|
||||
|
||||
public void setData(GiftWallInfoBean.Data data, int position) {
|
||||
@ -116,6 +116,7 @@ public class GiftWallGiftInfoListItemAdapter extends RecyclerView.Adapter<GiftWa
|
||||
}
|
||||
return;
|
||||
}
|
||||
anchor_name.setVisibility(View.GONE);
|
||||
if (isStar && list_type == 2) {
|
||||
ImgLoader.display(itemView.getContext(), data.getLive_avatar(), avatar);
|
||||
anchor_name.setText(data.getLive_user_name());
|
||||
|
@ -239,8 +239,8 @@ public class GiftWallInfoBean extends BaseModel {
|
||||
return gift_hall_send_num;
|
||||
}
|
||||
public String getGift_hall_send_numForString() {
|
||||
if(gift_hall_send_num>999999){
|
||||
return "999999+";
|
||||
if(gift_hall_send_num>99999){
|
||||
return "99999+";
|
||||
}else{
|
||||
return String.valueOf(gift_hall_send_num);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected int getPopupHeight() {
|
||||
if (isFullWindows) {
|
||||
return super.getPopupHeight();
|
||||
return super.getPopupHeight()-DpUtil.dp2px(10);
|
||||
}
|
||||
int screenHeight = ScreenDimenUtil.getInstance().getScreenHeight();
|
||||
return (int) (screenHeight * 0.8);
|
||||
@ -173,8 +173,15 @@ public class GiftWallDialog extends AbsDialogPopupWindow {
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvTips, () -> {
|
||||
new GiftWallRuleDialog(mContext).setFullWindows(isFullWindows).showDialog();
|
||||
});
|
||||
resetWindows();
|
||||
}
|
||||
private void resetWindows(){
|
||||
if(isFullWindows){
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.v_achievement).getLayoutParams();
|
||||
params.topMargin=DpUtil.dp2px(47);
|
||||
findViewById(R.id.v_achievement).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
@ -6,6 +6,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
@ -13,6 +14,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.widget.NestedScrollView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
@ -72,7 +74,7 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
String toUserId;
|
||||
boolean isAnchor;
|
||||
int gift_hall_type = 1;
|
||||
int list_type = 1;
|
||||
int list_type = 2;
|
||||
private boolean isLiveRoom;
|
||||
String time;
|
||||
private boolean isStar;
|
||||
@ -170,8 +172,8 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
((TextView) findViewById(R.id.user_name)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename));
|
||||
((TextView) findViewById(R.id.tv_rename)).setText(WordUtil.getNewString(R.string.dialog_gift_wall_list_info_list_header_rename_value));
|
||||
}
|
||||
btn_one.setVisibility(View.GONE);
|
||||
btn_one_tips.setVisibility(View.GONE);
|
||||
|
||||
findViewById(R.id.item_anchor_name).setVisibility(View.GONE);
|
||||
ViewClicksAntiShake.clicksAntiShake(tab1, () -> {
|
||||
|
||||
btn_one.setVisibility(View.GONE);
|
||||
@ -240,6 +242,14 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
mIvBack.setLayoutParams(params);
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, this::dismiss);
|
||||
resetWindows();
|
||||
}
|
||||
private void resetWindows(){
|
||||
if(isFullWindows){
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.gift_name).getLayoutParams();
|
||||
params.topMargin=DpUtil.dp2px(47);
|
||||
findViewById(R.id.gift_name).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
|
||||
void initData() {
|
||||
@ -247,6 +257,8 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
if (isAnchor) {
|
||||
if(isStar){
|
||||
gift_hall_type=2;
|
||||
}else {
|
||||
gift_hall_type=1;
|
||||
}
|
||||
LiveNetManager.get(mContext)
|
||||
.liveGiftHallDetail(toUserId, giftId, gift_hall_type, list_type, new HttpCallback<GiftWallInfoBean>() {
|
||||
@ -312,7 +324,9 @@ public class GiftWallGiftInfoDialog extends AbsDialogPopupWindow {
|
||||
}
|
||||
if (!isLiveRoom) {
|
||||
gift_btn.setEnabled(false);
|
||||
btn_one.setEnabled(false);
|
||||
gift_btn.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un);
|
||||
btn_one.setBackgroundResource(R.drawable.gift_wall_gift_info_btn_un);
|
||||
}
|
||||
adapter.setData(giftBean.getData());
|
||||
time = (WordUtil.isNewZh() ? "榜單結算時間" : "Settlement time") + giftBean.getGift_info().getGift_hall_start() + " - " + giftBean.getGift_info().getGift_hall_end();
|
||||
|
@ -166,9 +166,27 @@ public class GiftWallMainTab2ClassicInfoDialog extends AbsDialogPopupWindow {
|
||||
adapter = new GiftWallTab2GiftInfoListItemAdapter();
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.addItemDecoration(new ItemDecoration(mContext, 0x000, 0, 2));
|
||||
initData();
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(mIvBack, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
initData();
|
||||
resetWindows();
|
||||
}
|
||||
private void resetWindows(){
|
||||
if(isFullWindows){
|
||||
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) findViewById(R.id.iv_back).getLayoutParams();
|
||||
params.topMargin=DpUtil.dp2px(47);
|
||||
findViewById(R.id.iv_back).setLayoutParams(params);
|
||||
params = (ConstraintLayout.LayoutParams) findViewById(R.id.scrollView).getLayoutParams();
|
||||
params.topMargin=DpUtil.dp2px(47);
|
||||
findViewById(R.id.scrollView).setLayoutParams(params);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
@ -106,8 +106,8 @@ public class GiftWallMainTab2Fragment extends BaseFragment {
|
||||
recyclerView2.setAdapter(list2Adapter);
|
||||
|
||||
|
||||
recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(2), DpUtil.dp2px(10)));
|
||||
recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(2), DpUtil.dp2px(10)));
|
||||
recyclerView1.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(1), DpUtil.dp2px(5)));
|
||||
recyclerView2.addItemDecoration(new ItemDecoration(getContext(), 0x00000000, DpUtil.dp2px(1), DpUtil.dp2px(5)));
|
||||
|
||||
starGiftsTitle.getPaint().setShader(new LinearGradient(0, 0, 0, classicGiftsTitle.getPaint().getTextSize(),
|
||||
Color.parseColor("#FEE8C6"), Color.parseColor("#FFD5A3"), Shader.TileMode.CLAMP));
|
||||
|
@ -645,9 +645,13 @@ public class JavascriptInterfaceUtils {
|
||||
.setMethod("androidFansGroupInfo"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼物墙
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void toGiftNamingAlertAllPageView(String mAnchorName, String mLiveUid, String mAvatarUrl, int isAnchor) {
|
||||
RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0, isAnchor == 1);
|
||||
// RouteUtil.forwardGiftWallActivity("", mAnchorName, mLiveUid, mAvatarUrl, 0, isAnchor == 1);
|
||||
new com.yunbao.common.dialog.GiftWallDialog(mContext, mLiveUid,mAnchorName, isAnchor==1).setFullWindows(true).showDialog();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
@ -18,6 +18,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/nestedScrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:fillViewport="true"
|
||||
@ -64,14 +65,15 @@
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="17dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:maxLength="3"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFFFFF"
|
||||
@ -92,7 +94,8 @@
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/gift_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/gift_name" />
|
||||
app:layout_constraintTop_toTopOf="@+id/gift_name"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift"
|
||||
@ -217,23 +220,23 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:background="@drawable/gift_wall_gift_info_list_btn_up"
|
||||
android:background="@drawable/gift_wall_gift_info_list_btn_down"
|
||||
android:gravity="center"
|
||||
android:minWidth="70dp"
|
||||
android:text="@string/dialog_gift_wall_gfit_info_list_title_assistance"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#31326D"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/tab2"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="30dp"
|
||||
android:background="@drawable/gift_wall_gift_info_list_btn_down"
|
||||
android:background="@drawable/gift_wall_gift_info_list_btn_up"
|
||||
android:gravity="center"
|
||||
android:text="@string/dialog_gift_wall_gfit_info_list_title_champion"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textColor="#31326D"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/scrollView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:fillViewport="true"
|
||||
@ -309,6 +310,10 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<ImageView
|
||||
@ -453,7 +458,7 @@
|
||||
<include
|
||||
android:id="@+id/list_title"
|
||||
layout="@layout/item_dialog_gift_wall_gift_info"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
|
@ -77,9 +77,12 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user1_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="100dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:textColor="#FFD3A4"
|
||||
android:text="TextView"
|
||||
app:layout_constraintEnd_toEndOf="@+id/user1_avatar"
|
||||
|
@ -75,6 +75,7 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:translationY="1dp"
|
||||
android:background="@mipmap/gift_wall_main_list_bg"
|
||||
android:scaleType="fitXY"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -123,9 +123,9 @@
|
||||
android:id="@+id/recyclerView1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@ -148,18 +148,17 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/classic_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView2"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -46,41 +46,40 @@
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_rename"
|
||||
app:layout_constraintStart_toEndOf="@+id/avatar2"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="70dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
app:layout_constraintVertical_bias="0.0">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/anchor_name"
|
||||
android:id="@+id/item_anchor_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/dialog_gift_wall_list_info_list_header_rename"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="end"
|
||||
android:visibility="gone"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="@string/dialog_gift_wall_list_info_list_header_rename"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
/>
|
||||
tools:text="aaaaa" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -59,13 +59,16 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="扬帆出海"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_soles" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_soles"
|
||||
tools:text="aaaaaaaaaaaaaa" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -27,8 +27,13 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="TextView"
|
||||
android:textColor="#C4FFDBAC"
|
||||
android:textSize="12sp"
|
||||
@ -108,8 +113,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wait"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:text="@string/dialog_gift_wall_tab2_list_wait"
|
||||
android:textColor="#A2A2A2"
|
||||
android:textSize="14sp"
|
||||
@ -117,5 +125,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_number" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_number"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -27,8 +27,13 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="TextView"
|
||||
android:textColor="#C4FFDBAC"
|
||||
android:textSize="12sp"
|
||||
@ -108,8 +113,11 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wait"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/dialog_gift_wall_tab2_list_wait"
|
||||
android:textColor="#A2A2A2"
|
||||
android:textSize="14sp"
|
||||
@ -117,5 +125,6 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_number" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_number"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -778,6 +778,12 @@ public class SocketSwClient {
|
||||
case "SendMoneyLongEnd":
|
||||
Bus.get().post(new SendMoneyLongEndEvent());
|
||||
break;
|
||||
case Constants.SOCKET_LIVE_ANCHOR_PK_DIALOG:
|
||||
item = map.getJSONObject("ct");
|
||||
//DialogUitl.showSimpleDialog(mContext,WordUtil.isNewZh()?item.getString("text"):item.getString("text_en"),null);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_DIALOG_ANCHOR_TIPS)
|
||||
.setObject(WordUtil.isNewZh() ? item.getString("text") : item.getString("text_en")));
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -224,7 +224,9 @@ import io.rong.imkit.userinfo.RongUserInfoManager;
|
||||
import io.rong.imlib.RongIMClient;
|
||||
import io.rong.imlib.model.Conversation;
|
||||
import io.rong.imlib.model.UserInfo;
|
||||
|
||||
import com.bumptech.glide.load.resource.gif.GifDrawable;
|
||||
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
/**
|
||||
@ -1789,13 +1791,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
|
||||
//点击收起整蛊icon
|
||||
prank_small_icon.setOnClickListener(v->{
|
||||
prank_small_icon.setOnClickListener(v -> {
|
||||
prank_group.setVisibility(View.VISIBLE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
});
|
||||
|
||||
//点击图片转盘整蛊(跳转转盘整蛊)
|
||||
prank_group_turntable_icon.setOnClickListener(v->{
|
||||
prank_group_turntable_icon.setOnClickListener(v -> {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.WE_CHEAT));
|
||||
});
|
||||
@ -1808,15 +1810,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
/**
|
||||
* 收起整蛊列表
|
||||
*/
|
||||
public void closePrankView(){
|
||||
if(prank_group.getVisibility()==View.VISIBLE){
|
||||
public void closePrankView() {
|
||||
if (prank_group.getVisibility() == View.VISIBLE) {
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void sendMsgPrank(){
|
||||
public void sendMsgPrank() {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@ -1830,7 +1832,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
|
||||
//初始化整蛊列表进度
|
||||
public void initPrankProgress(int isShow){
|
||||
public void initPrankProgress(int isShow) {
|
||||
// LogUtils.e("yqw=====>主播id:"+mLiveUid);
|
||||
//获取整蛊列表
|
||||
LiveNetManager.get(mContext).getPrankProgressList(mLiveUid, new com.yunbao.common.http.base.HttpCallback<PrankProgressBean>() {
|
||||
@ -1843,7 +1845,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
prankAndComboList.addAll(data.getPrank_list());
|
||||
completedList.clear();
|
||||
completedList.addAll(data.getCompleted_list());
|
||||
setPrankList(isShow,data.getStatus(),data.getPrank_type(),data.getPrank_turntable_status());
|
||||
setPrankList(isShow, data.getStatus(), data.getPrank_type(), data.getPrank_turntable_status());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1851,62 +1853,65 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
prank_group_turntable_icon.setVisibility(View.GONE);
|
||||
ToastUtil.show(WordUtil.isNewZh()?"抱歉!出錯了!":"i \\'m sorry! An error occurred");
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//刷新整蛊礼物列表
|
||||
public void refreshPrank(String newPrankData){
|
||||
public void refreshPrank(String newPrankData) {
|
||||
try {
|
||||
// LogUtils.e("yqw=====>整蛊礼物数据1:"+newPrankData);
|
||||
org.json.JSONObject ctString = new org.json.JSONObject(newPrankData);
|
||||
if (ctString.getInt("is_update") == 1){
|
||||
if (ctString.getInt("is_update") == 1) {
|
||||
//列表全部更新
|
||||
if (ctString.getInt("status")==1){
|
||||
if (ctString.getInt("status") == 1) {
|
||||
//编辑添加整蛊
|
||||
initPrankProgress(1);
|
||||
}else {
|
||||
} else {
|
||||
//编辑取消整蛊
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
}
|
||||
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
return;
|
||||
}
|
||||
if (Integer.parseInt(ctString.getString("prank_turntable_status")) == 0){
|
||||
if (Integer.parseInt(ctString.getString("prank_turntable_status")) == 0) {
|
||||
prank_group_turntable_icon.setVisibility(View.GONE);
|
||||
}else {
|
||||
} else {
|
||||
prank_group_turntable_icon.setVisibility(View.VISIBLE);
|
||||
//ZeusKt.visible(prank_group_turntable_icon);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
//送整蛊礼物更新
|
||||
String prankListString = ctString.getString("prank_list");
|
||||
List<PrankProgressBean.PrankList> prankList = GsonUtils.fromJson(prankListString,new TypeToken<List<PrankProgressBean.PrankList>>() {}.getType());
|
||||
List<PrankProgressBean.PrankList> prankList = GsonUtils.fromJson(prankListString, new TypeToken<List<PrankProgressBean.PrankList>>() {
|
||||
}.getType());
|
||||
// LogUtils.e("yqw=====>整蛊礼物数据2:"+prankList.toString());
|
||||
prankAndComboList.clear();
|
||||
prankAndComboList.addAll(prankList);
|
||||
|
||||
String completedString = ctString.getString("completed_list");
|
||||
List<PrankProgressBean.PrankList> completeds = GsonUtils.fromJson(completedString,new TypeToken<List<PrankProgressBean.PrankList>>() {}.getType());
|
||||
List<PrankProgressBean.PrankList> completeds = GsonUtils.fromJson(completedString, new TypeToken<List<PrankProgressBean.PrankList>>() {
|
||||
}.getType());
|
||||
completedList.clear();
|
||||
completedList.addAll(completeds);
|
||||
|
||||
setPrankList(0,Integer.parseInt(ctString.getString("status")), Integer.parseInt(ctString.getString("prank_type")), Integer.parseInt(ctString.getString("prank_turntable_status")));
|
||||
setPrankList(0, Integer.parseInt(ctString.getString("status")), Integer.parseInt(ctString.getString("prank_type")), Integer.parseInt(ctString.getString("prank_turntable_status")));
|
||||
}
|
||||
}catch (Exception e){
|
||||
LogUtils.e("yqw=====>转换错误:"+e.getMessage());
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("yqw=====>转换错误:" + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initPrankAdapter() {
|
||||
prankAdapter = new PrankAdapter(mContext);
|
||||
//整蛊礼物点击
|
||||
prankAdapter.addOnItemClickListener(new PrankAdapter.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int giftId) {
|
||||
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
return;
|
||||
}
|
||||
openGiftDialog(String.valueOf(giftId));
|
||||
@ -1925,67 +1930,68 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
});
|
||||
L.e("onItemDel:"+giftId);
|
||||
L.e("onItemDel:" + giftId);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//设置整蛊礼物数据
|
||||
private void setPrankList(int isShow,int status,int mPrankType,int prankTurntableStatus){
|
||||
this.mPrankType =mPrankType;
|
||||
private void setPrankList(int isShow, int status, int mPrankType, int prankTurntableStatus) {
|
||||
this.mPrankType = mPrankType;
|
||||
// LogUtils.e("yqw=====>显示转盘icon:是否显示:"+(prankTurntableStatus == 1)+",是否在倒计时"+(lt_trickery.getVisibility() == View.VISIBLE));
|
||||
if (prankTurntableStatus == 1 && lt_trickery.getVisibility() == View.GONE){
|
||||
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (prankTurntableStatus == 1 && lt_trickery.getVisibility() == View.GONE) {
|
||||
if (!CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
prank_group_turntable_icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
prank_group_turntable_icon.setVisibility(View.GONE);
|
||||
}
|
||||
// LogUtils.e("yqw=====>显示整蛊列表或者投票列表:"+status);
|
||||
if (status == 1){
|
||||
if(isShow==1){
|
||||
if (status == 1) {
|
||||
if (isShow == 1) {
|
||||
prank_group.setVisibility(View.VISIBLE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
}else if(isShow==2){
|
||||
} else if (isShow == 2) {
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
//主播可能打开整蛊功能,但是不设置整蛊礼物,这里会是空列表
|
||||
if (!prankAndComboList.isEmpty()){
|
||||
if (!prankAndComboList.isEmpty()) {
|
||||
initPrankAdapter();
|
||||
recycler_prank.setAdapter(prankAdapter);
|
||||
if (mPrankType == 1){//礼物
|
||||
if (mPrankType == 1) {//礼物
|
||||
// sortByCompletionRate(prankAndComboList);
|
||||
prankAdapter.setViewType(PrankAdapter.TYPE_GIFT);
|
||||
//prankAdapter.setList(prankAndComboList);
|
||||
if(prankAnisShow){
|
||||
prankAdapter.showAnView(completedList,prankAnisShow);
|
||||
prank_group_title.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
|
||||
prank_group_turntable.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
|
||||
if (!completedList.isEmpty()){
|
||||
limitItem(1,Math.min(completedList.size(), 4));
|
||||
}else {
|
||||
if (prankAnisShow) {
|
||||
prankAdapter.showAnView(completedList, prankAnisShow);
|
||||
prank_group_title.setText(WordUtil.isNewZh() ? "待完成整蠱" : "To do");
|
||||
prank_group_turntable.setText(WordUtil.isNewZh() ? "整蠱進度" : "progress");
|
||||
if (!completedList.isEmpty()) {
|
||||
limitItem(1, Math.min(completedList.size(), 4));
|
||||
} else {
|
||||
recycler_prank.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}else{
|
||||
prankAdapter.showAnView(prankAndComboList,prankAnisShow);
|
||||
prank_group_title.setText(WordUtil.isNewZh()?"整蠱進度":"progress");
|
||||
prank_group_turntable.setText(WordUtil.isNewZh()?"待完成整蠱":"To do");
|
||||
limitItem(1,Math.min(prankAndComboList.size(), 4));
|
||||
} else {
|
||||
prankAdapter.showAnView(prankAndComboList, prankAnisShow);
|
||||
prank_group_title.setText(WordUtil.isNewZh() ? "整蠱進度" : "progress");
|
||||
prank_group_turntable.setText(WordUtil.isNewZh() ? "待完成整蠱" : "To do");
|
||||
limitItem(1, Math.min(prankAndComboList.size(), 4));
|
||||
}
|
||||
}else { //连击
|
||||
} else { //连击
|
||||
// sortBySendNum(prankAndComboList);
|
||||
prank_group_title.setText(R.string.combo_vote);
|
||||
prankAdapter.setViewType(PrankAdapter.TYPE_COMBO);
|
||||
prankAdapter.setList(prankAndComboList);
|
||||
limitItem(2,Math.min(prankAndComboList.size(), 4));
|
||||
limitItem(2, Math.min(prankAndComboList.size(), 4));
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
}
|
||||
if(CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
|
||||
prank_top_layout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@ -1996,24 +2002,24 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
prank_group_top_icon.setVisibility(View.VISIBLE);
|
||||
if(mPrankType==1){
|
||||
if (mPrankType == 1) {
|
||||
prank_group_turntable.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
} else {
|
||||
prank_group_turntable.setVisibility(View.GONE);
|
||||
}
|
||||
prank_group_bottom_icon.setVisibility(View.GONE);
|
||||
switchGifDrawable(!completedList.isEmpty());
|
||||
}else{
|
||||
} else {
|
||||
switchGifDrawable(false);
|
||||
if(mPrankType==1){
|
||||
if (mPrankType == 1) {
|
||||
prank_group_title.setText(R.string.prank_progress);
|
||||
}else{
|
||||
} else {
|
||||
prank_group_title.setText(R.string.combo_vote);
|
||||
}
|
||||
prank_group_turntable.setVisibility(View.GONE);
|
||||
prank_group_top_icon.setVisibility(View.GONE);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
prank_group.setVisibility(View.GONE);
|
||||
prank_small_icon.setVisibility(View.GONE);
|
||||
}
|
||||
@ -2033,12 +2039,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
//设置最多显示4个项目
|
||||
private void limitItem(int prankType,int maxItem){
|
||||
private void limitItem(int prankType, int maxItem) {
|
||||
recycler_prank.post(() -> {
|
||||
View itemView = recycler_prank.getChildAt(0);
|
||||
if (itemView != null){
|
||||
if (itemView != null) {
|
||||
int gap = prankType == 1 ? SizeUtils.dp2px(3f) : 0;
|
||||
int height = (itemView.getHeight() + gap)*maxItem;
|
||||
int height = (itemView.getHeight() + gap) * maxItem;
|
||||
ViewGroup.LayoutParams layoutParams = recycler_prank.getLayoutParams();
|
||||
layoutParams.height = height;
|
||||
recycler_prank.setLayoutParams(layoutParams);
|
||||
@ -2046,12 +2052,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
private void switchGifDrawable(boolean start){
|
||||
private void switchGifDrawable(boolean start) {
|
||||
// LogUtils.e("yqw=====>判断闪烁:"+(mGifDrawable != null)+","+start);
|
||||
if (mGifDrawable != null){
|
||||
if (start){
|
||||
if (mGifDrawable != null) {
|
||||
if (start) {
|
||||
mGifDrawable.start();
|
||||
}else {
|
||||
} else {
|
||||
mGifDrawable.seekTo(0);
|
||||
mGifDrawable.stop();
|
||||
}
|
||||
@ -2153,7 +2159,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
layoutParams.topMargin = DpUtil.dp2px(190);
|
||||
dragonImmediateParticipation.setLayoutParams(layoutParams);
|
||||
}
|
||||
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE && mContext instanceof LiveRyAnchorActivity||mContext instanceof LiveSwAnchorActivity) {
|
||||
if (dragonImmediateParticipationTime.getVisibility() == View.VISIBLE && mContext instanceof LiveRyAnchorActivity || mContext instanceof LiveSwAnchorActivity) {
|
||||
RelativeLayout.LayoutParams layoutParamsredPacket = (RelativeLayout.LayoutParams) redPacket.getLayoutParams();
|
||||
layoutParamsredPacket.topMargin = DpUtil.dp2px(110);
|
||||
redPacket.setLayoutParams(layoutParamsredPacket);
|
||||
@ -3687,8 +3693,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new com.yunbao.common.dialog.GiftWallDialog(mContext, mLiveUid + "",mAnchorName, true).setFullWindows(false).showDialog();
|
||||
//Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(mLiveUid).setVoicePress(true).setAvatar(mAvatarUrl).setUname(mAnchorName));
|
||||
new com.yunbao.common.dialog.GiftWallDialog(mContext, mLiveUid, mAnchorName, true).setFullWindows(false).showDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -3700,8 +3706,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
Bus.get().post(new LiveAudienceEvent().setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS));
|
||||
}
|
||||
});
|
||||
// wksAndGiftWall.addView(weekView);
|
||||
// wksAndGiftWall.startFlipping();
|
||||
// wksAndGiftWall.addView(weekView);
|
||||
// wksAndGiftWall.startFlipping();
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1);
|
||||
}
|
||||
|
||||
@ -5081,7 +5087,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
countDownTimerTrickery.cancel();
|
||||
countDownTimerTrickery = null;
|
||||
lt_trickery.setVisibility(View.GONE);
|
||||
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (!CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
prank_group_turntable_icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
LiveNetManager.get(mContext).endPrankTurntable(mLiveUid, new com.yunbao.common.http.base.HttpCallback<BaseModel>() {
|
||||
@ -5118,7 +5124,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
starTimeloud(2, time);
|
||||
} else {
|
||||
lt_trickery.setVisibility(View.GONE);
|
||||
if(!CommonAppConfig.getInstance().getUid().equals(mLiveUid)){
|
||||
if (!CommonAppConfig.getInstance().getUid().equals(mLiveUid)) {
|
||||
prank_group_turntable_icon.setVisibility(View.VISIBLE);
|
||||
}
|
||||
timeOver();
|
||||
|
Loading…
Reference in New Issue
Block a user