class="lines-num lines-num-new"> 642
            });
643
599 644
        }
600 645
601 646
        private void setVideoAllCallBack() {

+ 29 - 0
app/src/main/java/com/electric/chargingpile/adapter/ChatPhotoFragmentPagerAdapter.java

@ -0,0 +1,29 @@
1
package com.electric.chargingpile.adapter;
2
3
import android.support.v4.app.Fragment;
4
import android.support.v4.app.FragmentManager;
5
import android.support.v4.app.FragmentPagerAdapter;
6
7
import com.electric.chargingpile.fragment.ChatPhotoFragment;
8
9
import java.util.ArrayList;
10
import java.util.List;
11
12
public class ChatPhotoFragmentPagerAdapter extends FragmentPagerAdapter {
13
    private List<ChatPhotoFragment> fragments = new ArrayList<>();
14
15
    public ChatPhotoFragmentPagerAdapter(FragmentManager fm, List<ChatPhotoFragment> fragments) {
16
        super(fm);
17
        this.fragments = fragments;
18
    }
19
20
    @Override
21
    public Fragment getItem(int i) {
22
        return fragments.get(i);
23
    }
24
25
    @Override
26
    public int getCount() {
27
        return fragments.size();
28
    }
29
}

+ 67 - 0
app/src/main/java/com/electric/chargingpile/fragment/ChatPhotoFragment.java

@ -0,0 +1,67 @@
1
package com.electric.chargingpile.fragment;
2
3
import android.os.Bundle;
4
import android.support.annotation.Nullable;
5
import android.support.v4.app.Fragment;
6
import android.util.Log;
7
import android.view.GestureDetector;
8
import android.view.LayoutInflater;
9
import android.view.MotionEvent;
10
import android.view.View;
11
import android.view.ViewGroup;
12
import android.widget.ImageView;
13
14
import com.electric.chargingpile.R;
15
import com.github.chrisbanes.photoview.PhotoView;
16
17
public class ChatPhotoFragment extends Fragment {
18
    private static final String TAG = "ChatPhotoFragment";
19
    private static final String ARG_URL = "url";
20
21
    public static ChatPhotoFragment newInstance(String url) {
22
        ChatPhotoFragment fragment = new ChatPhotoFragment();
23
        Bundle args = new Bundle();
24
        args.putString(ARG_URL, url);
25
        fragment.setArguments(args);
26
        return fragment;
27
    }
28
29
    public ChatPhotoFragment() {
30
    }
31
32
    @Nullable
33
    @Override
34
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
35
        String url = getArguments().getString(ARG_URL);
36
        View rootView = inflater.inflate(R.layout.fragment_chat_photo, container, false);
37
        initView(rootView, url);
38
        return rootView;
39
    }
40
41
    private void initView(View rootView,String url) {
42
        final PhotoView photoView = rootView.findViewById(R.id.photoView);
43
        photoView.setImageResource(R.drawable.bg_guide_one);
44
//        photoView.setScaleType(ImageView.ScaleType.FIT_XY);
45
        photoView.setOnDoubleTapListener(new GestureDetector.OnDoubleTapListener() {
46
            @Override
47
            public boolean onSingleTapConfirmed(MotionEvent motionEvent) {
48
                return false;
49
            }
50
51
            @Override
52
            public boolean onDoubleTap(MotionEvent motionEvent) {
53
                if (photoView.getScaleType() == ImageView.ScaleType.FIT_CENTER) {
54
                    photoView.setScaleType(ImageView.ScaleType.FIT_START);
55
                }
56
                Log.d(TAG, "onDoubleTap: " + photoView.getScaleType());
57
                return false;
58
            }
59
60
            @Override
61
            public boolean onDoubleTapEvent(MotionEvent motionEvent) {
62
63
                return false;
64
            }
65
        });
66
    }
67
}

+ 354 - 1
app/src/main/res/layout/fragment_chat_content_pictures.xml

@ -6,7 +6,360 @@
6 6
    android:layout_height="match_parent"
7 7
    android:background="#990545">
8 8
9
    <include layout="@layout/fragment_chat_content_common" />
9
    <android.support.v4.view.ViewPager
10
        android:id="@+id/photoPager"
11
        android:layout_width="match_parent"
12
        android:layout_height="0dp"
13
        app:layout_constraintBottom_toTopOf="@+id/bottomView"
14
        app:layout_constraintLeft_toLeftOf="parent"
15
        app:layout_constraintRight_toRightOf="parent"
16
        app:layout_constraintTop_toBottomOf="@+id/navBar"
17
        tools:background="#66bd00"></android.support.v4.view.ViewPager>
18
19
    <!--<include layout="@layout/fragment_chat_content_common" />-->
20
    <android.support.constraint.ConstraintLayout
21
        android:id="@+id/statusBar"
22
        android:layout_width="match_parent"
23
        android:layout_height="20dp"
24
        app:layout_constraintLeft_toLeftOf="parent"
25
        app:layout_constraintRight_toRightOf="parent"
26
        app:layout_constraintTop_toTopOf="parent"
27
        tools:background="#76daff" />
28
29
    <!-- 导航栏 -->
30
    <android.support.constraint.ConstraintLayout
31
        android:id="@+id/navBar"
32
        android:layout_width="match_parent"
33
        android:layout_height="44dp"
34
        app:layout_constraintLeft_toLeftOf="parent"
35
        app:layout_constraintRight_toRightOf="parent"
36
        app:layout_constraintTop_toBottomOf="@+id/statusBar"
37
        tools:background="#DC7633">
38
39
        <ImageView
40
            android:id="@+id/backIcon"
41
            android:layout_width="wrap_content"
42
            android:layout_height="match_parent"
43
            android:paddingLeft="20dp"
44
            android:paddingRight="20dp"
45
            android:src="@drawable/app_white_back_icon"
46
            app:layout_constraintLeft_toLeftOf="parent" />
47
48
        <ImageView
49
            android:id="@+id/moreIcon"
50
            android:layout_width="wrap_content"
51
            android:layout_height="match_parent"
52
            android:paddingLeft="20dp"
53
            android:paddingRight="20dp"
54
            android:src="@drawable/app_header_more_icon"
55
            app:layout_constraintRight_toRightOf="parent" />
56
57
        <TextView
58
            android:id="@+id/navTitle"
59
            android:layout_width="0dp"
60
            android:layout_height="wrap_content"
61
            android:gravity="center_horizontal"
62
            android:textColor="#ffffff"
63
            android:textSize="16dp"
64
            app:layout_constraintBottom_toBottomOf="parent"
65
            app:layout_constraintLeft_toRightOf="@+id/backIcon"
66
            app:layout_constraintRight_toLeftOf="@+id/moreIcon"
