ode"> final String[] s = {file_url}; 427
                    Picasso.with(MainApplication.context)
428
                            .load(url)
429
                            .into(holder.iv_commentPic);
435
                String fileUrl = datas.get(position).getString("fileUrl");
436
                String file2Url = datas.get(position).getString("file2Url");
437
                String file3Url = datas.get(position).getString("file3Url");
438
                String type = datas.get(position).getString("type"); //23 视频,24 图片
439
                if (type.equals("23")){
440
441
                    String thumUrl = datas.get(position).getString("thumUrl");
442
                    if (!TextUtils.isEmpty(thumUrl)){
443
                        holder.imgVideo.setVisibility(View.VISIBLE);
444
                        holder.imgStart.setVisibility(View.VISIBLE);
445
446
                        holder.iv_commentPic.setVisibility(View.GONE);
447
                        holder.imgTwo.setVisibility(View.GONE);
448
                        holder.imgThree.setVisibility(View.GONE);
449
450
                        Glide.with(MainApplication.context)
451
                                .load(MainApplication.CDN +thumUrl)
452
                                .into(holder.imgVideo);
453
454
                        holder.imgVideo.setOnClickListener(v->{
455
                            try {
456
                                if (!datas.get(position).getString("id").equals("") && null != datas.get(position).getString("id")) {
457
                                    Intent intent = new Intent(finalConvertView1.getContext(), SingleCommentActivity.class);
458
                                    intent.putExtra("id", datas.get(position).getString("id"));
459
                                    finalConvertView1.getContext().startActivity(intent);
460
                                }
461
                            } catch (JSONException e) {
462
                                e.printStackTrace();
463
                            }
464
465
                        });
466
                    }
467
468
                }else {
469
470
                    holder.imgVideo.setVisibility(View.GONE);
471
                    holder.imgStart.setVisibility(View.GONE);
472
473
474
                    if (!fileUrl.equals("")) {
475
                        holder.iv_commentPic.setVisibility(View.VISIBLE);
476
                        holder.imgLayout.setVisibility(View.VISIBLE);
477
478
                        Picasso.with(MainApplication.context)
479
                                .load(MainApplication.url + "/zhannew/uploadfile/"+fileUrl)
480
                                .into(holder.iv_commentPic);
481
482
                    } else {
483
                        holder.iv_commentPic.setVisibility(View.GONE);
484
                        holder.imgLayout.setVisibility(View.GONE);
485
                    }
486
                    if (!file2Url.equals("")) {
487
                        holder.imgTwo.setVisibility(View.VISIBLE);
488
                        Picasso.with(MainApplication.context)
489
                                .load(MainApplication.url + "/zhannew/uploadfile/"+file2Url)
490
                                .into(holder.imgTwo);
491
                    } else {
492
                        holder.imgTwo.setVisibility(View.GONE);
493
                    }
494
                    if (!file3Url.equals("")) {
495
                        holder.imgThree.setVisibility(View.VISIBLE);
496
                        Picasso.with(MainApplication.context)
497
                                .load(MainApplication.url + "/zhannew/uploadfile/"+file3Url)
498
                                .into(holder.imgThree);
499
                    } else {
500
                        holder.imgThree.setVisibility(View.GONE);
501
                    }
502
503
504
                    String[] fileUrlArray = null;
505
                    if (!TextUtils.isEmpty(fileUrl) && !TextUtils.isEmpty(file2Url) &&!TextUtils.isEmpty(file3Url)){
506
                        fileUrlArray =new String[]{
507
                                MainApplication.url + "/zhannew/uploadfile/"+fileUrl,
508
                                MainApplication.url + "/zhannew/uploadfile/"+file2Url,
509
                                MainApplication.url + "/zhannew/uploadfile/"+file3Url
510
                        };
511
                    }else  if (!TextUtils.isEmpty(fileUrl) && !TextUtils.isEmpty(file2Url)){
512
                        fileUrlArray =new String[]{
513
                                MainApplication.url + "/zhannew/uploadfile/"+fileUrl,
514
                                MainApplication.url + "/zhannew/uploadfile/"+file2Url
515
                        };
516
                    }else  if (!TextUtils.isEmpty(fileUrl)){
517
                        fileUrlArray =new String[]{ MainApplication.url + "/zhannew/uploadfile/"+fileUrl};
518
                    }
519
430 520
                    final View finalConvertView2 = convertView;
521
                    String[] finalFileUrlArray = fileUrlArray;
431 522
                    holder.iv_commentPic.setOnClickListener(new View.OnClickListener() {
432 523
                        @Override
433 524
                        public void onClick(View v) {
434 525
                            Intent intent = new Intent(finalConvertView2.getContext(), ImagePagerActivity.class);
435 526
                            // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
436
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, s);
527
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
437 528
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
438 529
                            finalConvertView2.getContext().startActivity(intent);
439 530
                        }
440 531
                    });
