7eedebb7ec6e7eb4b4c2659bb0R693">693
685
            <TextView
686
                android:layout_width="wrap_content"
687
                android:layout_height="wrap_content"
688
                android:layout_gravity="center_horizontal"
689
                android:layout_marginTop="2dp"
690
                android:text="充电"
691
                android:textColor="@color/ui_64"
692
                android:textSize="10sp" />
693
694 694
        </LinearLayout>
695 695
696 696
        <RelativeLayout
@ -728,7 +728,7 @@
728 728
                android:layout_gravity="center_horizontal"
729 729
                android:layout_marginTop="2dp"
730 730
                android:text="发现"
731
                android:textColor="@color/ui_64"
731
                android:textColor="@color/color_0e0e0e"
732 732
                android:textSize="10sp" />
733 733
734 734
        </RelativeLayout>
@ -775,7 +775,7 @@
775 775
                android:layout_gravity="center_horizontal"
776 776
                android:layout_marginTop="2dp"
777 777
                android:text="我的"
778
                android:textColor="@color/ui_64"
778
                android:textColor="@color/color_c4c7d2"
779 779
                android:textSize="10sp" />
780 780
781 781
        </LinearLayout>

+ 17 - 14
app/src/main/res/layout/activity_main_map.xml

@ -6,6 +6,7 @@
6 6
    android:layout_height="match_parent"
7 7
    android:background="@color/white"
8 8
    android:focusable="true"
9
    android:clipChildren="false"
9 10
    tools:context="com.electric.chargingpile.activity.MainMapActivity">
10 11
11 12
    <!-- 标题搜索栏布局 -->
@ -279,8 +280,17 @@
279 280
            android:textSize="15sp"
280 281
            android:visibility="gone" />
281 282
    </com.zhy.autolayout.AutoRelativeLayout>
283
284
    <ImageView
285
        android:layout_alignParentBottom="true"
286
        android:background="@drawable/bg_tab"
287
        android:layout_width="match_parent"
288
        android:layout_height="wrap_content"/>
289
282 290
    <!-- 底部tab布局 -->
283 291
    <LinearLayout
292
        android:clipChildren="false"
293
        android:gravity="bottom"
284 294
        android:id="@+id/ll_tab"
285 295
        android:layout_width="match_parent"
286 296
        android:layout_height="49dp"
@ -311,7 +321,7 @@
311 321
                android:layout_gravity="center_horizontal"
312 322
                android:layout_marginTop="2dp"
313 323
                android:text="首页"
314
                android:textColor="@color/ui_64"
324
                android:textColor="@color/color_0e0e0e"
315 325
                android:textSize="10sp" />
316 326
        </LinearLayout>
317 327
@ -335,12 +345,13 @@
335 345
                android:layout_gravity="center_horizontal"
336 346
                android:layout_marginTop="2dp"
337 347
                android:text="@string/string_tab_qa"
338
                android:textColor="@color/ui_64"
348
                android:textColor="@color/color_c4c7d2"
339 349
                android:textSize="10sp" />
340 350
341 351
        </LinearLayout>
342 352
343 353
        <LinearLayout
354
            android:gravity="bottom|center_horizontal"
344 355
            android:id="@+id/tab_screening"
345 356
            android:layout_width="0dp"
346 357
            android:layout_height="match_parent"
@ -348,20 +359,12 @@
348 359
            android:orientation="vertical">
349 360
350 361
            <ImageView
362
                android:layout_marginBottom="7dp"
351 363
                android:layout_width="wrap_content"
352
                android:layout_height="wrap_content"
364
                android:layout_height="50dp"
353 365
                android:layout_gravity="center_horizontal"
354
                android:layout_marginTop="8dp"
355 366
                android:src="@drawable/icon_main_scan" />
356 367
357
            <TextView
358
                android:layout_width="wrap_content"
359
                android:layout_height="wrap_content"
360
                android:layout_gravity="center_horizontal"
361
                android:layout_marginTop="2dp"
362
                android:text="充电"
363
                android:textColor="@color/ui_64"
364
                android:textSize="10sp" />
365 368
366 369
        </LinearLayout>
367 370
@ -398,7 +401,7 @@
398 401
                android:layout_gravity="center_horizontal"
399 402
                android:layout_marginTop="2dp"
400 403
                android:text="发现"
401
                android:textColor="@color/ui_64"
404
                android:textColor="@color/color_c4c7d2"
402 405
                android:textSize="10sp" />
403 406
404 407
        </RelativeLayout>