67
            app:layout_constraintTop_toTopOf="parent"
68
            tools:text="1/4" />
69
70
    </android.support.constraint.ConstraintLayout>
71
72
    <!-- 底部视图 -->
73
    <android.support.constraint.ConstraintLayout
74
        android:id="@+id/bottomView"
75
        android:layout_width="match_parent"
76
        android:layout_height="wrap_content"
77
        android:layout_marginBottom="-40dp"
78
        app:layout_constraintBottom_toBottomOf="parent"
79
        tools:background="#f38654">
80
81
        <!-- 主题信息及关闭按钮 -->
82
        <android.support.constraint.ConstraintLayout
83
            android:layout_width="match_parent"
84
            android:layout_height="52dp"
85
            app:layout_constraintBottom_toTopOf="@+id/userInfo"
86
            tools:background="#39bd00">
87
88
            <android.support.constraint.ConstraintLayout
89
                android:id="@+id/topicInfo"
90
                android:layout_width="wrap_content"
91
                android:layout_height="30dp"
92
                android:layout_marginLeft="15dp"
93
                android:background="@drawable/topic_shape"
94
                android:paddingLeft="12dp"
95
                android:paddingRight="12dp"
96
                app:layout_constraintBottom_toBottomOf="parent"
97
                app:layout_constraintLeft_toLeftOf="parent"
98
                app:layout_constraintTop_toTopOf="parent"
99
                tools:background="#ff967d">
100
101
                <ImageView
102
                    android:id="@+id/topicIcon"
103
                    android:layout_width="wrap_content"
104
                    android:layout_height="wrap_content"
105
                    android:src="@drawable/topic_icon"
106
                    app:layout_constraintBottom_toBottomOf="parent"
107
                    app:layout_constraintLeft_toLeftOf="parent"
108
                    app:layout_constraintTop_toTopOf="parent" />
109
110
                <TextView
111
                    android:id="@+id/topicTitle"
112
                    android:layout_width="wrap_content"
113
                    android:layout_height="wrap_content"
114
                    android:paddingLeft="5dp"
115
                    android:textColor="#ffffff"
116
                    android:textSize="11sp"
117
                    app:layout_constraintBottom_toBottomOf="parent"
118
                    app:layout_constraintLeft_toRightOf="@+id/topicIcon"
119
                    app:layout_constraintTop_toTopOf="parent"
120
                    tools:text="#新能源#" />
121
            </android.support.constraint.ConstraintLayout>
122
123
124
            <ImageView
125
                android:id="@+id/closeUnfold"
126
                android:layout_width="22dp"
127
                android:layout_height="22dp"
128
                android:layout_margin="15dp"
129
                android:src="@drawable/icon_close"
130
                android:visibility="gone"
131
                app:layout_constraintBottom_toBottomOf="parent"
132
                app:layout_constraintRight_toRightOf="parent"
133
                app:layout_constraintTop_toTopOf="parent"
134
                tools:background="#013369"
135
                tools:visibility="visible" />
136
        </android.support.constraint.ConstraintLayout>
137
        <!-- 用户信息 -->
138
        <android.support.constraint.ConstraintLayout
139
            android:id="@+id/userInfo"
140
            android:layout_width="wrap_content"
141
            android:layout_height="wrap_content"
142
            android:layout_marginBottom="5dp"
143
            android:paddingLeft="15dp"
144
            app:layout_constraintBottom_toTopOf="@+id/msgContainer"
145
            app:layout_constraintLeft_toLeftOf="parent"
146
            tools:background="#33ccff">
147
148
            <ImageView
149
                android:id="@+id/headImage"
150
                android:layout_width="20dp"
151
                android:layout_height="20dp"
152
                app:layout_constraintBottom_toBottomOf="parent"
153
                app:layout_constraintLeft_toLeftOf="parent"
154
                app:layout_constraintTop_toTopOf="parent"
155
                tools:srcCompat="@tools:sample/avatars[1]" />
156
157
            <android.support.constraint.ConstraintLayout
158
                android:layout_width="wrap_content"
159
                android:layout_height="wrap_content"
160
                android:paddingLeft="5dp"
161
                app:layout_constraintBottom_toBottomOf="parent"
162
                app:layout_constraintLeft_toRightOf="@+id/headImage"
163
                app:layout_constraintTop_toTopOf="parent">
164
165
                <TextView
166
                    android:id="@+id/nickName"
167
                    android:layout_width="wrap_content"
168
                    android:layout_height="wrap_content"
169
                    android:textColor="#ffffff"
170
                    android:textSize="12sp"
171
                    app:layout_constraintLeft_toLeftOf="parent"
172
                    app:layout_constraintTop_toTopOf="parent"
173
                    tools:text="小电" />
174
175
                <TextView
176
                    android:id="@+id/addDate"
177
                    android:layout_width="wrap_content"
178
                    android:layout_height="wrap_content"
179
                    android:textColor="#888888"
180
                    android:textSize="12sp"
181
                    app:layout_constraintBottom_toBottomOf="parent"
182
                    app:layout_constraintLeft_toLeftOf="parent"
183
                    app:layout_constraintTop_toBottomOf="@+id/nickName"
184
                    tools:text="2019-05-29 16:28" />
185
            </android.support.constraint.ConstraintLayout>
186
        </android.support.constraint.ConstraintLayout>
187
188
        <!-- 信息 -->
189
        <android.support.constraint.ConstraintLayout
190
            android:id="@+id/msgContainer"
191
            android:layout_width="match_parent"
192
            android:layout_height="wrap_content"
193
            app:layout_constraintBottom_toTopOf="@+id/progressBar">
194
195
            <TextView
196
                android:id="@+id/msg"
197
                android:layout_width="0dp"
198
                android:layout_height="wrap_content"
199
                android:layout_marginRight="30dp"
200
                android:ellipsize="end"
201
                android:paddingLeft="40dp"
202
                android:paddingRight="10dp"
203
                android:paddingBottom="25dp"
204
                android:scrollbarStyle="outsideOverlay"
205
                android:scrollbars="vertical"
206
                android:textColor="#e2e2e2"
207
                android:textSize="14sp"
208
                app:layout_constraintBottom_toBottomOf="parent"
209
                app:layout_constraintLeft_toLeftOf="parent"
210
                app:layout_constraintRight_toRightOf="parent"
211
                app:layout_constraintTop_toTopOf="parent"
212
                tools:text="迪克啥看来当减肥考虑送到,迪克啥看来当减肥考虑送到迪克啥看来当减肥考虑送到" />
213
214
            <ImageView
215
                android:id="@+id/fold"
216
                android:layout_width="42dp"
217
                android:layout_height="62dp"
218
                android:paddingLeft="15dp"
219
                android:paddingTop="25dp"
220
                android:paddingRight="15dp"
