dxh лет назад: 5
Родитель
Сommit
e5cb4bede4

+ 38 - 25
app/src/main/java/com/electric/chargingpile/fragment/SvVideoShowView.java

@ -5,7 +5,6 @@ import android.content.Intent;
5 5
import android.support.v4.view.PagerAdapter;
6 6
import android.support.v4.view.ViewPager;
7 7
import android.text.TextUtils;
8
import android.util.Log;
9 8
import android.view.LayoutInflater;
10 9
import android.view.MotionEvent;
11 10
import android.view.View;
@ -86,21 +85,23 @@ public class SvVideoShowView implements View.OnClickListener {
86 85
    }
87 86
88 87
    public void setInfo(TalkRecommendBean talkRecommendBean) {
89
        this.talkRecommendBean = talkRecommendBean;
90
        int targetType = talkRecommendBean.targetType;
91
        if (view == null) {
92
            if (targetType == 23) {
93
                view = LayoutInflater.from(activity).inflate(R.layout.view_show_view, null);
94
                initPlayer(view);
95
96
            } else if (targetType == 24) {
97
                view = LayoutInflater.from(activity).inflate(R.layout.view_show_zoom, null);
98
                initZoomPhoto(view);
99
            }
100
            initBottom(view);
101
            viewGroup.addView(view);
88
        if (viewGroup != null) {
89
            this.talkRecommendBean = talkRecommendBean;
90
            int targetType = talkRecommendBean.targetType;
91
            if (view == null) {
92
                if (targetType == 23) {
93
                    view = LayoutInflater.from(activity).inflate(R.layout.view_show_view, null);
94
                    initPlayer(view);
95
96
                } else if (targetType == 24) {
97
                    view = LayoutInflater.from(activity).inflate(R.layout.view_show_zoom, null);
98
                    initZoomPhoto(view);
99
                }
100
                initBottom(view);
101
                viewGroup.addView(view);
102 102
103
            setData();
103
                setData();
104
            }
104 105
        }
105 106
    }
106 107
@ -163,8 +164,6 @@ public class SvVideoShowView implements View.OnClickListener {
163 164
    private void setData() {
164 165
        sv_show_comment_count_tv.setText(num4(talkRecommendBean.commentNums));
165 166
        sv_show_like_tv.setText(num4(talkRecommendBean.likeNums));
166
        sv_show_tvcon.setText(talkRecommendBean.content);
167
        sv_show_tvcon.setText(talkRecommendBean.title);
168 167
        sv_show_user_name.setText(talkRecommendBean.nickName);
169 168
        String time = "" + talkRecommendBean.addTime;
170 169
        sv_show_user_time.setText(time);
@ -198,13 +197,6 @@ public class SvVideoShowView implements View.OnClickListener {
198 197
        } else {
199 198
            // sv_show_like_img  not like
200 199
        }
201
        int length = sv_show_tvcon.length();
202
        Log.e("length", "setData: length: " + length);
203
        if (sv_show_tvcon.getLineCount() >= 3 && sv_show_tvcon.getText().length() > 100) {
204
            sv_show_tvcon_more.setVisibility(View.VISIBLE);
205
        } else {
206
            sv_show_tvcon_more.setVisibility(View.GONE);
207
        }
208 200
    }
209 201
210 202
@ -391,7 +383,25 @@ public class SvVideoShowView implements View.OnClickListener {
391 383
    }
392 384
393 385
    public void updateView() {
394
//        ToastUtil.showToast(activity, "updateView", Toast.LENGTH_LONG);
386
        String title = talkRecommendBean.title;
387
        if (TextUtils.isEmpty(title)) {
388
            sv_show_tvcon_more.setVisibility(View.GONE);
389
        } else {
390
            int length = title.length();
391
            if (length > 100) {
392
                sv_show_tvcon.setMaxLines(3);
393
                sv_show_tvcon.setEllipsize(TextUtils.TruncateAt.END);
394
                sv_show_tvcon_more.setVisibility(View.VISIBLE);
395
                sv_show_tvcon.setText(talkRecommendBean.title);
396
397
            } else {
398
                sv_show_tvcon_more.setVisibility(View.GONE);
399
400
                sv_show_tvcon.setMaxLines(100);
401
            }
402
403
        }
404
395 405
    }
396 406
397 407
    public void initAndPlay() {
@ -512,7 +522,10 @@ public class SvVideoShowView implements View.OnClickListener {
512 522
                                chargingShareBean.setIcon(talkRecommendBean.coverImgUrl);
513 523
                                chargingShareBean.setTitle(talkRecommendBean.title);
514 524
                                chargingShareBean.setUrl(shareUrl);
525
                                showSimpleBottomSheetGrid(chargingShareBean);
515 526
                            }
527
                        } else {
528
                            ToastUtil.showToast(activity, "获取分享信息失败,请重试", Toast.LENGTH_SHORT);
516 529
                        }
517 530
                    }
518 531
                });

+ 0 - 2
app/src/main/res/layout/view_show_bottom.xml

@ -123,8 +123,6 @@
123 123
        android:layout_marginRight="39dp"
124 124
        android:layout_marginBottom="23dp"
125 125
        android:textColor="#E2E2E2"
126
        android:ellipsize="end"
127
        android:maxLines="3"
128 126
        android:textSize="14sp" />
129 127
130 128
    <ImageView