441
                } else {
442
                    holder.iv_commentPic.setVisibility(View.GONE);
532
                    holder.imgTwo.setOnClickListener(new View.OnClickListener() {
533
                        @Override
534
                        public void onClick(View v) {
535
                            Intent intent = new Intent(finalConvertView2.getContext(), ImagePagerActivity.class);
536
                            // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
537
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
538
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 1);
539
                            finalConvertView2.getContext().startActivity(intent);
540
                        }
541
                    });
542
                    holder.imgThree.setOnClickListener(new View.OnClickListener() {
543
                        @Override
544
                        public void onClick(View v) {
545
                            Intent intent = new Intent(finalConvertView2.getContext(), ImagePagerActivity.class);
546
                            // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
547
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, finalFileUrlArray);
548
                            intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 2);
549
                            finalConvertView2.getContext().startActivity(intent);
550
                        }
551
                    });
443 552
                }
553
554
555
444 556
                //设置删除
445 557
                String userid = datas.get(position).getString("userid");
446 558
                final String id = datas.get(position).getString("id");
@ -505,11 +617,11 @@ public class ZhanCommentsAapter extends BaseAdapter {
505 617
        TextView tv_pdelete, tv_pname, tv_sname, tv_ptime, tv_stime, tv_pcontext, tv_scontext, tv_preply, tv_pcar, tv_more, tv_pzan;
506 618
        ImageView iv_picon, certified_icon, high_grade_comment_icon;
507 619
        LinearLayout ll_pzan;
508
        ImageView iv_havemessage, iv_commentPic;
620
        ImageView iv_havemessage, iv_commentPic,imgTwo,imgThree,imgVideo,imgStart;
509 621
        ImageView iv_pgrade, iv_pzan, iv_level_img;
510 622
        TagFlowLayout fl_ptag;
511 623
        ListView lv_scomment;
512
        RelativeLayout parent;
624
        RelativeLayout parent,imgLayout;
513 625
        View vvv;
514 626
    }
515 627

+ 1 - 1
app/src/main/java/com/electric/chargingpile/application/MainApplication.java