221
                android:paddingBottom="25dp"
222
                android:src="@drawable/unfold_icon"
223
                app:layout_constraintBottom_toBottomOf="parent"
224
                app:layout_constraintRight_toRightOf="parent" />
225
        </android.support.constraint.ConstraintLayout>
226
        <!-- 自定义进度条 -->
227
        <ProgressBar
228
            android:id="@+id/progressBar"
229
            style="@android:style/Widget.ProgressBar.Horizontal"
230
            android:layout_width="match_parent"
231
            android:layout_height="1dp"
232
            android:max="100"
233
            android:progressDrawable="@drawable/video_player_progressbar"
234
            app:layout_constraintBottom_toTopOf="@+id/toolBar"
235
            tools:progress="50" />
236
        <!-- 底部工具栏 -->
237
        <android.support.constraint.ConstraintLayout
238
            android:id="@+id/toolBar"
239
            android:layout_width="match_parent"
240
            android:layout_height="50dp"
241
            app:layout_constraintBottom_toBottomOf="parent"
242
            tools:background="#00aee6">
243
244
            <!-- 写评论-->
245
            <android.support.constraint.ConstraintLayout
246
                android:id="@+id/writeComment"
247
                android:layout_width="wrap_content"
248
                android:layout_height="match_parent"
249
                android:paddingLeft="15dp"
250
                android:paddingRight="15dp"
251
                app:layout_constraintLeft_toLeftOf="parent">
252
253
                <ImageView
254
                    android:id="@+id/WriteCommentIcon"
255
                    android:layout_width="wrap_content"
256
                    android:layout_height="wrap_content"
257
                    app:layout_constraintBottom_toBottomOf="parent"
258
                    app:layout_constraintLeft_toLeftOf="parent"
259
                    app:layout_constraintTop_toTopOf="parent"
260
                    app:srcCompat="@drawable/write_comment_icon" />
261
262
                <TextView
263
                    android:layout_width="wrap_content"
264
                    android:layout_height="match_parent"
265
                    android:gravity="center"
266
                    android:paddingLeft="3dp"
267
                    android:text="写评论"
268
                    android:textColor="#c2c2c2"
269
                    android:textSize="12sp"
270
                    app:layout_constraintLeft_toRightOf="@+id/WriteCommentIcon" />
271
            </android.support.constraint.ConstraintLayout>
272
273
            <!-- 转发 -->
274
            <android.support.constraint.ConstraintLayout
275
                android:id="@+id/transmit"
276
                android:layout_width="wrap_content"
277
                android:layout_height="match_parent"
278
                android:paddingLeft="15dp"
279
                android:paddingRight="15dp"
280
                app:layout_constraintRight_toRightOf="parent">
281
282
                <ImageView
283
                    android:layout_width="wrap_content"
284
                    android:layout_height="wrap_content"
285
                    android:paddingRight="3dp"
286
                    app:layout_constraintBottom_toBottomOf="parent"
287
                    app:layout_constraintRight_toLeftOf="@+id/transmitLabel"
288
                    app:layout_constraintTop_toTopOf="parent"
289
                    app:srcCompat="@drawable/transmit_icon" />
290
291
                <TextView
292
                    android:id="@+id/transmitLabel"
293
                    android:layout_width="wrap_content"
294
                    android:layout_height="match_parent"
295
                    android:gravity="center"
296
                    android:paddingLeft="3dp"
297
                    android:text="转发"
298
                    android:textColor="#888888"
299
                    android:textSize="12sp"
300
                    app:layout_constraintRight_toRightOf="parent" />
301
            </android.support.constraint.ConstraintLayout>
302
303
            <!-- 评论列表 -->
304
            <android.support.constraint.ConstraintLayout
305
                android:id="@+id/comment"
306
                android:layout_width="wrap_content"
307
                android:layout_height="match_parent"
308
                android:paddingLeft="15dp"
309
                android:paddingRight="15dp"
310
                app:layout_constraintRight_toLeftOf="@+id/transmit">
311
312
                <ImageView
313
                    android:layout_width="wrap_content"
314
                    android:layout_height="wrap_content"
315
                    android:src="@drawable/comment_icon"
316
                    app:layout_constraintBottom_toBottomOf="parent"
317
                    app:layout_constraintRight_toLeftOf="@+id/commentNumber"
318
                    app:layout_constraintTop_toTopOf="parent" />
319
320
                <TextView
321
                    android:id="@+id/commentNumber"
322
                    android:layout_width="wrap_content"
323
                    android:layout_height="match_parent"
324
                    android:gravity="center"
325
                    android:paddingLeft="3dp"
326
                    android:textColor="#888888"
327
                    android:textSize="12sp"
328
                    app:layout_constraintRight_toRightOf="parent"
329
                    tools:text="123" />
330
331
            </android.support.constraint.ConstraintLayout>
332
            <!-- 点赞 -->
333
            <android.support.constraint.ConstraintLayout
334
                android:id="@+id/like"
335
                android:layout_width="wrap_content"
336
                android:layout_height="match_parent"
337
                app:layout_constraintRight_toLeftOf="@+id/comment">
338
339
                <ImageView
340
                    android:id="@+id/likeIcon"
341
                    android:layout_width="wrap_content"
342
                    android:layout_height="wrap_content"
343
                    android:src="@drawable/like_icon"
344
                    app:layout_constraintBottom_toBottomOf="parent"
345
                    app:layout_constraintRight_toLeftOf="@+id/likeLabel"
346
                    app:layout_constraintTop_toTopOf="parent" />
347
348
                <TextView
349
                    android:id="@+id/likeLabel"
350
                    android:layout_width="wrap_content"
351
                    android:layout_height="match_parent"
352
                    android:gravity="center"
353
                    android:paddingLeft="3dp"
354
                    android:textColor="#888888"
355
                    android:textSize="12sp"
356
                    app:layout_constraintRight_toRightOf="parent"
357
                    tools:text="999+" />
358
            </android.support.constraint.ConstraintLayout>
359
360
        </android.support.constraint.ConstraintLayout>
361
362
    </android.support.constraint.ConstraintLayout>
10 363
11 364
    <include
12 365
        layout="@layout/fragment_chat_content_comment_list"

+ 332 - 1
app/src/main/res/layout/fragment_chat_content_video.xml

@ -44,7 +44,338 @@
44 44
45 45
    </android.support.constraint.ConstraintLayout>
46 46
47
    <include layout="@layout/fragment_chat_content_common" />
47
    <!--<include layout="@layout/fragment_chat_content_common" />-->
48
49
    <android.support.constraint.ConstraintLayout
50
        android:id="@+id/statusBar"
51
        android:layout_width="match_parent"
52
        android:layout_height="20dp"
53
        tools:background="#76daff"
