338
                        android:id="@+id/tv_cost"
339
                        android:layout_width="wrap_content"
340
                        android:layout_height="wrap_content"
341
                        android:layout_alignParentBottom="true"
342
                        android:layout_centerHorizontal="true"
343
                        android:layout_centerVertical="true"
344
                        android:text="--"
345
                        android:textColor="@color/ui_62"
346
                        android:textSize="21sp" />
347
348
                </RelativeLayout>
328 349
329
            <TextView
330
                android:id="@+id/tv_cost"
331
                android:layout_width="wrap_content"
332
                android:layout_height="wrap_content"
333
                android:layout_alignParentBottom="true"
334
                android:layout_centerHorizontal="true"
335
                android:layout_centerVertical="true"
336
                android:text="--"
337
                android:textColor="@color/ui_62"
338
                android:textSize="21sp" />
350
            </LinearLayout>
339 351
340
        </RelativeLayout>
341 352
342
    </LinearLayout>
353
            <RelativeLayout
354
                android:layout_width="match_parent"
355
                android:layout_height="match_parent">
356
                <LinearLayout
357
                    tools:visibility="visible"
358
                    android:visibility="gone"
359
                    android:id="@+id/layoutCarCertificate"
360
                    android:background="@drawable/bg_f9f9fb_radius5"
361
                    android:paddingBottom="3dp"
362
                    android:paddingTop="3dp"
363
                    android:paddingStart="13dp"
364
                    android:paddingEnd="13dp"
365
                    android:layout_marginTop="30dp"
366
                    android:layout_centerHorizontal="true"
367
                    android:layout_width="wrap_content"
368
                    android:layout_height="wrap_content">
369
                    <TextView
370
                        android:id="@+id/certifiedCarOwner"
371
                        android:drawablePadding="12dp"
372
                        android:drawableLeft="@drawable/ic_certification"
373
                        android:layout_marginEnd="35dp"
374
                        android:gravity="center"
375
                        android:layout_width="wrap_content"
376
                        android:layout_height="match_parent"
377
                        android:text="认证车主有优惠哦~"
378
                        android:textColor="@color/color_0e0e0e"
379
                        android:textSize="14sp"
380
                        />
381
                    <ImageView
382
                        android:src="@drawable/right_cursor"
383
                        android:layout_width="wrap_content"
384
                        android:layout_height="match_parent"/>
385
386
                </LinearLayout>
387
                <ImageView
388
                    tools:visibility="visible"
389
                    android:id="@+id/iv_activity"
390
                    android:layout_width="wrap_content"
391
                    android:layout_height="wrap_content"
392
                    android:layout_alignParentTop="true"
393
                    android:layout_alignParentRight="true"
394
                    android:layout_marginTop="21dp"
395
                    android:layout_marginRight="13dp"
396
                    android:visibility="gone" />
343 397
398
                <TextView
399
                    tools:visibility="visible"
400
                    android:id="@+id/tv_activity"
401
                    android:layout_width="wrap_content"
402
                    android:layout_height="wrap_content"
403
                    android:layout_below="@+id/tv_stop"
404
                    android:layout_centerHorizontal="true"
405
                    android:paddingTop="20dp"
406
                    android:paddingBottom="15dp"
407
                    android:text=""
408
                    android:textColor="#ffa900"
409
                    android:textSize="14sp"
410
                    android:visibility="visible" />
344 411
345
    <RelativeLayout
346
        android:layout_width="match_parent"
347
        android:layout_height="match_parent">
348
        <LinearLayout
349
            tools:visibility="visible"
350
            android:visibility="gone"
351
            android:id="@+id/layoutCarCertificate"
352
            android:background="@drawable/bg_f9f9fb_radius5"
353
            android:paddingBottom="3dp"
354
            android:paddingTop="3dp"
355
            android:paddingStart="13dp"
356
            android:paddingEnd="13dp"
357
            android:layout_marginTop="30dp"
358
            android:layout_centerHorizontal="true"
359
            android:layout_width="wrap_content"
360
            android:layout_height="wrap_content">
361
            <TextView
362
                android:id="@+id/certifiedCarOwner"
363
                android:drawablePadding="12dp"
364
                android:drawableLeft="@drawable/ic_certification"
365
                android:layout_marginEnd="35dp"
366
                android:gravity="center"
367
                android:layout_width="wrap_content"
368
                android:layout_height="match_parent"
369
                android:text="认证车主有优惠哦~"
370
                android:textColor="@color/color_0e0e0e"
371
                android:textSize="14sp"
372
                />
373
            <ImageView
374
                android:src="@drawable/right_cursor"
375
                android:layout_width="wrap_content"
376
                android:layout_height="match_parent"/>
412
                <TextView
413
                    android:layout_centerHorizontal="true"
414
                    android:textStyle="bold"
415
                    android:id="@+id/tv_stop"
416
                    android:layout_width="160dp"
417
                    android:layout_height="42dp"
418
                    android:layout_alignParentBottom="true"