@ -446,7 +449,7 @@
446 449
                android:layout_gravity="center_horizontal"
447 450
                android:layout_marginTop="2dp"
448 451
                android:text="我的"
449
                android:textColor="@color/ui_64"
452
                android:textColor="@color/color_c4c7d2"
450 453
                android:textSize="10sp" />
451 454
452 455

+ 16 - 16
app/src/main/res/layout/activity_qa.xml

@ -5,6 +5,7 @@
5 5
    android:layout_width="match_parent"
6 6
    android:layout_height="match_parent"
7 7
    xmlns:ptr="http://schemas.android.com/apk/res-auto"
8
    android:clipChildren="false"
8 9
    tools:context="com.electric.chargingpile.activity.QaActivity">
9 10
10 11
    <RelativeLayout
@ -71,8 +72,15 @@
71 72
        android:layout_marginRight="15dp"
72 73
        android:layout_marginBottom="22dp"
73 74
        android:src="@drawable/icon_qa_ask"/>
75
    <ImageView
76
        android:layout_alignParentBottom="true"
77
        android:background="@drawable/bg_tab"
78
        android:layout_width="match_parent"
79
        android:layout_height="wrap_content"/>
74 80
75 81
    <LinearLayout
82
        android:clipChildren="false"
83
        android:gravity="bottom"
76 84
        android:id="@+id/ll_tab"
77 85
        android:layout_width="match_parent"
78 86
        android:layout_height="49dp"
@ -104,7 +112,7 @@
104 112
                android:layout_gravity="center_horizontal"
105 113
                android:layout_marginTop="2dp"
106 114
                android:text="首页"
107
                android:textColor="@color/ui_64"
115
                android:textColor="@color/color_c4c7d2"
108 116
                android:textSize="10sp" />
109 117
110 118
        </LinearLayout>
@ -120,7 +128,7 @@
120 128
                android:layout_width="wrap_content"
121 129
                android:layout_height="wrap_content"
122 130
                android:layout_gravity="center_horizontal"
123
                android:layout_marginTop="8dp"
131
                android:layout_marginTop="10dp"
124 132
                android:src="@drawable/icon_main_qa_selected" />
125 133
126 134
            <TextView
@ -129,12 +137,13 @@
129 137
                android:layout_gravity="center_horizontal"
130 138
                android:layout_marginTop="2dp"
131 139
                android:text="@string/string_tab_qa"
132
                android:textColor="@color/ui_64"
140
                android:textColor="@color/color_0e0e0e"
133 141
                android:textSize="10sp" />
134 142
135 143
        </LinearLayout>
136 144
137 145
        <LinearLayout
146
            android:gravity="bottom|center_horizontal"
138 147
            android:id="@+id/tab_screening"
139 148
            android:layout_width="0dp"
140 149
            android:layout_height="match_parent"
@ -142,21 +151,12 @@
142 151
            android:orientation="vertical">
143 152
144 153
            <ImageView
154
                android:layout_marginBottom="7dp"
145 155
                android:layout_width="wrap_content"
146
                android:layout_height="wrap_content"
156
                android:layout_height="50dp"
147 157
                android:layout_gravity="center_horizontal"
148
                android:layout_marginTop="8dp"
149 158
                android:src="@drawable/icon_main_scan" />
150 159
151
            <TextView
152
                android:layout_width="wrap_content"
153
                android:layout_height="wrap_content"
154
                android:layout_gravity="center_horizontal"
155
                android:layout_marginTop="2dp"
156
                android:text="充电"
157
                android:textColor="@color/ui_64"
158
                android:textSize="10sp" />
159
160 160
        </LinearLayout>
161 161
162 162
        <RelativeLayout
@ -194,7 +194,7 @@
194 194
                android:layout_centerHorizontal="true"
195 195
                android:layout_marginTop="2dp"
196 196
                android:text="发现"
197
                android:textColor="@color/ui_64"
197
                android:textColor="@color/color_c4c7d2"
198 198
                android:textSize="10sp" />
199 199
200 200
        </RelativeLayout>
@ -241,7 +241,7 @@
241 241
                android:layout_gravity="center_horizontal"
242 242
                android:layout_marginTop="2dp"
243 243
                android:text="我的"
244
                android:textColor="@color/ui_64"
244
                android:textColor="@color/color_c4c7d2"
245 245
                android:textSize="10sp" />
246 246
247 247
        </LinearLayout>

+ 15 - 15
app/src/main/res/layout/activity_talk.xml

