diff --git a/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java b/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java index ba686fa63..242401fd3 100644 --- a/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java +++ b/common/src/main/java/com/yunbao/common/bean/LiveAnchorSayModel.java @@ -1,5 +1,7 @@ package com.yunbao.common.bean; +import androidx.annotation.Nullable; + import com.google.gson.annotations.SerializedName; import java.util.List; @@ -32,6 +34,9 @@ public class LiveAnchorSayModel extends BaseModel{ private int isShow; private String content; private String styleImage; + @Nullable + private String title; + public LivePreview() { } @@ -48,6 +53,15 @@ public class LiveAnchorSayModel extends BaseModel{ return content; } + @Nullable + public String getTitle() { + return title; + } + + public void setTitle(@Nullable String title) { + this.title = title; + } + public void setContent(String content) { this.content = content; } diff --git a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java index 14e3d7499..f9d1dc950 100644 --- a/common/src/main/java/com/yunbao/common/http/PDLiveApi.java +++ b/common/src/main/java/com/yunbao/common/http/PDLiveApi.java @@ -246,7 +246,7 @@ public interface PDLiveApi { * 【新人特惠】【趣味游戏】【幸运天使】 */ @GET("/api/public/?service=Live.getLiveRoomActivtyBanner") - Observable>> getLiveRoomActivityBanner(); + Observable>> getLiveRoomActivityBanner(@Query("langue") String language,@Query("version") String version); /** * 新侧边栏请求 diff --git a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java index 8f6ba3bec..4ec5d30f3 100644 --- a/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java +++ b/common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java @@ -1,6 +1,8 @@ package com.yunbao.common.http.live; import android.content.Context; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.text.TextUtils; import android.util.Log; @@ -348,8 +350,17 @@ public class LiveNetManager { * 获取 【新人特惠】【趣味游戏】【幸运天使】 */ public void getLiveRoomActivityBanner(HttpCallback> callback) { + //获取版本名称 + String versionName = ""; + try { + PackageManager manager = mContext.getPackageManager(); + PackageInfo info = manager.getPackageInfo(mContext.getPackageName(), 0); + versionName = info.versionName; + } catch (Exception e) { + e.printStackTrace(); + } API.get().pdLiveApi(mContext) - .getLiveRoomActivityBanner() + .getLiveRoomActivityBanner( WordUtil.isNewZh()?"chinese":"english",versionName) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(listResponseModel -> { diff --git a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java index 0a957990a..d8a6ba829 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveAudienceViewHolder.java @@ -243,7 +243,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder { }); Log.i("LiveAudienceViewHolder", "init4"); // //底部礼物弹窗 - ImgLoader.displayGif(mContext, R.mipmap.live_lw, giftImage); +// ImgLoader.displayGif(mContext, R.mipmap.live_lw, giftImage); ViewClicksAntiShake.clicksAntiShake(giftImage, new ViewClicksAntiShake.ViewClicksCallBack() { @Override diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 8a6e10173..8088cbd92 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -254,6 +254,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private TextView mVotes; private TextView mTvMedalRank; private TextView mGuardNum;//守护人数 + private RecyclerView mUserRecyclerView; private RecyclerView mChatRecyclerView; private LiveUserAdapter mLiveUserAdapter; @@ -290,6 +291,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis // public static FrameLayout ft_hot_add; public static ImageView newMessage, atMessage; + //多人PK static TextView time; @@ -415,9 +417,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //----主播说组件---// private View mAnchorSay; + private TextView titleTv; + private TextView contentTv; private ImageView mAnchorSayImage; - private TextView mAnchorSayText; - private ImageView mAnchorSayHide; + //----!主播说组件---// //----投票组件---// private LiveRoomVoteManager voteManager; @@ -439,6 +442,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private RecyclerView recycler_prank; private ImageView prank_group_bottom_icon, prank_group_turntable_icon; private GifImageView prank_small_icon; + private TextView zhengguTv; private PrankAdapter prankAdapter; private List prankAndComboList = new ArrayList<>(); private List completedList = new ArrayList<>(); @@ -524,6 +528,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis private ProgressBar weekProgressbar; private Group newWeekGroup; + // + private Group newGodSayGroup; + private View goddessSayBgView; + private TextView goddessSayTitleTv; public LiveRoomViewHolder setGuardType(int guardType) { this.guardType = guardType; @@ -1651,23 +1659,34 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void init() { EventBus.getDefault().register(this); mAnchorSay = findViewById(R.id.anchor_say_layout); - mAnchorSayImage = (ImageView) findViewById(R.id.anchor_say_icon); - mAnchorSayText = (TextView) findViewById(R.id.anchor_say_text); - mAnchorSayHide = (ImageView) findViewById(R.id.anchor_say_hide); - mAnchorSayHide.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮"); - hideAnchorSay(); - } - }); + titleTv = findViewById(R.id.titleTv); + contentTv = findViewById(R.id.contentTv); + mAnchorSayImage= findViewById(R.id.anchorSayImage); + goddessSayTitleTv = findViewById(R.id.goddessSayTitleTv); + newGodSayGroup =findViewById(R.id.newGodSayGroup); + goddessSayBgView =findViewById(R.id.goddessSayBgView); mAnchorSay.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮"); - + hideAnchorSay(); + newGodSayGroup.setVisibility(View.VISIBLE); } }); + goddessSayBgView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + mAnchorSay.setVisibility(View.VISIBLE); + newGodSayGroup.setVisibility(View.GONE); + } + }); +// mAnchorSay.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View view) { +// MobclickAgent.onEvent(mContext, "live_room_goddess_say", "女神说按钮"); +// +// } +// }); svga_new_user_gif = (SVGAImageView) findViewById(R.id.svga_new_user_gif); svga_new_user_double = (SVGAImageView) findViewById(R.id.svga_new_user_double); svga_new_user_follow = (SVGAImageView) findViewById(R.id.svga_new_user_follow); @@ -2282,7 +2301,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis prank_group_bottom_icon = (ImageView) findViewById(R.id.prank_group_bottom_icon);//收起icon prank_group_turntable_icon = (ImageView) findViewById(R.id.prank_group_turntable_icon);//转盘图标 prank_small_icon = (GifImageView) findViewById(R.id.prank_small_icon);//收起后图标 - + zhengguTv = findViewById(R.id.zhengguTv); try { if (WordUtil.isNewZh()) { mGifDrawable = new pl.droidsonroids.gif.GifDrawable(mContext.getResources(), R.drawable.pran_zh); @@ -2327,7 +2346,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis //点击收起 prank_group_bottom_icon.setOnClickListener(v -> { prank_group.setVisibility(View.INVISIBLE); - prank_small_icon.setVisibility(View.VISIBLE); + //prank_small_icon.setVisibility(View.VISIBLE); + zhengguTv.setVisibility(View.VISIBLE); if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) { switchGifDrawable(!completedList.isEmpty()); } else { @@ -2335,10 +2355,15 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } }); - //点击收起整蛊icon - prank_small_icon.setOnClickListener(v -> { +// //点击收起整蛊icon +// prank_small_icon.setOnClickListener(v -> { +// prank_group.setVisibility(View.VISIBLE); +// prank_small_icon.setVisibility(View.GONE); +// }); + + zhengguTv.setOnClickListener(v -> { prank_group.setVisibility(View.VISIBLE); - prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); }); //点击图片转盘整蛊(跳转转盘整蛊) @@ -2399,7 +2424,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis public void closePrankView() { if (prank_group.getVisibility() == View.VISIBLE) { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.VISIBLE); + // prank_small_icon.setVisibility(View.VISIBLE); + zhengguTv.setVisibility(View.VISIBLE); } } @@ -2437,7 +2463,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onError(String error) { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.GONE); + // prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); prank_group_turntable_icon.setVisibility(View.GONE); ToastUtil.show(WordUtil.isNewZh() ? "抱歉!出錯了!" : "i \\'m sorry! An error occurred"); } @@ -2457,7 +2484,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } else { //编辑取消整蛊 prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.GONE); + //prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); } if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) { return; @@ -2537,10 +2565,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis if (status == 1) { if (isShow == 1) { prank_group.setVisibility(View.VISIBLE); - prank_small_icon.setVisibility(View.GONE); + //prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); } else if (isShow == 2) { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.VISIBLE); + //prank_small_icon.setVisibility(View.VISIBLE); + zhengguTv.setVisibility(View.VISIBLE); } //主播可能打开整蛊功能,但是不设置整蛊礼物,这里会是空列表 if (!prankAndComboList.isEmpty()) { @@ -2575,7 +2605,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } else { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.GONE); + // prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); } if (CommonAppConfig.getInstance().getUid().equals(mLiveUid)) { @@ -2583,7 +2614,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis @Override public void onClick(View view) { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.VISIBLE); + //prank_small_icon.setVisibility(View.VISIBLE); + zhengguTv.setVisibility(View.VISIBLE); switchGifDrawable(!completedList.isEmpty()); } }); @@ -2607,7 +2639,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } } else { prank_group.setVisibility(View.GONE); - prank_small_icon.setVisibility(View.GONE); + // prank_small_icon.setVisibility(View.GONE); + zhengguTv.setVisibility(View.GONE); } } @@ -2901,42 +2934,44 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis * 隐藏女神说 */ private void hideAnchorSay() { - boolean hide = mAnchorSay.getTag() == null || (boolean) mAnchorSay.getTag(); - Animation animation; - if (hide) { - animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_out); - } else { - animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_in); - } - animation.setAnimationListener(new Animation.AnimationListener() { - @Override - public void onAnimationStart(Animation animation) { - if (!hide) { - mAnchorSay.setX((float) mAnchorSayImage.getTag()); - mAnchorSayImage.setVisibility(View.VISIBLE); - mAnchorSayText.setVisibility(View.VISIBLE); - mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show); - } - } + mAnchorSay.setVisibility(View.GONE); - @Override - public void onAnimationEnd(Animation animation) { - if (hide) { - mAnchorSayImage.setTag(mAnchorSay.getX()); - mAnchorSay.setX(-DpUtil.dp2px(53)); - mAnchorSayImage.setVisibility(View.INVISIBLE); - mAnchorSayText.setVisibility(View.INVISIBLE); - mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide); - } - mAnchorSay.setTag(!hide); - } - - @Override - public void onAnimationRepeat(Animation animation) { - - } - }); - mAnchorSay.startAnimation(animation); +// boolean hide = mAnchorSay.getTag() == null || (boolean) mAnchorSay.getTag(); +// Animation animation; +// if (hide) { +// animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_out); +// } else { +// animation = AnimationUtils.loadAnimation(mContext, R.anim.view_live_anchor_say_text_in); +// } +// animation.setAnimationListener(new Animation.AnimationListener() { +// @Override +// public void onAnimationStart(Animation animation) { +// if (!hide) { +// mAnchorSay.setX((float) mAnchorSayImage.getTag()); +// mAnchorSayImage.setVisibility(View.VISIBLE); +// mAnchorSayText.setVisibility(View.VISIBLE); +// mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show); +// } +// } +// +// @Override +// public void onAnimationEnd(Animation animation) { +// if (hide) { +// mAnchorSayImage.setTag(mAnchorSay.getX()); +// mAnchorSay.setX(-DpUtil.dp2px(53)); +// mAnchorSayImage.setVisibility(View.INVISIBLE); +// mAnchorSayText.setVisibility(View.INVISIBLE); +// mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide); +// } +// mAnchorSay.setTag(!hide); +// } +// +// @Override +// public void onAnimationRepeat(Animation animation) { +// +// } +// }); +// mAnchorSay.startAnimation(animation); } /** @@ -6828,12 +6863,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis sayModel = data; LiveAnchorSayModel.LivePreview preview = data.getLivePreview(); if (preview != null) { - mAnchorSayText.setText(getText(data.getLivePreview().getContent())); - ImgLoader.display(mContext, preview.getStyleImage(), mAnchorSayImage); + String title=data.getLivePreview().getTitle(); + if (!TextUtils.isEmpty(title)) + { + titleTv.setText(title); + goddessSayTitleTv.setText(title); + } + contentTv.setText(data.getLivePreview().getContent()); + // ImgLoader.display(mContext, preview.getStyleImage(), mAnchorSayImage); if (preview.getIsShow() == 1) { mAnchorSay.setVisibility(View.VISIBLE); + newGodSayGroup.setVisibility(View.GONE); } else { mAnchorSay.setVisibility(View.INVISIBLE); + newGodSayGroup.setVisibility(View.GONE); } } else { mAnchorSay.setVisibility(View.INVISIBLE); @@ -6864,14 +6907,14 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis } public void initAnchorSay() { - if (mAnchorSay.getTag() != null) { - mAnchorSay.setX((float) mAnchorSayImage.getTag()); - mAnchorSayImage.setTag(null); - mAnchorSayImage.setVisibility(View.VISIBLE); - mAnchorSayText.setVisibility(View.VISIBLE); - mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show); - } - mAnchorSay.setTag(null); +// if (mAnchorSay.getTag() != null) { +// mAnchorSay.setX((float) mAnchorSayImage.getTag()); +// mAnchorSayImage.setTag(null); +// mAnchorSayImage.setVisibility(View.VISIBLE); +// mAnchorSayText.setVisibility(View.VISIBLE); +// mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_show); +// } +// mAnchorSay.setTag(null); initAnchorSayData(); } diff --git a/live/src/main/res/drawable/bc_zheng_gu_left.xml b/live/src/main/res/drawable/bc_zheng_gu_left.xml new file mode 100644 index 000000000..621cf255c --- /dev/null +++ b/live/src/main/res/drawable/bc_zheng_gu_left.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/drawable/bg_live_room_say.xml b/live/src/main/res/drawable/bg_live_room_say.xml new file mode 100644 index 000000000..0bc334563 --- /dev/null +++ b/live/src/main/res/drawable/bg_live_room_say.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/sim_live_room_anchor_say1.xml b/live/src/main/res/layout/sim_live_room_anchor_say1.xml new file mode 100644 index 000000000..4633693ac --- /dev/null +++ b/live/src/main/res/layout/sim_live_room_anchor_say1.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_live_room.xml b/live/src/main/res/layout/view_live_room.xml index f69d8bee8..b19164351 100644 --- a/live/src/main/res/layout/view_live_room.xml +++ b/live/src/main/res/layout/view_live_room.xml @@ -1773,14 +1773,13 @@ + android:layout_marginStart="12dp" + android:visibility="invisible" + toolsvisible="visible"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:visibility="gone" + tools:visibility="visible"/> + @@ -152,7 +152,7 @@ android:layout_height="wrap_content" android:layout_marginStart="7dp" android:layout_marginTop="1dp" - android:text="@string/live_room_gift" + android:text="@string/live_room_wishlist" android:textColor="#FFFFFF" android:textSize="9sp" app:layout_constraintStart_toStartOf="@+id/newWishBgView" @@ -162,22 +162,22 @@ android:id="@+id/newWishNowTv" android:layout_width="wrap_content" android:layout_height="wrap_content" - tools:text="5" android:textColor="#FFC949 " android:textSize="12sp" app:layout_constraintStart_toStartOf="@+id/newWishTitleTv" - app:layout_constraintTop_toBottomOf="@+id/newWishTitleTv" /> + app:layout_constraintTop_toBottomOf="@+id/newWishTitleTv" + tools:text="5" /> + app:layout_constraintStart_toEndOf="@+id/newWishNowTv" + tools:text="/26" /> + @@ -240,22 +241,22 @@ android:id="@+id/newWeekNowTv" android:layout_width="wrap_content" android:layout_height="wrap_content" - tools:text="5" android:textColor="#FFC949 " android:textSize="12sp" app:layout_constraintStart_toStartOf="@+id/newWeekTitleTv" - app:layout_constraintTop_toBottomOf="@+id/newWeekTitleTv" /> + app:layout_constraintTop_toBottomOf="@+id/newWeekTitleTv" + tools:text="5" /> + app:layout_constraintStart_toEndOf="@+id/newWeekNowTv" + tools:text="/26" /> + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/mipmap-hdpi/ic_live_say_unpand.png b/live/src/main/res/mipmap-hdpi/ic_live_say_unpand.png new file mode 100644 index 000000000..9421d932b Binary files /dev/null and b/live/src/main/res/mipmap-hdpi/ic_live_say_unpand.png differ diff --git a/live/src/main/res/mipmap-xhdpi/ic_live_say_unpand.png b/live/src/main/res/mipmap-xhdpi/ic_live_say_unpand.png new file mode 100644 index 000000000..d51487e72 Binary files /dev/null and b/live/src/main/res/mipmap-xhdpi/ic_live_say_unpand.png differ diff --git a/live/src/main/res/mipmap-xxxhdpi/ic_live_say_unpand.png b/live/src/main/res/mipmap-xxxhdpi/ic_live_say_unpand.png new file mode 100644 index 000000000..601105880 Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/ic_live_say_unpand.png differ diff --git a/live/src/main/res/values/strings.xml b/live/src/main/res/values/strings.xml index 98e3d7a42..74b8e071a 100644 --- a/live/src/main/res/values/strings.xml +++ b/live/src/main/res/values/strings.xml @@ -176,4 +176,5 @@ Complete the newcomer tasks and receive multiple gifts Details If you like this anchor, please subscribe to him. + 整蠱 \ No newline at end of file