419
                    android:layout_marginBottom="94dp"
420
                    android:background="@drawable/bg_3ec34c_radius10"
421
                    android:gravity="center"
422
                    android:text="结束充电"
423
                    android:textColor="@color/color_3ec34c"
424
                    android:textSize="18sp" />
425
            </RelativeLayout>
377 426
378 427
        </LinearLayout>
379
        <ImageView
380
            tools:visibility="visible"
381
            android:id="@+id/iv_activity"
382
            android:layout_width="wrap_content"
383
            android:layout_height="wrap_content"
384
            android:layout_alignParentTop="true"
385
            android:layout_alignParentRight="true"
386
            android:layout_marginTop="21dp"
387
            android:layout_marginRight="13dp"
388
            android:visibility="gone" />
389
390
        <TextView
391
            tools:visibility="visible"
392
            android:id="@+id/tv_activity"
393
            android:layout_width="wrap_content"
394
            android:layout_height="wrap_content"
395
            android:layout_below="@+id/tv_stop"
396
            android:layout_centerHorizontal="true"
397
            android:paddingTop="20dp"
398
            android:paddingBottom="15dp"
399
            android:text=""
400
            android:textColor="#ffa900"
401
            android:textSize="14sp"
402
            android:visibility="visible" />
403
404
        <TextView
405
            android:layout_centerHorizontal="true"
406
            android:textStyle="bold"
407
            android:id="@+id/tv_stop"
408
            android:layout_width="160dp"
409
            android:layout_height="42dp"
410
            android:layout_alignParentBottom="true"
411
            android:layout_marginBottom="94dp"
412
            android:background="@drawable/bg_3ec34c_radius10"
413
            android:gravity="center"
414
            android:text="结束充电"
415
            android:textColor="@color/color_3ec34c"
416
            android:textSize="18sp" />
417
    </RelativeLayout>
418
428
    </androidx.core.widget.NestedScrollView>
419 429
</LinearLayout>

+ 224 - 0
app/src/main/res/layout/activity_logout.xml

@ -0,0 +1,224 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:orientation="vertical"
6
    android:background="@color/color_f6f6f6"
7
    android:layout_height="match_parent">
8
9
    <com.zhy.autolayout.AutoRelativeLayout
10
        android:layout_width="fill_parent"
11
        android:layout_height="130px"
12
        android:background="@color/title_background">
13
14
        <TextView
15
            android:id="@+id/title"
16
            android:layout_width="wrap_content"
17
            android:layout_height="wrap_content"
18
            android:layout_centerInParent="true"
19
            android:text="注销"
20
            android:textColor="@color/ui_62"
21
            android:textSize="16sp" />
22
23
        <ImageView
24
            android:id="@+id/iv_back"
25
            android:layout_width="wrap_content"
26
            android:layout_height="match_parent"
27
            android:layout_alignParentLeft="true"
28
            android:layout_centerVertical="true"
29
            android:contentDescription="@null"
30
            android:paddingBottom="4dp"
31
            android:paddingLeft="44px"
32
            android:paddingRight="44px"
33
            android:paddingTop="4dp"
34
            android:src="@drawable/icon_lvback1119" />
35
    </com.zhy.autolayout.AutoRelativeLayout>
36
37
    <LinearLayout
38
        android:orientation="vertical"
39
        android:id="@+id/unSubmittedLayout"
40
        android:layout_width="match_parent"
41
        android:layout_height="wrap_content">
42
43
        <ImageView
44
            android:layout_marginTop="40dp"
45
            android:layout_gravity="center"
46
            android:src="@drawable/ic_logout_hint"
47
            android:layout_width="wrap_content"
48
            android:layout_height="wrap_content"/>
49
50
        <TextView
51
            android:layout_gravity="center"
52
            android:layout_marginTop="30dp"
53
            android:textStyle="bold"
54
            android:gravity="center"
55
            android:layout_marginEnd="60dp"
56
            android:layout_marginStart="60dp"
57
            android:layout_width="match_parent"
58
            android:layout_height="wrap_content"
59
            android:text="非常遗憾不能继续为您服务\n感谢您的支持和陪伴"
60
            android:textColor="@color/color_0e0e0e"
61
            android:textSize="21sp"
62
            />
63
        <TextView
64
            android:layout_marginTop="20dp"
65
            android:layout_marginEnd="12dp"
66
            android:layout_marginStart="12dp"
67
            android:layout_width="match_parent"
68
            android:layout_height="wrap_content"
69
            android:text="注销账号前我们需要确认以下是否有未完成或未结算,以保证您的帐号安全"
70
            android:textColor="#ff707070"
71
            android:textSize="12sp"
72
            />
73
        <LinearLayout
74
            android:background="@drawable/bg_radius_6_white"
75
            android:layout_marginTop="20dp"
76
            android:layout_marginEnd="12dp"
77
            android:layout_marginStart="12dp"
78
            android:orientation="vertical"
79
            android:layout_width="match_parent"
