d>
publishArray.add(result);
|
|
|
893
|
Log.e(TAG, isSuccess + result);
|
|
|
894
|
if (isSuccess) {
|
|
|
895
|
PhotoUploadResult photoUploadResult = new PhotoUploadResult(result);
|
|
|
896
|
publishArray.add(photoUploadResult.formatResult());
|
|
|
897
|
}
|
|
|
898
|
|
|
874
|
899
|
if (publishCount == publishArray.size()) {
|
|
875
|
900
|
String urls = "";
|
|
876
|
901
|
for (int i = 0; i < publishArray.size(); i++) {
|
|
|
@ -895,12 +920,12 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
|
|
895
|
920
|
String url = MainApplication.urlNew + "/topic/publish.do";
|
|
896
|
921
|
Map<String, String> map = new HashMap<>();
|
|
897
|
922
|
map.put("content", et_context.getText().toString());
|
|
898
|
|
map.put("urls", urls);
|
|
|
923
|
map.put("urls", Base64.encode(urls.getBytes()).replaceAll("\\s*", ""));
|
|
|
924
|
Log.d(TAG, "requestPublishServer: " + Base64.encode(urls.getBytes()).replaceAll("\\s*", ""));
|
|
899
|
925
|
if (chatRecommendBean != null) {
|
|
900
|
926
|
map.put("topicId", chatRecommendBean.topicId + "");
|
|
901
|
927
|
}
|
|
902
|
928
|
map.put("targetType", ChatRecommendBean.TARGET_TYPE_IMAGE_TEXT + "");
|
|
903
|
|
map.put("coverImgUrl", "");
|
|
904
|
929
|
CommonParams.addCommonParams(map);
|
|
905
|
930
|
|
|
906
|
931
|
OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
|
|
|
@ -73,10 +73,10 @@ public class MainApplication extends MultiDexApplication {
|
|
73
|
73
|
public static String firstPoint = "";
|
|
74
|
74
|
public static Boolean firstSsyd;
|
|
75
|
75
|
public static String password = "";
|
|
76
|
|
// public static String url = "http://59.110.68.162";// 充电桩测试环境
|
|
77
|
|
public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
|
|
78
|
|
// public static String urlNew = "http://123.56.67.7:83/api/0200";// 一电测试环境
|
|
79
|
|
public static String urlNew = "https://api.touchev.com:83/api/0200";// 一电正式环境
|
|
|
76
|
public static String url = "http://59.110.68.162";// 充电桩测试环境
|
|
|
77
|
// public static String url = "http://cdz.evcharge.cc";// 充电桩正式环境
|
|
|
78
|
public static String urlNew = "http://123.56.67.7:83/api/0300";// 一电测试环境
|
|
|
79
|
// public static String urlNew = "https://api.touchev.com:83/api/0200";// 一电正式环境
|
|
80
|
80
|
public static String pic_url = "http://cdz.evcharge.cc/zhannew/uploadfile/";
|
|
81
|
81
|
// public static String url = "https://cdz.d1ev.com";
|
|
82
|
82
|
public static String build_flag = "0";
|
|
|
@ -0,0 +1,35 @@
|
|
|
1
|
package com.electric.chargingpile.data;
|
|
|
2
|
|
|
|
3
|
import android.util.Log;
|
|
|
4
|
|
|
|
5
|
import com.electric.chargingpile.util.JsonUtils;
|
|
|
6
|
import com.google.gson.Gson;
|
|
|
7
|
|
|
|
8
|
import java.util.HashMap;
|
|
|
9
|
import java.util.Map;
|
|
|
10
|
|
|
|
11
|
public class PhotoUploadResult {
|
|
|
12
|
private static final String TAG = "PhotoUploadResult";
|
|
|
13
|
private String result;
|
|
|
14
|
|
|
|
15
|
public PhotoUploadResult(String result) {
|
|
|
16
|
this.result = result;
|
|
|
17
|
}
|
|
|
18
|
|
|
|
19
|
public String formatResult() {
|
|
|
20
|
Gson gson = new Gson();
|
|
|
21
|
Map<String, Object> map = new HashMap<>();
|
|
|
22
|
map = gson.fromJson(result, map.getClass());
|
|
|
23
|
|
|
|
24
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
25
|
resultMap.put("type", map.get("image-type"));
|
|
|
26
|
resultMap.put("size", map.get("file_size"));
|
|
|
27
|
resultMap.put("w", map.get("image-width"));
|
|
|
28
|
resultMap.put("h", map.get("image-height"));
|
|
|
29
|
resultMap.put("url", map.get("url"));
|
|
|
30
|
resultMap.put("frames", map.get("image-frames"));
|
|
|
31
|
|
|
|
32
|
return JsonUtils.mapToJson(resultMap);
|
|
|
33
|
}
|
|
|
34
|
|
|
|
35
|
}
|
|
|
@ -3,7 +3,10 @@ package com.electric.chargingpile.fragment;
|
|
3
|
3
|
import android.os.Bundle;
|
|
4
|
4
|
import android.support.annotation.Nullable;
|
|
5
|
5
|
import android.support.v4.app.Fragment;
|
|
|
6
|
import android.util.Log;
|
|
|
7
|
import android.view.DragEvent;
|
|
6
|
8
|
import android.view.LayoutInflater;
|
|
|
9
|
import android.view.MotionEvent;
|
|
7
|
10
|
import android.view.View;
|
|
8
|
11
|
import android.view.ViewGroup;
|
|
9
|
12
|
|
|
|
@ -11,6 +14,7 @@ import com.electric.chargingpile.R;
|
|
11
|
14
|
import com.squareup.picasso.Picasso;
|
|
12
|
15
|
|
|
13
|
16
|
import uk.co.senab.photoview.PhotoView;
|
|
|
17
|
import uk.co.senab.photoview.PhotoViewAttacher;
|
|
14
|
18
|
|
|
15
|
19
|
public class ChatPhotoFragment extends Fragment {
|
|
16
|
20
|
private static final String TAG = "ChatPhotoFragment";
|
|
|
@ -22,6 +22,12 @@ public class DateUtils {
|
|
22
|
22
|
return sf.format(d);
|
|
23
|
23
|
}
|
|
24
|
24
|
|
|
|
25
|
public static String getSimpleCurrentDate() {
|
|
|
26
|
Date d = new Date();
|
|
|
27
|
sf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
28
|
return sf.format(d);
|
|
|
29
|
}
|
|
|
30
|
|
|
25
|
31
|
/*时间戳转换成字符窜*/
|
|
26
|
32
|
public static String getDateToString(long time) {
|
|
27
|
33
|
Date d = new Date(time);
|
|
|
@ -11,6 +11,7 @@ public class ImageItem implements Serializable {
|
|
11
|
11
|
public String thumbnailPath;
|
|
12
|
12
|
public String imagePath;
|
|
13
|
13
|
private Bitmap bitmap;
|
|
|
14
|
public String fName = "";
|
|
14
|
15
|
public boolean isSelected = false;
|
|
15
|
16
|
|
|
16
|
17
|
public String getImageId() {
|
|
|
@ -21,6 +21,7 @@ import java.util.ArrayList;
|
|
21
|
21
|
import java.util.HashMap;
|
|
22
|
22
|
import java.util.List;
|
|
23
|
23
|
import java.util.Map;
|
|
|
24
|
import java.util.Random;
|
|
24
|
25
|
|
|
25
|
26
|
public class Util {
|
|
26
|
27
|
private static final String PHONE_PATTERN = "[1]{1}[3,4,5,6,7,8,9]{1}[0-9]{9}";
|
|
|
@ -49,6 +50,15 @@ public class Util {
|
|
49
|
50
|
|
|
50
|
51
|
}
|
|
51
|
52
|
|
|
|
53
|
public static String getRandom(int length) {
|
|
|
54
|
String val = "";
|
|
|
55
|
Random random = new Random();
|
|
|
56
|
for (int i=0;i<length;i++) {
|
|
|
57
|
val += String.valueOf(random.nextInt(10));
|
|
|
58
|
}
|
|
|
59
|
return val;
|
|
|
60
|
}
|
|
|
61
|
|
|
52
|
62
|
|
|
53
|
63
|
public static String getPhone(Context context) {
|
|
54
|
64
|
return ProfileManager.getInstance().getUsername(context);
|
|
|
@ -8,7 +8,7 @@
|
|
8
|
8
|
|
|
9
|
9
|
<com.electric.chargingpile.iview.ChatPhotoViewPager
|
|
10
|
10
|
android:id="@+id/photoPager"
|
|
11
|
|
android:layout_width="match_parent"
|
|
|
11
|
android:layout_width="0dp"
|
|
12
|
12
|
android:layout_height="0dp"
|
|
13
|
13
|
app:layout_constraintBottom_toTopOf="@+id/bottomView"
|
|
14
|
14
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
@ -10,7 +10,7 @@
|
|
10
|
10
|
android:layout_width="match_parent"
|
|
11
|
11
|
android:layout_height="wrap_content"
|
|
12
|
12
|
android:adjustViewBounds="true"
|
|
13
|
|
android:scaleType="fitXY"
|
|
|
13
|
android:scaleType="centerCrop"
|
|
14
|
14
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
15
|
15
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
16
|
16
|
app:layout_constraintRight_toRightOf="parent"
|