diff --git a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java index 6d58671c4..985a39f67 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveNewReadySwViewHolder.java @@ -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); } diff --git a/live/src/main/res/layout/view_new_live_ready.xml b/live/src/main/res/layout/view_new_live_ready.xml index 131c49018..c4d75fa0f 100644 --- a/live/src/main/res/layout/view_new_live_ready.xml +++ b/live/src/main/res/layout/view_new_live_ready.xml @@ -95,17 +95,24 @@