80
            android:layout_height="wrap_content">
81
            <LinearLayout
82
                android:padding="14dp"
83
                android:layout_width="match_parent"
84
                android:layout_height="wrap_content">
85
                <TextView
86
                    android:layout_gravity="center_vertical"
87
                    android:layout_width="wrap_content"
88
                    android:layout_height="wrap_content"
89
                    android:text="●"
90
                    android:textColor="@color/color_707070"
91
                    android:textSize="4sp"
92
                    />
93
94
                <TextView
95
                    android:layout_marginStart="6dp"
96
                    android:layout_width="wrap_content"
97
                    android:layout_height="wrap_content"
98
                    android:text="您的账号当前没有正在充电的订单"
99
                    android:textColor="@color/color_707070"
100
                    android:textSize="12sp"
101
                    />
102
103
            </LinearLayout>
104
            <LinearLayout
105
                android:padding="14dp"
106
                android:layout_width="match_parent"
107
                android:layout_height="wrap_content">
108
                <TextView
109
                    android:layout_gravity="center_vertical"
110
                    android:layout_width="wrap_content"
111
                    android:layout_height="wrap_content"
112
                    android:text="●"
113
                    android:textColor="@color/color_707070"
114
                    android:textSize="4sp"
115
                    />
116
117
                <TextView
118
                    android:layout_marginStart="6dp"
119
                    android:layout_width="wrap_content"
120
                    android:layout_height="wrap_content"
121
                    android:text="您的账号没有未结算的充电订单"
122
                    android:textColor="@color/color_707070"
123
                    android:textSize="12sp"
124
                    />
125
126
            </LinearLayout>
127
            <LinearLayout
128
                android:padding="14dp"
129
                android:layout_width="match_parent"
130
                android:layout_height="wrap_content">
131
                <TextView
132
                    android:layout_gravity="center_vertical"
133
                    android:layout_width="wrap_content"
134
                    android:layout_height="wrap_content"
135
                    android:text="●"
136
                    android:textColor="@color/color_707070"
137
                    android:textSize="4dp"
138
                    />
139
140
                <TextView
141
                    android:layout_width="wrap_content"
142
                    android:layout_height="wrap_content"
143
                    android:layout_marginStart="6dp"
144
                    android:text="您的账号如果有余额请先完成退款或联系客服清空赠送金额"
145
                    android:textColor="@color/color_707070"
146
                    android:textSize="12sp" />
147
148
            </LinearLayout>
149
            <View
150
                android:background="@color/color_f5f6f7"
151
                android:layout_marginEnd="14dp"
152
                android:layout_marginStart="14dp"
153
                android:layout_width="match_parent"
154
                android:layout_height="1dp"/>
155
156
            <TextView
157
                android:padding="14dp"
158
                android:layout_width="match_parent"
159
                android:layout_height="wrap_content"
160
                android:text="注销提交后冻结账号15天,15天后自动注销账号,将清除账号所有相关信息和记录。冻结期内不可使用APP功能,可取消注销。"
161
                android:textColor="#ff707070"
162
                android:textSize="12sp"
163
                />
164
        </LinearLayout>
165
    </LinearLayout>
166
167
    <LinearLayout
168
        tools:visibility="visible"
169
        android:visibility="gone"
170
        android:id="@+id/unRegisterLayout"
171
        android:orientation="vertical"
172
        android:layout_width="match_parent"
173
        android:layout_height="wrap_content">
174
        <ImageView
175
            android:layout_marginTop="40dp"
176
            android:layout_gravity="center_horizontal"
177
            android:src="@drawable/ic_logout_hint2"
178
            android:layout_width="wrap_content"
179
            android:layout_height="wrap_content"/>
180
        <TextView
181
            android:layout_gravity="center"
182
            android:layout_marginTop="30dp"
183
            android:layout_width="wrap_content"
184
            android:layout_height="wrap_content"
185
            android:text="注销正在审核中…"
186
            android:textColor="@color/color_0e0e0e"
187
            android:textSize="21sp"
188
            />
189
190
        <TextView
191
            android:layout_marginTop="20dp"
192
            android:layout_gravity="center"
193
            android:layout_width="wrap_content"
194
            android:layout_height="wrap_content"
195
            tools:text="提交时间:2021-8-16  17:00"
196
            android:textColor="@color/app_color_9b"
197
            android:textSize="12sp"
198
            />
199
        <TextView
200
            android:layout_marginTop="20dp"
201
            android:layout_gravity="center"
202
            android:layout_width="wrap_content"
203
            android:layout_height="wrap_content"
204
            tools:text="审核中不能充值和开启充电,取消注销可继续使用"
205
            android:textColor="#ff0e0e0e"
206
            android:textSize="12sp"
207
            />
208
    </LinearLayout>
209
    <View
210
        android:layout_weight="1"
211
        android:layout_width="match_parent"
212
        android:layout_height="0dp"/>
213
    <TextView
214
        android:id="@+id/text"
