update 女神说主播端显示
update 联系方式改成svga update PK时隐藏女神说和联系方式
This commit is contained in:
parent
c22da60b82
commit
ce2048b9a5
BIN
live/src/main/assets/ic_live_anchor_call_me.svga
Normal file
BIN
live/src/main/assets/ic_live_anchor_call_me.svga
Normal file
Binary file not shown.
@ -109,7 +109,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
|
||||
public String anyway;
|
||||
public ViewGroup mContainer;
|
||||
protected ViewGroup mPageContainer;
|
||||
protected LiveRoomViewHolder mLiveRoomViewHolder;
|
||||
public LiveRoomViewHolder mLiveRoomViewHolder;
|
||||
protected AbsLiveViewHolder mLiveBottomViewHolder;
|
||||
protected LiveAddImpressViewHolder mLiveAddImpressViewHolder;
|
||||
protected LiveContributeViewHolder mLiveContributeViewHolder;
|
||||
|
@ -483,6 +483,8 @@ public class LiveAnchorActivity extends LiveActivity implements LiveFunctionClic
|
||||
}
|
||||
mLiveRoomViewHolder.initHourRankList();
|
||||
mLiveRoomViewHolder.startAnchorLight();
|
||||
//初始化女神说
|
||||
mLiveRoomViewHolder.initAnchorSay();
|
||||
}
|
||||
if (mLiveAnchorViewHolder == null) {
|
||||
mLiveAnchorViewHolder = new LiveAnchorViewHolder(mContext, mContainer);
|
||||
|
@ -780,7 +780,8 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
mLiveRoomViewHolder.initHourRankList();
|
||||
}
|
||||
mLiveRoomViewHolder.startAnchorLight();
|
||||
|
||||
//初始化女神说
|
||||
mLiveRoomViewHolder.initAnchorSay();
|
||||
}
|
||||
if (mLiveAnchorViewHolder == null) {
|
||||
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
|
||||
|
@ -114,6 +114,10 @@ public class LiveAnchorEditCallMeDialog extends AbsDialogPopupWindow {
|
||||
});
|
||||
status.setTag(0);
|
||||
status.setOnClickListener(v -> {
|
||||
if(callMeModel.getGiftId()==0){
|
||||
ToastUtil.show(R.string.live_anchor_edit_call_me_not_gift_toash);
|
||||
return;
|
||||
}
|
||||
int tag = (int) v.getTag();
|
||||
if (tag == 0) {
|
||||
status.setImageResource(R.mipmap.special_icon_on);
|
||||
|
@ -122,12 +122,13 @@ public class LiveAnchorSayPopDialog extends AbsDialogPopupWindow {
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
sayModel.getLivePreview().setContent(s.toString());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int n = (s.length() + 3) / 4;
|
||||
int len=6;
|
||||
int n = (s.length() + 3) / len;
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (i < (n - 1)) {
|
||||
sb.append(s.toString().substring(i * 4, (i + 1) * 4)).append("\n");
|
||||
sb.append(s.toString().substring(i * len, (i + 1) * len)).append("\n");
|
||||
} else {
|
||||
sb.append(s.toString().substring(i * 4));
|
||||
sb.append(s.toString().substring(i * len));
|
||||
}
|
||||
}
|
||||
if (sb.length() == 0) {
|
||||
|
@ -25,7 +25,9 @@ import android.widget.TextView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.LiveAnchorMessageCustomPopup;
|
||||
@ -195,7 +197,8 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
|
||||
} else if (id == R.id.live_tool_call_me) {
|
||||
new LiveAnchorEditCallMeDialog(mContext).setLiveUid(liveUid).showDialog();
|
||||
} else if (id == R.id.live_tool_anchor_say) {
|
||||
new LiveAnchorSayPopDialog(mContext).setLiveUid(liveUid).showDialog();
|
||||
new LiveAnchorSayPopDialog(mContext).setLiveUid(liveUid).setOnItemClickListener((bean, position)
|
||||
-> mLiveRoomHandler.postDelayed(()-> ((LiveRyAnchorActivity)(mContext)).mLiveRoomViewHolder.initAnchorSayData(),1000)).showDialog();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,6 @@ import static com.yunbao.live.views.LivePushRyViewHolder.btn_close;
|
||||
import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Outline;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
@ -4259,15 +4258,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
LiveAnchorSayModel sayModel;
|
||||
|
||||
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);
|
||||
public void initAnchorSayData() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getLivePreviewInfo(mLiveUid, new com.yunbao.common.http.base.HttpCallback<LiveAnchorSayModel>() {
|
||||
@Override
|
||||
@ -4291,7 +4282,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
public String getText(String content) {
|
||||
int t = 4;
|
||||
int t = 6;
|
||||
float len = (float) content.length() / t;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("\n");
|
||||
@ -4307,20 +4298,46 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
private static final int TOP_BANNER_TYPE_CALL_ME = 100;//联系方式
|
||||
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);
|
||||
initAnchorSayData();
|
||||
}
|
||||
|
||||
public void hideAnchorSayAndCallAnchor(){
|
||||
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);
|
||||
topBanner1.setVisibility(View.GONE);
|
||||
}
|
||||
public void showAnchorSayAndCallAnchor(){
|
||||
mAnchorSayImage.setTag(mAnchorSay.getX());
|
||||
mAnchorSay.setX(-DpUtil.dp2px(45));
|
||||
mAnchorSayImage.setVisibility(View.INVISIBLE);
|
||||
mAnchorSayText.setVisibility(View.INVISIBLE);
|
||||
mAnchorSayHide.setImageResource(R.mipmap.ic_live_anchor_say_hide);
|
||||
topBanner1.setVisibility(View.VISIBLE);
|
||||
}
|
||||
public void initTopBanner() {
|
||||
checkNewLetter();
|
||||
mTopBannerList = new ArrayList<>();
|
||||
topBanner1.setVisibility(View.GONE);
|
||||
topBanner1.setAutoPlay(true)
|
||||
.setPages(mTopBannerList, new Banner4CustomViewHolder())
|
||||
.setPages(mTopBannerList, new TopBannerCustomViewHolder())
|
||||
.setDelayTime(3000)
|
||||
.setBannerStyle(BannerConfig.NOT_INDICATOR)
|
||||
.setOnBannerClickListener(new OnBannerClickListener() {
|
||||
@Override
|
||||
public void onBannerClick(List datas, int position) {
|
||||
if (mTopBannerList.get(position).getType() == TOP_BANNER_TYPE_CALL_ME) {
|
||||
if (mTopBannerList.get(position).getType() == TopBannerCustomViewHolder.TYPE_CALL_ANCHOR) {
|
||||
Dialog loading = DialogUitl.loadingDialog(mContext);
|
||||
loading.show();
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
@ -4348,9 +4365,8 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
if (data.getIsShow() == 1) {
|
||||
topBanner1.setVisibility(View.VISIBLE);
|
||||
BannerBean call = new BannerBean();
|
||||
call.setIconRes(R.mipmap.ic_live_float_call_me);
|
||||
call.setActivityId(data.getGiftId());
|
||||
call.setType(TOP_BANNER_TYPE_CALL_ME);
|
||||
call.setType(TopBannerCustomViewHolder.TYPE_CALL_ANCHOR);
|
||||
mTopBannerList.add(0, call);
|
||||
topBanner1.update(mTopBannerList);
|
||||
}
|
||||
|
@ -1328,6 +1328,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
public void setPkStatus(boolean isPk) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.hotAddVisibility(isPk);
|
||||
if (isPk) {
|
||||
mLiveRoomViewHolder.hideAnchorSayAndCallAnchor();
|
||||
} else {
|
||||
mLiveRoomViewHolder.showAnchorSayAndCallAnchor();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.ms.banner.holder.BannerViewHolder;
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.live.R;
|
||||
|
||||
public class TopBannerCustomViewHolder implements BannerViewHolder<BannerBean> {
|
||||
public static final int TYPE_CALL_ANCHOR = 0;//联系主播
|
||||
public static final int TYPE_IMAGE = 1;
|
||||
|
||||
@Override
|
||||
public View createView(Context context, int position, BannerBean data) {
|
||||
View view = null;
|
||||
if (data.getType() == TYPE_IMAGE) {
|
||||
ImageView icon = new ImageView(context);
|
||||
if (data.getIconRes() != 0) {
|
||||
ImgLoader.display(context, data.getIconRes(), icon);
|
||||
} else {
|
||||
ImgLoader.display(context, data.getImageUrl(), icon);
|
||||
}
|
||||
view = icon;
|
||||
} else {
|
||||
view = LayoutInflater.from(context).inflate(R.layout.view_live_top_banner_call_me, null);
|
||||
SVGAImageView svga = view.findViewById(R.id.svga);
|
||||
new SVGAParser(context).decodeFromAssets("ic_live_anchor_call_me.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(SVGAVideoEntity videoItem) {
|
||||
SVGADrawable drawable = new SVGADrawable(videoItem);
|
||||
svga.setImageDrawable(drawable);
|
||||
svga.setTag("svga");
|
||||
SVGAViewUtils.playEndClear(svga, false);
|
||||
svga.setClearsAfterStop(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
Log.e("errqs", "errl");
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
}
|
9
live/src/main/res/drawable/bg_live_top_banner.xml
Normal file
9
live/src/main/res/drawable/bg_live_top_banner.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="52dp" android:height="52dp">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#4d000000" />
|
||||
<corners android:topLeftRadius="6dp" android:topRightRadius="6dp" android:bottomLeftRadius="6dp" android:bottomRightRadius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
14
live/src/main/res/drawable/bg_live_top_banner_text.xml
Normal file
14
live/src/main/res/drawable/bg_live_top_banner_text.xml
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="48dp" android:height="18dp">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke android:width="0dp" android:color="#4dffffff" />
|
||||
<solid android:color="#000000" />
|
||||
<gradient android:angle="180" android:centerColor="#0548cfff" android:endColor="#4d7733ff" android:startColor="#4d33ddff" android:type="linear" android:useLevel="true" />
|
||||
<corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#4dFFFFFF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -8,7 +8,7 @@
|
||||
<include
|
||||
android:id="@+id/anchor_say"
|
||||
layout="@layout/sim_live_room_anchor_say"
|
||||
android:layout_width="67dp"
|
||||
android:layout_width="77dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:visibility="invisible"
|
||||
|
@ -19,13 +19,15 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/anchor_say_text"
|
||||
android:layout_width="50dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:ellipsize="none"
|
||||
android:gravity="center"
|
||||
android:inputType="textMultiLine"
|
||||
android:maxEms="4"
|
||||
android:maxEms="6"
|
||||
android:text="中文测试\n中文测试\n中文测试\n中文测试"
|
||||
android:textColor="#333333"
|
||||
android:textSize="10sp"
|
||||
|
@ -1272,7 +1272,7 @@
|
||||
<include
|
||||
android:id="@+id/anchor_say_layout"
|
||||
layout="@layout/sim_live_room_anchor_say"
|
||||
android:layout_width="67dp"
|
||||
android:layout_width="77dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_alignBottom="@+id/live_video"
|
||||
android:layout_marginStart="14dp"
|
||||
|
46
live/src/main/res/layout/view_live_top_banner_call_me.xml
Normal file
46
live/src/main/res/layout/view_live_top_banner_call_me.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView7"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/bg_live_top_banner" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:visibility="visible"
|
||||
app:autoPlay="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView11"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_live_top_banner_text"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@string/live_ready_anchor_call_me"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/svga" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -74,6 +74,7 @@
|
||||
<string name="live_anchor_edit_call_me_select_gift">選擇禮物</string>
|
||||
<string name="live_anchor_edit_call_me_not_filled">未填寫</string>
|
||||
<string name="live_anchor_edit_call_me_not_filled_toash">请填写联系方式后再启用</string>
|
||||
<string name="live_anchor_edit_call_me_not_gift_toash">未選擇禮物</string>
|
||||
<string name="live_anchor_edit_call_me_letter_title">信內容</string>
|
||||
<string name="live_anchor_edit_call_me_letter_content">我能想到最浪漫的事,就是和你一起慢慢變老,一路上收藏點點滴滴的歡笑,留到以後坐著搖椅慢慢聊。</string>
|
||||
<string name="live_ready_anchor_call_me">聯繫方式</string>
|
||||
|
Loading…
Reference in New Issue
Block a user