54
        app:layout_constraintLeft_toLeftOf="parent"
55
        app:layout_constraintRight_toRightOf="parent"
56
        app:layout_constraintTop_toTopOf="parent" />
57
58
    <!-- 导航栏 -->
59
    <android.support.constraint.ConstraintLayout
60
        android:id="@+id/navBar"
61
        android:layout_width="match_parent"
62
        android:layout_height="44dp"
63
        app:layout_constraintLeft_toLeftOf="parent"
64
        app:layout_constraintRight_toRightOf="parent"
65
        app:layout_constraintTop_toBottomOf="@+id/statusBar"
66
        tools:background="#DC7633">
67
68
        <ImageView
69
            android:id="@+id/backIcon"
70
            android:layout_width="wrap_content"
71
            android:layout_height="match_parent"
72
            android:paddingLeft="20dp"
73
            android:paddingRight="20dp"
74
            android:src="@drawable/app_white_back_icon"
75
            app:layout_constraintLeft_toLeftOf="parent" />
76
77
        <ImageView
78
            android:id="@+id/moreIcon"
79
            android:layout_width="wrap_content"
80
            android:layout_height="match_parent"
81
            android:paddingLeft="20dp"
82
            android:paddingRight="20dp"
83
            android:src="@drawable/app_header_more_icon"
84
            app:layout_constraintRight_toRightOf="parent" />
85
86
    </android.support.constraint.ConstraintLayout>
87
88
    <!-- 底部视图 -->
89
    <android.support.constraint.ConstraintLayout
90
        android:id="@+id/bottomView"
91
        android:layout_width="match_parent"
92
        android:layout_height="wrap_content"
93
        android:layout_marginBottom="-40dp"
94
        app:layout_constraintBottom_toBottomOf="parent"
95
        tools:background="#f38654">
96
97
        <!-- 主题信息及关闭按钮 -->
98
        <android.support.constraint.ConstraintLayout
99
            android:layout_width="match_parent"
100
            android:layout_height="52dp"
101
            app:layout_constraintBottom_toTopOf="@+id/userInfo"
102
            tools:background="#39bd00">
103
104
            <android.support.constraint.ConstraintLayout
105
                android:id="@+id/topicInfo"
106
                android:layout_width="wrap_content"
107
                android:layout_height="30dp"
108
                android:layout_marginLeft="15dp"
109
                android:background="@drawable/topic_shape"
110
                android:paddingLeft="12dp"
111
                android:paddingRight="12dp"
112
                app:layout_constraintBottom_toBottomOf="parent"
113
                app:layout_constraintLeft_toLeftOf="parent"
114
                app:layout_constraintTop_toTopOf="parent"
115
                tools:background="#ff967d">
116
117
                <ImageView
118
                    android:id="@+id/topicIcon"
119
                    android:layout_width="wrap_content"
120
                    android:layout_height="wrap_content"
121
                    android:src="@drawable/topic_icon"
122
                    app:layout_constraintBottom_toBottomOf="parent"
123
                    app:layout_constraintLeft_toLeftOf="parent"
124
                    app:layout_constraintTop_toTopOf="parent" />
125
126
                <TextView
127
                    android:id="@+id/topicTitle"
128
                    android:layout_width="wrap_content"
129
                    android:layout_height="wrap_content"
130
                    android:paddingLeft="5dp"
131
                    android:textColor="#ffffff"
132
                    android:textSize="11sp"
133
                    app:layout_constraintBottom_toBottomOf="parent"
134
                    app:layout_constraintLeft_toRightOf="@+id/topicIcon"
135
                    app:layout_constraintTop_toTopOf="parent"
136
                    tools:text="#新能源#" />
137
            </android.support.constraint.ConstraintLayout>
138
139
140
            <ImageView
141
                android:id="@+id/closeUnfold"
142
                android:layout_width="22dp"
143
                android:layout_height="22dp"
144
                android:layout_margin="15dp"
145
                android:src="@drawable/icon_close"
146
                android:visibility="gone"
147
                app:layout_constraintBottom_toBottomOf="parent"
148
                app:layout_constraintRight_toRightOf="parent"
149
                app:layout_constraintTop_toTopOf="parent"
150
                tools:background="#013369"
151
                tools:visibility="visible" />
152
        </android.support.constraint.ConstraintLayout>
153
        <!-- 用户信息 -->
154
        <android.support.constraint.ConstraintLayout
155
            android:id="@+id/userInfo"
156
            android:layout_width="wrap_content"
157
            android:layout_height="wrap_content"
158
            android:layout_marginBottom="5dp"
159
            android:paddingLeft="15dp"
160
            app:layout_constraintBottom_toTopOf="@+id/msgContainer"
161
            app:layout_constraintLeft_toLeftOf="parent"
162
            tools:background="#33ccff">
163
164
            <ImageView
165
                android:id="@+id/headImage"
166
                android:layout_width="20dp"
167
                android:layout_height="20dp"
168
                app:layout_constraintBottom_toBottomOf="parent"
169
                app:layout_constraintLeft_toLeftOf="parent"
170
                app:layout_constraintTop_toTopOf="parent"
171
                tools:srcCompat="@tools:sample/avatars[1]" />
172
173
            <android.support.constraint.ConstraintLayout
174
                android:layout_width="wrap_content"
175
                android:layout_height="wrap_content"
176
                android:paddingLeft="5dp"
177
                app:layout_constraintBottom_toBottomOf="parent"
178
                app:layout_constraintLeft_toRightOf="@+id/headImage"
179
                app:layout_constraintTop_toTopOf="parent">
180
181
                <TextView
182
                    android:id="@+id/nickName"
183
                    android:layout_width="wrap_content"
184
                    android:layout_height="wrap_content"
185
                    android:textColor="#ffffff"
186
                    android:textSize="12sp"
187
                    app:layout_constraintLeft_toLeftOf="parent"
188
                    app:layout_constraintTop_toTopOf="parent"
189
                    tools:text="小电" />
190
191
                <TextView
192
                    android:id="@+id/addDate"
193
                    android:layout_width="wrap_content"
194
                    android:layout_height="wrap_content"
195
                    android:textColor="#888888"
196
                    android:textSize="12sp"
197
                    app:layout_constraintBottom_toBottomOf="parent"
198
                    app:layout_constraintLeft_toLeftOf="parent"
199
                    app:layout_constraintTop_toBottomOf="@+id/nickName"
200
                    tools:text="2019-05-29 16:28" />
201
            </android.support.constraint.ConstraintLayout>
202
        </android.support.constraint.ConstraintLayout>
203
204
        <!-- 信息 -->
205
        <android.support.constraint.ConstraintLayout
206
            android:id="@+id/msgContainer"
207
            android:layout_width="match_parent"
