Merge branch 'dev_share'
# Conflicts: # main/src/main/java/com/yunbao/main/views/MainHomeViewHolder.java
This commit is contained in:
@@ -1 +1 @@
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.android.library'
|
||||
@@ -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;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:id="@+id/anchor_say"
|
||||
layout="@layout/sim_live_room_anchor_say"
|
||||
android:layout_width="77dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:visibility="invisible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="128dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/bg_anchor_say"
|
||||
android:layout_marginTop="10dp">
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
<include
|
||||
layout="@layout/sim_live_room_anchor_say"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_width="83dp"
|
||||
android:layout_height="110dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -2,20 +2,21 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="88dp">
|
||||
android:layout_width="77dp"
|
||||
android:layout_height="110dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/anchor_say_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@color/main_color_79CDF9"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:srcCompat="@color/main_color_79CDF9" />
|
||||
tools:srcCompat="@mipmap/tmp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/anchor_say_text"
|
||||
@@ -28,14 +29,14 @@
|
||||
android:gravity="center"
|
||||
android:inputType="textMultiLine"
|
||||
android:maxEms="6"
|
||||
android:text="中文测试\n中文测试\n中文测试\n中文测试"
|
||||
android:text="已输入的内容\n已输入的内容\n已输入的"
|
||||
android:textColor="#333333"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/anchor_say_icon"
|
||||
tools:text="中文测试\n中文测试\n中文测试\n中文测试" />
|
||||
tools:text="已输入的内容\n已输入的内容\n已输入的" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/anchor_say_hide"
|
||||
|
||||
@@ -1295,7 +1295,7 @@
|
||||
android:id="@+id/anchor_say_layout"
|
||||
layout="@layout/sim_live_room_anchor_say"
|
||||
android:layout_width="77dp"
|
||||
android:layout_height="88dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_alignBottom="@+id/live_video"
|
||||
android:layout_marginStart="14dp"
|
||||
android:visibility="invisible"
|
||||
|
||||
Reference in New Issue
Block a user