@ -4,6 +4,7 @@
4 4
    xmlns:tools="http://schemas.android.com/tools"
5 5
    android:layout_width="match_parent"
6 6
    android:layout_height="match_parent"
7
    android:clipChildren="false"
7 8
    xmlns:ptr="http://schemas.android.com/apk/res-auto"
8 9
    tools:context="com.electric.chargingpile.activity.TalkActivity">
9 10
@ -84,8 +85,15 @@
84 85
        android:layout_below="@+id/rl_title"
85 86
        android:background="#f4f4f4"
86 87
        android:layout_above="@+id/ll_tab"/>
88
    <ImageView
89
        android:layout_alignParentBottom="true"
90
        android:background="@drawable/bg_tab"
91
        android:layout_width="match_parent"
92
        android:layout_height="wrap_content"/>
87 93
88 94
    <LinearLayout
95
        android:clipChildren="false"
96
        android:gravity="bottom"
89 97
        android:id="@+id/ll_tab"
90 98
        android:layout_width="match_parent"
91 99
        android:layout_height="49dp"
@ -117,7 +125,7 @@
117 125
                android:layout_gravity="center_horizontal"
118 126
                android:layout_marginTop="2dp"
119 127
                android:text="首页"
120
                android:textColor="@color/ui_64"
128
                android:textColor="@color/color_c4c7d2"
121 129
                android:textSize="10sp" />
122 130
123 131
        </LinearLayout>
@ -143,33 +151,25 @@
143 151
                android:layout_gravity="center_horizontal"
144 152
                android:layout_marginTop="2dp"
145 153
                android:text="@string/string_tab_qa"
146
                android:textColor="@color/ui_64"
154
                android:textColor="@color/color_0e0e0e"
147 155
                android:textSize="10sp" />
148 156
149 157
        </LinearLayout>
150 158
151 159
        <LinearLayout
160
            android:gravity="bottom|center_horizontal"
152 161
            android:id="@+id/tab_screening"
153 162
            android:layout_width="0dp"
154 163
            android:layout_height="match_parent"
155 164
            android:layout_weight="1"
156 165
            android:orientation="vertical">
157
158 166
            <ImageView
167
                android:layout_marginBottom="7dp"
159 168
                android:layout_width="wrap_content"
160
                android:layout_height="wrap_content"
169
                android:layout_height="50dp"
161 170
                android:layout_gravity="center_horizontal"
162
                android:layout_marginTop="8dp"
163 171
                android:src="@drawable/icon_main_scan" />
164 172
165
            <TextView
166
                android:layout_width="wrap_content"
167
                android:layout_height="wrap_content"
168
                android:layout_gravity="center_horizontal"
169
                android:layout_marginTop="2dp"
170
                android:text="充电"
171
                android:textColor="@color/ui_64"
172
                android:textSize="10sp" />
173 173
174 174
        </LinearLayout>
175 175
@ -208,7 +208,7 @@
208 208
                android:layout_centerHorizontal="true"
209 209
                android:layout_marginTop="2dp"
210 210
                android:text="发现"
211
                android:textColor="@color/ui_64"
211
                android:textColor="@color/color_c4c7d2"
212 212
                android:textSize="10sp" />
213 213
214 214
        </RelativeLayout>
@ -255,7 +255,7 @@
255 255
                android:layout_gravity="center_horizontal"
256 256
                android:layout_marginTop="2dp"
257 257
                android:text="我的"
258
                android:textColor="@color/ui_64"
258
                android:textColor="@color/color_c4c7d2"
259 259
                android:textSize="10sp" />
260 260
261 261
        </LinearLayout>

+ 15 - 13
app/src/main/res/layout/activity_user_center.xml

@ -5,6 +5,7 @@
5 5
    xmlns:app="http://schemas.android.com/apk/res-auto"
6 6
    android:background="@color/activity_bgcolor"
7 7
    android:focusable="true"
8
    android:clipChildren="false"
8 9
    android:focusableInTouchMode="true">
9 10
10 11
@ -961,8 +962,15 @@
961 962
962 963
    <!--</ScrollView>-->
963 964
965
    <ImageView
966
        android:layout_alignParentBottom="true"
967
        android:background="@drawable/bg_tab"
968
        android:layout_width="match_parent"
969
        android:layout_height="wrap_content"/>
964 970
965 971
    <LinearLayout
972
        android:clipChildren="false"
973
        android:gravity="bottom"
966 974
        android:layout_width="match_parent"