215
        android:layout_marginBottom="40dp"
216
        android:layout_marginEnd="12dp"
217
        android:layout_marginStart="12dp"
218
        android:gravity="center"
219
        android:textColor="@color/white"
220
        android:text="退出登录"
221
        android:background="@drawable/bg_raduis_20_lvse"
222
        android:layout_width="match_parent"
223
        android:layout_height="40dp"/>
224
</LinearLayout>

+ 49 - 4
app/src/main/res/layout/activity_user_center_more.xml

@ -42,10 +42,12 @@
42 42
        android:background="@color/ui_titleline"/>
43 43
44 44
    <com.zhy.autolayout.AutoLinearLayout
45
        android:layout_marginEnd="12dp"
46
        android:layout_marginStart="12dp"
45 47
        android:layout_width="match_parent"
46 48
        android:layout_height="wrap_content"
47 49
        android:layout_marginTop="44px"
48
        android:background="@color/white"
50
        android:background="@drawable/bg_radius_6_white"
49 51
        android:orientation="vertical">
50 52
51 53
        <View
@ -288,15 +290,59 @@
288 290
            android:background="@color/Line" />
289 291
290 292
    </com.zhy.autolayout.AutoLinearLayout>
293
    <LinearLayout
294
        android:id="@+id/logOutLayout"
295
        android:paddingBottom="20dp"
296
        android:paddingTop="20dp"
297
        android:layout_marginEnd="12dp"
298
        android:layout_marginStart="12dp"
299
        android:background="@drawable/bg_radius_6_white"
300
        android:layout_marginTop="15dp"
301
        android:layout_width="match_parent"
302
        android:layout_height="wrap_content">
303
        <TextView
304
            android:layout_marginStart="14dp"
305
            android:layout_gravity="center_vertical"
306
            android:layout_width="wrap_content"
307
            android:layout_height="wrap_content"
308
            android:text="注销账号"
309
            android:textColor="@color/color_0e0e0e"
310
            android:textSize="14sp"
311
            />
312
        <View
313
            android:layout_weight="1"
314
            android:layout_gravity="center_vertical"
315
            android:layout_width="0dp"
316
            android:layout_height="1dp"/>
317
        <TextView
318
            android:layout_marginEnd="9dp"
319
            android:layout_width="wrap_content"
320
            android:layout_height="wrap_content"
321
            tools:text="正在审核中"
322
            android:textColor="@color/color_e32727"
323
            android:textSize="14sp"
324
            />
325
        <ImageView
326
            android:layout_width="wrap_content"
327
            android:layout_height="match_parent"
328
            android:layout_alignParentRight="true"
329
            android:layout_centerVertical="true"
330
            android:contentDescription="@null"
331
            android:paddingRight="16dp"
332
            android:src="@drawable/icon_more2_0" />
333
    </LinearLayout>
291 334
292 335
    <com.zhy.autolayout.AutoRelativeLayout
293 336
        android:layout_width="match_parent"
294 337
        android:layout_height="match_parent">
295 338
    <TextView
339
        android:layout_marginBottom="40dp"
340
        android:layout_marginEnd="12dp"
341
        android:layout_marginStart="12dp"
296 342
        android:id="@+id/tv_exit"
297 343
        android:layout_width="fill_parent"
298
        android:layout_height="127px"
299
        android:background="@color/lvse"
344
        android:layout_height="40dp"
345
        android:background="@drawable/bg_raduis_20_lvse"
300 346
        android:gravity="center"
301 347
        android:text="退出登录"
302 348
        android:textColor="@color/bg_row"
@ -324,7 +370,6 @@
324 370
325 371
    </com.zhy.autolayout.AutoRelativeLayout>
326 372
327
328 373
</com.zhy.autolayout.AutoLinearLayout>
329 374
330 375

+ 35 - 0
app/src/main/res/layout/dialog_state.xml

@ -0,0 +1,35 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    tools:background="#f1f1"
6
    android:id="@+id/stateLayout"
7
    android:orientation="vertical"
8
    android:layout_height="match_parent">
9
10
    <LinearLayout
11
        android:gravity="center"
12
        android:orientation="vertical"
13
        android:layout_centerInParent="true"
14
        android:background="@drawable/bg_white_radius10"
15
        android:layout_width="268dp"
16
        android:layout_height="124dp">
17
18
        <ImageView
19
            android:id="@+id/stateImg"
20
            android:layout_marginTop="10dp"
21
            tools:src="@drawable/ic_logout_dialog"
22
            android:layout_gravity="center"
23
            android:layout_width="wrap_content"
24
            android:layout_height="wrap_content"/>
25
        <TextView
26
            android:layout_marginTop="20dp"
27
            android:id="@+id/stateText"
28
            android:layout_marginBottom="10dp"
29
            android:layout_gravity="center"
30
            tools:text="请先退款或完成退款订单"
31
            android:textColor="@color/black"
32
            android:layout_width="wrap_content"
33
            android:layout_height="wrap_content"/>