208
            android:layout_height="wrap_content"
209
            app:layout_constraintBottom_toTopOf="@+id/progressBar">
210
211
            <TextView
212
                android:id="@+id/msg"
213
                android:layout_width="0dp"
214
                android:layout_height="wrap_content"
215
                android:layout_marginRight="30dp"
216
                android:ellipsize="end"
217
                android:paddingLeft="40dp"
218
                android:paddingRight="10dp"
219
                android:paddingBottom="25dp"
220
                android:scrollbarStyle="outsideOverlay"
221
                android:scrollbars="vertical"
222
                android:textColor="#e2e2e2"
223
                android:textSize="14sp"
224
                app:layout_constraintBottom_toBottomOf="parent"
225
                app:layout_constraintLeft_toLeftOf="parent"
226
                app:layout_constraintRight_toRightOf="parent"
227
                app:layout_constraintTop_toTopOf="parent"
228
                tools:text="迪克啥看来当减肥考虑送到,迪克啥看来当减肥考虑送到迪克啥看来当减肥考虑送到" />
229
230
            <ImageView
231
                android:id="@+id/fold"
232
                android:layout_width="42dp"
233
                android:layout_height="62dp"
234
                android:paddingLeft="15dp"
235
                android:paddingTop="25dp"
236
                android:paddingRight="15dp"
237
                android:paddingBottom="25dp"
238
                android:src="@drawable/unfold_icon"
239
                app:layout_constraintBottom_toBottomOf="parent"
240
                app:layout_constraintRight_toRightOf="parent" />
241
        </android.support.constraint.ConstraintLayout>
242
        <!-- 自定义进度条 -->
243
        <ProgressBar
244
            android:id="@+id/progressBar"
245
            style="@android:style/Widget.ProgressBar.Horizontal"
246
            android:layout_width="match_parent"
247
            android:layout_height="1dp"
248
            android:max="100"
249
            android:progressDrawable="@drawable/video_player_progressbar"
250
            app:layout_constraintBottom_toTopOf="@+id/toolBar"
251
            tools:progress="50" />
252
        <!-- 底部工具栏 -->
253
        <android.support.constraint.ConstraintLayout
254
            android:id="@+id/toolBar"
255
            android:layout_width="match_parent"
256
            android:layout_height="50dp"
257
            app:layout_constraintBottom_toBottomOf="parent"
258
            tools:background="#00aee6">
259
260
            <!-- 写评论-->
261
            <android.support.constraint.ConstraintLayout
262
                android:id="@+id/writeComment"
263
                android:layout_width="wrap_content"
264
                android:layout_height="match_parent"
265
                android:paddingLeft="15dp"
266
                android:paddingRight="15dp"
267
                app:layout_constraintLeft_toLeftOf="parent">
268
269
                <ImageView
270
                    android:id="@+id/WriteCommentIcon"
271
                    android:layout_width="wrap_content"
272
                    android:layout_height="wrap_content"
273
                    app:layout_constraintBottom_toBottomOf="parent"
274
                    app:layout_constraintLeft_toLeftOf="parent"
275
                    app:layout_constraintTop_toTopOf="parent"
276
                    app:srcCompat="@drawable/write_comment_icon" />
277
278
                <TextView
279
                    android:layout_width="wrap_content"
280
                    android:layout_height="match_parent"
281
                    android:gravity="center"
282
                    android:paddingLeft="3dp"
283
                    android:text="写评论"
284
                    android:textColor="#c2c2c2"
285
                    android:textSize="12sp"
286
                    app:layout_constraintLeft_toRightOf="@+id/WriteCommentIcon" />
287
            </android.support.constraint.ConstraintLayout>
288
289
            <!-- 转发 -->
290
            <android.support.constraint.ConstraintLayout
291
                android:id="@+id/transmit"
292
                android:layout_width="wrap_content"
293
                android:layout_height="match_parent"
294
                android:paddingLeft="15dp"
295
                android:paddingRight="15dp"
296
                app:layout_constraintRight_toRightOf="parent">
297
298
                <ImageView
299
                    android:layout_width="wrap_content"
300
                    android:layout_height="wrap_content"
301
                    android:paddingRight="3dp"
302
                    app:layout_constraintBottom_toBottomOf="parent"
303
                    app:layout_constraintRight_toLeftOf="@+id/transmitLabel"
304
                    app:layout_constraintTop_toTopOf="parent"
305
                    app:srcCompat="@drawable/transmit_icon" />
306
307
                <TextView
308
                    android:id="@+id/transmitLabel"
309
                    android:layout_width="wrap_content"
310
                    android:layout_height="match_parent"
311
                    android:gravity="center"
312
                    android:paddingLeft="3dp"
313
                    android:text="转发"
314
                    android:textColor="#888888"
315
                    android:textSize="12sp"
316
                    app:layout_constraintRight_toRightOf="parent" />
317
            </android.support.constraint.ConstraintLayout>
318
319
            <!-- 评论列表 -->
320
            <android.support.constraint.ConstraintLayout
321
                android:id="@+id/comment"
322
                android:layout_width="wrap_content"
323
                android:layout_height="match_parent"
324
                android:paddingLeft="15dp"
325
                android:paddingRight="15dp"
326
                app:layout_constraintRight_toLeftOf="@+id/transmit">
327
328
                <ImageView
329
                    android:layout_width="wrap_content"
330
                    android:layout_height="wrap_content"
331
                    android:src="@drawable/comment_icon"
332
                    app:layout_constraintBottom_toBottomOf="parent"
333
                    app:layout_constraintRight_toLeftOf="@+id/commentNumber"
334
                    app:layout_constraintTop_toTopOf="parent" />
335
336
                <TextView
337
                    android:id="@+id/commentNumber"
338
                    android:layout_width="wrap_content"
339
                    android:layout_height="match_parent"
340
                    android:gravity="center"
341
                    android:paddingLeft="3dp"
342
                    android:textColor="#888888"
343
                    android:textSize="12sp"
344
                    app:layout_constraintRight_toRightOf="parent"
345
                    tools:text="123" />
346
347
            </android.support.constraint.ConstraintLayout>
348
            <!-- 点赞 -->
349
            <android.support.constraint.ConstraintLayout
350
                android:id="@+id/like"
351
                android:layout_width="wrap_content"
352
                android:layout_height="match_parent"
353
                app:layout_constraintRight_toLeftOf="@+id/comment">
354
355
                <ImageView
356
                    android:id="@+id/likeIcon"
357
                    android:layout_width="wrap_content"
358
                    android:layout_height="wrap_content"
359
                    android:src="@drawable/like_icon"
360
                    app:layout_constraintBottom_toBottomOf="parent"
361
                    app:layout_constraintRight_toLeftOf="@+id/likeLabel"
