开播小贴士只随机取一条
This commit is contained in:
parent
88cf7ca74b
commit
94ec0d1d88
@ -343,7 +343,13 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
}
|
||||
Log.i("LiveOpenTipsBean",data.toString());
|
||||
findViewById(R.id.tips).setVisibility(View.VISIBLE);
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
int i = -1;
|
||||
if (data.size() == 1){
|
||||
i=0;
|
||||
}else if (data.size() >1){
|
||||
i= (int) (Math.random()*data.size());
|
||||
}
|
||||
if(i>-1){
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
textParams.leftMargin = DpUtil.dp2px(5);
|
||||
@ -356,7 +362,22 @@ public class LiveNewReadySwViewHolder extends AbsViewHolder implements View.OnCl
|
||||
week.setText(WordUtil.isNewZh() ? data.get(i).getContent() : data.get(i).getEnglish_content());
|
||||
liveOpenVf.addView(weekView);
|
||||
}
|
||||
liveOpenVf.startFlipping();
|
||||
//
|
||||
//
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16));
|
||||
// LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
// textParams.leftMargin = DpUtil.dp2px(5);
|
||||
// textParams.rightMargin = DpUtil.dp2px(5);
|
||||
// params.leftMargin = DpUtil.dp2px(5);
|
||||
// View weekView = LayoutInflater.from(mContext).inflate(R.layout.view_live_open_tips, null);
|
||||
// TextView week = weekView.findViewById(R.id.wish_index);
|
||||
// week.setLayoutParams(textParams);
|
||||
// week.setGravity(Gravity.CENTER_VERTICAL);
|
||||
// week.setText(WordUtil.isNewZh() ? data.get(i).getContent() : data.get(i).getEnglish_content());
|
||||
// liveOpenVf.addView(weekView);
|
||||
// }
|
||||
// liveOpenVf.startFlipping();
|
||||
}else {
|
||||
findViewById(R.id.tips).setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -95,17 +95,24 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cover_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginEnd="3dp"
|
||||
android:text="@string/live_cover_2"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textColor="#FFFFFF"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:lines="1"
|
||||
android:paddingTop="1dp"
|
||||
android:paddingBottom="1dp"
|
||||
android:background="@drawable/bg_chang_live_cover"
|
||||
app:autoSizeMaxTextSize="10sp"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
android:textSize="10sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
Loading…
Reference in New Issue
Block a user