967 975
        android:layout_height="49dp"
968 976
        android:layout_alignParentBottom="true"
@ -993,7 +1001,7 @@
993 1001
                android:layout_gravity="center_horizontal"
994 1002
                android:layout_marginTop="2dp"
995 1003
                android:text="首页"
996
                android:textColor="@color/ui_64"
1004
                android:textColor="@color/color_c4c7d2"
997 1005
                android:textSize="10sp" />
998 1006
999 1007
        </LinearLayout>
@ -1018,12 +1026,13 @@
1018 1026
                android:layout_gravity="center_horizontal"
1019 1027
                android:layout_marginTop="2dp"
1020 1028
                android:text="@string/string_tab_qa"
1021
                android:textColor="@color/ui_64"
1029
                android:textColor="@color/color_c4c7d2"
1022 1030
                android:textSize="10sp" />
1023 1031
1024 1032
        </LinearLayout>
1025 1033
1026 1034
        <LinearLayout
1035
            android:gravity="bottom|center_horizontal"
1027 1036
            android:id="@+id/tab_screening"
1028 1037
            android:layout_width="0dp"
1029 1038
            android:layout_height="match_parent"
@ -1031,20 +1040,13 @@
1031 1040
            android:orientation="vertical">
1032 1041
1033 1042
            <ImageView
1043
                android:layout_marginBottom="7dp"
1034 1044
                android:layout_width="wrap_content"
1035
                android:layout_height="wrap_content"
1045
                android:layout_height="50dp"
1036 1046
                android:layout_gravity="center_horizontal"
1037 1047
                android:layout_marginTop="8dp"
1038 1048
                android:src="@drawable/icon_main_scan" />
1039 1049
1040
            <TextView
1041
                android:layout_width="wrap_content"
1042
                android:layout_height="wrap_content"
1043
                android:layout_gravity="center_horizontal"
1044
                android:layout_marginTop="2dp"
1045
                android:text="充电"
1046
                android:textColor="@color/ui_64"
1047
                android:textSize="10sp" />
1048 1050
1049 1051
        </LinearLayout>
1050 1052
@ -1083,7 +1085,7 @@
1083 1085
                android:layout_centerHorizontal="true"
1084 1086
                android:layout_marginTop="2dp"
1085 1087
                android:text="发现"
1086
                android:textColor="@color/ui_64"
1088
                android:textColor="@color/color_c4c7d2"
1087 1089
                android:textSize="10sp" />
1088 1090
1089 1091
        </RelativeLayout>
@ -1182,7 +1184,7 @@
1182 1184
                android:layout_gravity="center_horizontal"
1183 1185
                android:layout_marginTop="2dp"
1184 1186
                android:text="我的"
1185
                android:textColor="@color/ui_64"
1187
                android:textColor="@color/color_0e0e0e"
1186 1188
                android:textSize="10sp" />
1187 1189
1188 1190

+ 2 - 0
app/src/main/res/values/color.xml

@ -188,6 +188,8 @@
188 188
    <color name="color_888888">#888888</color>
189 189
    <color name="color_fb9349">#fb9349</color>
190 190
    <color name="color_1bb637">#1bb637</color>
191
    <color name="color_0e0e0e">#0E0E0E</color>
192
    <color name="color_c4c7d2">#C4C7D2</color>
191 193

192 194
    <color name="sv_black">#FF000000</color>
193 195
    <color name="sv_white">#FFFFFF</color>

图片列表修改 · 4993086aed - Gogs: Go Git Service
Ver Código Fonte

图片列表修改

huyuguo 6 anos atrás
pai
commit
4993086aed

+ 38 - 32
app/src/main/java/com/electric/chargingpile/activity/ChatContentListActivity.java

@ -9,6 +9,7 @@ import android.support.constraint.ConstraintLayout;
9 9
import android.support.v4.app.Fragment;
10 10
import android.support.v4.app.FragmentManager;
11 11
import android.support.v4.app.FragmentPagerAdapter;
12
import android.support.v4.app.FragmentStatePagerAdapter;
12 13
import android.support.v4.view.ViewPager;
13 14
import android.support.v7.app.AppCompatActivity;
14 15
import android.os.Bundle;
@ -169,41 +170,42 @@ public class ChatContentListActivity extends AppCompatActivity {
169 170
            return;
170 171
        }
