Ver Código Fonte

底部视图开发

huyuguo 5 anos atrás
pai
commit
9f22561322

+ 214 - 105
app/src/main/java/com/electric/chargingpile/activity/ChatContentListActivity.java

@ -10,10 +10,13 @@ import android.support.v4.app.FragmentPagerAdapter;
10 10
import android.support.v4.view.ViewPager;
11 11
import android.support.v7.app.AppCompatActivity;
12 12
import android.os.Bundle;
13
import android.text.TextUtils;
14
import android.text.method.ScrollingMovementMethod;
13 15
import android.util.Log;
14 16
import android.view.LayoutInflater;
15 17
import android.view.View;
16 18
import android.view.ViewGroup;
19
import android.view.ViewTreeObserver;
17 20
import android.widget.Button;
18 21
import android.widget.ImageView;
19 22
import android.widget.ProgressBar;
@ -27,6 +30,7 @@ import com.electric.chargingpile.data.ChatBeanLab;
27 30
import com.electric.chargingpile.data.ChatRecommendBean;
28 31
import com.electric.chargingpile.manager.PreferenceManager;
29 32
import com.electric.chargingpile.manager.ProfileManager;
33
import com.electric.chargingpile.util.CircleTransform;
30 34
import com.electric.chargingpile.util.CommonParams;
31 35
import com.electric.chargingpile.util.DensityUtil;
32 36
import com.electric.chargingpile.util.ImageDisplayUtils;
@ -41,6 +45,7 @@ import com.shuyu.gsyvideoplayer.GSYVideoManager;
41 45
import com.shuyu.gsyvideoplayer.listener.GSYVideoProgressListener;
42 46
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
43 47
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
48
import com.squareup.picasso.Picasso;
44 49
import com.zhy.http.okhttp.OkHttpUtils;
45 50
import com.zhy.http.okhttp.callback.StringCallback;
46 51
@ -147,7 +152,7 @@ public class ChatContentListActivity extends AppCompatActivity {
147 152
        switch (networkType) {
148 153
            case NETWORK_2G:
149 154
            case NETWORK_3G:
150
            case NETWORK_WIFI:
155
            case NETWORK_4G:
151 156
                if (ProfileManager.getInstance().getMakeSureNetworkForView(ChatContentListActivity.this)) {
152 157
                    chatContentFragment.play();
153 158
                } else {
@ -171,14 +176,6 @@ public class ChatContentListActivity extends AppCompatActivity {
171 176
        }
172 177
    }
173 178
174
//    @Override
175
//    public void onBackPressed() {
176
//        Intent intent = new Intent();
177
//        setResult(200, intent);
178
//        finish();
179
//    }
180
181
182 179
    public class ChatContentAdapter extends FragmentPagerAdapter {
183 180
184 181
        public Map<String, ChatContentFragment> map = new HashMap<>();
@ -210,6 +207,14 @@ public class ChatContentListActivity extends AppCompatActivity {
210 207
        private ImageView playIcon;
211 208
        private TextView likeLabel;
212 209
        private ImageView likeIcon;
210
        private ProgressBar progressBar;
211
        private TextView msg;
212
        private ImageView fold;
213
        private int msgLines;
214
        private ConstraintLayout toolBar;
215
        private ImageView headImage;
216
        private TextView nickName;
217
        private TextView addDate;
213 218
214 219
        public static ChatContentFragment newInstance(int index, String from) {
215 220
            ChatContentFragment fragment = new ChatContentFragment();
@ -246,15 +251,23 @@ public class ChatContentListActivity extends AppCompatActivity {
246 251
            return rootView;
247 252
        }
248 253
249
        private void initVideoView(View rootView, final ChatRecommendBean bean) {
254
        private void initVideoView(final View rootView, final ChatRecommendBean bean) {
250 255
            videoPlayer = rootView.findViewById(R.id.videoPlayer);
251 256
            videoPlayer.setUp(bean.videoUrl, true, "");
252 257
            videoIcon = rootView.findViewById(R.id.videoIcon);
253 258
            playIcon = rootView.findViewById(R.id.playIcon);
254 259
            likeLabel = rootView.findViewById(R.id.likeLabel);
255 260
            likeIcon = rootView.findViewById(R.id.likeIcon);
261
            progressBar = rootView.findViewById(R.id.progressBar);
262
            msg = rootView.findViewById(R.id.msg);
263
            fold = rootView.findViewById(R.id.fold);
264
            toolBar = rootView.findViewById(R.id.toolBar);
265
            headImage = rootView.findViewById(R.id.headImage);
266
            nickName = rootView.findViewById(R.id.nickName);
267
            addDate = rootView.findViewById(R.id.addDate);
256 268
            ConstraintLayout navBar = rootView.findViewById(R.id.navBar);
257 269
270
            // 视频尺寸判断
258 271
            if (bean.coverImgH != 0 && bean.coverImgW != 0 && bean.coverImgW > bean.coverImgH) {
259 272
                int navHeight = DensityUtil.dip2px(getContext(), 44);
260 273
                ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams) videoPlayer.getLayoutParams();
@ -291,6 +304,197 @@ public class ChatContentListActivity extends AppCompatActivity {
291 304
                likeIcon.setImageResource(R.drawable.like_icon);
292 305
            }
293 306
307
            // 封面图片
308
            ImageView thumbImageView = new ImageView(getContext());
309
            thumbImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
310
            ImageDisplayUtils.dispalyImg(getContext(), bean.coverImgUrl, thumbImageView);
311
            videoPlayer.setThumbImageView(thumbImageView);
312
313
            rootView.findViewById(R.id.videoPlayerCover).setOnClickListener(new View.OnClickListener() {
314
                @Override
315
                public void onClick(View view) {
316
                    NetworkUtils.NetworkType networkType = NetworkUtils.getNetworkType();
317
                    switch (networkType) {
318
                        case NETWORK_2G:
319
                        case NETWORK_3G:
320
                        case NETWORK_4G:
321
                            new AlertDialog(getContext()).builder()
322
                                    .setMsg("目前正在移动网络下,是否播放")
323
                                    .setPositiveButton("继续播放", new View.OnClickListener() {
324
                                        @Override
325
                                        public void onClick(View view) {
326
                                            ProfileManager.getInstance().setMakeSureNetworkForView(getContext());
327
                                            playOrPause();
328
                                        }
329
                                    }).setNegativeButton("暂停播放", null).show();
330
                            break;
331
                        default:
332
                            playOrPause();
333
                            break;
334
                    }
335
                }
336
            });
337
338
            rootView.findViewById(R.id.like).setOnClickListener(new View.OnClickListener() {
339
                @Override
340
                public void onClick(View view) {
341
                    if (bean.likeFlg == 0) {
342
                        doLike(bean);
343
                    }
344
                }
345
            });
346
347
            videoPlayer.setGSYVideoProgressListener(new GSYVideoProgressListener() {
348
                @Override
349
                public void onProgress(int i, int i1, int i2, int i3) {
350
                    progressBar.setProgress(i);
351
                }
352
            });
353
354
            final String str = bean.title;
355
            msg.setText(str);
356
357
            msg.post(new Runnable() {
358
                @Override
359
                public void run() {
360
                    msgLines = msg.getLineCount();
361
                    if (msgLines > 3) {
362
                        msg.setMaxLines(3);
363
                        fold.setVisibility(View.VISIBLE);
364
                    } else {
365
                        fold.setVisibility(View.GONE);
366
                    }
367
                }
368
            });
369
370
371
            fold.setOnClickListener(new View.OnClickListener() {
372
                @Override
373
                public void onClick(View view) {
374
                    Log.d(TAG, "onClick: " + msg.getLineCount());
375
                    int maxLines = msg.getMaxLines();
376
                    if (maxLines == 3) {
377
                        fold.setImageResource(R.drawable.unfold_icon);
378
                        if (msgLines > 7) {
379
                            msg.setMaxLines(7);
380
                            msg.setMovementMethod(ScrollingMovementMethod.getInstance());
381
                            msg.setScrollbarFadingEnabled(false);
382
                        } else {
383
                            msg.setMaxLines(Integer.MAX_VALUE);
384
                        }
385
                        toolBar.setVisibility(View.GONE);
386
                    } else {
387
                        fold.setImageResource(R.drawable.fold_icon);
388
                        msg.setMovementMethod(null);
389
                        msg.setMaxLines(3);
390
                        msg.setScrollbarFadingEnabled(true);
391
                        msg.setEllipsize(TextUtils.TruncateAt.END);
392
                        msg.setText(str);  // 重新赋值,解决...不出现的问题
393
394
                        toolBar.setVisibility(View.VISIBLE);
395
                    }
396
                }
397
            });
398
399
            if (TextUtils.isEmpty(bean.headImgUrl)) {
400
                Picasso.with(getContext())
401
                        .load(R.drawable.icon_face2_0)
402
                        .placeholder(R.drawable.icon_face2_0)
403
                        .error(R.drawable.icon_face2_0)
404
                        .transform(new CircleTransform())
405
                        .into(headImage);
406
            } else {
407
                Picasso.with(getContext())
408
                        .load("http://cdz.evcharge.cc/zhannew/uploadfile/" + bean.headImgUrl)
409
                        .placeholder(R.drawable.icon_face2_0)
410
                        .error(R.drawable.icon_face2_0)
411
                        .transform(new CircleTransform())
412
                        .into(headImage);
413
            }
414
415
            nickName.setText(bean.nickName);
416
            addDate.setText(bean.addDate);
417
418
419
            rootView.findViewById(R.id.bottomView).setOnClickListener(new View.OnClickListener() {
420
                @Override
421
                public void onClick(View view) {
422
                }
423
            });
424
425
            setVideoAllCallBack();
426
        }
427
428
        private void doLike(final ChatRecommendBean bean) {
429
            String url = MainApplication.urlNew + "/topic/like.do";
430
            Map<String, String> map = new HashMap<>();
431
            map.put("targetId", bean.targetId + "");
432
            map.put("targetType", bean.targetType + "");
433
            map.put("flag", "1");
434
            map.put("authorId", bean.addUserId + "");
435
            CommonParams.addCommonParams(map);
436
437
            OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
438
                @Override
439
                public void onError(Call call, Exception e) {
440
                    ToastUtil.showToast(getContext(), "点赞失败,请重试", Toast.LENGTH_SHORT);
441
                }
442
443
                @Override
444
                public void onResponse(String res) {
445
                    String code = JsonUtils.getKeyResult(res, "code");
446
                    String desc = JsonUtils.getKeyResult(res, "desc");
447
                    if ("1000".equals(code)) {
448
                        bean.likeFlg = 1;
449
                        bean.likeNums += 1;
450
                        likeLabel.setText(bean.likeNums > 999 ? "999+" : bean.likeNums + "");
451
                        if (bean.likeFlg == 1) {
452
                            likeIcon.setImageResource(R.drawable.like_red_icon);
453
                        } else {
454
                            likeIcon.setImageResource(R.drawable.like_icon);
455
                        }
456
                    } else {
457
                        ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
458
                    }
459
                }
460
            });
461
        }
462
463
        private void playOrPause() {
464
            int currentStatue = videoPlayer.getCurrentState();
465
            if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
466
                playIcon.setVisibility(View.VISIBLE);
467
                videoPlayer.onVideoPause();
468
            } else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
469
                playIcon.setVisibility(View.GONE);
470
                videoPlayer.onVideoResume(false);
471
            } else {
472
                playIcon.setVisibility(View.GONE);
473
                videoPlayer.startPlayLogic();
474
            }
475
        }
476
477
        public void play() {
478
            if (videoPlayer == null) {
479
                return;
480
            }
481
482
            playIcon.setVisibility(View.GONE);
483
            int currentStatue = videoPlayer.getCurrentState();
484
            if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
485
            } else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
486
                videoPlayer.onVideoResume(true);
487
            } else {
488
                videoPlayer.startPlayLogic();
489
            }
490
        }