362
                    app:layout_constraintTop_toTopOf="parent" />
363
364
                <TextView
365
                    android:id="@+id/likeLabel"
366
                    android:layout_width="wrap_content"
367
                    android:layout_height="match_parent"
368
                    android:gravity="center"
369
                    android:paddingLeft="3dp"
370
                    android:textColor="#888888"
371
                    android:textSize="12sp"
372
                    app:layout_constraintRight_toRightOf="parent"
373
                    tools:text="999+" />
374
            </android.support.constraint.ConstraintLayout>
375
376
        </android.support.constraint.ConstraintLayout>
377
378
    </android.support.constraint.ConstraintLayout>
48 379
49 380
    <include
50 381
        layout="@layout/fragment_chat_content_comment_list"

+ 13 - 0
app/src/main/res/layout/fragment_chat_photo.xml

@ -0,0 +1,13 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout
3
    xmlns:android="http://schemas.android.com/apk/res/android"
4
    xmlns:app="http://schemas.android.com/apk/res-auto"
5
    xmlns:tools="http://schemas.android.com/tools"
6
    android:layout_width="match_parent"
7
    android:layout_height="match_parent">
8
9
    <com.github.chrisbanes.photoview.PhotoView
10
        android:id="@+id/photoView"
11
        android:layout_width="match_parent"
12
        android:layout_height="match_parent" />
13
</android.support.constraint.ConstraintLayout>

话题详情开发 · d55e574519 - Gogs: Go Git Service
Ver Código Fonte

话题详情开发

huyuguo 7 anos atrás
pai
commit
d55e574519

+ 34 - 1
app/src/main/java/com/electric/chargingpile/activity/TopicDetailActivity.java

@ -3,22 +3,55 @@ package com.electric.chargingpile.activity;
3 3
import android.os.Bundle;
4 4
import android.support.annotation.Nullable;
5 5
import android.support.v7.app.AppCompatActivity;
6
import android.support.v7.widget.RecyclerView;
6 7
import android.view.View;
8
import android.widget.TextView;
9
10
import com.andview.refreshview.XRefreshView;
7 11
import com.electric.chargingpile.R;
8 12
9 13
/**
10 14
 * @desc 话题详情
11 15
 */
12 16
public class TopicDetailActivity extends AppCompatActivity implements View.OnClickListener {
17
18
    private TextView titleTextView;
19
    private XRefreshView xRefreshView;
20
    private RecyclerView recyclerView;
21
13 22
    @Override
14 23
    protected void onCreate(@Nullable Bundle savedInstanceState) {
15 24
        super.onCreate(savedInstanceState);
16
        setContentView(R.layout.activity_topic_details_info);
25
        setContentView(R.layout.activity_topic_detail);
26
        initView();
27
        initListener();
28
    }
29
30
    private void initView() {
31
        titleTextView = findViewById(R.id.titleTextView);
32
        xRefreshView = findViewById(R.id.xRefreshView);
33
        recyclerView = findViewById(R.id.recyclerView);
17 34
    }
18 35
36
    private void initListener() {
37
        findViewById(R.id.backImageView).setOnClickListener(this);
38
        findViewById(R.id.shareTextView).setOnClickListener(this);
39
    }
19 40
20 41
    @Override
21 42
    public void onClick(View view) {
43
        switch (view.getId()) {
44
            case R.id.backImageView:
45
                finish();
46
                break;
47
            case R.id.shareTextView:
48
                shareInfo();
49
                break;
50
        }
51
52
    }
22 53
54
    private void shareInfo() {
55
        // TODO by huyuguo share information
23 56
    }
24 57
}

+ 111 - 0
app/src/main/java/com/electric/chargingpile/adapter/TopicDetailAdapter.java

@ -0,0 +1,111 @@
1
package com.electric.chargingpile.adapter;
2
3
import android.content.Context;
4
import android.support.v7.widget.RecyclerView;
5
import android.view.LayoutInflater;
6
import android.view.View;
7
import android.view.ViewGroup;
8
import android.widget.ArrayAdapter;
9
10
import com.aspsine.irecyclerview.IViewHolder;
11
import com.electric.chargingpile.R;
12
import com.electric.chargingpile.data.ChatRecommendBean;
13
import com.electric.chargingpile.data.TopicDetailBeanLab;
14
15
import java.util.ArrayList;
16
17
public class TopicDetailAdapter extends RecyclerView.Adapter<IViewHolder> {
18
    public static final int TOPIC_DETAIL_HEADER = 1;
19
    public static final int TOPIC_DETAIL_CONTENT = 2;
20
    private Context context;
21
    private LayoutInflater layoutInflater;
22
    private final TopicDetailBeanLab beanLab;
23
    private ChatRecommendBean topicDetailBean;
24
25
    public TopicDetailAdapter(Context context) {
26
        this.context = context;
27
        this.layoutInflater = LayoutInflater.from(context);
28
        beanLab = TopicDetailBeanLab.get(context);
29
    }
30
31
    @Override
32
    public IViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
33
        View itemView = null;
34
        IViewHolder viewHolder = null;
35
        switch (viewType) {
36
            case TOPIC_DETAIL_HEADER:
37
                itemView = layoutInflater.inflate(R.layout.activity_topic_detail_header, parent, false);
38
                viewHolder = new HeaderViewHolder(itemView);
39
                break;
40
            case TOPIC_DETAIL_CONTENT:
41
                itemView = layoutInflater.inflate(R.layout.activity_chat_content, parent, false);
42
                viewHolder = new ContentViewHolder(itemView);
43
                break;
44
        }
45
        return viewHolder;
46
    }
47
48
    @Override
49
    public void onBindViewHolder(IViewHolder viewHolder, int position) {
50
        switch (viewHolder.getItemViewType()) {
51
            case TOPIC_DETAIL_HEADER:
52
                bindHeaderViewHolder(viewHolder, position);
53
                break;
54
            case TOPIC_DETAIL_CONTENT:
55
                bindContentViewHolder(viewHolder, position);
56
                break;
57
        }
58
    }
59
60
    @Override
61
    public int getItemCount() {
62
        return beanLab.beans().size() + 1;
63
    }
64
65
    @Override
66
    public int getItemViewType(int position) {
67
        return position == 0 ? TOPIC_DETAIL_HEADER : TOPIC_DETAIL_CONTENT;
68
    }
69
70
    private void bindHeaderViewHolder(IViewHolder viewHolder, int position) {
71
        HeaderViewHolder headerViewHolder = (HeaderViewHolder)viewHolder;
72
73
    }
74
75
    private void bindContentViewHolder(IViewHolder viewHolder, int position) {
76
77
    }
