Merge branch 'dev_share'
# Conflicts: # main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
This commit is contained in:
@@ -101,6 +101,7 @@ import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
|
||||
import com.yunbao.live.views.LiveRoomPlayViewHolder;
|
||||
import com.yunbao.live.views.PortraitLiveManager;
|
||||
import com.yunbao.share.ui.SharePopDialog;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@@ -909,6 +910,13 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
.setBean(mLiveBean)
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.REPORT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void share() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setBean(mLiveBean)
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_SHARE));
|
||||
}
|
||||
});
|
||||
new XPopup.Builder(mContext)
|
||||
.hasShadowBg(false)
|
||||
@@ -1280,6 +1288,14 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
case LIVE_HIDE_MSG_RED:
|
||||
showMsgRed(-1);
|
||||
break;
|
||||
case LIVE_SHARE:
|
||||
new SharePopDialog(mContext)
|
||||
.setUid(CommonAppConfig.getInstance().getUid())
|
||||
.setAnchorId(event.getBean().getUid())
|
||||
.setAnchorName(event.getBean().getUserNiceName())
|
||||
.setAnchorAvatar(event.getBean().getAvatar())
|
||||
.showDialog();
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class LiveAnchorSayItemsAdapter extends RecyclerView.Adapter<LiveAnchorSa
|
||||
}
|
||||
|
||||
public void setData(String text, int position) {
|
||||
textView.setText("已输入的\n内容已输\n入的内容\n入的内容");
|
||||
textView.setText("已输入的内容\n已输入的内容\n已输入的");
|
||||
ImgLoader.display(mContext, text, icon);
|
||||
if (position == click) {
|
||||
itemView.setBackgroundResource(R.drawable.bg_anchor_say_select);
|
||||
|
||||
@@ -121,20 +121,7 @@ public class LiveAnchorSayPopDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
sayModel.getLivePreview().setContent(s.toString());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
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 * len, (i + 1) * len)).append("\n");
|
||||
} else {
|
||||
sb.append(s.toString().substring(i * len));
|
||||
}
|
||||
}
|
||||
if (sb.length() == 0) {
|
||||
sb.append("默认字符\n默认字符\n默认字符");
|
||||
}
|
||||
sayText.setText(sb.toString());
|
||||
sayText.setText(getText(s.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,6 +129,21 @@ public class LiveAnchorSayPopDialog extends AbsDialogPopupWindow {
|
||||
|
||||
}
|
||||
|
||||
public String getText(String content) {
|
||||
int t = 6;
|
||||
float len = (float) content.length() / t;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("\n");
|
||||
for (int i = 0; i < len; i++) {
|
||||
if (len - i < 1) {
|
||||
sb.append(content.substring(i * t));
|
||||
} else {
|
||||
sb.append(content.substring(i * t, i * t + t)).append("\n");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
});
|
||||
close.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
|
||||
@@ -300,7 +300,8 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
LIVE_VIDEO(54, "画质选择"),
|
||||
LUCKY_100_CHECK(55, "幸运百分百"),
|
||||
LIVE_END(56, "主播下播"),
|
||||
LIVE_HIDE_MSG_RED(57,"隐藏红点");
|
||||
LIVE_HIDE_MSG_RED(57,"隐藏红点"),
|
||||
LIVE_SHARE(58,"直播間分享");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
||||
Reference in New Issue
Block a user