491
492
        private void initPicturesView(View rootView, ChatRecommendBean bean) {
493
            TextView positionTextView = rootView.findViewById(R.id.position);
494
            positionTextView.setText(bean.title);
495
        }
496
497
        private void setVideoAllCallBack() {
294 498
            videoPlayer.setVideoAllCallBack(new VideoAllCallBack() {
295 499
                @Override
296 500
                public void onAutoComplete(String s, Object... objects) {
@ -391,101 +595,6 @@ public class ChatContentListActivity extends AppCompatActivity {
391 595
                public void onClickStartThumb(String s, Object... objects) {
392 596
                }
393 597
            });
394
395
            ImageView thumbImageView = new ImageView(getContext());
396
            thumbImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
397
            ImageDisplayUtils.dispalyImg(getContext(), bean.coverImgUrl, thumbImageView);
398
            videoPlayer.setThumbImageView(thumbImageView);
399
400
            rootView.findViewById(R.id.videoPlayerCover).setOnClickListener(new View.OnClickListener() {
401
                @Override
402
                public void onClick(View view) {
403
                    if (ProfileManager.getInstance().getMakeSureNetworkForView(getContext())) {
404
                        playOrPause();
405
                    } else {
406
                        new AlertDialog(getContext()).builder()
407
                                .setMsg("目前正在移动网络下,是否播放")
408
                                .setPositiveButton("继续播放", new View.OnClickListener() {
409
                                    @Override
410
                                    public void onClick(View view) {
411
                                        ProfileManager.getInstance().setMakeSureNetworkForView(getContext());
412
                                        playOrPause();
413
                                    }
414
                                }).setNegativeButton("暂停播放", null).show();
415
                    }
416
                }
417
            });
418
419
            rootView.findViewById(R.id.like).setOnClickListener(new View.OnClickListener() {
420
                @Override
421
                public void onClick(View view) {
422
                    doLike(bean);
423
                }
424
            });
425
        }
426
427
        private void doLike(final ChatRecommendBean bean) {
428
            String url = MainApplication.urlNew + "/topic/like.do";
429
            Map<String, String> map = new HashMap<>();
430
            map.put("targetId", bean.targetId + "");
431
            map.put("targetType", bean.targetType + "");
432
            map.put("flag", "1");
433
            map.put("authorId", bean.addUserId + "");
434
            CommonParams.addCommonParams(map);
435
436
            OkHttpUtils.get().url(url).params(map).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
437
                @Override
438
                public void onError(Call call, Exception e) {
439
                    ToastUtil.showToast(getContext(), "点赞失败,请重试", Toast.LENGTH_SHORT);
440
                }
441
442
                @Override
443
                public void onResponse(String res) {
444
                    String code = JsonUtils.getKeyResult(res, "code");
445
                    String desc = JsonUtils.getKeyResult(res, "desc");
446
                    if ("1000".equals(code)) {
447
                        bean.likeFlg = 1;
448
                        bean.likeNums += 1;
449
450
                    } else {
451
                        ToastUtil.showToast(getContext(), desc, Toast.LENGTH_SHORT);
452
                    }
453
                }
454
            });
455
        }