34
    </LinearLayout>
35
</RelativeLayout>

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

@ -200,6 +200,9 @@
200 200
    <color name="color_f08f4b">#F08F4B</color>
201 201
    <color name="color_ff333333">#ff333333</color>
202 202

203
    <color name="color_e32727">#ffe32727</color>
204
    <color name="color_707070">#ff707070</color>
205
    <color name="color_f5f6f7">#F5F6F7</color>
203 206

204 207

205 208


add video topic · b14c9d588a - Gogs: Go Git Service
Browse Source

add video topic

1145873331@qq.com 7 years ago
parent
commit
b14c9d588a

+ 1 - 3
app/build.gradle

@ -263,8 +263,6 @@ dependencies {
263 263
    compile 'me.iwf.photopicker:PhotoPicker:0.9.12@aar'
264 264
    compile 'top.zibin:Luban:1.1.2'
265 265
    compile 'com.ms-square:expandableTextView:0.1.4'
266
//    compile 'io.reactivex:rxjava:1.1.0'
267
//    compile 'io.reactivex:rxandroid:1.1.0'
268 266
269 267
    compile 'io.reactivex.rxjava2:rxjava:2.0.5'
270 268
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
@ -282,5 +280,5 @@ dependencies {
282 280
    compile 'com.github.Aspsine:IRecyclerView:0.0.7'
283 281
    compile project(':ijkplayer-java')
284 282
    compile 'com.upyun:upyun-android-sdk:+'
285
   compile project(':videolibrary:picture_library')
283
    compile project(':videolibrary:picture_library')
286 284
}

+ 18 - 139
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

@ -4,11 +4,9 @@ import android.Manifest;
4 4
import android.annotation.SuppressLint;
5 5
import android.app.Activity;
6 6
import android.app.ProgressDialog;
7
import android.content.ContentValues;
8 7
import android.content.Context;
9 8
import android.content.Intent;
10 9
import android.content.pm.PackageManager;
11
import android.database.Cursor;
12 10
import android.graphics.Bitmap;
13 11
import android.graphics.BitmapFactory;
14 12
import android.graphics.Color;
@ -27,7 +25,6 @@ import android.telephony.TelephonyManager;
27 25
import android.text.Editable;
28 26
import android.text.TextUtils;
29 27
import android.text.TextWatcher;
30
import android.util.Base64;
31 28
import android.util.Log;
32 29
import android.view.LayoutInflater;
33 30
import android.view.View;
@ -61,19 +58,16 @@ import com.electric.chargingpile.util.PublicWay;
61 58
import com.electric.chargingpile.util.Res;
62 59
import com.electric.chargingpile.util.SystemTypeUtil;
63 60
import com.electric.chargingpile.util.ToastUtil;
64
import com.electric.chargingpile.util.UploadUtil;
65 61
import com.umeng.analytics.MobclickAgent;
66 62
import com.upyun.library.common.ParallelUploader;
67 63
import com.upyun.library.common.UploadEngine;
68 64
import com.upyun.library.listener.UpCompleteListener;
69 65
import com.upyun.library.listener.UpProgressListener;
70
import com.upyun.library.utils.UpYunUtils;
71 66
import com.zhy.http.okhttp.OkHttpUtils;
72 67
import com.zhy.http.okhttp.callback.StringCallback;
73 68
74 69
import java.io.ByteArrayOutputStream;
75 70
import java.io.File;
76
import java.io.FileNotFoundException;
77 71
import java.io.IOException;
78 72
import java.util.ArrayList;
79 73
import java.util.HashMap;
@ -323,18 +317,19 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
323 317
                    ArrayList<AuthSignBean> signBeans = (ArrayList<AuthSignBean>) JsonUtils.parseToObjectList(rtnMsg, AuthSignBean.class);
324 318
325 319
                    if (null != signBeans && signBeans.size() > 0) {
326
                        File tempFile = new File(Bimp.tempSelectBitmap.get(0).getImagePath().trim());
327
                        String fileName = tempFile.getName();
328
                        //生产policy传的参数
329
                        Map<String, Object> map = new HashMap<>();
330
                        map.put("bucket", "d1evcom01-fs");
331
                        map.put("expiration", (System.currentTimeMillis() + 1800) + "");
332
                        map.put("save-key", picSavePath + "/" + tempFile.getName());
333
                        policy = UpYunUtils.getPolicy(map);
320
//                        File tempFile = new File(Bimp.tempSelectBitmap.get(0).getImagePath().trim());
321
//                        String fileName = tempFile.getName();
322
//                        //生产policy传的参数
323
//                        Map<String, Object> map = new HashMap<>();
324
//                        map.put("bucket", SPACE);
325
//                        map.put("expiration", (System.currentTimeMillis() + 1800) + "");
326
//                        map.put("save-key", picSavePath + "/" + tempFile.getName());
327
//                        policy = UpYunUtils.getPolicy(map);
334 328
                        String sign = signBeans.get(0).sign;
335 329
336
                        formUpload(Bimp.tempSelectBitmap.get(0).getImagePath(), sign,
337
                                signBeans.get(0).fname, signBeans.get(0).policy);
330
                        formUpload(Bimp.tempSelectBitmap.get(0).getImagePath(), sign, signBeans.get(0).policy);
331
332
338 333
                    }
339 334
                }