171 172
172
        if (bean.targetType != ChatRecommendBean.TARGET_TYPE_VIDEO) {
173
        if (bean.targetType == ChatRecommendBean.TARGET_TYPE_VIDEO) {
174
            NetworkUtils.NetworkType networkType = NetworkUtils.getNetworkType();
175
            switch (networkType) {
176
                case NETWORK_2G:
177
                case NETWORK_3G:
178
                case NETWORK_4G:
179
                    if (ProfileManager.getInstance().getMakeSureNetworkForView(ChatContentListActivity.this)) {
180
                        chatContentFragment.play();
181
                    } else {
182
                        if (isFirstShowNetworkDialog) {
183
                            isFirstShowNetworkDialog = false;
184
                            new AlertDialog(ChatContentListActivity.this).builder()
185
                                    .setMsg("目前正在移动网络下,是否播放")
186
                                    .setPositiveButton("继续播放", new View.OnClickListener() {
187
                                        @Override
188
                                        public void onClick(View view) {
189
                                            ProfileManager.getInstance().setMakeSureNetworkForView(ChatContentListActivity.this);
190
                                            chatContentFragment.play();
191
                                        }
192
                                    }).setNegativeButton("暂停播放", null).show();
193
                        }
194
                    }
195
                    break;
196
                default:
197
                    chatContentFragment.play();
198
                    break;
199
            }
200
201
        } else {
173 202
            GSYVideoADManager.onPause();
174 203
            GSYVideoManager.onPause();
175
            return;
176
        }
177
178
        NetworkUtils.NetworkType networkType = NetworkUtils.getNetworkType();
179
        switch (networkType) {
180
            case NETWORK_2G:
181
            case NETWORK_3G:
182
            case NETWORK_4G:
183
                if (ProfileManager.getInstance().getMakeSureNetworkForView(ChatContentListActivity.this)) {
184
                    chatContentFragment.play();
185
                } else {
186
                    if (isFirstShowNetworkDialog) {
187
                        isFirstShowNetworkDialog = false;
188
                        new AlertDialog(ChatContentListActivity.this).builder()
189
                                .setMsg("目前正在移动网络下,是否播放")
190
                                .setPositiveButton("继续播放", new View.OnClickListener() {
191
                                    @Override
192
                                    public void onClick(View view) {
193
                                        ProfileManager.getInstance().setMakeSureNetworkForView(ChatContentListActivity.this);
194
                                        chatContentFragment.play();
195
                                    }
196
                                }).setNegativeButton("暂停播放", null).show();
197
                    }
198
                }
199
                break;
200
            default:
201
                chatContentFragment.play();
202
                break;
204
            chatContentFragment.showPhotos();
203 205
        }
204 206
    }
