huyuguo 5 年 前
コミット
9c85577f67

+ 29 - 30
app/src/main/java/com/electric/chargingpile/activity/PublishPicTopicActivity.java

@ -26,6 +26,7 @@ import android.support.v4.app.ActivityCompat;
26 26
import android.support.v7.app.AlertDialog;
27 27
import android.telephony.TelephonyManager;
28 28
import android.text.Editable;
29
import android.text.Html;
29 30
import android.text.TextUtils;
30 31
import android.text.TextWatcher;
31 32
import android.util.Log;
@ -257,14 +258,13 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
257 258
//                    ToastUtil.showToast(getApplicationContext(), "输入字数不能超过500", Toast.LENGTH_SHORT);
258 259
//                    return;
259 260
//                }
260
                if (!s.trim().isEmpty() && s.length() > 0 && null != Bimp.tempSelectBitmap && Bimp.tempSelectBitmap.size() > 0) {
261
                    tv_right.setEnabled(true);
262
//					tv_right.setTextColor(getResources().getColor(R.color.lvse));
263
                    tv_right.setBackgroundColor(Color.parseColor("#02b637"));
264
                } else {
265
                    tv_right.setEnabled(false);
266
                    tv_right.setBackgroundColor(Color.parseColor("#9ed3ae"));
267
                }
261
//                if (!s.trim().isEmpty() && s.length() > 0 && null != Bimp.tempSelectBitmap && Bimp.tempSelectBitmap.size() > 0) {
262
//                    tv_right.setEnabled(true);
263
//                    tv_right.setBackgroundColor(Color.parseColor("#02b637"));
264
//                } else {
265
//                    tv_right.setEnabled(false);
266
//                    tv_right.setBackgroundColor(Color.parseColor("#9ed3ae"));
267
//                }
268 268
269 269
                if (TextUtils.isEmpty(s))
270 270
                    publishtopic_word_num.setText("0");
@ -324,7 +324,6 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
324 324
                    ToastUtil.showToast(getApplicationContext(), desc, Toast.LENGTH_SHORT);
325 325
                } else {
326 326
                    uploadDialog.dismiss();
327
                    uploadDialog.cancel();
328 327
                    ToastUtil.showToast(getApplicationContext(), desc, Toast.LENGTH_SHORT);
329 328
                }
330 329
            }
@ -339,12 +338,12 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
339 338
    @Override
340 339
    public void onClick(View v) {
341 340
        switch (v.getId()) {
342
            case R.id.publishtopic_choose_topic_de:
341
            case R.id.publishtopic_choose_topic_de: // 取消选择的话题
343 342
                mPublishtopicChooseTopic.setText("# 选择话题");
344 343
                mPublishTopicDe.setVisibility(View.GONE);
345
                talkRecommendBean = null;
344
                chatRecommendBean = null;
346 345
                break;
347
            case R.id.publishtopic_choose_topic:
346
            case R.id.publishtopic_choose_topic: // 选择话题
348 347
                startActivityForResult(new Intent(this, TopicActivity.class), reqTopic);
349 348
                break;
350 349
            case R.id.iv_back:
@ -355,13 +354,11 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
355 354
                    }
356 355
                }
357 356
                showDialogToExit();
358
//                finish();
359 357
                break;
360 358
        }
361 359
    }
362 360
363
    TalkRecommendBean talkRecommendBean = null;
364
361
    ChatRecommendBean chatRecommendBean = null;
365 362
366 363
    @Override