340 335
            }
@ -568,8 +563,6 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
568 563
                        takePhoto.setBitmap(bitmap);
569 564
                        takePhoto.setImagePath(imagePath);
570 565
                        Bimp.tempSelectBitmap.add(takePhoto);
571
//
572
//                        Log.e(TAG, "call: "+imagePath );
573 566
                        subscriber.onNext(imagePath);
574 567
                    }
575 568
                    subscriber.onComplete();
@ -725,43 +718,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
725 718
        }
726 719
    }
727 720
728
    public static Uri getImageContentUri(Context context, File imageFile) {
729
        String filePath = imageFile.getAbsolutePath();
730
        Cursor cursor = context.getContentResolver().query(
731
                MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
732
                new String[]{MediaStore.Images.Media._ID},
733
                MediaStore.Images.Media.DATA + "=? ",
734
                new String[]{filePath}, null);
735
736
        if (cursor != null && cursor.moveToFirst()) {
737
            int id = cursor.getInt(cursor
738
                    .getColumnIndex(MediaStore.MediaColumns._ID));
739
            Uri baseUri = Uri.parse("content://media/external/images/media");
740
            return Uri.withAppendedPath(baseUri, "" + id);
741
        } else {
742
            if (imageFile.exists()) {
743
                ContentValues values = new ContentValues();
744
                values.put(MediaStore.Images.Media.DATA, filePath);
745
                return context.getContentResolver().insert(
746
                        MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
747
            } else {
748
                return null;
749
            }
750
        }
751
    }
752
753
    public Bitmap decodeUriAsBitmap(Uri uri) {
754
        Bitmap bitmap = null;
755
        try {
756
            bitmap = BitmapFactory.decodeStream(this.getContentResolver().openInputStream(uri));
757
        } catch (FileNotFoundException e) {
758
            e.printStackTrace();
759
            return null;
760
        }
761
        return bitmap;
762
    }
763
764
721
    @Override
765 722
    protected void onRestart() {
766 723
        adapter.update();
767 724
        super.onRestart();
@ -774,66 +731,6 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
774 731
        Bimp.max = 0;
775 732
    }
776 733
777
    private void uploadFeedbackPic() {
778
        Map<String, String> par = new HashMap<String, String>();
779
        String file;
780
        for (int i = 0; i < Bimp.tempSelectBitmap.size(); i++) {
781
            try {
782
                bm = imageZoom(Bimp.tempSelectBitmap.get(i).getBitmap());
783
                file = bitmapToBase64(bm);
784
                par.put("file" + (i + 1), file);
785
                Log.i("file--------" + (i + 1), file);
786
                par.put("filename" + (i + 1), "androidapp.jpg");
787
            } catch (Exception e) {
788
                e.printStackTrace();
789
            }
790
791
        }
792
        try {
793
            String u = UploadUtil.postTopicPicture(
794
                    MainApplication.urlNew + "/topic/sign.do",
795
//                    "http://123.57.6.131/zhannew/basic/web/index.php/zhanlist/add",
796
//					"http://59.110.68.162"+"/zhannew/fileupload/multi-upload",
797
                    par, null);
798
            System.err.println(u);
799
            // submit(u);
800
            Message msg = new Message();
801
            msg.obj = u;
802
            msg.what = 2;
803
            handler.sendMessage(msg);
804
        } catch (IOException e) {
805
            e.printStackTrace();
806
        }
807
    }
808
809
    private String bitmapToBase64(Bitmap bitmap) {
810
811
        String result = null;
812
        ByteArrayOutputStream baos = null;
813
        try {
814
            if (bitmap != null) {
815
                baos = new ByteArrayOutputStream();
816
                bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
817
                baos.flush();
818
                baos.close();
819
                byte[] bitmapBytes = baos.toByteArray();
820
                result = Base64.encodeToString(bitmapBytes, Base64.DEFAULT);
821
            }
822
        } catch (IOException e) {
823
            e.printStackTrace();
824
        } finally {
825
            try {
826
                if (baos != null) {
827
                    baos.flush();
828
                    baos.close();
829
                }
830
            } catch (IOException e) {
831
                e.printStackTrace();
832
            }
833
        }
834
        return result;
835
    }
836
837 734
    private Bitmap imageZoom(Bitmap bm) {
838 735
        // 图片允许最大空间 单位:KB
839 736
        double maxSize = 200.00;
@ -879,13 +776,6 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
879 776
        TelephonyManager telephonyManager = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE);
880 777
        final String imem;
881 778
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
882
            // TODO: Consider calling
883
            //    ActivityCompat#requestPermissions
884
            // here to request the missing permissions, and then overriding
885
            //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
886
            //                                          int[] grantResults)
887
            // to handle the case where the user grants the permission. See the documentation
888
            // for ActivityCompat#requestPermissions for more details.
889 779
            imem = "";
890 780
        } else {
891 781
            imem = telephonyManager.getDeviceId();
@ -1015,25 +905,12 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
1015 905
    /**
1016 906
     * 表单上传
1017 907
     *
908
     * @param SAMPLE_PIC_FILE
1018 909
     * @param sign
1019
     * @param saveName
910
     * @param policyServer
1020 911
     */
1021
    private void formUpload(String SAMPLE_PIC_FILE, String sign, String saveName, String policyServer) {
912
    private void formUpload(String SAMPLE_PIC_FILE, String sign, String policyServer) {
1022 913
        File temp = new File(SAMPLE_PIC_FILE);
1023
//
1024
//        final Map<String, Object> paramsMap = new HashMap<>();
1025
//        //上传空间
1026
//        paramsMap.put(Params.BUCKET, SPACE);
1027
//        //保存路径,任选其中一个
1028
//        paramsMap.put(Params.SAVE_KEY, picSavePath);
1029
//        //添加 CONTENT_LENGTH 参数使用大文件表单上传
1030
//        paramsMap.put(Params.CONTENT_LENGTH, temp.length());
1031
//
1032
//
1033
//        paramsMap.put(Params.CONTENT_MD5, UpYunUtils.md5Hex(temp));
1034
////        paramsMap.put(Params.PATH, savePath);
1035
//        //可选参数(详情见api文档介绍)
1036
//        paramsMap.put(Params.RETURN_URL, "httpbin.org/post");
1037 914
//        //进度回调,可为空
1038 915
        UpProgressListener progressListener = new UpProgressListener() {
1039 916
            @Override
@ -1053,8 +930,10 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
1053 930
                Log.e(TAG, isSuccess + ":" + result);
1054 931
            }
1055 932
        };
933
1056 934
        //表单上传(服务器签名方式)
1057
        UploadEngine.getInstance().formUpload(temp, policyServer, OPERATER, sign, completeListener, progressListener);
935
        UploadEngine.getInstance().formUpload(temp, policyServer, OPERATER, sign, completeListener,
936
                progressListener);
1058 937
1059 938
    }
1060 939

+ 49 - 9
app/src/main/java/com/electric/chargingpile/activity/PublishTopicActivity.java

@ -3,8 +3,11 @@ package com.electric.chargingpile.activity;
3 3
import android.app.Activity;
4 4
import android.content.Context;
5 5
import android.content.Intent;
6
import android.graphics.drawable.Drawable;
7
import android.net.Uri;
6 8
import android.os.Bundle;
7 9
import android.os.Environment;
10
import android.support.annotation.Nullable;
8 11
import android.text.Editable;
9 12
import android.text.Html;
10 13
import android.text.TextUtils;
@ -14,8 +17,14 @@ import android.view.View;
14 17
import android.view.View.OnClickListener;
15 18
import android.widget.EditText;
16 19
import android.widget.ImageView;
20
import android.widget.RelativeLayout;
17 21
import android.widget.TextView;
18 22

23
import com.bumptech.glide.Glide;
24
import com.bumptech.glide.load.DataSource;
25
import com.bumptech.glide.load.engine.GlideException;
26
import com.bumptech.glide.request.RequestListener;
27
import com.bumptech.glide.request.target.Target;
19 28
import com.electric.chargingpile.R;
20 29
import com.electric.chargingpile.data.TalkRecommendBean;
21 30
import com.electric.chargingpile.util.BarColorUtil;
@ -30,11 +39,7 @@ import java.io.File;
30 39
import java.util.List;
31 40

32 41
public class PublishTopicActivity extends Activity implements OnClickListener {
33
    private ImageView ivBack, icon_scan;
34
    private TextView tvVersion, tv_banquan, tv_call, android;
35
    private String app_version;
36 42
    Context mContext;
37
    private static final int RC_CALL_PERM = 123;
38 43
    private ImageView mPublishtopicBack;
39 44
    private TextView mPublishtopicPublish;
40 45
    private EditText mPublishtopicCon;
@ -43,6 +48,12 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
43 48
    private TextView mPublishtopicChoosePreview;
44 49
    private TextView mPublishtopicWordNum;
45 50
    private ImageView mPublishTopicDe;
51

52
    private RelativeLayout mItemVideoLl;
53
    private ImageView mItemVideo;
54
    private View mItemVideoDelete;
55

56

46 57
    public static final String CACHE_DIR = Environment.getExternalStorageDirectory().getAbsolutePath() + "/cdz";
47 58

48 59

@ -68,6 +79,11 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
68 79
        mPublishtopicWordNum = (TextView) findViewById(R.id.publishtopic_word_num);
69 80
        mPublishTopicDe = (ImageView) findViewById(R.id.publishtopic_choose_topic_de);
70 81

82
        mItemVideoLl = (RelativeLayout) findViewById(R.id.item_video_ll);
83
        mItemVideo = (ImageView) findViewById(R.id.item_video);
84
        mItemVideoDelete = (View) findViewById(R.id.item_video_delete);
85

86

71 87
        mPublishtopicCon.addTextChangedListener(new TextWatcher() {
72 88
            @Override
73 89
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
@ -97,6 +113,7 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
97 113
        mPublishtopicChoosePreview.setOnClickListener(this);
98 114
        mPublishtopicChooseTopic.setOnClickListener(this);
99 115
        mPublishTopicDe.setOnClickListener(this);
116
        mItemVideoDelete.setOnClickListener(this);
100 117
        mPublishtopicGv.setOnClickListener(this);
101 118
    }
102 119

@ -146,6 +163,10 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
146 163
                        .recordVideoSecond(15)//录制视频秒数 默认60秒
147 164
                        .forResult(PictureConfig.CHOOSE_REQUEST);
148 165
                break;
166
            case R.id.item_video_delete:
167
                mItemVideoLl.setVisibility(View.GONE);
168
                mPublishtopicGv.setVisibility(View.VISIBLE);
169
                break;
149 170
            default:
150 171
                break;
151 172
        }
@ -171,21 +192,40 @@ public class PublishTopicActivity extends Activity implements OnClickListener {
171 192
                    return;
172 193
                }
173 194
                if (!fileIsExists(media.getPath())) {
174
                    Log.e("yopic","文件可能不存在了~");
195
                    Log.e("yopic", "文件可能不存在了~");
175 196
                    return;
176 197
                }
177
                Log.e("yopic","TEST===> video path = " + media.getPath()
198

199
                Glide.with(this).load(Uri.fromFile(new File(media.getPath())))
200
                        .listener(new RequestListener<Drawable>() {
201
                            @Override
202
                            public boolean onLoadFailed(@Nullable GlideException e, Object model,
203
                                                        Target<Drawable> target, boolean isFirstResource) {
204
                                return false;
205
                            }
206

207
                            @Override
208
                            public boolean onResourceReady(Drawable resource, Object model,
209
                                                           Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
210
                                return false;
211
                            }
212
                        })
213
                        .into(mItemVideo);
214
                mItemVideoLl.setVisibility(View.VISIBLE);
215
                mPublishtopicGv.setVisibility(View.GONE);
216
                Log.e("yopic", "TEST===> video path = " + media.getPath()
178 217
                        + ",  compressPath = " + media.getCompressPath()
179 218
                        + ", height = " + media.getHeight()
180 219
                        + ", width = " + media.getWidth());
181 220
            }
182 221

183

184 222
        }
185 223
    }