456
457
        private void playOrPause() {
458
            int currentStatue = videoPlayer.getCurrentState();
459
            if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
460
                playIcon.setVisibility(View.VISIBLE);
461
                videoPlayer.onVideoPause();
462
            } else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
463
                playIcon.setVisibility(View.GONE);
464
                videoPlayer.onVideoResume(false);
465
            } else {
466
                playIcon.setVisibility(View.GONE);
467
                videoPlayer.startPlayLogic();
468
            }
469
        }
470
471
        public void play() {
472
            if (videoPlayer == null) {
473
                return;
474
            }
475
476
            playIcon.setVisibility(View.GONE);
477
            int currentStatue = videoPlayer.getCurrentState();
478
            if (currentStatue == GSYVideoView.CURRENT_STATE_PLAYING) {
479
            } else if (currentStatue == GSYVideoView.CURRENT_STATE_PAUSE) {
480
                videoPlayer.onVideoResume(true);
481
            } else {
482
                videoPlayer.startPlayLogic();
483
            }
484
        }
485
486
        private void initPicturesView(View rootView, ChatRecommendBean bean) {
487
            TextView positionTextView = rootView.findViewById(R.id.position);
488
            positionTextView.setText(bean.title);
489 598
        }
490 599
    }
491 600
}

+ 2 - 0
app/src/main/java/com/electric/chargingpile/data/ChatRecommendBean.java