205 207
206
    public class ChatContentAdapter extends FragmentPagerAdapter {
208
    public class ChatContentAdapter extends FragmentStatePagerAdapter {
207 209
208 210
        public Map<String, ChatContentFragment> map = new HashMap<>();
209 211
        private Handler handler;
@ -261,6 +263,8 @@ public class ChatContentListActivity extends AppCompatActivity {
261 263
        private ViewPager photoPager;
262 264
        private ConstraintLayout bottomView;
263 265
        private TextView navTitle;
266
        private List<ChatPhotoFragment> chatPhotoFragments;
267
        private ChatPhotoFragmentPagerAdapter chatPhotoFragmentPagerAdapter;
264 268
265 269
        public static ChatContentFragment newInstance(int index, String from) {
266 270
            ChatContentFragment fragment = new ChatContentFragment();
@ -618,13 +622,13 @@ public class ChatContentListActivity extends AppCompatActivity {
618 622
                navTitle.setText("");
619 623
            }
620 624
621
            List<ChatPhotoFragment> chatPhotoFragments = new ArrayList<>();
625
            chatPhotoFragments = new ArrayList<>();
622 626
            for (String url : bean.imgUrls) {
623 627
                ChatPhotoFragment fragment = ChatPhotoFragment.newInstance(url);
624 628
                chatPhotoFragments.add(fragment);
625 629
            }
626 630
627
            ChatPhotoFragmentPagerAdapter chatPhotoFragmentPagerAdapter = new ChatPhotoFragmentPagerAdapter(fm, chatPhotoFragments);
631
            chatPhotoFragmentPagerAdapter = new ChatPhotoFragmentPagerAdapter(getChildFragmentManager(), chatPhotoFragments);
628 632
            photoPager.setAdapter(chatPhotoFragmentPagerAdapter);
629 633
            photoPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
630 634
                @Override
@ -640,7 +644,9 @@ public class ChatContentListActivity extends AppCompatActivity {
640 644
                public void onPageScrollStateChanged(int state) {
641 645
                }
642 646
            });
647
        }
643 648
649
        private void showPhotos() {
644 650
        }
645 651
646 652
        private void setVideoAllCallBack() {

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

@ -3,6 +3,9 @@ package com.electric.chargingpile.adapter;
3 3
import android.support.v4.app.Fragment;
4 4
import android.support.v4.app.FragmentManager;
5 5
import android.support.v4.app.FragmentPagerAdapter;
6
import android.support.v4.app.FragmentStatePagerAdapter;
7
import android.support.v4.view.PagerAdapter;
8
import android.view.View;
6 9
7 10
import com.electric.chargingpile.fragment.ChatPhotoFragment;
8 11
@ -26,4 +29,5 @@ public class ChatPhotoFragmentPagerAdapter extends FragmentPagerAdapter {
26 29
    public int getCount() {
27 30
        return fragments.size();
28 31
    }
32
29 33
}

+ 10 - 2
app/src/main/java/com/electric/chargingpile/fragment/ChatPhotoFragment.java

@ -17,6 +17,7 @@ import com.github.chrisbanes.photoview.PhotoView;
17 17
public class ChatPhotoFragment extends Fragment {
18 18
    private static final String TAG = "ChatPhotoFragment";
19 19
    private static final String ARG_URL = "url";
20
    private View rootView;
20 21
21 22
    public static ChatPhotoFragment newInstance(String url) {
22 23
        ChatPhotoFragment fragment = new ChatPhotoFragment();
@ -33,12 +34,19 @@ public class ChatPhotoFragment extends Fragment {
33 34
    @Override
34 35
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
35 36
        String url = getArguments().getString(ARG_URL);
36
        View rootView = inflater.inflate(R.layout.fragment_chat_photo, container, false);
37
        if (rootView != null) {
38
            ViewGroup parent = (ViewGroup)rootView.getParent();
39
            if (parent!=null) {
40
                parent.removeView(rootView);
41
            }
42
            return rootView;
43
        }
44
        rootView = inflater.inflate(R.layout.fragment_chat_photo, container, false);
37 45
        initView(rootView, url);
38 46
        return rootView;
39 47
    }
40 48
41
    private void initView(View rootView,String url) {
49
    private void initView(View rootView, String url) {
42 50
        final PhotoView photoView = rootView.findViewById(R.id.photoView);
43 51
        photoView.setImageResource(R.drawable.bg_guide_one);
44 52
//        photoView.setScaleType(ImageView.ScaleType.FIT_XY);

+ 42 - 0
app/src/main/java/com/electric/chargingpile/iview/ChatVerticalViewPager.java

@ -0,0 +1,42 @@
1
package com.electric.chargingpile.iview;
2
3
import android.content.Context;
4
import android.util.AttributeSet;
5
import android.view.MotionEvent;
6
7
import fr.castorflex.android.verticalviewpager.VerticalViewPager;
8
9
public class ChatVerticalViewPager extends VerticalViewPager {
10
    private boolean isScroll = true;
11
    public ChatVerticalViewPager(Context context) {
12
        super(context);
13
    }
14
15
    public ChatVerticalViewPager(Context context, AttributeSet attrs) {
16
        super(context, attrs);
17
    }
18
19
    //----------禁止上下滑动-----------------
20
    @Override
21
    public boolean onTouchEvent(MotionEvent ev) {
22
        if (isScroll) {
23
            return super.onTouchEvent(ev);
24
        } else {
25
            return false;
26
        }
27
    }
28
29
    @Override
30
    public boolean onInterceptTouchEvent(MotionEvent ev) {
31
        if (isScroll) {
32
            return super.onInterceptTouchEvent(ev);
33
        } else {
34
            return false;
35
        }
36
37
    }
38
39
    public void setScroll(boolean scroll) {
40
        isScroll = scroll;
41
    }
42
}

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

@ -14,7 +14,7 @@
14 14
        app:layout_constraintLeft_toLeftOf="parent"
15 15
        app:layout_constraintRight_toRightOf="parent"
16 16
        app:layout_constraintTop_toBottomOf="@+id/navBar"
17
        tools:background="#66bd00"></android.support.v4.view.ViewPager>
17
        android:background="#66bd00"></android.support.v4.view.ViewPager>
18 18
19 19
    <!--<include layout="@layout/fragment_chat_content_common" />-->
20 20
    <android.support.constraint.ConstraintLayout