78
79
    public void setContentData(ArrayList<ChatRecommendBean> beans) {
80
        beanLab.clear();
81
        beanLab.add(beans);
82
        notifyDataSetChanged();
83
    }
84
85
    public void addContentData(ArrayList<ChatRecommendBean> beans) {
86
        int startSize = beanLab.beans().size();
87
        beanLab.add(beans);
88
        int endSize = beanLab.beans().size();
89
        notifyItemRangeChanged(startSize, endSize);
90
    }
91
92
    public void setHeaderData(ChatRecommendBean bean) {
93
        topicDetailBean = bean;
94
    }
95
96
    class HeaderViewHolder extends IViewHolder {
97
        public HeaderViewHolder(View itemView) {
98
            super(itemView);
99
        }
100
101
    }
102
103
    class ContentViewHolder extends IViewHolder {
104
105
        public ContentViewHolder(View itemView) {
106
            super(itemView);
107
        }
108
    }
109
110
111
}

+ 45 - 0
app/src/main/java/com/electric/chargingpile/data/TopicDetailBeanLab.java

@ -0,0 +1,45 @@
1
package com.electric.chargingpile.data;
2
3
import android.content.Context;
4
5
import java.util.ArrayList;
6
import java.util.List;
7
8
public class TopicDetailBeanLab {
9
    private static TopicDetailBeanLab topicDetailBeanLab;
10
    private List<ChatRecommendBean> beans;
11
12
    public static TopicDetailBeanLab get(Context context) {
13
        if (topicDetailBeanLab == null) {
14
            topicDetailBeanLab = new TopicDetailBeanLab(context);
15
        }
16
17
        return topicDetailBeanLab;
18
    }
19
20
    private TopicDetailBeanLab(Context context) {
21
        beans = new ArrayList<>();
22
    }
23
24
    public List<ChatRecommendBean> beans() {
25
        return beans;
26
    }
27
28
    public ChatRecommendBean bean(int topicId) {
29
        for (ChatRecommendBean bean : beans) {
30
            if (bean.topicId == topicId) {
31
                return bean;
32
            }
33
        }
34
        return null;
35
    }
36
37
    public void clear() {
38
        beans.clear();
39
    }
40
41
42
    public void add(List<ChatRecommendBean> list) {
43
        beans.addAll(list);
44
    }
45
}

BIN
app/src/main/res/drawable-hdpi/app_publish_item_qa.png


BIN
app/src/main/res/drawable-hdpi/chat_publish_tips.png


BIN
app/src/main/res/drawable-hdpi/提问.png


app/src/main/res/drawable-mdpi/提问.png → app/src/main/res/drawable-mdpi/app_publish_item_qa.png


BIN
app/src/main/res/drawable-mdpi/chat_publish_tips.png


app/src/main/res/drawable-xhdpi/提问.png → app/src/main/res/drawable-xhdpi/app_publish_item_qa.png


BIN
app/src/main/res/drawable-xhdpi/chat_publish_tips.png


app/src/main/res/drawable-xxhdpi/提问.png → app/src/main/res/drawable-xxhdpi/app_publish_item_qa.png


BIN
app/src/main/res/drawable-xxhdpi/chat_publish_tips.png


app/src/main/res/drawable-xxxhdpi/提问.png → app/src/main/res/drawable-xxxhdpi/app_publish_item_qa.png


app/src/main/res/drawable-xxxhdpi/发布.png → app/src/main/res/drawable-xxxhdpi/chat_publish_icon.png


BIN
app/src/main/res/drawable-xxxhdpi/chat_publish_tips.png


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

@ -0,0 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout
3
    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4
    android:layout_height="match_parent">
5
6
</android.support.constraint.ConstraintLayout>

+ 100 - 0
app/src/main/res/layout/activity_topic_detail.xml

@ -0,0 +1,100 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="#f4f4f4"
8
    tools:context=".activity.TopicDetailActivity">
9
10
    <android.support.constraint.ConstraintLayout
11
        android:id="@+id/navBar"
12
        android:layout_width="0dp"
13
        android:layout_height="44dp"
14
        app:layout_constraintEnd_toEndOf="parent"
15
        app:layout_constraintStart_toStartOf="parent"
16
        app:layout_constraintTop_toTopOf="parent">
17
18
        <ImageView
19
            android:id="@+id/backImageView"
20
            android:layout_width="wrap_content"
21
            android:layout_height="wrap_content"
22
            android:paddingLeft="16dp"
23
            android:paddingTop="5dp"
24
            android:paddingRight="16dp"
25
            android:paddingBottom="5dp"
26
            app:layout_constraintBottom_toBottomOf="parent"
27
            app:layout_constraintStart_toStartOf="parent"
28
            app:layout_constraintTop_toTopOf="parent"
29
            app:srcCompat="@drawable/icon_lvback1119" />
30
31
        <TextView
32
            android:id="@+id/shareTextView"
33
            android:layout_width="wrap_content"
34
            android:layout_height="0dp"
35
            android:gravity="center"
36
            android:paddingLeft="16dp"
37
            android:paddingRight="16dp"
38
            android:text="分享"
39
            android:textColor="#222222"
40
            android:textSize="15sp"
41
            app:layout_constraintBottom_toBottomOf="parent"
42
            app:layout_constraintEnd_toEndOf="parent"
43
            app:layout_constraintTop_toTopOf="parent" />
44
45
        <TextView
46
            android:id="@+id/titleTextView"
47
            android:layout_width="wrap_content"
48
            android:layout_height="0dp"
49
            android:layout_marginStart="8dp"
50
            android:layout_marginEnd="8dp"
51
            android:gravity="center"
52
            android:textColor="#222222"
53
            android:textSize="17sp"
54
            android:textStyle="bold"
55
            app:layout_constraintBottom_toBottomOf="parent"
56
            app:layout_constraintEnd_toStartOf="@+id/shareTextView"
57
            app:layout_constraintStart_toEndOf="@+id/backImageView"
58
            app:layout_constraintTop_toTopOf="parent"
59
            tools:text="TextView" />
60
    </android.support.constraint.ConstraintLayout>
61
62
    <com.andview.refreshview.XRefreshView
63
        android:id="@+id/xRefreshView"
64
        android:layout_width="0dp"
65
        android:layout_height="0dp"
66
        app:layout_constraintBottom_toBottomOf="parent"
67
        app:layout_constraintEnd_toEndOf="parent"
68
        app:layout_constraintStart_toStartOf="parent"
69
        app:layout_constraintTop_toBottomOf="@+id/navBar">
70
71
        <android.support.v7.widget.RecyclerView
72
            android:id="@+id/recyclerView"
73
            android:layout_width="match_parent"
74
            android:layout_height="match_parent"
75
            android:scrollbars="vertical" />
76
77
    </com.andview.refreshview.XRefreshView>