367 364
    protected void onPause() {
@ -504,11 +501,10 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
504 501
    @Override
505 502
    protected void onActivityResult(int requestCode, int resultCode, final Intent data) {
506 503
        super.onActivityResult(requestCode, resultCode, data);
507
        if (requestCode == 100 && resultCode == -100) {
508
            talkRecommendBean = (TalkRecommendBean) data.getSerializableExtra("topic");
509
            if (talkRecommendBean != null) {
510
                mPublishtopicChooseTopic.setText("# " + talkRecommendBean.topicName);
511
                topicId = talkRecommendBean.topicId + "";
504
        if (requestCode == reqTopic && resultCode == -100) {
505
            chatRecommendBean = (ChatRecommendBean) data.getSerializableExtra("topic");
506
            if (chatRecommendBean != null) {
507
                mPublishtopicChooseTopic.setText(Html.fromHtml(chatRecommendBean.name));
512 508
                mPublishTopicDe.setVisibility(View.VISIBLE);
513 509
            }
514 510
        }
@ -550,13 +546,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
550 546
                        subscriber.onNext(imagePath);
551 547
                    }
552 548
                    subscriber.onComplete();
553
                    if (null != photos && photos.size() > 0 && !TextUtils.isEmpty(et_context.getText().toString().trim())) {
554
                        tv_right.setEnabled(true);
555
                        tv_right.setBackgroundColor(Color.parseColor("#02b637"));
556
                    } else {
557
                        tv_right.setEnabled(false);
558
                        tv_right.setBackgroundColor(Color.parseColor("#9ed3ae"));
559
                    }
549
560 550
                } catch (Exception e) {
561 551
                    e.printStackTrace();
562 552
                    subscriber.onError(e);
@ -698,6 +688,13 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
698 688
            public void handleMessage(Message msg) {
699 689
                switch (msg.what) {
700 690
                    case 1:
691
                        if (null != Bimp.tempSelectBitmap && Bimp.tempSelectBitmap.size() > 0) {
692
                            tv_right.setEnabled(true);
693
                            tv_right.setBackgroundColor(Color.parseColor("#02b637"));
694
                        } else {
695
                            tv_right.setEnabled(false);
696
                            tv_right.setBackgroundColor(Color.parseColor("#9ed3ae"));
697
                        }
701 698
                        adapter.notifyDataSetChanged();
702 699
                        break;
703 700
                }
@ -902,10 +899,11 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
902 899
        Map<String, String> map = new HashMap<>();
903 900
        map.put("content", et_context.getText().toString());
904 901
        map.put("urls", urls);
905
        map.put("topicId", topicId);
906
        map.put("targetType", "24");
902
        if (chatRecommendBean != null) {
903
            map.put("topicId", chatRecommendBean.targetId + "");
904
        }
905
        map.put("targetType", ChatRecommendBean.TARGET_TYPE_IMAGE_TEXT + "");
907 906
        map.put("coverImgUrl", "");
908
        map.put("appToken", ProfileManager.getInstance().getKeyMessageToken(getApplicationContext()));
909 907
        CommonParams.addCommonParams(map);
910 908
911 909
        OkHttpUtils.post().params(map).url(url).build().connTimeOut(6000).readTimeOut(6000).execute(new StringCallback() {
@ -928,6 +926,7 @@ public class PublishPicTopicActivity extends Activity implements OnClickListener
928 926
                String desc = JsonUtils.getKeyResult(response, "desc");
929 927
                if ("1000".equals(code)) {
930 928
                    ToastUtil.showToast(getApplicationContext(), "发布成功", Toast.LENGTH_SHORT);
929
                    startActivity(new Intent(getApplicationContext(), ChatActivity.class));
931 930
                } else {
932 931
                    ToastUtil.showToast(getApplicationContext(), desc, Toast.LENGTH_SHORT);
933 932
                }

+ 3 - 4
app/src/main/java/com/electric/chargingpile/activity/PublishVideoTopicActivity.java

@ -148,8 +148,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
148 148
    }
149 149
150 150
    private void updatePublishBtn() {
151
        String s = mPublishtopicCon.getText().toString();
152
        if (!s.trim().isEmpty() && s.length() > 0 && null != media) {
151
        if (null != media) {
153 152
            mPublishtopicPublish.setEnabled(true);
154 153
            mPublishtopicPublish.setBackgroundColor(Color.parseColor("#02b637"));
155 154
        } else {
@ -193,7 +192,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
193 192
                        .selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE : PictureConfig.SINGLE
194 193
                        .previewImage(true)// 是否可预览图片
195 194
                        .previewVideo(true)// 是否可预览视频
196
                        .enablePreviewAudio(false)// 是否预览音频
195
                        .enablePreviewAudio(true)// 是否预览音频
197 196
                        .isCamera(true)// 是否显示拍照按钮
198 197
                        .isZoomAnim(true)// 图片列表点击 缩放效果 默认true
199 198
                        .setOutputCameraPath(IMAGE_CACHE)// 自定义拍照保存路径
@ -205,7 +204,7 @@ public class PublishVideoTopicActivity extends Activity implements OnClickListen
205 204
                        .compressGrade(Luban.CUSTOM_GEAR)
206 205
                        .compressMaxKB(1024)//压缩最大值kb compressGrade()为Luban.CUSTOM_GEAR有效
207 206
                        .minimumCompressSize(500) //add by tanhaiqin, 图片大小 <= 500KB(数字可变) 不需要压缩
208
                        .videoSecond(5 * 60)//显示多少秒以内的视频
207
                        .videoSecond(2 * 60)// 显示多少秒以内的视频
209 208
                        .recordVideoSecond(15)//录制视频秒数 默认60秒
210 209
                        .forResult(PictureConfig.CHOOSE_REQUEST);
211 210
                break;

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

@ -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/0200";// 一电测试环境
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";

BIN
app/src/main/res/drawable-xhdpi/bg_w_4.9.png


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


BIN
app/src/main/res/drawable-xhdpi/bg_w_41.jpg


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

@ -42,7 +42,7 @@
42 42
            android:layout_alignParentEnd="true"
43 43
            android:layout_centerHorizontal="true"
44 44
            android:layout_marginTop="@dimen/ui_10_dip"
45
            android:layout_marginEnd="25dp"
45
            android:layout_marginEnd="15dp"
46 46
            android:background="#9ed3ae"
47 47
            android:enabled="false"
48 48
            android:gravity="center"

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

@ -28,7 +28,7 @@
28 28
        android:layout_alignParentEnd="true"
29 29
        android:layout_centerHorizontal="true"
30 30
        android:layout_marginTop="@dimen/ui_10_dip"
31
        android:layout_marginEnd="25dp"
31
        android:layout_marginEnd="15dp"
32 32
        android:background="#9ed3ae"
33 33
        android:enabled="false"
34 34
        android:gravity="center"

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

@ -11,7 +11,7 @@
11 11
        android:layout_centerHorizontal="true"
12 12
13 13
        android:contentDescription="@null"
14
        android:src="@drawable/bg_w_41" />
14
        android:src="@drawable/bg_w_4" />
15 15
16 16
    <ImageView
17 17
        android:layout_width="200dp"

+ 1 - 1
videolibrary/picture_library/src/main/java/com/luck/picture/lib/PicturePreviewActivity.java

@ -475,7 +475,7 @@ public class PicturePreviewActivity extends PictureBaseActivity implements View.
475 475
476 476
            rlSelectBarLayout.setVisibility(View.VISIBLE);
477 477
478
            if (media.getDuration() > 15 * 1000) {
478
            if (media.getDuration() > 120 * 1000) {
479 479
                video_layout.setVisibility(View.GONE);
480 480
                video_layout10.setVisibility(View.VISIBLE);
481 481

+ 2 - 1
videolibrary/picture_library/src/main/res/layout/picture_preview.xml

@ -38,6 +38,7 @@
38 38
                    android:layout_centerVertical="true"
39 39
                    android:padding="10dp"
40 40
                    android:text="编辑"
41
                    android:visibility="gone"
41 42
                    android:textColor="@color/color_13bfb1"
42 43
                    android:textSize="15sp" />
43 44
@ -66,7 +67,7 @@
66 67
                    android:layout_height="wrap_content"
67 68
                    android:layout_centerVertical="true"
68 69
                    android:padding="10dp"
69
                    android:text="只能分享15秒内视频,需要进行编辑"
70
                    android:text="只能分享120秒内视频,需要进行编辑"
70 71
                    android:textColor="@color/color_69"
71 72
                    android:textSize="12sp" />
72 73