update 调整女神说布局大小
This commit is contained in:
parent
ef757a8adc
commit
97ad5c2d92
@ -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();
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user