78
79
    <ImageView
80
        android:id="@+id/chatPublishIcon"
81
        android:layout_width="wrap_content"
82
        android:layout_height="wrap_content"
83
        android:layout_marginRight="20dp"
84
        android:layout_marginBottom="30dp"
85
        android:src="@drawable/chat_publish_icon"
86
        app:layout_constraintBottom_toBottomOf="parent"
87
        app:layout_constraintRight_toRightOf="parent" />
88
89
    <ImageView
90
        android:id="@+id/chatPublishTips"
91
        android:layout_width="wrap_content"
92
        android:layout_height="wrap_content"
93
        android:layout_marginRight="5dp"
94
        android:src="@drawable/chat_publish_tips"
95
        app:layout_constraintBottom_toBottomOf="@+id/chatPublishIcon"
96
        app:layout_constraintRight_toLeftOf="@+id/chatPublishIcon"
97
        app:layout_constraintTop_toTopOf="@+id/chatPublishIcon" />
98
99
100
</android.support.constraint.ConstraintLayout>

+ 119 - 0
app/src/main/res/layout/activity_topic_detail_header.xml

@ -0,0 +1,119 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="260dp">
7
8
    <android.support.constraint.ConstraintLayout
9
        android:layout_width="0dp"
10
        android:layout_height="200dp"
11
        android:background="#ffffff"
12
        app:layout_constraintEnd_toEndOf="parent"
13
        app:layout_constraintStart_toStartOf="parent"
14
        app:layout_constraintTop_toTopOf="parent">
15
16
        <ImageView
17
            android:id="@+id/headImage"
18
            android:layout_width="71dp"
19
            android:layout_height="60dp"
20
            android:layout_marginStart="15dp"
21
            android:layout_marginTop="15dp"
22
            app:layout_constraintStart_toStartOf="parent"
23
            app:layout_constraintTop_toTopOf="parent"
24
            tools:srcCompat="@tools:sample/avatars" />
25
26
        <TextView
27
            android:id="@+id/title"
28
            android:layout_width="0dp"
29
            android:layout_height="0dp"
30
            android:layout_marginStart="5dp"
31
            android:layout_marginTop="5dp"
32
            android:layout_marginEnd="15dp"
33
            android:layout_marginBottom="5dp"
34
            android:gravity="center_vertical"
35
            android:maxLines="2"
36
            android:textColor="#222222"
37
            android:textSize="17sp"
38
            android:textStyle="bold"
39
            app:layout_constraintBottom_toBottomOf="@+id/headImage"
40
            app:layout_constraintEnd_toEndOf="parent"
41
            app:layout_constraintStart_toEndOf="@+id/headImage"
42
            app:layout_constraintTop_toTopOf="@+id/headImage"
43
            tools:text="#车主说车#" />
44
45
        <TextView
46
            android:id="@+id/desc"
47
            android:layout_width="0dp"
48
            android:layout_height="wrap_content"
49
            android:layout_marginStart="15dp"
50
            android:layout_marginTop="15dp"
51
            android:layout_marginEnd="15dp"
52
            android:maxLines="3"
53
            android:textColor="#555555"
54
            android:textSize="15sp"
55
            app:layout_constraintEnd_toEndOf="parent"
56
            app:layout_constraintStart_toStartOf="parent"
57
            app:layout_constraintTop_toBottomOf="@+id/headImage"
58
            tools:text="电动小汽车,炫13.98万元起,魅15.98万元起,太值了!NEDC综合续航510km" />
59
60
        <TextView
61
            android:id="@+id/readLabel"
62
            android:layout_width="wrap_content"
63
            android:layout_height="wrap_content"
64
            android:layout_marginStart="15dp"
65
            android:layout_marginBottom="14dp"
66
            android:text="阅读"
67
            android:textColor="#555555"
68
            android:textSize="12sp"
69
            app:layout_constraintBottom_toBottomOf="parent"
70
            app:layout_constraintStart_toStartOf="parent" />
71
72
        <TextView
73
            android:id="@+id/readTextView"
74
            android:layout_width="wrap_content"
75
            android:layout_height="wrap_content"
76
            android:layout_marginStart="5dp"
77
            android:gravity="center_vertical"
78
            android:textSize="12sp"
79
            app:layout_constraintBottom_toBottomOf="@+id/readLabel"
80
            app:layout_constraintLeft_toRightOf="@+id/readLabel"
81
            app:layout_constraintTop_toTopOf="@+id/readLabel"
82
            tools:text="8" />
83
84
        <TextView
85
            android:id="@+id/joinLabel"
86
            android:layout_width="wrap_content"
87
            android:layout_height="wrap_content"
88
            android:layout_marginStart="30dp"
89
            android:gravity="center_vertical"
90
            android:text="参与"
91
            android:textColor="#555555"
92
            android:textSize="12sp"
93
            app:layout_constraintBottom_toBottomOf="@+id/readTextView"
94
            app:layout_constraintStart_toEndOf="@+id/readTextView"
95
            app:layout_constraintTop_toTopOf="@+id/readTextView" />
96
97
        <TextView
98
            android:id="@+id/joinTextView"
99
            android:layout_width="wrap_content"
100
            android:layout_height="wrap_content"
101
            android:layout_marginStart="5dp"
102
            android:gravity="center_vertical"
103
            android:text="32"
104
            android:textColor="#555555"
105
            android:textSize="12sp"
106
            app:layout_constraintBottom_toBottomOf="@+id/joinLabel"
107
            app:layout_constraintStart_toEndOf="@+id/joinLabel"
108
            app:layout_constraintTop_toTopOf="@+id/joinLabel" />
109
    </android.support.constraint.ConstraintLayout>
110
111
    <LinearLayout
112
        android:layout_width="0dp"
113
        android:layout_height="50dp"
114
        android:background="#ff00ff"
115
        android:orientation="horizontal"
116
        app:layout_constraintBottom_toBottomOf="parent"
117
        app:layout_constraintEnd_toEndOf="parent"
118
        app:layout_constraintStart_toStartOf="parent"></LinearLayout>
119
</android.support.constraint.ConstraintLayout>

+ 0 - 19
app/src/main/res/layout/activity_topic_details_info.xml

@ -1,19 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    tools:context=".activity.TopicDetailActivity">
8
9
    <com.andview.refreshview.XRefreshView
10
        android:layout_width="0dp"
11
        android:layout_height="0dp"
12
        app:layout_constraintBottom_toBottomOf="parent"
13
        app:layout_constraintEnd_toEndOf="parent"
14
        app:layout_constraintStart_toStartOf="parent"
15
        app:layout_constraintTop_toTopOf="parent">
16
17
    </com.andview.refreshview.XRefreshView>
18
19
</android.support.constraint.ConstraintLayout>