186
    public static boolean fileIsExists(String strFile) {
187
        if (TextUtils.isEmpty(strFile)) return false;
188 224

225
    public static boolean fileIsExists(String strFile) {
226
        if (TextUtils.isEmpty(strFile)) {
227
            return false;
228
        }
189 229
        try {
190 230
            File f = new File(strFile);
191 231
            if (!f.exists()) {

+ 28 - 0
app/src/main/res/layout/activity_publishtopic.xml

@ -68,6 +68,34 @@
68 68
                android:layout_height="108dp"
69 69
                android:background="@drawable/icon_feedback_upload"
70 70
                android:scaleType="centerCrop" />
71
72
            <RelativeLayout
73
                android:id="@+id/item_video_ll"
74
                android:visibility="gone"
75
                android:layout_width="wrap_content"
76
                android:layout_height="wrap_content">
77
78
                <ImageView
79
                    android:id="@+id/item_video"
80
                    android:layout_width="wrap_content"
81
                    android:layout_height="wrap_content"
82
                    android:background="@drawable/icon_feedback_upload"
83
                    android:scaleType="centerCrop" />
84
85
                <View
86
                    android:layout_width="40dp"
87
                    android:layout_height="40dp"
88
                    android:layout_centerInParent="true"
89
                    android:background="@drawable/app_talk_video_icon" />
90
91
                <View
92
                    android:id="@+id/item_video_delete"
93
                    android:layout_width="16dp"
94
                    android:layout_height="16dp"
95
                    android:layout_alignEnd="@+id/item_video"
96
                    android:layout_margin="12dp"
97
                    android:background="@drawable/icon_tuijian_close" />
98
            </RelativeLayout>
71 99
        </LinearLayout>
72 100
    </ScrollView>
73 101

+ 1 - 1
videolibrary/picture_library/build.gradle

@ -21,7 +21,7 @@ android {
21 21
dependencies {
22 22
    compile 'com.android.support:appcompat-v7:26.1.0'
23 23
    compile 'com.android.support:recyclerview-v7:26.1.0'
24
    compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
24
    compile 'com.github.bumptech.glide:glide:4.1.1'
25 25
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
26 26
    compile 'io.reactivex.rxjava2:rxjava:2.0.5'
27 27
    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'