@ -97,7 +97,7 @@ public class MainApplication extends MultiDexApplication {
97 97
//    public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
98 98

99 99
        public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
100
        public static String d1evTestUrl = "https://d1ev-new.yiduyongche.com";// 一电测试环境
100
        public static String d1evTestUrl = "https://d1ev-new.yiduyongche.com";// 评论上传视频
101 101
        public static String CDN = "https://cdn-fs.d1ev.com";
102 102
//    public static String urlNew = "https://api.touchev.com:83/api/0300";// 一电正式环境
103 103


+ 2 - 0
app/src/main/java/com/electric/chargingpile/fragment/ZhanCommentFragment.java

@ -6,6 +6,8 @@ import android.os.Bundle;
6 6
import android.os.Handler;
7 7
import androidx.fragment.app.Fragment;
8 8
import androidx.core.content.ContextCompat;
9
10
import android.util.Log;
9 11
import android.util.TypedValue;
10 12
import android.view.LayoutInflater;
11 13
import android.view.View;

+ 2 - 1
app/src/main/res/layout/activity_image_pager.xml

@ -10,10 +10,11 @@
10 10
        android:background="@color/black" />
11 11
12 12
    <TextView
13
        android:layout_marginTop="37dp"
13 14
        android:id="@+id/indicator"
14 15
        android:layout_width="match_parent"
15 16
        android:layout_height="wrap_content"
16
        android:layout_gravity="bottom"
17
        android:layout_gravity="top"
17 18
        android:gravity="center"
18 19
        android:textSize="18sp"
19 20
        android:textColor="@android:color/white"

+ 52 - 8
app/src/main/res/layout/item_newpinglun.xml

@ -8,7 +8,7 @@
8 8
    android:background="#ffffff"
9 9
    android:orientation="vertical">
10 10
11
    <RelativeLayout
11
    <RelativeLayout xmlns:tools="http://schemas.android.com/tools"
12 12
        android:layout_width="match_parent"
13 13
        android:layout_height="match_parent"
14 14
        android:background="@color/bg_row">
@ -68,6 +68,7 @@
68 68
            android:layout_toEndOf="@+id/rl_icon" />
69 69
70 70
        <RelativeLayout
71
            tools:visibility="visible"
71 72
            android:id="@+id/rl_grade"
72 73
            android:layout_width="wrap_content"
73 74
            android:layout_height="wrap_content"
@ -127,15 +128,58 @@
127 128
128 129
        </com.zhy.view.flowlayout.TagFlowLayout>
129 130
130
        <ImageView
131
            android:layout_width="65dp"
132
            android:layout_height="65dp"
133
            android:id="@+id/iv_commentPic"
131
        <RelativeLayout
134 132
            android:layout_marginTop="10dp"
133
            android:id="@+id/imgLayout"
135 134
            android:layout_below="@+id/id_flowlayout_activity"
136 135
            android:layout_alignLeft="@+id/tv_comment"
137
            android:scaleType="centerCrop"
138
            android:visibility="gone"/>
136
            android:layout_width="match_parent"
137
            android:layout_height="wrap_content">
138
            <ImageView
139
                tools:visibility="visible"
140
                android:id="@+id/iv_commentPic"
141
                android:layout_width="65dp"
142
                android:layout_height="65dp"
143
                android:scaleType="centerCrop"
144
                android:visibility="gone" />
145
            <ImageView
146
                android:layout_marginEnd="4dp"
147
                android:layout_marginStart="4dp"
148
                android:id="@+id/imgTwo"
149
                tools:visibility="visible"
150
                android:layout_width="65dp"
151
                android:layout_height="65dp"
152
                android:layout_toRightOf="@+id/iv_commentPic"
153
                android:scaleType="centerCrop"
154
                android:visibility="gone" />
155
            <ImageView
156
                android:id="@+id/imgThree"
157
                tools:visibility="visible"
158
                android:layout_width="65dp"
159
                android:layout_height="65dp"
160
                android:layout_toRightOf="@+id/imgTwo"
161
                android:scaleType="centerCrop"
162
                android:visibility="gone" />
163
164
            <ImageView
165
                tools:visibility="visible"
166
                android:id="@+id/imgVideo"
167
                android:layout_width="110dp"
168
                android:layout_height="62dp"
169
                android:scaleType="centerCrop"
170
                android:visibility="gone" />
171
172
            <ImageView
173
                android:layout_centerInParent="true"
174
                android:id="@+id/imgStart"
175
                android:layout_width="wrap_content"
176
                android:layout_height="wrap_content"
177
                android:layout_alignEnd="@+id/imgVideo"
178
                android:layout_alignParentStart="true"
179
                android:src="@drawable/app_talk_video_icon"
180
                android:visibility="gone"
181
                tools:visibility="visible" />
182
        </RelativeLayout>
139 183
140 184
141 185
        <TextView
@ -159,7 +203,7 @@
159 203
            android:background="#fafafa"
160 204
            android:divider="@null"
161 205
            android:visibility="visible"
162
            android:layout_below="@+id/iv_commentPic"
206
            android:layout_below="@+id/imgLayout"
163 207
            android:layout_toRightOf="@+id/rl_icon"
164 208
            android:layout_toEndOf="@+id/rl_icon"
165 209
            android:layout_marginTop="10dp"

+ 61 - 11
app/src/main/res/layout/item_zhancomments.xml

@ -145,21 +145,64 @@
145 145
            android:visibility="visible"
146 146
            zhy:max_select="-1" />
147 147
148
        <ImageView
149
            android:id="@+id/iv_commentPic"
150
            android:layout_width="65dp"
151
            android:layout_height="65dp"
148
        <RelativeLayout
149
            android:layout_marginTop="10dp"
150
            android:id="@+id/imgLayout"
152 151
            android:layout_below="@+id/fl_ptag"
153 152
            android:layout_alignLeft="@+id/tv_pcontext"
154
            android:layout_marginTop="10dp"
155
            android:scaleType="centerCrop"
156
            android:visibility="gone" />
153
            android:layout_width="match_parent"
154
            android:layout_height="wrap_content">
155
            <ImageView
156
                tools:visibility="visible"
157
                android:id="@+id/iv_commentPic"
158
                android:layout_width="65dp"
159
                android:layout_height="65dp"
160
                android:scaleType="centerCrop"
161
                android:visibility="gone" />
162
            <ImageView
163
                android:layout_marginEnd="4dp"
164
                android:layout_marginStart="4dp"
165
                android:id="@+id/imgTwo"
166
                tools:visibility="visible"
167
                android:layout_width="65dp"
168
                android:layout_height="65dp"
169
                android:layout_toRightOf="@+id/iv_commentPic"
170
                android:scaleType="centerCrop"
171
                android:visibility="gone" />
172
            <ImageView
173
                android:id="@+id/imgThree"
174
                tools:visibility="visible"
175
                android:layout_width="65dp"
176
                android:layout_height="65dp"
177
                android:layout_toRightOf="@+id/imgTwo"
178
                android:scaleType="centerCrop"
179
                android:visibility="gone" />
180
181
            <ImageView
182
                tools:visibility="visible"
183
                android:id="@+id/imgVideo"
184
                android:layout_width="110dp"
185
                android:layout_height="62dp"
186
                android:scaleType="centerCrop"
187
                android:visibility="gone" />
188
189
            <ImageView
190
                android:layout_centerInParent="true"
191
                android:id="@+id/imgStart"
192
                android:layout_width="wrap_content"
193
                android:layout_height="wrap_content"
194
                android:layout_alignEnd="@+id/imgVideo"
195
                android:layout_alignParentStart="true"
196
                android:src="@drawable/app_talk_video_icon"
197
                android:visibility="gone"
198
                tools:visibility="visible" />
199
        </RelativeLayout>
157 200
158 201
        <TextView
159 202
            android:id="@+id/tv_ptime"
160 203
            android:layout_width="wrap_content"
161 204
            android:layout_height="wrap_content"
162
            android:layout_below="@+id/iv_commentPic"
205
            android:layout_below="@+id/imgLayout"
163 206
            android:layout_alignStart="@+id/tv_pcontext"
164 207
            android:layout_alignLeft="@+id/tv_pcontext"
165 208
            android:layout_marginTop="10dp"
@ -170,6 +213,7 @@
170 213
            android:textSize="12sp" />
171 214
172 215
        <TextView
216
            tools:visibility="visible"
173 217
            android:id="@+id/tv_pdelete"
174 218
            android:layout_width="wrap_content"
175 219
            android:layout_height="wrap_content"
@ -187,7 +231,7 @@
187 231
            android:id="@+id/ll_pzan"
188 232
            android:layout_width="wrap_content"
189 233
            android:layout_height="wrap_content"
190
            android:layout_below="@+id/iv_commentPic"
234
            android:layout_below="@+id/imgLayout"
191 235
            android:layout_toLeftOf="@+id/tv_preply"
192 236
            android:paddingLeft="10dp"
193 237
            android:paddingTop="10dp"
@ -217,10 +261,11 @@
217 261
218 262
219 263
        <TextView
264
220 265
            android:id="@+id/tv_preply"
221 266
            android:layout_width="wrap_content"
222 267
            android:layout_height="wrap_content"
223
            android:layout_below="@+id/iv_commentPic"
268
            android:layout_below="@+id/imgLayout"
224 269
            android:layout_alignEnd="@+id/tv_pcontext"
225 270
            android:layout_alignRight="@+id/tv_pcontext"
226 271
            android:layout_alignParentRight="true"
@ -236,6 +281,7 @@
236 281
237 282
238 283
        <TextView
284
            tools:visibility="visible"
239 285
            android:id="@+id/tv_childName"
240 286
            android:layout_width="wrap_content"
241 287
            android:layout_height="wrap_content"
@ -248,6 +294,7 @@
248 294
            android:visibility="gone" />
249 295
250 296
        <TextView
297
            tools:visibility="visible"
251 298
            android:id="@+id/textView14"
252 299
            android:layout_width="wrap_content"
253 300
            android:layout_height="wrap_content"
@ -260,6 +307,7 @@
260 307
            android:visibility="gone" />
261 308
262 309
        <TextView
310
            tools:visibility="visible"
263 311
            android:id="@+id/tv_parentName"
264 312
            android:layout_width="wrap_content"
265 313
            android:layout_height="wrap_content"
@ -272,6 +320,7 @@
272 320
            android:visibility="gone" />
273 321
274 322
        <TextView
323
            tools:visibility="visible"
275 324
            android:id="@+id/tv_commentDetail"
276 325
            android:layout_width="wrap_content"
277 326
            android:layout_height="wrap_content"
@ -296,6 +345,7 @@
296 345
            android:paddingLeft="15dp" />
297 346
298 347
        <TextView
348
            tools:visibility="visible"
299 349
            android:id="@+id/tv_more"
300 350
            android:layout_width="match_parent"
301 351
            android:layout_height="40dp"
@ -352,7 +402,7 @@
352 402
        <!--android:background="@color/bg_row"-->
353 403
        <!--android:layout_below="@+id/ll_comment"/>-->
354 404
        <View
355
405
            tools:visibility="visible"
356 406
            android:layout_width="match_parent"
357 407
            android:layout_height="0.5dp"
358 408
            android:layout_below="@+id/tv_ptime"

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

@ -82,6 +82,7 @@
82 82
    <color name="progress_background">#ededed</color>
83 83
    <color name="blue">#4c90f9</color>
84 84
    <color name="topic_blue">#2fb3ff</color>
85
    <color name="topic_green">#3EC34C</color>
85 86
    <color name="itemlist">#f4f4f4</color>
86 87
    <color name="act_background">#efefef</color>
87 88
    <color name="phone_bg">#f6f6f6</color>

Sign In - Gogs: Go Git Service

Sign In