@ -15,6 +15,7 @@ public class ChatRecommendBean implements Serializable {
15 15
    public String title;
16 16
    public String name;
17 17
    public long addTime;
18
    public String addDate;
18 19
    public long topicId;
19 20
    public long joinNums;
20 21
    public int visitNums;
@ -43,6 +44,7 @@ public class ChatRecommendBean implements Serializable {
43 44
                ", title='" + title + '\'' +
44 45
                ", name='" + name + '\'' +
45 46
                ", addTime=" + addTime +
47
                ", addDate='" + addDate + '\'' +
46 48
                ", topicId=" + topicId +
47 49
                ", joinNums=" + joinNums +
48 50
                ", visitNums=" + visitNums +

+ 1 - 0
app/src/main/java/com/electric/chargingpile/util/DateUtils.java

@ -29,6 +29,7 @@ public class DateUtils {
29 29
        return sf.format(d);
30 30
    }
31 31
32
32 33
    /*将字符串转为时间戳*/
33 34
    public static long getStringToDate(String time) {
34 35
        sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

+ 5 - 0
app/src/main/res/drawable/topic_shape.xml

@ -0,0 +1,5 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android">
3
    <corners android:radius="4dp" />
4
    <solid android:color="#6e303030" />
5
</shape>

+ 2 - 2
app/src/main/res/drawable/video_player_progressbar.xml

@ -3,14 +3,14 @@
3 3
    <!--默认颜色-->
4 4
    <item android:id="@android:id/background">
5 5
        <shape>
6
            <solid android:color="#424242" />
6
            <solid android:color="#505050" />
7 7
        </shape>
8 8
    </item>
9 9
    <!--进度颜色-->
10 10
    <item android:id="@android:id/progress">
11 11
        <clip>
12 12
            <shape>
13
                <solid android:color="@color/white" />
13
                <solid android:color="#00edb2" />
14 14
            </shape>
15 15
        </clip>
16 16
    </item>

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

@ -33,6 +33,7 @@
33 33
            android:layout_height="wrap_content"
34 34
            android:src="@drawable/app_talk_video_icon"
35 35
            android:visibility="gone"
36
            android:contentDescription="播放按钮图标"
36 37
            app:layout_constraintBottom_toBottomOf="@+id/coverImage"
37 38
            app:layout_constraintLeft_toLeftOf="@+id/coverImage"
38 39
            app:layout_constraintRight_toRightOf="@+id/coverImage"
@ -93,6 +94,7 @@
93 94
                    android:id="@+id/headImage"
94 95
                    android:layout_width="20dp"
95 96
                    android:layout_height="20dp"
97
                    android:contentDescription="用户头像"
96 98
                    app:layout_constraintBottom_toBottomOf="parent"
97 99
                    app:layout_constraintStart_toStartOf="parent"
98 100
                    app:layout_constraintTop_toTopOf="parent"

+ 162 - 2
app/src/main/res/layout/fragment_chat_content_video.xml

@ -16,6 +16,7 @@
16 16
        app:layout_constraintTop_toTopOf="parent"></com.electric.chargingpile.video.VideoPlayer>
17 17
18 18
    <ImageView
19
        android:id="@+id/coverVideoPlayerProgress"
19 20
        android:layout_width="match_parent"
20 21
        android:layout_height="1.5dp"
21 22
        android:background="#424242"
@ -71,15 +72,174 @@
71 72
72 73
    </android.support.constraint.ConstraintLayout>
73 74
75
    <!-- 底部视图 -->
74 76
    <android.support.constraint.ConstraintLayout
75 77
        android:id="@+id/bottomView"
76 78
        android:layout_width="match_parent"
77 79
        android:layout_height="wrap_content"
78 80
        android:layout_marginBottom="-40dp"
79
        app:layout_constraintBottom_toBottomOf="parent">
81
        app:layout_constraintBottom_toBottomOf="parent"
82
        tools:background="#f38654">
80 83
84
        <!-- 主题信息及关闭按钮 -->
81 85
        <android.support.constraint.ConstraintLayout
82 86
            android:layout_width="match_parent"
87
            android:layout_height="52dp"
88
            app:layout_constraintBottom_toTopOf="@+id/userInfo"
89
            tools:background="#39bd00">
90
91
            <android.support.constraint.ConstraintLayout
92
                android:id="@+id/topicInfo"
93
                android:layout_width="wrap_content"
94
                android:layout_height="30dp"
95
                android:layout_marginLeft="15dp"
96
                android:background="@drawable/topic_shape"
97
                android:paddingLeft="12dp"
98
                android:paddingRight="12dp"
99
                app:layout_constraintBottom_toBottomOf="parent"
100
                app:layout_constraintLeft_toLeftOf="parent"
101
                app:layout_constraintTop_toTopOf="parent"
102
                tools:background="#ff967d">
103
104
                <ImageView
105
                    android:id="@+id/topicIcon"
106
                    android:layout_width="wrap_content"
107
                    android:layout_height="wrap_content"
108
                    android:src="@drawable/topic_icon"
109
                    app:layout_constraintBottom_toBottomOf="parent"
110
                    app:layout_constraintLeft_toLeftOf="parent"
111
                    app:layout_constraintTop_toTopOf="parent" />
112
113
                <TextView
114
                    android:id="@+id/topicTitle"
115
                    android:layout_width="wrap_content"
116
                    android:layout_height="wrap_content"
117
                    android:paddingLeft="5dp"
118
                    android:textColor="#ffffff"
119
                    android:textSize="11sp"
120
                    app:layout_constraintBottom_toBottomOf="parent"
121
                    app:layout_constraintLeft_toRightOf="@+id/topicIcon"
122
                    app:layout_constraintTop_toTopOf="parent"
123
                    tools:text="#新能源#" />
124
            </android.support.constraint.ConstraintLayout>
125
126
127
            <ImageView
128
                android:id="@+id/closeUnfold"
129
                android:layout_width="22dp"
130
                android:layout_height="22dp"
131
                android:layout_margin="15dp"
132
                android:src="@drawable/icon_close"
133
                android:visibility="gone"
134
                app:layout_constraintBottom_toBottomOf="parent"
135
                app:layout_constraintRight_toRightOf="parent"
136
                app:layout_constraintTop_toTopOf="parent"
137
                tools:background="#013369"
138
                tools:visibility="visible" />
139
        </android.support.constraint.ConstraintLayout>
140
        <!-- 用户信息 -->
141
        <android.support.constraint.ConstraintLayout
142
            android:id="@+id/userInfo"
143
            android:layout_width="wrap_content"
144
            android:layout_height="wrap_content"
145
            android:layout_marginBottom="5dp"
146
            android:paddingLeft="15dp"
147
            app:layout_constraintBottom_toTopOf="@+id/msgContainer"
148
            app:layout_constraintLeft_toLeftOf="parent"
149
            tools:background="#33ccff">
150
151
            <ImageView
152
                android:id="@+id/headImage"
153
                android:layout_width="20dp"
154
                android:layout_height="20dp"
155
                app:layout_constraintBottom_toBottomOf="parent"
156
                app:layout_constraintLeft_toLeftOf="parent"
157
                app:layout_constraintTop_toTopOf="parent"
158
                tools:srcCompat="@tools:sample/avatars[1]" />
159
160
            <android.support.constraint.ConstraintLayout
161
                android:layout_width="wrap_content"
162
                android:layout_height="wrap_content"
163
                android:paddingLeft="5dp"
164
                app:layout_constraintBottom_toBottomOf="parent"
165
                app:layout_constraintLeft_toRightOf="@+id/headImage"
166
                app:layout_constraintTop_toTopOf="parent">
167
168
                <TextView
169
                    android:id="@+id/nickName"
170
                    android:layout_width="wrap_content"
171
                    android:layout_height="wrap_content"
172
                    android:textColor="#ffffff"
173
                    android:textSize="12sp"
174
                    app:layout_constraintLeft_toLeftOf="parent"
175
                    app:layout_constraintTop_toTopOf="parent"
176
                    tools:text="小电" />
177
178
                <TextView
179
                    android:id="@+id/addDate"
180
                    android:layout_width="wrap_content"
181
                    android:layout_height="wrap_content"
182
                    android:textColor="#888888"
183
                    android:textSize="12sp"
184
                    app:layout_constraintBottom_toBottomOf="parent"
185
                    app:layout_constraintLeft_toLeftOf="parent"
186
                    app:layout_constraintTop_toBottomOf="@+id/nickName"
187
                    tools:text="2019-05-29 16:28" />
188
            </android.support.constraint.ConstraintLayout>
189
        </android.support.constraint.ConstraintLayout>
190
191
        <!-- 信息 -->
192
        <android.support.constraint.ConstraintLayout
193
            android:id="@+id/msgContainer"
194
            android:layout_width="match_parent"
195
            android:layout_height="wrap_content"
196
            app:layout_constraintBottom_toTopOf="@+id/progressBar">
197
198
            <TextView
199
                android:id="@+id/msg"
200
                android:layout_width="0dp"
201
                android:layout_height="wrap_content"
202
                android:layout_marginRight="30dp"
203
                android:ellipsize="end"
204
                android:paddingLeft="40dp"
205
                android:paddingRight="10dp"
206
                android:paddingBottom="25dp"
207
                android:scrollbarStyle="outsideOverlay"
208
                android:scrollbars="vertical"
209
                android:textColor="#e2e2e2"
210
                android:textSize="14sp"
211
                app:layout_constraintBottom_toBottomOf="parent"
212
                app:layout_constraintLeft_toLeftOf="parent"
213
                app:layout_constraintRight_toRightOf="parent"
214
                app:layout_constraintTop_toTopOf="parent"
215
                tools:text="迪克啥看来当减肥考虑送到,迪克啥看来当减肥考虑送到迪克啥看来当减肥考虑送到" />
216
217
            <ImageView
218
                android:id="@+id/fold"
219
                android:layout_width="42dp"
220
                android:layout_height="62dp"
221
                android:paddingLeft="15dp"
222
                android:paddingTop="25dp"
223
                android:paddingRight="15dp"
224
                android:paddingBottom="25dp"
225
                android:src="@drawable/unfold_icon"
226
                app:layout_constraintBottom_toBottomOf="parent"
227
                app:layout_constraintRight_toRightOf="parent" />
228
        </android.support.constraint.ConstraintLayout>
229
        <!-- 自定义进度条 -->
230
        <ProgressBar
231
            android:id="@+id/progressBar"
232
            style="@android:style/Widget.ProgressBar.Horizontal"
233
            android:layout_width="match_parent"
234
            android:layout_height="1dp"
235
            android:max="100"
236
            android:progressDrawable="@drawable/video_player_progressbar"
237
            app:layout_constraintBottom_toTopOf="@+id/toolBar"
238
            tools:progress="50" />
239
        <!-- 底部工具栏 -->
240
        <android.support.constraint.ConstraintLayout
241
            android:id="@+id/toolBar"
242
            android:layout_width="match_parent"
83 243
            android:layout_height="50dp"
84 244
            app:layout_constraintBottom_toBottomOf="parent"
85 245
            tools:background="#00aee6">
@ -201,6 +361,6 @@
201 361
            </android.support.constraint.ConstraintLayout>
202 362
203 363
        </android.support.constraint.ConstraintLayout>
204
    </android.support.constraint.ConstraintLayout>
205 364
365
    </android.support.constraint.ConstraintLayout>
206 366
</android.support.constraint.ConstraintLayout>