"> 283
//        getIntegration();
284
285
286
        // ATTENTION: This was auto-generated to implement the App Indexing API.
217
        // ATTENTION: This was auto-generated to implement the App Indexing API.
287
        // See https://g.co/AppIndexing/AndroidStudio for more information.
218
        // See https://g.co/AppIndexing/AndroidStudio for more information.
288
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
219
        client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
298
                    } catch (Exception e) {
229
                    } catch (Exception e) {
299
                        e.printStackTrace();
230
                        e.printStackTrace();
300
                    }
231
                    }
301
302
//                    saveBitmap(bm);
303
304
                    break;
232
                    break;
305
306
307
                default:
233
                default:
308
                    break;
234
                    break;
309
            }
235
            }
364
        iv_hongbao = (ImageView) findViewById(R.id.iv_hongbao);
290
        iv_hongbao = (ImageView) findViewById(R.id.iv_hongbao);
365
        iv_chongdianbi = (ImageView) findViewById(R.id.iv_chongdianbi);
291
        iv_chongdianbi = (ImageView) findViewById(R.id.iv_chongdianbi);
366
        yue = (TextView) findViewById(R.id.tv_yue);
292
        yue = (TextView) findViewById(R.id.tv_yue);
367
//        iv_message = (ImageView) findViewById(R.id.iv_message);
368
        iv_message = (ImageView) findViewById(R.id.iv_have_message);
293
        iv_message = (ImageView) findViewById(R.id.iv_have_message);
369
294
370
        ll_tab_find = (RelativeLayout) findViewById(R.id.ll_tab_find);
295
        ll_tab_find = (RelativeLayout) findViewById(R.id.ll_tab_find);
379
304
380
305
381
        iv_our = (ImageView) findViewById(R.id.iv_our);
306
        iv_our = (ImageView) findViewById(R.id.iv_our);
382
//        if (MainMapActivity.have_message == 1) {
383
//            Log.e("userCenter==",MainMapActivity.have_message+"");
384
//            iv_message.setVisibility(View.VISIBLE);
385
//        } else {
386
//            iv_message.setVisibility(View.INVISIBLE);
387
//        }
388
389
390
//        iv_havemessage = (ImageView) findViewById(R.id.iv_havemessage);
391
//        if (MainFragment.have_message == 1){
392
//            iv_havemessage.setVisibility(View.VISIBLE);
393
//        }else if(MainFragment.have_message == 0){
394
//            iv_havemessage.setVisibility(View.GONE);
395
//        }
396
397
398
//        if (have_message == 1){
399
//            iv_message.setVisibility(View.VISIBLE);
400
//        }else{
401
//            iv_message.setVisibility(View.INVISIBLE);
402
//        }
403
307
404
        rl_collection = (RelativeLayout) findViewById(R.id.rl_collection);
308
        rl_collection = (RelativeLayout) findViewById(R.id.rl_collection);
405
        rl_collection.setOnClickListener(this);
309
        rl_collection.setOnClickListener(this);
406
310
407
408
//        rl_more = (RelativeLayout) findViewById(R.id.rl_more);
409
//        rl_more.setOnClickListener(this);
410
411
        rl_message = (RelativeLayout) findViewById(R.id.rl_message);
311
        rl_message = (RelativeLayout) findViewById(R.id.rl_message);
412
        rl_message.setOnClickListener(this);
312
        rl_message.setOnClickListener(this);
413
313
414
415
        rl_shareNo = (RelativeLayout) findViewById(R.id.rl_shareNo);
314
        rl_shareNo = (RelativeLayout) findViewById(R.id.rl_shareNo);
416
        rl_shareNo.setOnClickListener(this);
315
        rl_shareNo.setOnClickListener(this);
417
316
422
        chat_share_bar = findViewById(R.id.chat_share_bar);
321
        chat_share_bar = findViewById(R.id.chat_share_bar);
423
        chat_share_bar.setOnClickListener(this);
322
        chat_share_bar.setOnClickListener(this);
424
323
324
        rl_car_owner_certificate = findViewById(R.id.rl_car_owner_certificate);
325
        rl_car_owner_certificate.setOnClickListener(this);
326
327
        rl_publish_price = findViewById(R.id.rl_publish_price);
328
        rl_publish_price.setOnClickListener(this);
425
329
426
        rl_chongzhi = (RelativeLayout) findViewById(R.id.rl_chongzhi);
330
        rl_chongzhi = (RelativeLayout) findViewById(R.id.rl_chongzhi);
427
        rl_chongzhi.setOnClickListener(this);
331
        rl_chongzhi.setOnClickListener(this);
437
341
438
        rl_yue = (RelativeLayout) findViewById(R.id.rl_yue);
342
        rl_yue = (RelativeLayout) findViewById(R.id.rl_yue);
439
        rl_yue.setOnClickListener(this);
343
        rl_yue.setOnClickListener(this);
440
//        mTogBtn = (ToggleButton) findViewById(R.id.iosbutton); // 获取到控件
441
//        if (MainApplication.userTpye == "1") {
442
//            mTogBtn.setChecked(false);
443
//        } else if (MainApplication.userTpye == "2") {
444
//            mTogBtn.setChecked(true);
445
//        }
446
//
447
//        mTogBtn.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
448
//
449
//            @Override
450
//            public void onCheckedChanged(CompoundButton buttonView,
451
//                                         boolean isChecked) {
452
//                // TODO Auto-generated method stub
453
//                if (isChecked) {
454
//                    MainApplication.userTpye = "2";
455
//                    Log.e("suit_car", "特斯拉");
456
//                    MainFragment.firstSelect();
457
//                } else {
458
//                    MainApplication.userTpye = "1";
459
//                    Log.e("suit_car", "国标");
460
//                    MainFragment.firstSelect();
461
//                }
462
//            }
463
//        });
464
344
465
        tab_main = (LinearLayout) findViewById(R.id.tab_main);
345
        tab_main = (LinearLayout) findViewById(R.id.tab_main);
466
        tab_main.setOnClickListener(this);
346
        tab_main.setOnClickListener(this);
478
        llPerson = (RelativeLayout) findViewById(R.id.ll_person);
358
        llPerson = (RelativeLayout) findViewById(R.id.ll_person);
479
        llPerson.setOnClickListener(this);
359
        llPerson.setOnClickListener(this);
480
360
481
482
        //退出登录按钮
483
//        tv_exit = (TextView) findViewById(R.id.tv_exit);
484
//        tv_exit.setOnClickListener(this);
485
486
        //登陆按钮
361
        //登陆按钮
487
        userLogin = (TextView) findViewById(R.id.userLogin);
362
        userLogin = (TextView) findViewById(R.id.userLogin);
488
        userLogin.setOnClickListener(this);
363
        userLogin.setOnClickListener(this);
901
                MobclickAgent.onEvent(getApplicationContext(), "0815");
776
                MobclickAgent.onEvent(getApplicationContext(), "0815");
902
                break;
777
                break;
903
778
779
            case R.id.rl_car_owner_certificate: // 车主认证
780
                if (!MainApplication.isLogin()) {
781
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
782
                    startActivity(new Intent(getApplication(), LoginActivity.class));
783
                } else {
784
                    // 列表接口
785
                    // 1.无认证记录
786
                    startActivity(new Intent(getApplication(), CarOwnerCertificateActivity.class));
787
//                    MobclickAgent.onEvent(getApplicationContext(), "0810"); // TODO
788
                }
789
                break;
790
            case R.id.rl_publish_price: // 发表成交价
791
                if (!MainApplication.isLogin()) {
792
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
793
                    startActivity(new Intent(getApplication(), LoginActivity.class));
794
                } else {
795
                    // TODO 跳转html
796
                    System.out.println("come on");
797
                }
798
                break;
799
904
            case R.id.rl_chongzhi:
800
            case R.id.rl_chongzhi:
905
                if (!MainApplication.isLogin()) {
801
                if (!MainApplication.isLogin()) {
906
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();
802
                    Toast.makeText(getApplication(), "请先登录", Toast.LENGTH_SHORT).show();

+ 97 - 0
app/src/main/java/com/electric/chargingpile/adapter/CarBrandGroupedListAdapter.java

1
package com.electric.chargingpile.adapter;
2
3
import android.content.Context;
4
import android.view.LayoutInflater;
5
import android.view.View;
6
import android.view.ViewGroup;
7
import android.widget.Button;
8
import android.widget.ImageView;
9
10
import com.bumptech.glide.Glide;
11
import com.bumptech.glide.load.engine.DiskCacheStrategy;
12
import com.donkingliang.groupedadapter.adapter.GroupedRecyclerViewAdapter;
13
import com.donkingliang.groupedadapter.holder.BaseViewHolder;
14
import com.electric.chargingpile.R;
15
import com.electric.chargingpile.entity.CarBrandChildEntity;
16
import com.electric.chargingpile.entity.CarBrandGroupEntity;
17
18
import java.util.ArrayList;
19
20
public class CarBrandGroupedListAdapter extends GroupedRecyclerViewAdapter {
21
22
    protected ArrayList<CarBrandGroupEntity> groups;
23
24
    public CarBrandGroupedListAdapter(Context context, ArrayList<CarBrandGroupEntity> groups) {
25
        super(context);
26
        this.groups = groups;
27
    }
28
29
    public void clear() {
30
        groups.clear();
31
        notifyDataChanged();
32
    }
33
34
    public void setGroups(ArrayList<CarBrandGroupEntity> groups) {
35
        this.groups = groups;
36
        notifyDataChanged();
37
    }
38
39
    @Override
40
    public int getGroupCount() {
41
        return groups == null ? 0 : groups.size();
42
    }
43
44
    @Override
45
    public int getChildrenCount(int groupPosition) {
46
        ArrayList<CarBrandChildEntity> children = groups.get(groupPosition).getBrandList();
47
        return children == null ? 0 : children.size();
48
    }
49
50
    @Override
51
    public boolean hasHeader(int groupPosition) {
52
        return true;
53
    }
54
55
    @Override
56
    public boolean hasFooter(int groupPosition) {
57
        return false;
58
    }
59
60
    @Override
61
    public int getHeaderLayout(int viewType) {
62
        return R.layout.adapter_header_car_brand;
63
    }
64
65
    @Override
66
    public int getFooterLayout(int viewType) {
67
        return 0;
68
    }
69
70
    @Override
71
    public int getChildLayout(int viewType) {
72
        return R.layout.adapter_child_car_brand;
73
    }
74
75
    @Override
76
    public void onBindHeaderViewHolder(BaseViewHolder holder, int groupPosition) {
77
        CarBrandGroupEntity entity = groups.get(groupPosition);
78
        holder.setText(R.id.title, entity.getInitial());
79
    }
80
81
    @Override
82
    public void onBindFooterViewHolder(BaseViewHolder holder, int groupPosition) {
83
    }
84
85
    @Override
86
    public void onBindChildViewHolder(BaseViewHolder holder, int groupPosition, int childPosition) {
87
        CarBrandChildEntity entity = groups.get(groupPosition).getBrandList().get(childPosition);
88
        holder.setText(R.id.title, entity.getBrandName());
89
        if (childPosition == 0) {
90
            holder.setVisible(R.id.line, View.GONE);
91
        } else {
92
            holder.setVisible(R.id.line, View.VISIBLE);
93
        }
94
        ImageView icon = holder.getImageView(R.id.icon);
95
        Glide.with(mContext).load(entity.getIcon()).placeholder(android.R.color.white).fitCenter().into(icon);
96
    }
97
}

+ 95 - 0
app/src/main/java/com/electric/chargingpile/adapter/CarModelGroupedListAdapter.java

1
package com.electric.chargingpile.adapter;
2
3
import android.content.Context;
4
import android.view.View;
5
import android.widget.ImageView;
6
7
import com.bumptech.glide.Glide;
8
import com.bumptech.glide.load.engine.DiskCacheStrategy;
9
import com.donkingliang.groupedadapter.adapter.GroupedRecyclerViewAdapter;
10
import com.donkingliang.groupedadapter.holder.BaseViewHolder;
11
import com.electric.chargingpile.R;
12
import com.electric.chargingpile.entity.CarCompanyEntity;
13
import com.electric.chargingpile.entity.CarSeriesEntity;
14
15
import java.util.ArrayList;
16
17
public class CarModelGroupedListAdapter extends GroupedRecyclerViewAdapter {
18
    protected ArrayList<CarCompanyEntity> groups;
19
20
    public CarModelGroupedListAdapter(Context context, ArrayList<CarCompanyEntity> groups) {
21
        super(context);
22
        this.groups = groups;
23
    }
24
25
    public void clear() {
26
        groups.clear();
27
        notifyDataChanged();
28
    }
29
30
    public void setGroups(ArrayList<CarCompanyEntity> groups) {
31
        this.groups = groups;
32
        notifyDataChanged();
33
    }
34
35
    @Override
36
    public int getGroupCount() {
37
        return groups == null ? 0 : groups.size();
38
    }
39
40
    @Override
41
    public int getChildrenCount(int groupPosition) {
42
        ArrayList<CarSeriesEntity> children = groups.get(groupPosition).getSerieslist();
43
        return children == null ? 0 : children.size();
44
    }
45
46
    @Override
47
    public boolean hasHeader(int groupPosition) {
48
        return true;
49
    }
50
51
    @Override
52
    public boolean hasFooter(int groupPosition) {
53
        return false;
54
    }
55
56
    @Override
57
    public int getHeaderLayout(int viewType) {
58
        return R.layout.adapter_header_car_model;
59
    }
60
61
    @Override
62
    public int getFooterLayout(int viewType) {
63
        return 0;
64
    }
65
66
    @Override
67
    public int getChildLayout(int viewType) {
68
        return R.layout.adapter_child_car_model;
69
    }
70
71
    @Override
72
    public void onBindHeaderViewHolder(BaseViewHolder holder, int groupPosition) {
73
        CarCompanyEntity entity = groups.get(groupPosition);
74
        holder.setText(R.id.title, entity.getCompanyName());
75
    }
76
77
    @Override
78
    public void onBindFooterViewHolder(BaseViewHolder holder, int groupPosition) {
79
80
    }
81
82
    @Override
83
    public void onBindChildViewHolder(BaseViewHolder holder, int groupPosition, int childPosition) {
84
        CarSeriesEntity entity = groups.get(groupPosition).getSerieslist().get(childPosition);
85
        holder.setText(R.id.title, entity.getSeriesName());
86
        if (childPosition == 0) {
87
            holder.setVisible(R.id.line, View.GONE);
88
        } else {
89
            holder.setVisible(R.id.line, View.VISIBLE);
90
        }
91
        ImageView icon = holder.getImageView(R.id.icon);
92
        Glide.with(mContext).load(entity.getIcon()).placeholder(android.R.color.white).diskCacheStrategy(DiskCacheStrategy.RESOURCE).fitCenter().into(icon);
93
    }
94
95
}

+ 59 - 0
app/src/main/java/com/electric/chargingpile/entity/CarBrandChildEntity.java

1
package com.electric.chargingpile.entity;
2
3
import java.util.ArrayList;
4
5
public class CarBrandChildEntity {
6
    private int brandId;
7
    private String brandName;
8
    private int seriesNum;
9
    private String icon;
10
    private ArrayList<CarCompanyEntity> companyList;
11
12
    public CarBrandChildEntity(int brandId, String brandName, int seriesNum, String icon, ArrayList<CarCompanyEntity> companyList) {
13
        this.brandId = brandId;
14
        this.brandName = brandName;
15
        this.seriesNum = seriesNum;
16
        this.icon = icon;
17
        this.companyList = companyList;
18
    }
19
20
    public int getBrandId() {
21
        return brandId;
22
    }
23
24
    public void setBrandId(int brandId) {
25
        this.brandId = brandId;
26
    }
27
28
    public String getBrandName() {
29
        return brandName;
30
    }
31
32
    public void setBrandName(String brandName) {
33
        this.brandName = brandName;
34
    }
35
36
    public int getSeriesNum() {
37
        return seriesNum;
38
    }
39
40
    public void setSeriesNum(int seriesNum) {
41
        this.seriesNum = seriesNum;
42
    }
43
44
    public String getIcon() {
45
        return icon;
46
    }
47
48
    public void setIcon(String icon) {
49
        this.icon = icon;
50
    }
51
52
    public ArrayList<CarCompanyEntity> getCompanyList() {
53
        return companyList;
54
    }
55
56
    public void setCompanyList(ArrayList<CarCompanyEntity> companyList) {
57
        this.companyList = companyList;
58
    }
59
}

+ 30 - 0
app/src/main/java/com/electric/chargingpile/entity/CarBrandGroupEntity.java

1
package com.electric.chargingpile.entity;
2
3
4
import java.util.ArrayList;
5
6
public class CarBrandGroupEntity {
7
    private String initial; // header
8
    private ArrayList<CarBrandChildEntity> brandList; // children
9
10
    public CarBrandGroupEntity(String initial, ArrayList<CarBrandChildEntity> brandList) {
11
        this.initial = initial;
12
        this.brandList = brandList;
13
    }
14
15
    public String getInitial() {
16
        return initial;
17
    }
18
19
    public void setInitial(String initial) {
20
        this.initial = initial;
21
    }
22
23
    public ArrayList<CarBrandChildEntity> getBrandList() {
24
        return brandList;
25
    }
26
27
    public void setBrandList(ArrayList<CarBrandChildEntity> brandList) {
28
        this.brandList = brandList;
29
    }
30
}

+ 50 - 0
app/src/main/java/com/electric/chargingpile/entity/CarCompanyEntity.java

1
package com.electric.chargingpile.entity;
2
3
import java.util.ArrayList;
4
5
public class CarCompanyEntity {
6
    private int companyId;
7
    private String companyName;
8
    private int brandId;
9
    private ArrayList<CarSeriesEntity> serieslist;
10
11
    public CarCompanyEntity(int companyId, String companyName, int brandId, ArrayList<CarSeriesEntity> serieslist) {
12
        this.companyId = companyId;
13
        this.companyName = companyName;
14
        this.brandId = brandId;
15
        this.serieslist = serieslist;
16
    }
17
18
19
    public int getCompanyId() {
20
        return companyId;
21
    }
22
23
    public void setCompanyId(int companyId) {
24
        this.companyId = companyId;
25
    }
26
27
    public String getCompanyName() {
28
        return companyName;
29
    }
30
31
    public void setCompanyName(String companyName) {
32
        this.companyName = companyName;
33
    }
34
35
    public int getBrandId() {
36
        return brandId;
37
    }
38
39
    public void setBrandId(int brandId) {
40
        this.brandId = brandId;
41
    }
42
43
    public ArrayList<CarSeriesEntity> getSerieslist() {
44
        return serieslist;
45
    }
46
47
    public void setSerieslist(ArrayList<CarSeriesEntity> serieslist) {
48
        this.serieslist = serieslist;
49
    }
50
}

+ 67 - 0
app/src/main/java/com/electric/chargingpile/entity/CarSeriesEntity.java

1
package com.electric.chargingpile.entity;
2
3
public class CarSeriesEntity {
4
    private int brandId;
5
    private String brandName;
6
    private int companyId;
7
    private int seriesId;
8
    private String seriesName;
9
    private String icon;
10
11
    public CarSeriesEntity(int brandId, String brandName, int companyId, int seriesId, String seriesName, String icon) {
12
        this.brandId = brandId;
13
        this.brandName = brandName;
14
        this.companyId = companyId;
15
        this.seriesId = seriesId;
16
        this.seriesName = seriesName;
17
        this.icon = icon;
18
    }
19
20
    public int getBrandId() {
21
        return brandId;
22
    }
23
24
    public void setBrandId(int brandId) {
25
        this.brandId = brandId;
26
    }
27
28
    public String getBrandName() {
29
        return brandName;
30
    }
31
32
    public void setBrandName(String brandName) {
33
        this.brandName = brandName;
34
    }
35
36
    public int getCompanyId() {
37
        return companyId;
38
    }
39
40
    public void setCompanyId(int companyId) {
41
        this.companyId = companyId;
42
    }
43
44
    public int getSeriesId() {
45
        return seriesId;
46
    }
47
48
    public void setSeriesId(int seriesId) {
49
        this.seriesId = seriesId;
50
    }
51
52
    public String getSeriesName() {
53
        return seriesName;
54
    }
55
56
    public void setSeriesName(String seriesName) {
57
        this.seriesName = seriesName;
58
    }
59
60
    public String getIcon() {
61
        return icon;
62
    }
63
64
    public void setIcon(String icon) {
65
        this.icon = icon;
66
    }
67
}

+ 21 - 0
app/src/main/java/com/electric/chargingpile/event/CarBrandEvent.java

1
package com.electric.chargingpile.event;
2
3
import com.electric.chargingpile.entity.CarBrandGroupEntity;
4
5
import java.util.ArrayList;
6
7
public class CarBrandEvent {
8
    private ArrayList<CarBrandGroupEntity> groups;
9
10
    public CarBrandEvent(ArrayList<CarBrandGroupEntity> groups) {
11
        this.groups = groups;
12
    }
13
14
    public ArrayList<CarBrandGroupEntity> getGroups() {
15
        return groups;
16
    }
17
18
    public void setGroups(ArrayList<CarBrandGroupEntity> groups) {
19
        this.groups = groups;
20
    }
21
}

+ 20 - 0
app/src/main/java/com/electric/chargingpile/event/CarCompanyEvent.java

1
package com.electric.chargingpile.event;
2
3
import com.electric.chargingpile.entity.CarCompanyEntity;
4
5
import java.util.ArrayList;
6
7
public class CarCompanyEvent {
8
    private ArrayList<CarCompanyEntity> companyList;
9
    public ArrayList<CarCompanyEntity> getCompanyList() {
10
        return companyList;
11
    }
12
13
    public void setCompanyList(ArrayList<CarCompanyEntity> companyList) {
14
        this.companyList = companyList;
15
    }
16
17
    public CarCompanyEvent(ArrayList<CarCompanyEntity> companyList) {
18
        this.companyList = companyList;
19
    }
20
}

+ 19 - 0
app/src/main/java/com/electric/chargingpile/event/CarSerieEvent.java

1
package com.electric.chargingpile.event;
2
3
import com.electric.chargingpile.entity.CarSeriesEntity;
4
5
public class CarSerieEvent {
6
    private CarSeriesEntity carSeriesEntity;
7
8
    public CarSerieEvent(CarSeriesEntity carSeriesEntity) {
9
        this.carSeriesEntity = carSeriesEntity;
10
    }
11
12
    public CarSeriesEntity getCarSeriesEntity() {
13
        return carSeriesEntity;
14
    }
15
16
    public void setCarSeriesEntity(CarSeriesEntity carSeriesEntity) {
17
        this.carSeriesEntity = carSeriesEntity;
18
    }
19
}

+ 12 - 0
app/src/main/java/com/electric/chargingpile/util/DensityUtil.java

28
        final float scale = context.getResources().getDisplayMetrics().density;
28
        final float scale = context.getResources().getDisplayMetrics().density;
29
        return (int) (pxValue / scale + 0.5f);
29
        return (int) (pxValue / scale + 0.5f);
30
    }
30
    }
31

32
    /**
33
     * 将sp值转换为px值,保证文字大小不变
34
     *
35
     * @param spValue fontScale(DisplayMetrics类中属性scaledDensity)
36
     * @return
37
     */
38
    public static int sp2px(Context context, float spValue) {
39
        final float fontScale = context.getResources().getDisplayMetrics().scaledDensity;
40
        return (int) (spValue * fontScale + 0.5f);
41
    }
42

31
}
43
}

+ 154 - 0
app/src/main/java/com/electric/chargingpile/view/LetterSideView.java

1
package com.electric.chargingpile.view;
2
3
import android.content.Context;
4
import android.graphics.Canvas;
5
import android.graphics.Color;
6
import android.graphics.Paint;
7
import android.graphics.Rect;
8
import android.util.AttributeSet;
9
import android.view.MotionEvent;
10
import android.view.View;
11
import android.widget.TextView;
12
13
import com.electric.chargingpile.util.DensityUtil;
14
15
public class LetterSideView extends View {
16
    // 26个字母
17
    public static String[] letters = {
18
            "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
19
            "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "#"
20
    };
21
    private int choose = -1;  // 选中的字母的y坐标
22
    private int chosen = -1;
23
    private Paint paint = new Paint(); // 字母画笔
24
    private Paint circle = new Paint(); // 选中字符背景
25
    private TextView mTextDialog;  // 显示当前字母的文本框
26
    private int singleHeight;      // 一个字母的空间
27
    Rect rect = new Rect();     // 存放文字的高度
28
29
    public LetterSideView(Context context, AttributeSet attrs) {
30
        super(context, attrs);
31
    }
32
33
    @Override
34
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
35
        super.onLayout(changed, left, top, right, bottom);
36
        paint.setAntiAlias(true); // 设置抗锯齿
37
        paint.setTextSize(DensityUtil.sp2px(getContext(), 12f)); // 设置字母字体大小为12sp
38
        paint.getTextBounds("A", 0, 1, rect);  // 获取一个字母实际的宽高到rect
39
        singleHeight = (getHeight() - (getPaddingTop() + getPaddingBottom())) / letters.length;   // 获取一个字母的空间
40
41
        circle.setAntiAlias(true); // 设置抗锯齿
42
        circle.setColor(Color.parseColor("#C1CCD5"));
43
    }
44
45
    /**
46
     * 为SideBar设置显示字母的TextView
47
     *
48
     * @param mTextDialog 在activity传递过来的textView
49
     */
50
    public void setTextView(TextView mTextDialog) {
51
        this.mTextDialog = mTextDialog;
52
    }
53
54
    public void setPosition(int position) {
55
        chosen = position;
56
        invalidate();
57
    }
58
59
    /**
60
     * 绘制
61
     */
62
    @Override
63
    protected void onDraw(Canvas canvas) {
64
        super.onDraw(canvas);
65
        // 循环绘制字母
66
        for (int i = 0; i < letters.length; i++) {
67
            //paint.setTypeface(Typeface.DEFAULT_BOLD); // 设置默认字体加粗
68
69
70
            // 选中的状态
71
            if (i == chosen) {
72
                paint.setColor(Color.parseColor("#FFFFFF")); // 选中的字母改变颜色
73
                paint.setFakeBoldText(true); // 设置字体为粗体
74
                float yPos = getPaddingTop() + singleHeight * i + rect.height() / 2f;
75
                canvas.drawCircle(getWidth() / 2f, yPos, getWidth() * 0.35f, circle);
76
            } else {
77
                paint.setColor(Color.parseColor("#6F6F7D")); // 设置字体颜色
78
                paint.setFakeBoldText(false); // 设置字体为正常
79
            }
80
81
            // x坐标等于中间-字符宽度的一半.
82
            float xPos = getWidth() / 2 - paint.measureText(letters[i]) / 2;
83
            // Y轴坐标
84
            float yPos = getPaddingTop() + singleHeight * i + rect.height();
85
            canvas.drawText(letters[i], xPos, yPos, paint); // 绘制字母
86
        }
87
    }
88
89
    /**
90
     * 分发触摸事件
91
     *
92
     * @param event
93
     * @return
94
     */
95
    @Override
96
    public boolean dispatchTouchEvent(MotionEvent event) {
97
        final int action = event.getAction();
98
        final float y = event.getY(); // 点击y坐标
99
        chosen = choose;  // 上一个选中的字母
100
        // 点击y坐标所占总高度的比例  *   数组的长度就等于点击了 数组中的位置.
101
        final int c = (int) (y / (getHeight() - getPaddingTop() - getPaddingBottom()) * letters.length);
102
        switch (action) {
103
            case MotionEvent.ACTION_UP:
104
                //抬起来的时候设置背景为透明
105
                //setBackgroundDrawable(new ColorDrawable(0x00000000));
106
                choose = -1;
107
                invalidate();
108
                if (mTextDialog != null) {
109
                    mTextDialog.setVisibility(View.INVISIBLE);
110
                }
111
                break;
112
            default:
113
                //按下,滑动的时候设置背景为灰色
114
                //setBackgroundDrawable(new ColorDrawable(0x44000000));
115
                //setBackgroundResource(R.drawable.sidebar_background);
116
                if (chosen != c) { // 判断选中字母是否发生改变
117
                    if (c >= 0 && c < letters.length) {
118
                        if (listener != null) {
119
                            listener.onTouchLetterChanged(letters[c]);
120
                            listener.onTouchLetterPosition(c);
121
                        }
122
                        if (mTextDialog != null) {
123
                            mTextDialog.setText(letters[c]);
124
                            mTextDialog.setVisibility(View.VISIBLE);
125
                        }
126
                        // 设置选中字母在数组的位置
127
                        choose = c;
128
                        chosen = choose;
129
                        invalidate();
130
                    }
131
                }
132
                break;
133
        }
134
        return true;
135
    }
136
137
    // 触摸回调接口
138
    private OnTouchLetterChangedListener listener;
139
140
141
    public void setOnTouchLetterChangedListener(OnTouchLetterChangedListener onTouchLetterChangedListener) {
142
        this.listener = onTouchLetterChangedListener;
143
    }
144
145
    public interface OnTouchLetterChangedListener {
146
        /**
147
         * 触摸字母回调
148
         *
149
         * @param s 触摸的字符
150
         */
151
        void onTouchLetterChanged(String s);
152
        void onTouchLetterPosition(int position);
153
    }
154
}

+ 92 - 0
app/src/main/java/com/electric/chargingpile/view/TextImageView.java

1
package com.electric.chargingpile.view;
2
3
import android.content.Context;
4
import android.content.res.TypedArray;
5
import android.graphics.Rect;
6
import android.graphics.drawable.Drawable;
7
import android.util.AttributeSet;
8
9
import androidx.appcompat.widget.AppCompatTextView;
10
11
import com.electric.chargingpile.R;
12
13
public class TextImageView extends AppCompatTextView {
14
    private int leftWidth;
15
    private int leftHeight;
16
    private int topWidth;
17
    private int topHeight;
18
    private int rightWidth;
19
    private int rightHeight;
20
    private int bottomWidth;
21
    private int bottomHeight;
22
23
24
    public TextImageView(Context context) {
25
        super(context);
26
    }
27
28
    public TextImageView(Context context, AttributeSet attrs) {
29
        super(context, attrs);
30
        init(context, attrs);
31
    }
32
33
    public TextImageView(Context context, AttributeSet attrs, int defStyleAttr) {
34
        super(context, attrs, defStyleAttr);
35
        init(context, attrs);
36
    }
37
38
    private void init(Context context, AttributeSet attrs) {
39
        TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TextImageView);
40
        leftWidth = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableLeftWidth, 0);
41
        leftHeight = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableLeftHeight, 0);
42
        topWidth = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableTopWidth, 0);
43
        topHeight = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableTopHeight, 0);
44
        rightWidth = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableRightWidth, 0);
45
        rightHeight = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableRightHeight, 0);
46
        bottomWidth = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableBottomWidth, 0);
47
        bottomHeight = typedArray.getDimensionPixelOffset(R.styleable.TextImageView_drawableBottomHeight, 0);
48
        typedArray.recycle();
49
        setDrawablesSize();
50
    }
51
52
    private void setDrawablesSize() {
53
        Drawable[] compoundDrawables = getCompoundDrawables();
54
        for (int i = 0; i < compoundDrawables.length; i++) {
55
            switch (i) {
56
                case 0:
57
                    setDrawableBounds(compoundDrawables[0], leftWidth, leftHeight);
58
                    break;
59
                case 1:
60
                    setDrawableBounds(compoundDrawables[1], topWidth, topHeight);
61
                    break;
62
                case 2:
63
                    setDrawableBounds(compoundDrawables[2], rightWidth, rightHeight);
64
                    break;
65
                case 3:
66
                    setDrawableBounds(compoundDrawables[3], bottomWidth, bottomHeight);
67
                    break;
68
                default:
69
                    break;
70
            }
71
        }
72
        setCompoundDrawables(compoundDrawables[0], compoundDrawables[1], compoundDrawables[2], compoundDrawables[3]);
73
    }
74
75
    private void setDrawableBounds(Drawable drawable, int width, int height) {
76
        if (drawable != null) {
77
            double scale = ((double) drawable.getIntrinsicHeight()) / ((double) drawable.getIntrinsicWidth());
78
            drawable.setBounds(0, 0, width, height);
79
            Rect bounds = drawable.getBounds();
80
            // 高宽只给一个值时,自适应
81
            if (bounds.right != 0 | bounds.bottom != 0) {
82
                bounds.right = (int) (bounds.bottom / scale);
83
                drawable.setBounds(bounds);
84
            }
85
            if (bounds.bottom == 0) {
86
                bounds.bottom = (int) (bounds.right * scale);
87
                drawable.setBounds(bounds);
88
            }
89
        }
90
    }
91
92
}

BIN
app/src/main/res/drawable-hdpi/icon_radio_normal.png


BIN
app/src/main/res/drawable-hdpi/icon_radio_selected.png


BIN
app/src/main/res/drawable-mdpi/icon_radio_normal.png


BIN
app/src/main/res/drawable-mdpi/icon_radio_selected.png


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


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


BIN
app/src/main/res/drawable-xxhdpi/icon_radio_normal.png


BIN
app/src/main/res/drawable-xxhdpi/icon_radio_selected.png


BIN
app/src/main/res/drawable-xxxhdpi/icon_radio_normal.png


BIN
app/src/main/res/drawable-xxxhdpi/icon_radio_selected.png


+ 8 - 0
app/src/main/res/drawable/bg_add_car_model_shape.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:shape="rectangle">
4
    <corners android:radius="48dp" /> <!-- 圆角大小 -->
5
    <stroke
6
        android:width="1dp"
7
        android:color="#CFE5D6" /> <!-- 边框颜色 -->
8
</shape>

BIN
app/src/main/res/drawable/group_adapter_empty_view_image.png


+ 83 - 0
app/src/main/res/layout/activity_car_brand.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="@color/white"
8
    tools:context=".activity.CarBrandActivity">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
        android:id="@+id/nav_bar"
12
        android:layout_width="match_parent"
13
        android:layout_height="44dp"
14
        app:layout_constraintTop_toTopOf="parent">
15
16
        <TextView
17
            android:id="@+id/nav_title"
18
            android:layout_width="match_parent"
19
            android:layout_height="match_parent"
20
            android:gravity="center"
21
            android:text="品牌"
22
            android:textColor="#444444"
23
            android:textSize="18sp" />
24
25
        <ImageView
26
            android:id="@+id/iv_back"
27
            android:layout_width="wrap_content"
28
            android:layout_height="match_parent"
29
            android:layout_alignParentLeft="true"
30
            android:layout_centerVertical="true"
31
            android:contentDescription="@null"
32
            android:paddingLeft="15dp"
33
            android:paddingRight="15dp"
34
            android:src="@drawable/icon_lvback1119"
35
            app:layout_constraintLeft_toLeftOf="parent" />
36
37
        <View
38
            android:layout_width="match_parent"
39
            android:layout_height="0.5dp"
40
            android:background="@color/ui_titleline"
41
            app:layout_constraintBottom_toBottomOf="parent" />
42
    </androidx.constraintlayout.widget.ConstraintLayout>
43
44
    <com.donkingliang.groupedadapter.widget.StickyHeaderLayout
45
        android:id="@+id/sticky_header_layout"
46
        android:layout_width="match_parent"
47
        android:layout_height="0dp"
48
        app:layout_constraintBottom_toBottomOf="parent"
49
        app:layout_constraintTop_toBottomOf="@+id/nav_bar">
50
51
        <androidx.recyclerview.widget.RecyclerView
52
            android:id="@+id/recycler_view"
53
            android:layout_width="match_parent"
54
            android:layout_height="match_parent" />
55
    </com.donkingliang.groupedadapter.widget.StickyHeaderLayout>
56
57
    <com.electric.chargingpile.view.LetterSideView
58
        android:id="@+id/letter_side_view"
59
        android:layout_width="30dp"
60
        android:layout_height="0dp"
61
        android:background="#F8FBFE"
62
        android:paddingTop="25dp"
63
        android:paddingBottom="25dp"
64
        android:visibility="gone"
65
        app:layout_constraintBottom_toBottomOf="parent"
66
        app:layout_constraintRight_toRightOf="parent"
67
        app:layout_constraintTop_toBottomOf="@+id/nav_bar"
68
        tools:visibility="visible" />
69
70
    <TextView
71
        android:id="@+id/text_view_dialog"
72
        android:layout_width="match_parent"
73
        android:layout_height="0dp"
74
        android:gravity="center"
75
        android:textColor="#CCCCCC"
76
        android:textSize="40sp"
77
        android:visibility="gone"
78
        app:layout_constraintBottom_toBottomOf="parent"
79
        app:layout_constraintTop_toBottomOf="@+id/nav_bar"
80
        tools:text="X"
81
        tools:visibility="visible" />
82
83
</androidx.constraintlayout.widget.ConstraintLayout>

+ 57 - 0
app/src/main/res/layout/activity_car_model.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="@color/white"
8
    tools:context=".activity.CarModelActivity">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
        android:id="@+id/nav_bar"
12
        android:layout_width="match_parent"
13
        android:layout_height="44dp"
14
        app:layout_constraintTop_toTopOf="parent">
15
16
        <TextView
17
            android:id="@+id/nav_title"
18
            android:layout_width="match_parent"
19
            android:layout_height="match_parent"
20
            android:gravity="center"
21
            android:text="车型"
22
            android:textColor="#444444"
23
            android:textSize="18sp" />
24
25
        <ImageView
26
            android:id="@+id/iv_back"
27
            android:layout_width="wrap_content"
28
            android:layout_height="match_parent"
29
            android:layout_alignParentLeft="true"
30
            android:layout_centerVertical="true"
31
            android:contentDescription="@null"
32
            android:paddingLeft="15dp"
33
            android:paddingRight="15dp"
34
            android:src="@drawable/icon_lvback1119"
35
            app:layout_constraintLeft_toLeftOf="parent" />
36
37
        <View
38
            android:layout_width="match_parent"
39
            android:layout_height="0.5dp"
40
            android:background="@color/ui_titleline"
41
            app:layout_constraintBottom_toBottomOf="parent" />
42
    </androidx.constraintlayout.widget.ConstraintLayout>
43
44
    <com.donkingliang.groupedadapter.widget.StickyHeaderLayout
45
        android:id="@+id/sticky_header_layout"
46
        android:layout_width="match_parent"
47
        android:layout_height="0dp"
48
        android:background="#FFF2F6F9"
49
        app:layout_constraintBottom_toBottomOf="parent"
50
        app:layout_constraintTop_toBottomOf="@+id/nav_bar">
51
52
        <androidx.recyclerview.widget.RecyclerView
53
            android:id="@+id/recycler_view"
54
            android:layout_width="match_parent"
55
            android:layout_height="match_parent" />
56
    </com.donkingliang.groupedadapter.widget.StickyHeaderLayout>
57
</androidx.constraintlayout.widget.ConstraintLayout>

+ 363 - 0
app/src/main/res/layout/activity_car_owner_certificate.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="match_parent"
7
    android:background="@color/white"
8
    android:focusableInTouchMode="true"
9
    tools:context=".activity.CarOwnerCertificateActivity">
10
11
    <androidx.constraintlayout.widget.ConstraintLayout
12
        android:id="@+id/nav_bar"
13
        android:layout_width="match_parent"
14
        android:layout_height="44dp"
15
        app:layout_constraintTop_toTopOf="parent">
16
17
        <TextView
18
            android:id="@+id/nav_title"
19
            android:layout_width="match_parent"
20
            android:layout_height="match_parent"
21
            android:gravity="center"
22
            android:text="车主认证"
23
            android:textColor="#444444"
24
            android:textSize="18sp" />
25
26
        <ImageView
27
            android:id="@+id/iv_back"
28
            android:layout_width="wrap_content"
29
            android:layout_height="match_parent"
30
            android:layout_alignParentLeft="true"
31
            android:layout_centerVertical="true"
32
            android:contentDescription="@null"
33
            android:paddingLeft="15dp"
34
            android:paddingRight="15dp"
35
            android:src="@drawable/icon_lvback1119"
36
            app:layout_constraintLeft_toLeftOf="parent" />
37
38
        <View
39
            android:layout_width="match_parent"
40
            android:layout_height="0.5dp"
41
            android:background="@color/ui_titleline"
42
            app:layout_constraintBottom_toBottomOf="parent" />
43
    </androidx.constraintlayout.widget.ConstraintLayout>
44
45
    <ScrollView
46
        android:layout_width="match_parent"
47
        android:layout_height="0dp"
48
        android:orientation="vertical"
49
        android:scrollbars="none"
50
        app:layout_constraintBottom_toTopOf="@+id/submit_btn"
51
        app:layout_constraintTop_toBottomOf="@+id/nav_bar">
52
53
        <androidx.constraintlayout.widget.ConstraintLayout
54
            android:layout_width="match_parent"
55
            android:layout_height="wrap_content"
56
            android:paddingLeft="15dp"
57
            android:paddingRight="15dp">
58
59
            <!-- 车型 -->
60
            <androidx.constraintlayout.widget.ConstraintLayout
61
                android:id="@+id/car_model_constraint_layout"
62
                android:layout_width="match_parent"
63
                android:layout_height="0dp"
64
                android:layout_marginTop="15dp"
65
                app:layout_constraintDimensionRatio="h,518:95"
66
                app:layout_constraintTop_toTopOf="parent">
67
68
                <ImageView
69
                    android:id="@+id/add_car_model_icon"
70
                    android:layout_width="match_parent"
71
                    android:layout_height="match_parent"
72
                    android:scaleType="fitXY"
73
                    android:src="@drawable/icon_car_model"
74
                    app:layout_constraintBottom_toBottomOf="parent"
75
                    app:layout_constraintTop_toTopOf="parent" />
76
77
                <TextView
78
                    android:id="@+id/add_car_model_btn"
79
                    android:layout_width="80dp"
80
                    android:layout_height="32dp"
81
                    android:layout_marginRight="15dp"
82
                    android:background="@drawable/bg_add_car_model_shape"
83
                    android:gravity="center"
84
                    android:text="添加车型"
85
                    android:textColor="#506857"
86
                    android:textSize="14sp"
87
                    app:layout_constraintBottom_toBottomOf="parent"
88
                    app:layout_constraintRight_toRightOf="parent"
89
                    app:layout_constraintTop_toTopOf="parent" />
90
            </androidx.constraintlayout.widget.ConstraintLayout>
91
92
            <androidx.constraintlayout.widget.ConstraintLayout
93
                android:id="@+id/car_model_selected_constraint_layout"
94
                android:layout_width="match_parent"
95
                android:layout_height="wrap_content"
96
                android:layout_marginTop="15dp"
97
                android:background="@color/white"
98
                android:visibility="gone"
99
                app:layout_constraintTop_toBottomOf="@+id/car_model_constraint_layout"
100
                tools:background="#cccccc"
101
                tools:visibility="visible">
102
103
                <ImageView
104
                    android:id="@+id/car_icon"
105
                    android:layout_width="95dp"
106
                    android:layout_height="63dp"
107
                    android:scaleType="fitCenter"
108
                    app:layout_constraintBottom_toBottomOf="parent"
109
                    app:layout_constraintLeft_toLeftOf="parent"
110
                    app:layout_constraintTop_toTopOf="parent"
111
                    tools:background="#00ff00" />
112
113
                <TextView
114
                    android:id="@+id/car_name"
115
                    android:layout_width="wrap_content"
116
                    android:layout_height="wrap_content"
117
                    android:layout_marginLeft="10dp"
118
                    android:layout_marginTop="12dp"
119
                    android:textColor="#FF222222"
120
                    android:textSize="14sp"
121
                    app:layout_constraintLeft_toRightOf="@+id/car_icon"
122
                    app:layout_constraintTop_toTopOf="parent"
123
                    tools:text="蔚来ES6" />
124
125
                <TextView
126
                    android:id="@+id/car_series"
127
                    android:layout_width="wrap_content"
128
                    android:layout_height="wrap_content"
129
                    android:layout_marginBottom="10dp"
130
                    android:textColor="#FF0D1120"
131
                    android:textSize="14sp"
132
                    app:layout_constraintBottom_toBottomOf="parent"
133
                    app:layout_constraintLeft_toLeftOf="@+id/car_name"
134
135
                    tools:text="2020款 420KM 运动版" />
136
137
                <ImageView
138
                    android:layout_width="wrap_content"
139
                    android:layout_height="wrap_content"
140
                    android:src="@drawable/icon_right_cursor"
141
                    app:layout_constraintBottom_toBottomOf="parent"
142
                    app:layout_constraintRight_toRightOf="parent"
143
                    app:layout_constraintTop_toTopOf="parent" />
144
145
146
            </androidx.constraintlayout.widget.ConstraintLayout>
147
148
149
            <!-- 行驶证图片 -->
150
            <androidx.constraintlayout.widget.ConstraintLayout
151
                android:id="@+id/driving_license"
152
                android:layout_width="match_parent"
153
                android:layout_height="0dp"
154
                android:layout_marginTop="10dp"
155
                app:layout_constraintDimensionRatio="h,518:315"
156
                app:layout_constraintTop_toBottomOf="@+id/car_model_selected_constraint_layout">
157
158
                <ImageView
159
                    android:id="@+id/driving_license_icon"
160
                    android:layout_width="match_parent"
161
                    android:layout_height="match_parent"
162
                    android:src="@drawable/icon_driving_license" />
163
164
                <TextView
165
                    android:id="@+id/driving_license_text_view"
166
                    android:layout_width="wrap_content"
167
                    android:layout_height="wrap_content"
168
                    android:text="上传行驶证首页(选填)"
169
                    android:textColor="#3D5545"
170
                    android:textSize="14sp"
171
                    app:layout_constraintBottom_toBottomOf="parent"
172
                    app:layout_constraintLeft_toLeftOf="parent"
173
                    app:layout_constraintRight_toRightOf="parent"
174
                    app:layout_constraintTop_toTopOf="parent" />
175
176
                <ImageView
177
                    android:id="@+id/driving_license_upload_icon"
178
                    android:layout_width="wrap_content"
179
                    android:layout_height="wrap_content"
180
                    android:layout_marginBottom="5dp"
181
                    android:src="@drawable/icon_upload"
182
                    app:layout_constraintBottom_toTopOf="@+id/driving_license_text_view"
183
                    app:layout_constraintLeft_toLeftOf="parent"
184
                    app:layout_constraintRight_toRightOf="parent" />
185
186
            </androidx.constraintlayout.widget.ConstraintLayout>
187
188
            <!-- 行驶证信息 -->
189
            <LinearLayout
190
                android:id="@+id/driving_license_info"
191
                android:layout_width="match_parent"
192
                android:layout_height="wrap_content"
193
                android:layout_marginTop="5dp"
194
                android:layout_marginBottom="50dp"
195
                android:orientation="vertical"
196
                app:layout_constraintTop_toBottomOf="@+id/driving_license">
197
198
                <LinearLayout
199
                    android:layout_width="match_parent"
200
                    android:layout_height="50dp"
201
                    android:gravity="center_vertical"
202
                    android:orientation="horizontal">
203
204
                    <TextView
205
                        android:layout_width="90dp"
206
                        android:layout_height="wrap_content"
207
                        android:text="* 车牌号"
208
                        android:textColor="#0D1120"
209
                        android:textSize="14sp"
210
                        android:textStyle="bold" />
211
212
                    <EditText
213
                        android:layout_width="0dp"
214
                        android:layout_height="match_parent"
215
                        android:layout_weight="1"
216
                        android:background="@null"
217
                        android:hint="请输入正确的车牌号"
218
                        android:inputType="text"
219
                        android:textColor="#0D1120"
220
                        android:textColorHint="#CBCBCB"
221
                        android:textSize="14sp" />
222
                </LinearLayout>
223
224
                <View
225
                    android:layout_width="match_parent"
226
                    android:layout_height="1dp"
227
                    android:background="#F8F8F8" />
228
229
                <LinearLayout
230
                    android:layout_width="match_parent"
231
                    android:layout_height="50dp"
232
                    android:gravity="center_vertical"
233
                    android:orientation="horizontal">
234
235
                    <TextView
236
                        android:layout_width="90dp"
237
                        android:layout_height="wrap_content"
238
                        android:text="* 发动机号"
239
                        android:textColor="#0D1120"
240
                        android:textSize="14sp"
241
                        android:textStyle="bold" />
242
243
                    <EditText
244
                        android:layout_width="0dp"
245
                        android:layout_height="match_parent"
246
                        android:layout_weight="1"
247
                        android:background="@null"
248
                        android:hint="请输入发动机号"
249
                        android:inputType="text"
250
                        android:textColor="#0D1120"
251
                        android:textColorHint="#CBCBCB"
252
                        android:textSize="14sp" />
253
                </LinearLayout>
254
255
                <View
256
                    android:layout_width="match_parent"
257
                    android:layout_height="1dp"
258
                    android:background="#F8F8F8" />
259
260
                <LinearLayout
261
                    android:layout_width="match_parent"
262
                    android:layout_height="50dp"
263
                    android:gravity="center_vertical"
264
                    android:orientation="horizontal">
265
266
                    <TextView
267
                        android:layout_width="90dp"
268
                        android:layout_height="wrap_content"
269
                        android:text="注册时间"
270
                        android:textColor="#0D1120"
271
                        android:textSize="14sp"
272
                        android:textStyle="bold" />
273
274
                    <EditText
275
                        android:layout_width="0dp"
276
                        android:layout_height="match_parent"
277
                        android:layout_weight="1"
278
                        android:background="@null"
279
                        android:hint="请输入有效日期"
280
                        android:inputType="text"
281
                        android:textColor="#0D1120"
282
                        android:textColorHint="#CBCBCB"
283
                        android:textSize="14sp" />
284
                </LinearLayout>
285
286
                <View
287
                    android:layout_width="match_parent"
288
                    android:layout_height="1dp"
289
                    android:background="#F8F8F8" />
290
            </LinearLayout>
291
            <!-- 行驶证类型 -->
292
            <LinearLayout
293
                android:id="@+id/driving_license_type"
294
                android:layout_width="match_parent"
295
                android:layout_height="50dp"
296
                android:layout_marginTop="10dp"
297
                android:gravity="center_vertical"
298
                android:orientation="horizontal"
299
                app:layout_constraintTop_toBottomOf="@+id/driving_license_info">
300
301
                <com.electric.chargingpile.view.TextImageView
302
                    android:id="@+id/driving_license_type_first"
303
                    android:layout_width="wrap_content"
304
                    android:layout_height="match_parent"
305
                    android:drawableLeft="@drawable/icon_radio_selected"
306
                    android:drawablePadding="10dp"
307
                    android:gravity="center_vertical"
308
                    android:paddingRight="40dp"
309
                    android:text="自用"
310
                    app:drawableLeftHeight="17dp"
311
                    app:drawableLeftWidth="17dp" />
312
313
                <com.electric.chargingpile.view.TextImageView
314
                    android:id="@+id/driving_license_type_second"
315
                    android:layout_width="wrap_content"
316
                    android:layout_height="match_parent"
317
                    android:drawableLeft="@drawable/icon_radio_normal"
318
                    android:drawablePadding="10dp"
319
                    android:gravity="center_vertical"
320
                    android:paddingRight="40dp"
321
                    android:text="营运"
322
                    app:drawableLeftHeight="17dp"
323
                    app:drawableLeftWidth="17dp" />
324
325
326
                <com.electric.chargingpile.view.TextImageView
327
                    android:id="@+id/driving_license_type_third"
328
                    android:layout_width="wrap_content"
329
                    android:layout_height="match_parent"
330
                    android:drawableLeft="@drawable/icon_radio_normal"
331
                    android:drawablePadding="10dp"
332
                    android:gravity="center_vertical"
333
                    android:paddingRight="40dp"
334
                    android:text="公务"
335
                    app:drawableLeftHeight="17dp"
336
                    app:drawableLeftWidth="17dp" />
337
338
            </LinearLayout>
339
            <!-- 认证说明信息 -->
340
            <TextView
341
                android:layout_width="match_parent"
342
                android:layout_height="wrap_content"
343
                android:layout_marginTop="10dp"
344
                android:layout_marginBottom="30dp"
345
                android:text="认证说明\n\n1.车型信息和行驶证主页为必填项;\n2.最多可认证三款车型;\n3.默认首款认证车型为主车型;\n4.上传行驶证详细页面,并保证所有信息清晰;\n5.认证成功的首个车型可获得50元充电红包。"
346
                android:textColor="#0D1120"
347
                android:textSize="14sp"
348
                app:layout_constraintBottom_toBottomOf="parent"
349
                app:layout_constraintTop_toBottomOf="@+id/driving_license_type" />
350
        </androidx.constraintlayout.widget.ConstraintLayout>
351
    </ScrollView>
352
353
    <Button
354
        android:id="@+id/submit_btn"
355
        android:layout_width="match_parent"
356
        android:layout_height="44dp"
357
        android:background="#00CA42"
358
        android:text="确认提交"
359
        android:textColor="#ffffff"
360
        android:textSize="16sp"
361
        app:layout_constraintBottom_toBottomOf="parent" />
362
363
</androidx.constraintlayout.widget.ConstraintLayout>

+ 81 - 0
app/src/main/res/layout/activity_user_center.xml

479
                        android:layout_width="match_parent"
479
                        android:layout_width="match_parent"
480
                        android:layout_height="0.5dp"
480
                        android:layout_height="0.5dp"
481
                        android:background="@color/ui_line" />
481
                        android:background="@color/ui_line" />
482
                    <RelativeLayout
483
                        android:id="@+id/rl_car_owner_certificate"
484
                        android:layout_width="fill_parent"
485
                        android:layout_height="44dp"
486
                        android:background="@drawable/item_selector">
487
488
                        <TextView
489
                            android:layout_width="wrap_content"
490
                            android:layout_height="wrap_content"
491
                            android:layout_alignParentStart="true"
492
                            android:layout_alignParentLeft="true"
493
                            android:layout_alignParentTop="true"
494
                            android:layout_alignParentBottom="true"
495
                            android:layout_marginLeft="15dp"
496
                            android:drawableLeft="@drawable/icon_car_user_certificate"
497
                            android:drawablePadding="15dp"
498
                            android:gravity="center_vertical"
499
                            android:text="车主认证"
500
                            android:textColor="@color/ui_62"
501
                            android:textSize="15sp" />
502
503
                        <TextView
504
                            android:layout_width="wrap_content"
505
                            android:layout_height="wrap_content"
506
                            android:layout_alignParentTop="true"
507
                            android:layout_alignParentRight="true"
508
                            android:layout_alignParentBottom="true"
509
                            android:layout_marginRight="15dp"
510
                            android:drawableRight="@drawable/icon_more2_0"
511
                            android:drawablePadding="30px"
512
                            android:gravity="center_vertical"
513
                            android:text=""
514
                            android:textColor="@color/ui_68"
515
                            android:textSize="14sp" />
516
                    </RelativeLayout>
517
                    <View
518
                        android:layout_width="match_parent"
519
                        android:layout_height="0.5dp"
520
                        android:layout_marginLeft="16dp"
521
                        android:background="@color/ui_line" />
522
523
                    <RelativeLayout
524
                        android:id="@+id/rl_publish_price"
525
                        android:layout_width="fill_parent"
526
                        android:layout_height="44dp"
527
                        android:background="@drawable/item_selector">
528
529
                        <TextView
530
                            android:layout_width="wrap_content"
531
                            android:layout_height="wrap_content"
532
                            android:layout_alignParentStart="true"
533
                            android:layout_alignParentLeft="true"
534
                            android:layout_alignParentTop="true"
535
                            android:layout_alignParentBottom="true"
536
                            android:layout_marginLeft="15dp"
537
                            android:drawableLeft="@drawable/icon_publish_price"
538
                            android:drawablePadding="15dp"
539
                            android:gravity="center_vertical"
540
                            android:text="发表成交价"
541
                            android:textColor="@color/ui_62"
542
                            android:textSize="15sp" />
543
544
                        <TextView
545
                            android:layout_width="wrap_content"
546
                            android:layout_height="wrap_content"
547
                            android:layout_alignParentTop="true"
548
                            android:layout_alignParentRight="true"
549
                            android:layout_alignParentBottom="true"
550
                            android:layout_marginRight="15dp"
551
                            android:drawableRight="@drawable/icon_more2_0"
552
                            android:drawablePadding="30px"
553
                            android:gravity="center_vertical"
554
                            android:text=""
555
                            android:textColor="@color/ui_68"
556
                            android:textSize="14sp" />
557
                    </RelativeLayout>
558
                    <View
559
                        android:layout_width="match_parent"
560
                        android:layout_height="0.5dp"
561
                        android:layout_marginLeft="16dp"
562
                        android:background="@color/ui_line" />
482
563
483
                    <RelativeLayout
564
                    <RelativeLayout
484
                        android:id="@+id/rl_chongzhi"
565
                        android:id="@+id/rl_chongzhi"

+ 42 - 0
app/src/main/res/layout/adapter_child_car_brand.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="55dp"
7
    android:orientation="vertical"
8
    android:paddingLeft="15dp"
9
    android:background="@color/white"
10
    tools:background="#cccccc">
11
12
    <View
13
        android:id="@+id/line"
14
        android:layout_width="match_parent"
15
        android:layout_height="1dp"
16
        android:background="#E6E6E6"
17
        app:layout_constraintTop_toTopOf="parent" />
18
19
    <ImageView
20
        android:id="@+id/icon"
21
        android:layout_width="40dp"
22
        android:layout_height="40dp"
23
        android:scaleType="fitCenter"
24
        app:layout_constraintBottom_toBottomOf="parent"
25
        app:layout_constraintLeft_toLeftOf="parent"
26
        app:layout_constraintTop_toTopOf="parent"
27
        tools:background="#00ff00" />
28
29
    <TextView
30
        android:id="@+id/title"
31
        android:layout_width="wrap_content"
32
        android:layout_height="wrap_content"
33
        android:layout_gravity="center_vertical"
34
        android:layout_marginLeft="10dp"
35
        android:textColor="#FF222222"
36
        android:textSize="14sp"
37
        app:layout_constraintBottom_toBottomOf="parent"
38
        app:layout_constraintLeft_toRightOf="@+id/icon"
39
        app:layout_constraintTop_toTopOf="parent"
40
        tools:text="奥迪" />
41
42
</androidx.constraintlayout.widget.ConstraintLayout>

+ 77 - 0
app/src/main/res/layout/adapter_child_car_model.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:layout_width="match_parent"
6
    android:layout_height="100dp"
7
    android:paddingLeft="15dp"
8
    android:background="@color/white"
9
    tools:background="#cccccc">
10
11
    <View
12
        android:id="@+id/line"
13
        android:layout_width="match_parent"
14
        android:layout_height="1dp"
15
        android:background="#E6E6E6"
16
        app:layout_constraintTop_toTopOf="parent" />
17
18
    <ImageView
19
        android:id="@+id/icon"
20
        android:layout_width="120dp"
21
        android:layout_height="80dp"
22
        android:scaleType="fitCenter"
23
        app:layout_constraintBottom_toBottomOf="parent"
24
        app:layout_constraintLeft_toLeftOf="parent"
25
        app:layout_constraintTop_toTopOf="parent"
26
        tools:background="#00ff00" />
27
28
    <TextView
29
        android:id="@+id/title"
30
        android:layout_width="wrap_content"
31
        android:layout_height="wrap_content"
32
        android:layout_gravity="center_vertical"
33
        android:layout_marginLeft="10dp"
34
        android:layout_marginTop="27dp"
35
        android:textColor="#FF222222"
36
        android:textSize="14sp"
37
        app:layout_constraintLeft_toRightOf="@+id/icon"
38
        app:layout_constraintTop_toTopOf="parent"
39
        tools:text="奥迪" />
40
41
    <LinearLayout
42
        android:layout_width="wrap_content"
43
        android:layout_height="wrap_content"
44
        android:layout_marginLeft="10dp"
45
        android:layout_marginBottom="28dp"
46
        android:orientation="horizontal"
47
        app:layout_constraintBottom_toBottomOf="parent"
48
        app:layout_constraintLeft_toRightOf="@+id/icon">
49
50
        <TextView
51
            android:layout_width="wrap_content"
52
            android:layout_height="wrap_content"
53
            android:textColor="#FFE02020"
54
            android:textSize="14sp"
55
            tools:text="33.8-52.3" />
56
57
        <TextView
58
            android:id="@+id/price"
59
            android:layout_width="wrap_content"
60
            android:layout_height="wrap_content"
61
            android:layout_gravity="center_vertical"
62
            android:layout_marginLeft="5dp"
63
            android:text="万"
64
            android:textColor="#FF222222"
65
            android:textSize="12sp" />
66
67
        <TextView
68
            android:id="@+id/endurance"
69
            android:layout_width="wrap_content"
70
            android:layout_height="wrap_content"
71
            android:layout_marginLeft="20dp"
72
            android:textColor="#FF222222"
73
            android:textSize="12sp"
74
            tools:text="续航:300km" />
75
    </LinearLayout>
76
77
</androidx.constraintlayout.widget.ConstraintLayout>

+ 19 - 0
app/src/main/res/layout/adapter_header_car_brand.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
4
    android:layout_width="match_parent"
5
    android:layout_height="25dp"
6
    android:background="#FFF2F6F9"
7
    android:paddingLeft="15dp"
8
    android:paddingRight="15dp">
9
    
10
    <TextView
11
        android:id="@+id/title"
12
        android:layout_width="match_parent"
13
        android:layout_height="match_parent"
14
        android:gravity="center_vertical"
15
        android:lines="1"
16
        android:textColor="#FF6F6F7D"
17
        android:textSize="12sp"
18
        tools:text="A" />
19
</LinearLayout>

+ 19 - 0
app/src/main/res/layout/adapter_header_car_model.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
4
    android:layout_width="match_parent"
5
    android:layout_height="25dp"
6
    android:background="#FFF2F6F9"
7
    android:paddingLeft="15dp"
8
    android:paddingRight="15dp">
9
    
10
    <TextView
11
        android:id="@+id/title"
12
        android:layout_width="match_parent"
13
        android:layout_height="match_parent"
14
        android:gravity="center_vertical"
15
        android:lines="1"
16
        android:textColor="#FF6F6F7D"
17
        android:textSize="12sp"
18
        tools:text="A" />
19
</LinearLayout>

+ 13 - 0
app/src/main/res/layout/group_adapter_default_empty_view.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    android:layout_height="match_parent"
5
    android:orientation="vertical">
6
7
    <ImageView
8
        android:layout_width="wrap_content"
9
        android:layout_height="wrap_content"
10
        android:layout_gravity="center"
11
        android:src="@drawable/group_adapter_empty_view_image"/>
12
13
</FrameLayout>

+ 5 - 0
app/src/main/res/values/strings.xml

208
    <string name="personal_shar_info_content">快来分享吧\n小主大家都很期待你的精彩内容哦</string>
208
    <string name="personal_shar_info_content">快来分享吧\n小主大家都很期待你的精彩内容哦</string>
209
    <string name="query_all_addresses"><u>查看全部目的地</u></string>
209
    <string name="query_all_addresses"><u>查看全部目的地</u></string>
210
    <string name="query_all_points"><u>查看全部站点</u></string>
210
    <string name="query_all_points"><u>查看全部站点</u></string>
211
212
    <item name="type_header" type="integer" />
213
    <item name="type_footer" type="integer" />
214
    <item name="type_child" type="integer" />
215
    <item name="type_empty" type="integer" />
211
</resources>
216
</resources>

+ 11 - 0
app/src/main/res/values/styles.xml

355
        <!--相册文件夹列表选中图标-->
355
        <!--相册文件夹列表选中图标-->
356
        <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>
356
        <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>
357
    </style>
357
    </style>
358

359
    <declare-styleable name="TextImageView">
360
        <attr name="drawableLeftWidth" format="dimension" />
361
        <attr name="drawableLeftHeight" format="dimension" />
362
        <attr name="drawableTopWidth" format="dimension" />
363
        <attr name="drawableTopHeight" format="dimension" />
364
        <attr name="drawableRightWidth" format="dimension" />
365
        <attr name="drawableRightHeight" format="dimension" />
366
        <attr name="drawableBottomWidth" format="dimension" />
367
        <attr name="drawableBottomHeight" format="dimension" />
368
    </declare-styleable>
358
</resources>
369
</resources>

更换高德地图SDK以及so文件 · 86c28bdcb9 - Gogs: Go Git Service
Просмотр исходного кода

更换高德地图SDK以及so文件

hy лет назад: 4
Родитель
Сommit
86c28bdcb9
43 измененных файлов с 610 добавлено и 480 удалено
  1. BIN
      app/libs/AMap3DMap_6.9.2_AMapNavi_6.9.0_AMapSearch_6.9.2_AMapLocation_4.7.0_20190710.jar
  2. BIN
      app/libs/AMap3DMap_8.1.0_AMapNavi_8.1.0_AMapSearch_8.1.0_AMapLocation_5.6.0_20211029.jar
  3. 30 20
      app/src/main/java/com/electric/chargingpile/activity/AlterTwoActivity.java
  4. 17 10
      app/src/main/java/com/electric/chargingpile/activity/BasicNaviActivity.java
  5. 31 20
      app/src/main/java/com/electric/chargingpile/activity/BuildMapActivity.java
  6. 22 17
      app/src/main/java/com/electric/chargingpile/activity/ClaimMapActivity.java
  7. 29 20
      app/src/main/java/com/electric/chargingpile/activity/ClaimSurveyTwoActivity.java
  8. 43 40
      app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java
  9. 31 26
      app/src/main/java/com/electric/chargingpile/activity/NewSelectCityActivity.java
  10. 19 14
      app/src/main/java/com/electric/chargingpile/activity/OfflineMapActivity.java
  11. 40 35
      app/src/main/java/com/electric/chargingpile/activity/PileDetailsActivity.java
  12. 0 1
      app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java
  13. 30 20
      app/src/main/java/com/electric/chargingpile/activity/PrivateZhuangMapActivity.java
  14. 25 20
      app/src/main/java/com/electric/chargingpile/activity/RecommendZhanActivity.java
  15. 58 80
      app/src/main/java/com/electric/chargingpile/activity/RoutePlanMapActivity.java
  16. 11 3
      app/src/main/java/com/electric/chargingpile/activity/RoutePlanSelectAddressActivity.java
  17. 30 20
      app/src/main/java/com/electric/chargingpile/activity/RouteSelectPointActivity.java
  18. 9 3
      app/src/main/java/com/electric/chargingpile/activity/SearchActivity.java
  19. 16 11
      app/src/main/java/com/electric/chargingpile/activity/SelectCityActivity.java
  20. 31 20
      app/src/main/java/com/electric/chargingpile/activity/ShareMapActivity.java
  21. 22 17
      app/src/main/java/com/electric/chargingpile/activity/ShowBuildLocationActivity.java
  22. 18 9
      app/src/main/java/com/electric/chargingpile/activity/SimpleNaviActivity.java
  23. 15 10
      app/src/main/java/com/electric/chargingpile/activity/SwitchCityActivity.java
  24. 16 10
      app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java
  25. 15 10
      app/src/main/java/com/electric/chargingpile/adapter/CityListAdapter.java
  26. 39 35
      app/src/main/java/com/electric/chargingpile/adapter/ZhuangStatusadapter.java
  27. 6 0
      app/src/main/java/com/electric/chargingpile/application/MainApplication.java
  28. 7 9
      app/src/main/java/com/electric/chargingpile/util/TTSController.java
  29. BIN
      app/src/main/jniLibs/arm64-v8a/libAMapSDK_MAP_v6_9_2.so
  30. BIN
      app/src/main/jniLibs/arm64-v8a/libAMapSDK_NAVI_v6_9_0.so
  31. BIN
      app/src/main/jniLibs/arm64-v8a/libAMapSDK_NAVI_v8_1_0.so
  32. BIN
      app/src/main/jniLibs/arm64-v8a/libneonui_shared.so
  33. BIN
      app/src/main/jniLibs/arm64-v8a/libneonuijni_public.so
  34. BIN
      app/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v6_9_2.so
  35. BIN
      app/src/main/jniLibs/armeabi-v7a/libAMapSDK_NAVI_v6_9_0.so
  36. BIN
      app/src/main/jniLibs/armeabi-v7a/libAMapSDK_NAVI_v8_1_0.so
  37. BIN
      app/src/main/jniLibs/armeabi-v7a/libneonui_shared.so
  38. BIN
      app/src/main/jniLibs/armeabi-v7a/libneonuijni_public.so
  39. BIN
      app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v6_9_2.so
  40. BIN
      app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v6_9_0.so
  41. BIN
      app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v8_1_0.so
  42. BIN
      app/src/main/jniLibs/armeabi/libneonui_shared.so
  43. BIN
      app/src/main/jniLibs/armeabi/libneonuijni_public.so

BIN
app/libs/AMap3DMap_6.9.2_AMapNavi_6.9.0_AMapSearch_6.9.2_AMapLocation_4.7.0_20190710.jar


BIN
app/libs/AMap3DMap_8.1.0_AMapNavi_8.1.0_AMapSearch_8.1.0_AMapLocation_5.6.0_20211029.jar


+ 30 - 20
app/src/main/java/com/electric/chargingpile/activity/AlterTwoActivity.java

@ -36,6 +36,7 @@ import com.amap.api.maps.model.LatLng;
36 36
import com.amap.api.maps.model.Marker;
37 37
import com.amap.api.maps.model.MarkerOptions;
38 38
import com.amap.api.maps.model.MyLocationStyle;
39
import com.amap.api.services.core.AMapException;
39 40
import com.amap.api.services.core.LatLonPoint;
40 41
import com.amap.api.services.geocoder.GeocodeResult;
41 42
import com.amap.api.services.geocoder.GeocodeSearch;
@ -551,9 +552,13 @@ public class AlterTwoActivity extends Activity implements
551 552
            //获得地图的最大和最小缩放级别
552 553
            maxZoomLevel = aMap.getMaxZoomLevel();
553 554
            minZoomLevel = aMap.getMinZoomLevel();
554
            geocoderSearch = new GeocodeSearch(this);
555
            geocoderSearch.setOnGeocodeSearchListener(this);
556
            setUpMap();
555
            try {
556
                geocoderSearch = new GeocodeSearch(this);
557
                geocoderSearch.setOnGeocodeSearchListener(this);
558
                setUpMap();
559
            } catch (AMapException e) {
560
                e.printStackTrace();
561
            }
557 562
        }
558 563
    }
559 564
@ -661,23 +666,28 @@ public class AlterTwoActivity extends Activity implements
661 666
    public void activate(OnLocationChangedListener onLocationChangedListener) {
662 667
        mListener = onLocationChangedListener;
663 668
        if (mlocationClient == null) {
664
            mlocationClient = new AMapLocationClient(this);
665
            mLocationOption = new AMapLocationClientOption();
666
            //设置定位监听
667
            mlocationClient.setLocationListener(this);
668
            //设置为高精度定位模式
669
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
670
            //设置定位参数
671
            mlocationClient.setLocationOption(mLocationOption);
672
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
673
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
674
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
675
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
676
            // 设置是否只定位一次,默认为false
677
            mLocationOption.setOnceLocation(true);
678
            //设置是否强制刷新WIFI,默认为强制刷新
679
            mLocationOption.setWifiActiveScan(false);
680
            mlocationClient.startLocation();
669
            try {
670
                mlocationClient = new AMapLocationClient(this);
671
                mLocationOption = new AMapLocationClientOption();
672
                //设置定位监听
673
                mlocationClient.setLocationListener(this);
674
                //设置为高精度定位模式
675
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
676
                //设置定位参数
677
                mlocationClient.setLocationOption(mLocationOption);
678
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
679
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
680
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
681
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
682
                // 设置是否只定位一次,默认为false
683
                mLocationOption.setOnceLocation(true);
684
                //设置是否强制刷新WIFI,默认为强制刷新
685
                mLocationOption.setWifiActiveScan(false);
686
                mlocationClient.startLocation();
687
            } catch (Exception e) {
688
                e.printStackTrace();
689
            }
690
681 691
        }
682 692
    }
683 693

+ 17 - 10
app/src/main/java/com/electric/chargingpile/activity/BasicNaviActivity.java

@ -7,6 +7,7 @@ import android.util.Log;
7 7
import android.view.Window;
8 8
import android.view.WindowManager;
9 9
10
import com.amap.api.maps.AMapException;
10 11
import com.amap.api.navi.AMapNavi;
11 12
import com.amap.api.navi.AMapNaviListener;
12 13
import com.amap.api.navi.AMapNaviView;
@ -18,7 +19,7 @@ import com.amap.api.navi.model.AMapLaneInfo;
18 19
import com.amap.api.navi.model.AMapModelCross;
19 20
import com.amap.api.navi.model.AMapNaviCameraInfo;
20 21
import com.amap.api.navi.model.AMapNaviCross;
21
import com.amap.api.navi.model.AMapNaviInfo;
22
22 23
import com.amap.api.navi.model.AMapNaviLocation;
23 24
import com.amap.api.navi.model.AMapNaviRouteNotifyData;
24 25
import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo;
@ -27,7 +28,7 @@ import com.amap.api.navi.model.AimLessModeCongestionInfo;
27 28
import com.amap.api.navi.model.AimLessModeStat;
28 29
import com.amap.api.navi.model.NaviInfo;
29 30
import com.amap.api.navi.model.NaviLatLng;
30
import com.autonavi.tbt.TrafficFacilityInfo;
31
31 32
import com.blankj.utilcode.util.LogUtils;
32 33
import com.electric.chargingpile.R;
33 34
@ -60,7 +61,11 @@ public class BasicNaviActivity extends Activity implements AMapNaviListener, AMa
60 61
//        mTtsManager.init();
61 62
//        mTtsManager.startSpeaking();
62 63
//
63
        mAMapNavi = AMapNavi.getInstance(getApplicationContext());
64
        try {
65
            mAMapNavi = AMapNavi.getInstance(getApplicationContext());
66
        } catch (AMapException e) {
67
            e.printStackTrace();
68
        }
64 69
        mAMapNavi.addAMapNaviListener(this);
65 70
66 71
//        mAMapNavi.addAMapNaviListener(mTtsManager);
@ -210,10 +215,7 @@ public class BasicNaviActivity extends Activity implements AMapNaviListener, AMa
210 215
211 216
    }
212 217
213
    @Override
214
    public void onNaviInfoUpdated(AMapNaviInfo aMapNaviInfo) {
215 218
216
    }
217 219
218 220
    @Override
219 221
    public void updateCameraInfo(AMapNaviCameraInfo[] aMapNaviCameraInfos) {
@ -241,10 +243,6 @@ public class BasicNaviActivity extends Activity implements AMapNaviListener, AMa
241 243
242 244
    }
243 245
244
    @Override
245
    public void OnUpdateTrafficFacility(TrafficFacilityInfo trafficFacilityInfo) {
246
247
    }
248 246
249 247
    @Override
250 248
    public void showCross(AMapNaviCross aMapNaviCross) {
@ -333,6 +331,11 @@ public class BasicNaviActivity extends Activity implements AMapNaviListener, AMa
333 331
    }
334 332
335 333
    @Override
334
    public void onGpsSignalWeak(boolean b) {
335
336
    }
337
338
    @Override
336 339
    public void onNaviSetting() {
337 340
338 341
    }
@ -387,4 +390,8 @@ public class BasicNaviActivity extends Activity implements AMapNaviListener, AMa
387 390
388 391
    }
389 392
393
    @Override
394
    public void onPointerCaptureChanged(boolean hasCapture) {
395
396
    }
390 397
}

+ 31 - 20
app/src/main/java/com/electric/chargingpile/activity/BuildMapActivity.java

@ -22,6 +22,7 @@ import com.amap.api.maps.UiSettings;
22 22
import com.amap.api.maps.model.CameraPosition;
23 23
import com.amap.api.maps.model.LatLng;
24 24
import com.amap.api.maps.model.MyLocationStyle;
25
import com.amap.api.services.core.AMapException;
25 26
import com.amap.api.services.core.LatLonPoint;
26 27
import com.amap.api.services.geocoder.GeocodeResult;
27 28
import com.amap.api.services.geocoder.GeocodeSearch;
@ -95,9 +96,14 @@ public class BuildMapActivity extends Activity implements View.OnClickListener,
95 96
            //获得地图的最大和最小缩放级别
96 97
            maxZoomLevel = aMap.getMaxZoomLevel();
97 98
            minZoomLevel = aMap.getMinZoomLevel();
98
            geocoderSearch = new GeocodeSearch(this);
99
            geocoderSearch.setOnGeocodeSearchListener(this);
100
            setUpMap();
99
            try {
100
                geocoderSearch = new GeocodeSearch(this);
101
                geocoderSearch.setOnGeocodeSearchListener(this);
102
                setUpMap();
103
            } catch (AMapException e) {
104
                e.printStackTrace();
105
            }
106
101 107
        }
102 108
    }
103 109
@ -342,23 +348,28 @@ public class BuildMapActivity extends Activity implements View.OnClickListener,
342 348
    public void activate(OnLocationChangedListener onLocationChangedListener) {
343 349
        mListener = onLocationChangedListener;
344 350
        if (mlocationClient == null) {
345
            mlocationClient = new AMapLocationClient(this);
346
            mLocationOption = new AMapLocationClientOption();
347
            //设置定位监听
348
            mlocationClient.setLocationListener(this);
349
            //设置为高精度定位模式
350
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
351
            //设置定位参数
352
            mlocationClient.setLocationOption(mLocationOption);
353
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
354
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
355
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
356
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
357
            // 设置是否只定位一次,默认为false
358
            mLocationOption.setOnceLocation(true);
359
            //设置是否强制刷新WIFI,默认为强制刷新
360
            mLocationOption.setWifiActiveScan(false);
361
            mlocationClient.startLocation();
351
            try {
352
                mlocationClient = new AMapLocationClient(this);
353
                mLocationOption = new AMapLocationClientOption();
354
                //设置定位监听
355
                mlocationClient.setLocationListener(this);
356
                //设置为高精度定位模式
357
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
358
                //设置定位参数
359
                mlocationClient.setLocationOption(mLocationOption);
360
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
361
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
362
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
363
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
364
                // 设置是否只定位一次,默认为false
365
                mLocationOption.setOnceLocation(true);
366
                //设置是否强制刷新WIFI,默认为强制刷新
367
                mLocationOption.setWifiActiveScan(false);
368
                mlocationClient.startLocation();
369
370
            } catch (Exception e) {
371
                e.printStackTrace();
372
            }
362 373
363 374
        }
364 375
    }

+ 22 - 17
app/src/main/java/com/electric/chargingpile/activity/ClaimMapActivity.java

@ -1607,23 +1607,28 @@ public class ClaimMapActivity extends Activity implements OnClickListener, AMap.
1607 1607
    public void activate(OnLocationChangedListener onLocationChangedListener) {
1608 1608
        mListener = onLocationChangedListener;
1609 1609
        if (mlocationClient == null) {
1610
            mlocationClient = new AMapLocationClient(this);
1611
            mLocationOption = new AMapLocationClientOption();
1612
            //设置定位监听
1613
            mlocationClient.setLocationListener(this);
1614
            //设置为高精度定位模式
1615
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
1616
            //设置定位参数
1617
            mlocationClient.setLocationOption(mLocationOption);
1618
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
1619
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
1620
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
1621
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
1622
            // 设置是否只定位一次,默认为false
1623
            mLocationOption.setOnceLocation(true);
1624
            //设置是否强制刷新WIFI,默认为强制刷新
1625
            mLocationOption.setWifiActiveScan(false);
1626
            mlocationClient.startLocation();
1610
            try {
1611
                mlocationClient = new AMapLocationClient(this);
1612
                mLocationOption = new AMapLocationClientOption();
1613
                //设置定位监听
1614
                mlocationClient.setLocationListener(this);
1615
                //设置为高精度定位模式
1616
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
1617
                //设置定位参数
1618
                mlocationClient.setLocationOption(mLocationOption);
1619
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
1620
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
1621
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
1622
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
1623
                // 设置是否只定位一次,默认为false
1624
                mLocationOption.setOnceLocation(true);
1625
                //设置是否强制刷新WIFI,默认为强制刷新
1626
                mLocationOption.setWifiActiveScan(false);
1627
                mlocationClient.startLocation();
1628
            } catch (Exception e) {
1629
                e.printStackTrace();
1630
            }
1631
1627 1632
1628 1633
        }
1629 1634
    }

+ 29 - 20
app/src/main/java/com/electric/chargingpile/activity/ClaimSurveyTwoActivity.java

@ -62,6 +62,7 @@ import com.amap.api.maps.model.LatLng;
62 62
import com.amap.api.maps.model.Marker;
63 63
import com.amap.api.maps.model.MarkerOptions;
64 64
import com.amap.api.maps.model.MyLocationStyle;
65
import com.amap.api.services.core.AMapException;
65 66
import com.amap.api.services.core.LatLonPoint;
66 67
import com.amap.api.services.geocoder.GeocodeResult;
67 68
import com.amap.api.services.geocoder.GeocodeSearch;
@ -2201,9 +2202,13 @@ public class ClaimSurveyTwoActivity extends Activity implements View.OnClickList
2201 2202
            //获得地图的最大和最小缩放级别
2202 2203
            maxZoomLevel = aMap.getMaxZoomLevel();
2203 2204
            minZoomLevel = aMap.getMinZoomLevel();
2204
            geocoderSearch = new GeocodeSearch(this);
2205
            geocoderSearch.setOnGeocodeSearchListener(this);
2206
            setUpMap();
2205
            try {
2206
                geocoderSearch = new GeocodeSearch(this);
2207
                geocoderSearch.setOnGeocodeSearchListener(this);
2208
                setUpMap();
2209
            } catch (AMapException e) {
2210
                e.printStackTrace();
2211
            }
2207 2212
        }
2208 2213
    }
2209 2214
@ -2234,23 +2239,27 @@ public class ClaimSurveyTwoActivity extends Activity implements View.OnClickList
2234 2239
    public void activate(OnLocationChangedListener onLocationChangedListener) {
2235 2240
        mListener = onLocationChangedListener;
2236 2241
        if (mlocationClient == null) {
2237
            mlocationClient = new AMapLocationClient(this);
2238
            mLocationOption = new AMapLocationClientOption();
2239
            //设置定位监听
2240
            mlocationClient.setLocationListener(this);
2241
            //设置为高精度定位模式
2242
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
2243
            //设置定位参数
2244
            mlocationClient.setLocationOption(mLocationOption);
2245
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
2246
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
2247
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
2248
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
2249
            // 设置是否只定位一次,默认为false
2250
            mLocationOption.setOnceLocation(true);
2251
            //设置是否强制刷新WIFI,默认为强制刷新
2252
            mLocationOption.setWifiActiveScan(false);
2253
            mlocationClient.startLocation();
2242
            try {
2243
                mlocationClient = new AMapLocationClient(this);
2244
                mLocationOption = new AMapLocationClientOption();
2245
                //设置定位监听
2246
                mlocationClient.setLocationListener(this);
2247
                //设置为高精度定位模式
2248
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
2249
                //设置定位参数
2250
                mlocationClient.setLocationOption(mLocationOption);
2251
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
2252
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
2253
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
2254
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
2255
                // 设置是否只定位一次,默认为false
2256
                mLocationOption.setOnceLocation(true);
2257
                //设置是否强制刷新WIFI,默认为强制刷新
2258
                mLocationOption.setWifiActiveScan(false);
2259
                mlocationClient.startLocation();
2260
            } catch (Exception e) {
2261
                e.printStackTrace();
2262
            }
2254 2263
        }
2255 2264
    }
2256 2265

+ 43 - 40
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -1401,7 +1401,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1401 1401
1402 1402
        changeButton();
1403 1403
1404
        if (hasLocationPermission() && center == null) {
1404
        if (hasLocationPermission() && center == null && mlocationClient!=null) {
1405 1405
            mlocationClient.startLocation();
1406 1406
        }
1407 1407
    }
@ -1504,62 +1504,65 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1504 1504
    public void activate(OnLocationChangedListener listener) {
1505 1505
        mListener = listener;
1506 1506
        if (mlocationClient == null) {
1507
            mlocationClient = new AMapLocationClient(this);
1507
            try {
1508
                mlocationClient = new AMapLocationClient(this);
1508 1509
1509
            mLocationOption = new AMapLocationClientOption();
1510
            //设置定位监听
1511
            mlocationClient.setLocationListener(this);
1512
            //设置为高精度定位模式
1513
            mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving);
1510
                mLocationOption = new AMapLocationClientOption();
1511
                //设置定位监听
1512
                mlocationClient.setLocationListener(this);
1513
                //设置为高精度定位模式
1514
                mLocationOption.setLocationMode(AMapLocationMode.Battery_Saving);
1514 1515
//            mLocationOption.setGpsFirst(true);
1515 1516
//            mLocationOption.setOnceLocation(true);
1516
            mLocationOption.setInterval(1500);
1517
                mLocationOption.setInterval(1500);
1517 1518
1518
            //设置是否强制刷新WIFI,默认为强制刷新
1519
                //设置是否强制刷新WIFI,默认为强制刷新
1519 1520
//            mLocationOption.setWifiActiveScan(true);
1520
            //设置定位参数
1521
            mlocationClient.setLocationOption(mLocationOption);
1522
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
1523
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
1524
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
1525
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
1526
            // 设置是否只定位一次,默认为false
1527
            mLocationOption.setOnceLocation(false);
1528
            //设置是否强制刷新WIFI,默认为强制刷新
1529
            //mLocationOption.setWifiActiveScan(false);
1530
            mLocationOption.setWifiScan(true);
1531
1532
            if (ProfileManager.getInstance().getStartedRequestLocationPermission(MainMapActivity.this)) {
1533
                if (hasLocationPermission()) {
1534
                    requestLocationPermission();
1535
                }
1536
            } else { // 首次启动
1521
                //设置定位参数
1522
                mlocationClient.setLocationOption(mLocationOption);
1523
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
1524
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
1525
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
1526
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
1527
                // 设置是否只定位一次,默认为false
1528
                mLocationOption.setOnceLocation(false);
1529
                //设置是否强制刷新WIFI,默认为强制刷新
1530
                //mLocationOption.setWifiActiveScan(false);
1531
                mLocationOption.setWifiScan(true);
1532
                if (ProfileManager.getInstance().getStartedRequestLocationPermission(MainMapActivity.this)) {
1533
                    if (hasLocationPermission()) {
1534
                        requestLocationPermission();
1535
                    }
1536
                } else { // 首次启动
1537 1537
1538
                ProfileManager.getInstance().setStartedRequestLocationPermission(MainMapActivity.this, true);
1539
                new LocationPermissionsDialog(context)
1540
                        .builder()
1541
                        .setMsg("需要确定您所在的城市,首页才能显示您所在的城市的站点信息,请您授权定位")
1542
                        .setLeftButton("取消",v -> {
1538
                    ProfileManager.getInstance().setStartedRequestLocationPermission(MainMapActivity.this, true);
1539
                    new LocationPermissionsDialog(context)
1540
                            .builder()
1541
                            .setMsg("需要确定您所在的城市,首页才能显示您所在的城市的站点信息,请您授权定位")
1542
                            .setLeftButton("取消",v -> {
1543 1543
1544
                        })
1545
                        .setRightButton("确定",v->{
1544
                            })
1545
                            .setRightButton("确定",v->{
1546 1546
                                EasyPermissions.requestPermissions(
1547 1547
                                        this,
1548 1548
                                        "为了定位您的位置,推荐充电桩,充电桩位置路线导航需要开启位置权限,是否前往开启?",
1549 1549
                                        RC_Location_FIRST_PERM,
1550 1550
                                        Manifest.permission.ACCESS_FINE_LOCATION,
1551 1551
                                        Manifest.permission.ACCESS_COARSE_LOCATION
1552
                                        );
1552
                                );
1553 1553
1554
                        }).show();
1554
                            }).show();
1555 1555
1556
            }
1556
                }
1557 1557
1558
            if (hasLocationPermission()) {
1559
                Log.e(TAG, "onResume: hyc 4" );
1560
                requestLocationPermission();
1561
            }
1558
                if (hasLocationPermission()) {
1559
                    Log.e(TAG, "onResume: hyc 4" );
1560
                    requestLocationPermission();
1561
                }
1562 1562
1563
            } catch (Exception e) {
1564
                e.printStackTrace();
1565
            }
1563 1566
        }
1564 1567
    }
1565 1568

+ 31 - 26
app/src/main/java/com/electric/chargingpile/activity/NewSelectCityActivity.java

@ -397,35 +397,40 @@ public class NewSelectCityActivity extends AppCompatActivity implements ISelectC
397 397
    }
398 398
399 399
    private void initLocation() {
400
        mlocationClient = new AMapLocationClient(this);
401
        //初始化定位参数
402
        mLocationOption = new AMapLocationClientOption();
403
        //设置定位监听
404
        mlocationClient.setLocationListener(this);
405
        //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
406
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
407
        mLocationOption.setOnceLocation(true);
408
        //设置是否强制刷新WIFI,默认为强制刷新
409
        mLocationOption.setWifiActiveScan(false);
410
        //设置定位间隔,单位毫秒,默认为2000ms
411
        // mLocationOption.setInterval(2000);
412
        // 设置定位参数
413
        mlocationClient.setLocationOption(mLocationOption);
414
        // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
415
        // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
416
        // 在定位结束后,在合适的生命周期调用onDestroy()方法
417
        // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
418
        //启动定位
419
420
        if (hasLocationPermission()) {
421
            requestLocationPermission();
422
        } else {
423
            mTvLocation.setText("定位失败");
424
            if (!ProfileManager.getInstance().getFirstRequestLocationPermission(NewSelectCityActivity.this)) {
425
                ProfileManager.getInstance().setFirstRequestLocationPermission(NewSelectCityActivity.this, true);
400
        try {
401
            mlocationClient = new AMapLocationClient(this);
402
            //初始化定位参数
403
            mLocationOption = new AMapLocationClientOption();
404
            //设置定位监听
405
            mlocationClient.setLocationListener(this);
406
            //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
407
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
408
            mLocationOption.setOnceLocation(true);
409
            //设置是否强制刷新WIFI,默认为强制刷新
410
            mLocationOption.setWifiActiveScan(false);
411
            //设置定位间隔,单位毫秒,默认为2000ms
412
            // mLocationOption.setInterval(2000);
413
            // 设置定位参数
414
            mlocationClient.setLocationOption(mLocationOption);
415
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
416
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
417
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
418
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
419
            //启动定位
420
421
            if (hasLocationPermission()) {
426 422
                requestLocationPermission();
423
            } else {
424
                mTvLocation.setText("定位失败");
425
                if (!ProfileManager.getInstance().getFirstRequestLocationPermission(NewSelectCityActivity.this)) {
426
                    ProfileManager.getInstance().setFirstRequestLocationPermission(NewSelectCityActivity.this, true);
427
                    requestLocationPermission();
428
                }
427 429
            }
430
        } catch (Exception e) {
431
            e.printStackTrace();
428 432
        }
433
429 434
    }
430 435
431 436
    private void insertData(CityRecord cityRecord) {

+ 19 - 14
app/src/main/java/com/electric/chargingpile/activity/OfflineMapActivity.java

@ -238,20 +238,25 @@ public class OfflineMapActivity extends Activity implements
238 238
        mAllOfflineMapList = (ExpandableListView) provinceContainer
239 239
                .findViewById(R.id.province_download_list);
240 240
241
        amapManager = new OfflineMapManager(this, this);
242
243
        initProvinceListAndCityMap();
244
245
        // adapter = new OfflineListAdapter(provinceList, cityMap, amapManager,
246
        // OfflineMapActivity.this);
247
        adapter = new OfflineListAdapter(provinceList, amapManager,
248
                OfflineMapActivity.this);
249
        // 为列表绑定数据源
250
        mAllOfflineMapList.setAdapter(adapter);
251
        // adapter实现了扩展列表的展开与合并监听
252
        mAllOfflineMapList.setOnGroupCollapseListener(adapter);
253
        mAllOfflineMapList.setOnGroupExpandListener(adapter);
254
        mAllOfflineMapList.setGroupIndicator(null);
241
        try {
242
            amapManager = new OfflineMapManager(this, this);
243
244
            initProvinceListAndCityMap();
245
246
            // adapter = new OfflineListAdapter(provinceList, cityMap, amapManager,
247
            // OfflineMapActivity.this);
248
            adapter = new OfflineListAdapter(provinceList, amapManager,
249
                    OfflineMapActivity.this);
250
            // 为列表绑定数据源
251
            mAllOfflineMapList.setAdapter(adapter);
252
            // adapter实现了扩展列表的展开与合并监听
253
            mAllOfflineMapList.setOnGroupCollapseListener(adapter);
254
            mAllOfflineMapList.setOnGroupExpandListener(adapter);
255
            mAllOfflineMapList.setGroupIndicator(null);
256
        } catch (Exception e) {
257
            e.printStackTrace();
258
        }
259
255 260
    }
256 261
257 262
    /**

+ 40 - 35
app/src/main/java/com/electric/chargingpile/activity/PileDetailsActivity.java

@ -348,43 +348,48 @@ public class PileDetailsActivity extends AppCompatActivity implements View.OnCli
348 348
        final AMapLocationClient mlocationClient;
349 349
        //声明mLocationOption对象
350 350
        AMapLocationClientOption mLocationOption = null;
351
        mlocationClient = new AMapLocationClient(this);
352
        //初始化定位参数
353
        mLocationOption = new AMapLocationClientOption();
354
        //设置定位监听
355
        mlocationClient.setLocationListener(new AMapLocationListener() {
356
            @Override
357
            public void onLocationChanged(AMapLocation amapLocation) {
358
                if (amapLocation != null) {
359
                    if (amapLocation.getErrorCode() == 0) {
360
                        //定位成功回调信息,设置相关消息
361
                        amapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见定位类型表
362
                        amapLocation.getLatitude();//获取纬度
363
                        amapLocation.getLongitude();//获取
364
                        amapLocation.getAccuracy();//获取精度信息
365
                        LogUtils.e(amapLocation.getLatitude() + "--" + amapLocation.getLongitude());
366
                        mlocationClient.stopLocation();
367
                        sendControlParkingDownLock(amapLocation, pileData);
368
                    } else {
369
                        //显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
370
                        Log.e("AmapError", "location Error, ErrCode:"
371
                                + amapLocation.getErrorCode() + ", errInfo:"
372
                                + amapLocation.getErrorInfo());
351
        try {
352
            mlocationClient = new AMapLocationClient(this);
353
            //初始化定位参数
354
            mLocationOption = new AMapLocationClientOption();
355
            //设置定位监听
356
            mlocationClient.setLocationListener(new AMapLocationListener() {
357
                @Override
358
                public void onLocationChanged(AMapLocation amapLocation) {
359
                    if (amapLocation != null) {
360
                        if (amapLocation.getErrorCode() == 0) {
361
                            //定位成功回调信息,设置相关消息
362
                            amapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见定位类型表
363
                            amapLocation.getLatitude();//获取
364
                            amapLocation.getLongitude();//获取经度
365
                            amapLocation.getAccuracy();//获取精度信息
366
                            LogUtils.e(amapLocation.getLatitude() + "--" + amapLocation.getLongitude());
367
                            mlocationClient.stopLocation();
368
                            sendControlParkingDownLock(amapLocation, pileData);
369
                        } else {
370
                            //显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
371
                            Log.e("AmapError", "location Error, ErrCode:"
372
                                    + amapLocation.getErrorCode() + ", errInfo:"
373
                                    + amapLocation.getErrorInfo());
374
                        }
373 375
                    }
374 376
                }
375
            }
376
        });
377
        //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
378
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
379
        //设置定位间隔,单位毫秒,默认为2000ms//        mLocationOption.setInterval(2000);
380
        //设置定位参数
381
        mlocationClient.setLocationOption(mLocationOption);
382
        // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
383
        // 注意设置合适的定位时间的间隔(最小间隔支持为1000ms),并且在合适时间调用stopLocation()方法来取消定位请求
384
        // 在定位结束后,在合适的生命周期调用onDestroy()方法
385
        // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
386
        //启动定位
387
        mlocationClient.startLocation();
377
            });
378
            //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
379
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
380
            //设置定位间隔,单位毫秒,默认为2000ms//        mLocationOption.setInterval(2000);
381
            //设置定位参数
382
            mlocationClient.setLocationOption(mLocationOption);
383
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
384
            // 注意设置合适的定位时间的间隔(最小间隔支持为1000ms),并且在合适时间调用stopLocation()方法来取消定位请求
385
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
386
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
387
            //启动定位
388
            mlocationClient.startLocation();
389
        } catch (Exception e) {
390
            e.printStackTrace();
391
        }
392
388 393
    }
389 394
390 395
    private void sendControlParkingDownLock(AMapLocation amapLocation, PileData pileData) {

+ 0 - 1
app/src/main/java/com/electric/chargingpile/activity/PrivacyAgreementActivity.java

@ -37,7 +37,6 @@ public class PrivacyAgreementActivity extends Activity {
37 37
        setContentView(R.layout.activity_privacy_agreement);
38 38
        BarColorUtil.initStatusBarColor(PrivacyAgreementActivity.this);
39 39
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
40
            MainApplication.initSDK();
41 40
            Log.e("TAG_HYC", "onCreate:  getPrivacyAgreement" );
42 41
            startActivity(new Intent(PrivacyAgreementActivity.this, WelcomeActivity.class));
43 42
            finish();

+ 30 - 20
app/src/main/java/com/electric/chargingpile/activity/PrivateZhuangMapActivity.java

@ -29,6 +29,7 @@ import com.amap.api.maps.model.BitmapDescriptorFactory;
29 29
import com.amap.api.maps.model.CameraPosition;
30 30
import com.amap.api.maps.model.LatLng;
31 31
import com.amap.api.maps.model.MyLocationStyle;
32
import com.amap.api.services.core.AMapException;
32 33
import com.amap.api.services.core.LatLonPoint;
33 34
import com.amap.api.services.geocoder.GeocodeResult;
34 35
import com.amap.api.services.geocoder.GeocodeSearch;
@ -126,9 +127,13 @@ public class PrivateZhuangMapActivity extends Activity implements View.OnClickLi
126 127
            //获得地图的最大和最小缩放级别
127 128
            maxZoomLevel = aMap.getMaxZoomLevel();
128 129
            minZoomLevel = aMap.getMinZoomLevel();
129
            geocoderSearch = new GeocodeSearch(this);
130
            geocoderSearch.setOnGeocodeSearchListener(this);
131
            setUpMap();
130
            try {
131
                geocoderSearch = new GeocodeSearch(this);
132
                geocoderSearch.setOnGeocodeSearchListener(this);
133
                setUpMap();
134
            } catch (AMapException e) {
135
                e.printStackTrace();
136
            }
132 137
        }
133 138
    }
134 139
@ -432,23 +437,28 @@ public class PrivateZhuangMapActivity extends Activity implements View.OnClickLi
432 437
    public void activate(OnLocationChangedListener onLocationChangedListener) {
433 438
        mListener = onLocationChangedListener;
434 439
        if (mlocationClient == null) {
435
            mlocationClient = new AMapLocationClient(this);
436
            mLocationOption = new AMapLocationClientOption();
437
            //设置定位监听
438
            mlocationClient.setLocationListener(this);
439
            //设置为高精度定位模式
440
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
441
            //设置定位参数
442
            mlocationClient.setLocationOption(mLocationOption);
443
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
444
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
445
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
446
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
447
            // 设置是否只定位一次,默认为false
448
            mLocationOption.setOnceLocation(true);
449
            //设置是否强制刷新WIFI,默认为强制刷新
450
            mLocationOption.setWifiActiveScan(false);
451
            mlocationClient.startLocation();
440
            try {
441
                mlocationClient = new AMapLocationClient(this);
442
                mLocationOption = new AMapLocationClientOption();
443
                //设置定位监听
444
                mlocationClient.setLocationListener(this);
445
                //设置为高精度定位模式
446
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
447
                //设置定位参数
448
                mlocationClient.setLocationOption(mLocationOption);
449
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
450
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
451
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
452
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
453
                // 设置是否只定位一次,默认为false
454
                mLocationOption.setOnceLocation(true);
455
                //设置是否强制刷新WIFI,默认为强制刷新
456
                mLocationOption.setWifiActiveScan(false);
457
                mlocationClient.startLocation();
458
459
            } catch (Exception e) {
460
                e.printStackTrace();
461
            }
452 462
453 463
        }
454 464
    }

+ 25 - 20
app/src/main/java/com/electric/chargingpile/activity/RecommendZhanActivity.java

@ -361,31 +361,36 @@ public class RecommendZhanActivity extends Activity implements View.OnClickListe
361 361
    public void activate(OnLocationChangedListener onLocationChangedListener) {
362 362
        mListener = onLocationChangedListener;
363 363
        if (mlocationClient == null) {
364
            mlocationClient = new AMapLocationClient(this);
364
            try {
365
                mlocationClient = new AMapLocationClient(this);
365 366
366
            mLocationOption = new AMapLocationClientOption();
367
            //设置定位监听
368
            mlocationClient.setLocationListener(this);
369
            //设置为高精度定位模式
370
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
367
                mLocationOption = new AMapLocationClientOption();
368
                //设置定位监听
369
                mlocationClient.setLocationListener(this);
370
                //设置为高精度定位模式
371
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving);
371 372
//            mLocationOption.setGpsFirst(true);
372 373
//            mLocationOption.setOnceLocation(true);
373
            mLocationOption.setInterval(1500);
374
                mLocationOption.setInterval(1500);
374 375
375
            //设置是否强制刷新WIFI,默认为强制刷新
376
                //设置是否强制刷新WIFI,默认为强制刷新
376 377
//            mLocationOption.setWifiActiveScan(true);
377
            //设置定位参数
378
            mlocationClient.setLocationOption(mLocationOption);
379
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
380
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
381
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
382
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
383
            // 设置是否只定位一次,默认为false
384
            mLocationOption.setOnceLocation(false);
385
386
            //设置是否强制刷新WIFI,默认为强制刷新
387
            mLocationOption.setWifiActiveScan(false);
388
            mlocationClient.startLocation();
378
                //设置定位参数
379
                mlocationClient.setLocationOption(mLocationOption);
380
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
381
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
382
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
383
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
384
                // 设置是否只定位一次,默认为false
385
                mLocationOption.setOnceLocation(false);
386
387
                //设置是否强制刷新WIFI,默认为强制刷新
388
                mLocationOption.setWifiActiveScan(false);
389
                mlocationClient.startLocation();
390
391
            } catch (Exception e) {
392
                e.printStackTrace();
393
            }
389 394
390 395
        }
391 396
    }

+ 58 - 80
app/src/main/java/com/electric/chargingpile/activity/RoutePlanMapActivity.java

@ -68,7 +68,7 @@ import com.amap.api.navi.model.AMapLaneInfo;
68 68
import com.amap.api.navi.model.AMapModelCross;
69 69
import com.amap.api.navi.model.AMapNaviCameraInfo;
70 70
import com.amap.api.navi.model.AMapNaviCross;
71
import com.amap.api.navi.model.AMapNaviInfo;
71
72 72
import com.amap.api.navi.model.AMapNaviLocation;
73 73
import com.amap.api.navi.model.AMapNaviPath;
74 74
import com.amap.api.navi.model.AMapNaviRouteNotifyData;
@ -80,13 +80,14 @@ import com.amap.api.navi.model.AimLessModeStat;
80 80
import com.amap.api.navi.model.NaviInfo;
81 81
import com.amap.api.navi.model.NaviLatLng;
82 82
import com.amap.api.navi.view.RouteOverLay;
83
import com.amap.api.services.core.AMapException;
83 84
import com.amap.api.services.core.LatLonPoint;
84 85
import com.amap.api.services.core.PoiItem;
85 86
import com.amap.api.services.geocoder.GeocodeResult;
86 87
import com.amap.api.services.geocoder.GeocodeSearch;
87 88
import com.amap.api.services.geocoder.RegeocodeQuery;
88 89
import com.amap.api.services.geocoder.RegeocodeResult;
89
import com.autonavi.tbt.TrafficFacilityInfo;
90
90 91
import com.blankj.utilcode.util.EmptyUtils;
91 92
import com.blankj.utilcode.util.LogUtils;
92 93
import com.blankj.utilcode.util.SizeUtils;
@ -414,16 +415,26 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
414 415
        if (amap == null) {
415 416
            amap = mapView.getMap();
416 417
            Util.setMapCustomStyleFile(amap, getApplicationContext());
417
            aMapNavi = AMapNavi.getInstance(getApplicationContext());
418
            aMapNavi.addAMapNaviListener(this);
419
            aMapNavi.setUseInnerVoice(true);
420
            MyLocationStyle myLocationStyle = new MyLocationStyle();
421
            myLocationStyle.myLocationIcon(com.amap.api.maps.model.BitmapDescriptorFactory.fromResource(R.drawable.point_icon));// 设置小蓝点的图标
422
            amap.setMyLocationStyle(myLocationStyle);
418
            try {
419
                aMapNavi = AMapNavi.getInstance(getApplicationContext());
420
                aMapNavi.addAMapNaviListener(this);
421
                aMapNavi.setUseInnerVoice(true);
422
                MyLocationStyle myLocationStyle = new MyLocationStyle();
423
                myLocationStyle.myLocationIcon(com.amap.api.maps.model.BitmapDescriptorFactory.fromResource(R.drawable.point_icon));// 设置小蓝点的图标
424
                amap.setMyLocationStyle(myLocationStyle);
425
            } catch (com.amap.api.maps.AMapException e) {
426
                e.printStackTrace();
427
            }
428
423 429
            //获得地图的最大和最小缩放级别
424
            geocoderSearch = new GeocodeSearch(this);
425
            geocoderSearch.setOnGeocodeSearchListener(this);
426
            setUpMap();
430
            try {
431
                geocoderSearch = new GeocodeSearch(this);
432
                geocoderSearch.setOnGeocodeSearchListener(this);
433
                setUpMap();
434
            } catch (AMapException e) {
435
                e.printStackTrace();
436
            }
437
427 438
428 439
        }
429 440
    }
@ -747,12 +758,12 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
747 758
            routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
748 759
            routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
749 760
            routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
750
            routeOverLay.setTrafficLightsVisible(false);
761
            //routeOverLay.setTrafficLightsVisible(false);
751 762
            routeOverLay.addToMap();
752 763
            routeOverlays.put(routeIds[i], routeOverLay);
753 764
            routeOverLay.getAMapNaviPath().getSteps();
754 765
755
            routePlanInfo.setNo(routeOverlays.get(routeIds[i]).getAMapNaviPath().getStrategy() + "");
766
            routePlanInfo.setNo(routeOverlays.get(routeIds[i]).getAMapNaviPath().getLabels() + "");
756 767
            routePlanInfo.setTime(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllTime() + "");
757 768
            routePlanInfo.setDistance(routeOverlays.get(routeIds[i]).getAMapNaviPath().getAllLength() + "");
758 769
@ -857,15 +868,8 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
857 868
        int i = l.size();
858 869
859 870
        if (i == 1) {
860
            if (l.get(0).getNo().equals("0")) {
861
                tv_route_no1.setText("推荐");
862
            } else if (l.get(0).getNo().equals("2")) {
863
                tv_route_no1.setText("距离最短");
864
            } else if (l.get(0).getNo().equals("4")) {
865
                tv_route_no1.setText("时间最短");
866
            } else {
867
                tv_route_no1.setText("其他方案");
868
            }
871
            tv_route_no1.setText(l.get(0).getNo());
872
869 873
            tv_route_distance1.setText(getMToKm(l.get(0).getDistance()));
870 874
            tv_route_time1.setText(getSToHm(l.get(0).getTime()));
871 875
            rl_route2.setVisibility(View.GONE);
@ -873,26 +877,13 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
873 877
            view1.setVisibility(View.GONE);
874 878
            view2.setVisibility(View.GONE);
875 879
        } else if (i == 2) {
876
            if (l.get(0).getNo().equals("0")) {
877
                tv_route_no1.setText("推荐");
878
            } else if (l.get(0).getNo().equals("2")) {
879
                tv_route_no1.setText("距离最短");
880
            } else if (l.get(0).getNo().equals("4")) {
881
                tv_route_no1.setText("时间最短");
882
            } else {
883
                tv_route_no1.setText("其他方案");
884
            }
880
            tv_route_no1.setText(l.get(0).getNo());
881
885 882
            tv_route_distance1.setText(getMToKm(l.get(0).getDistance()));
886 883
            tv_route_time1.setText(getSToHm(l.get(0).getTime()));
887
            if (l.get(1).getNo().equals("0")) {
888
                tv_route_no2.setText("推荐");
889
            } else if (l.get(1).getNo().equals("2")) {
890
                tv_route_no2.setText("距离最短");
891
            } else if (l.get(1).getNo().equals("4")) {
892
                tv_route_no2.setText("时间最短");
893
            } else {
894
                tv_route_no2.setText("其他方案");
895
            }
884
885
            tv_route_no2.setText(l.get(1).getNo());
886
896 887
            tv_route_distance2.setText(getMToKm(l.get(1).getDistance()));
897 888
            tv_route_time2.setText(getSToHm(l.get(1).getTime()));
898 889
@ -906,38 +897,18 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
906 897
            view2.setVisibility(View.VISIBLE);
907 898
            rl_route2.setVisibility(View.VISIBLE);
908 899
            view1.setVisibility(View.VISIBLE);
909
            if (l.get(0).getNo().equals("0")) {
910
                tv_route_no1.setText("推荐");
911
            } else if (l.get(0).getNo().equals("2")) {
912
                tv_route_no1.setText("距离最短");
913
            } else if (l.get(0).getNo().equals("4")) {
914
                tv_route_no1.setText("时间最短");
915
            } else {
916
                tv_route_no1.setText("其他方案");
917
            }
900
901
            tv_route_no1.setText(l.get(0).getNo());
902
918 903
            tv_route_distance1.setText(getMToKm(l.get(0).getDistance()));
919 904
            tv_route_time1.setText(getSToHm(l.get(0).getTime()));
920 905
921
            if (l.get(1).getNo().equals("0")) {
922
                tv_route_no2.setText("推荐");
923
            } else if (l.get(1).getNo().equals("2")) {
924
                tv_route_no2.setText("距离最短");
925
            } else if (l.get(1).getNo().equals("4")) {
926
                tv_route_no2.setText("时间最短");
927
            } else {
928
                tv_route_no2.setText("其他方案");
929
            }
906
907
            tv_route_no2.setText(l.get(1).getNo());
908
930 909
            tv_route_distance2.setText(getMToKm(l.get(1).getDistance()));
931 910
            tv_route_time2.setText(getSToHm(l.get(1).getTime()));
932
            if (l.get(2).getNo().equals("0")) {
933
                tv_route_no3.setText("推荐");
934
            } else if (l.get(2).getNo().equals("2")) {
935
                tv_route_no3.setText("距离最短");
936
            } else if (l.get(2).getNo().equals("4")) {
937
                tv_route_no3.setText("时间最短");
938
            } else {
939
                tv_route_no3.setText("其他方案");
940
            }
911
            tv_route_no3.setText(l.get(2).getNo());
941 912
            tv_route_distance3.setText(getMToKm(l.get(2).getDistance()));
942 913
            tv_route_time3.setText(getSToHm(l.get(2).getTime()));
943 914
        }
@ -1004,6 +975,11 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1004 975
    public void onNaviRouteNotify(AMapNaviRouteNotifyData aMapNaviRouteNotifyData) {
1005 976
    }
1006 977
978
    @Override
979
    public void onGpsSignalWeak(boolean b) {
980
981
    }
982
1007 983
1008 984
    public void changeRoute(View view) {
1009 985
        if (mMarkerCity != null) {
@ -1509,10 +1485,6 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1509 1485
1510 1486
    }
1511 1487
1512
    @Override
1513
    public void onNaviInfoUpdated(AMapNaviInfo naviInfo) {
1514
1515
    }
1516 1488
1517 1489
    @Override
1518 1490
    public void updateCameraInfo(AMapNaviCameraInfo[] aMapNaviCameraInfos) {
@ -1535,10 +1507,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1535 1507
1536 1508
    }
1537 1509
1538
    @Override
1539
    public void OnUpdateTrafficFacility(TrafficFacilityInfo trafficFacilityInfo) {
1540 1510
1541
    }
1542 1511
1543 1512
    @Override
1544 1513
    public void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo) {
@ -1605,7 +1574,11 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1605 1574
    public void activate(OnLocationChangedListener onLocationChangedListener) {
1606 1575
        mListener = onLocationChangedListener;
1607 1576
        if (mlocationClient == null) {
1608
            mlocationClient = new AMapLocationClient(this);
1577
            try {
1578
                mlocationClient = new AMapLocationClient(this);
1579
            } catch (Exception e) {
1580
                e.printStackTrace();
1581
            }
1609 1582
            mLocationOption = new AMapLocationClientOption();
1610 1583
            //设置定位监听
1611 1584
            mlocationClient.setLocationListener(this);
@ -1854,7 +1827,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1854 1827
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
1855 1828
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
1856 1829
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
1857
                        routeOverLay.setTrafficLightsVisible(false);
1830
                        //routeOverLay.setTrafficLightsVisible(false);
1858 1831
                        routeOverLay.addToMap();
1859 1832
                        routeOverlays.put(routeIds[i], routeOverLay);
1860 1833
                    }
@ -1916,7 +1889,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1916 1889
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_start)));
1917 1890
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_route_end)));
1918 1891
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
1919
                        routeOverLay.setTrafficLightsVisible(false);
1892
                        //routeOverLay.setTrafficLightsVisible(false);
1920 1893
                        routeOverLay.addToMap();
1921 1894
                        routeOverlays.put(routeIds[i], routeOverLay);
1922 1895
                    }
@ -1976,7 +1949,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
1976 1949
                        routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
1977 1950
                        routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
1978 1951
                        routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
1979
                        routeOverLay.setTrafficLightsVisible(false);
1952
                        //routeOverLay.setTrafficLightsVisible(false);
1980 1953
                        routeOverLay.addToMap();
1981 1954
                        routeOverlays.put(routeIds[i], routeOverLay);
1982 1955
                    }
@ -2065,7 +2038,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2065 2038
                            routeOverLay.setStartPointBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon_newstarr));
2066 2039
                            routeOverLay.setEndPointBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon_newstopr));
2067 2040
                            routeOverLay.setWayPointBitmap(BitmapFactory.decodeResource(this.getResources(), R.drawable.icon_zhanwei));
2068
                            routeOverLay.setTrafficLightsVisible(false);
2041
                            //routeOverLay.setTrafficLightsVisible(false);
2069 2042
                            routeOverlays.put(routeIds[i], routeOverLay);
2070 2043
                            routeOverLay.addToMap();
2071 2044
                        }
@ -2933,7 +2906,7 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2933 2906
                routeOverLay.setStartPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstarr)));
2934 2907
                routeOverLay.setEndPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_newstopr)));
2935 2908
                routeOverLay.setWayPointBitmap(drawableToBitamp(getResources().getDrawable(R.drawable.icon_zhanwei)));
2936
                routeOverLay.setTrafficLightsVisible(false);
2909
                //routeOverLay.setTrafficLightsVisible(false);
2937 2910
                routeOverLay.addToMap();
2938 2911
                routeOverlays.put(routeIds[i], routeOverLay);
2939 2912
            }
@ -2990,4 +2963,9 @@ public class RoutePlanMapActivity extends Activity implements LocationSource, AM
2990 2963
    public View getInfoContents(Marker marker) {
2991 2964
        return null;
2992 2965
    }
2966
2967
    @Override
2968
    public void onPointerCaptureChanged(boolean hasCapture) {
2969
2970
    }
2993 2971
}

+ 11 - 3
app/src/main/java/com/electric/chargingpile/activity/RoutePlanSelectAddressActivity.java

@ -1,6 +1,7 @@
1 1
package com.electric.chargingpile.activity;
2 2
3 3
4
import android.annotation.SuppressLint;
4 5
import android.app.Activity;
5 6
import android.content.ContentValues;
6 7
import android.content.Context;
@ -28,6 +29,7 @@ import android.widget.SimpleCursorAdapter;
28 29
import android.widget.TextView;
29 30
import android.widget.Toast;
30 31
32
import com.amap.api.services.core.AMapException;
31 33
import com.amap.api.services.core.PoiItem;
32 34
import com.amap.api.services.core.SuggestionCity;
33 35
import com.amap.api.services.poisearch.PoiResult;
@ -96,6 +98,7 @@ public class RoutePlanSelectAddressActivity extends Activity implements View.OnC
96 98
//        Toast.makeText(getApplicationContext(),tag,Toast.LENGTH_SHORT).show();
97 99
    }
98 100
101
    @SuppressLint("Range")
99 102
    private void initViews() {
100 103
        rl_mapselect = (RelativeLayout) findViewById(R.id.rl_mapselect);
101 104
        rl_mapselect.setOnClickListener(this);
@ -455,9 +458,14 @@ public class RoutePlanSelectAddressActivity extends Activity implements View.OnC
455 458
        query.setPageSize(20);// 设置每页最多返回多少条poiitem
456 459
        query.setPageNum(currentPage);// 设置查第一页
457 460
458
        poiSearch = new PoiSearch(this, query);
459
        poiSearch.setOnPoiSearchListener(this);
460
        poiSearch.searchPOIAsyn();
461
        try {
462
            poiSearch = new PoiSearch(this, query);
463
            poiSearch.setOnPoiSearchListener(this);
464
            poiSearch.searchPOIAsyn();
465
        } catch (AMapException e) {
466
            e.printStackTrace();
467
        }
468
461 469
    }
462 470
463 471
    @Override

+ 30 - 20
app/src/main/java/com/electric/chargingpile/activity/RouteSelectPointActivity.java

@ -26,6 +26,7 @@ import com.amap.api.maps.UiSettings;
26 26
import com.amap.api.maps.model.CameraPosition;
27 27
import com.amap.api.maps.model.LatLng;
28 28
import com.amap.api.maps.model.MyLocationStyle;
29
import com.amap.api.services.core.AMapException;
29 30
import com.amap.api.services.core.LatLonPoint;
30 31
import com.amap.api.services.core.PoiItem;
31 32
import com.amap.api.services.geocoder.GeocodeResult;
@ -122,9 +123,13 @@ public class RouteSelectPointActivity extends Activity implements View.OnClickLi
122 123
            //获得地图的最大和最小缩放级别
123 124
            maxZoomLevel = aMap.getMaxZoomLevel();
124 125
            minZoomLevel = aMap.getMinZoomLevel();
125
            geocoderSearch = new GeocodeSearch(this);
126
            geocoderSearch.setOnGeocodeSearchListener(this);
127
            setUpMap();
126
            try {
127
                geocoderSearch = new GeocodeSearch(this);
128
                geocoderSearch.setOnGeocodeSearchListener(this);
129
                setUpMap();
130
            } catch (AMapException e) {
131
                e.printStackTrace();
132
            }
128 133
        }
129 134
    }
130 135
@ -267,23 +272,28 @@ public class RouteSelectPointActivity extends Activity implements View.OnClickLi
267 272
    public void activate(OnLocationChangedListener onLocationChangedListener) {
268 273
        mListener = onLocationChangedListener;
269 274
        if (mlocationClient == null) {
270
            mlocationClient = new AMapLocationClient(this);
271
            mLocationOption = new AMapLocationClientOption();
272
            //设置定位监听
273
            mlocationClient.setLocationListener(this);
274
            //设置为高精度定位模式
275
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
276
            //设置定位参数
277
            mlocationClient.setLocationOption(mLocationOption);
278
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
279
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
280
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
281
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
282
            // 设置是否只定位一次,默认为false
283
            mLocationOption.setOnceLocation(true);
284
            //设置是否强制刷新WIFI,默认为强制刷新
285
            mLocationOption.setWifiActiveScan(false);
286
            mlocationClient.startLocation();
275
            try {
276
                mlocationClient = new AMapLocationClient(this);
277
                mLocationOption = new AMapLocationClientOption();
278
                //设置定位监听
279
                mlocationClient.setLocationListener(this);
280
                //设置为高精度定位模式
281
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
282
                //设置定位参数
283
                mlocationClient.setLocationOption(mLocationOption);
284
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
285
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
286
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
287
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
288
                // 设置是否只定位一次,默认为false
289
                mLocationOption.setOnceLocation(true);
290
                //设置是否强制刷新WIFI,默认为强制刷新
291
                mLocationOption.setWifiActiveScan(false);
292
                mlocationClient.startLocation();
293
294
            } catch (Exception e) {
295
                e.printStackTrace();
296
            }
287 297
288 298
        }
289 299
    }

+ 9 - 3
app/src/main/java/com/electric/chargingpile/activity/SearchActivity.java

@ -42,6 +42,7 @@ import android.widget.Toast;
42 42

43 43
import com.amap.api.maps.AMapUtils;
44 44
import com.amap.api.maps.model.LatLng;
45
import com.amap.api.services.core.AMapException;
45 46
import com.amap.api.services.core.PoiItem;
46 47
import com.amap.api.services.core.SuggestionCity;
47 48
import com.amap.api.services.help.Inputtips;
@ -912,9 +913,14 @@ public class SearchActivity extends Activity implements OnClickListener, Inputti
912 913
        query.setPageSize(30);// 设置每页最多返回多少条poiitem
913 914
        query.setPageNum(currentPage);// 设置查第一页
914 915

915
        poiSearch = new PoiSearch(this, query);
916
        poiSearch.setOnPoiSearchListener(this);
917
        poiSearch.searchPOIAsyn();
916
        try {
917
            poiSearch = new PoiSearch(this, query);
918
            poiSearch.setOnPoiSearchListener(this);
919
            poiSearch.searchPOIAsyn();
920
        } catch (AMapException e) {
921
            e.printStackTrace();
922
        }
923

918 924
    }
919 925

920 926
    private void doPointNameSearchQuery() {

+ 16 - 11
app/src/main/java/com/electric/chargingpile/activity/SelectCityActivity.java

@ -293,7 +293,7 @@ public class SelectCityActivity extends Activity implements AMapLocationListener
293 293
        SQLiteDatabase recentVisitDb = cityOpenHelper.getWritableDatabase();
294 294
        Cursor cursor = recentVisitDb.rawQuery("select * from recentcity order by date desc limit 0, 3", null);
295 295
        while (cursor.moveToNext()) {
296
            String recentVisitCityName = cursor.getString(cursor.getColumnIndex("name"));
296
            @SuppressLint("Range") String recentVisitCityName = cursor.getString(cursor.getColumnIndex("name"));
297 297
            recentCityList.add(recentVisitCityName);
298 298
        }
299 299
        cursor.close();
@ -599,27 +599,32 @@ public class SelectCityActivity extends Activity implements AMapLocationListener
599 599
    private void setUpMap() {
600 600
//        //声明mLocationOption对象
601 601
//        AMapLocationClientOption mLocationOption = null;
602
        mlocationClient = new AMapLocationClient(this);
603
//初始化定位参数
604
        mLocationOption = new AMapLocationClientOption();
602
        try {
603
            mlocationClient = new AMapLocationClient(this);
604
            //初始化定位参数
605
            mLocationOption = new AMapLocationClientOption();
605 606
//设置定位监听
606
        mlocationClient.setLocationListener(this);
607
            mlocationClient.setLocationListener(this);
607 608
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
608
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
609
        mLocationOption.setOnceLocation(true);
610
        //设置是否强制刷新WIFI,默认为强制刷新
611
        mLocationOption.setWifiActiveScan(false);
609
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
610
            mLocationOption.setOnceLocation(true);
611
            //设置是否强制刷新WIFI,默认为强制刷新
612
            mLocationOption.setWifiActiveScan(false);
612 613
//设置定位间隔,单位毫秒,默认为2000ms
613 614
//        mLocationOption.setInterval(2000);
614 615
//设置定位参数
615
        mlocationClient.setLocationOption(mLocationOption);
616
            mlocationClient.setLocationOption(mLocationOption);
616 617
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
617 618
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
618 619
// 在定位结束后,在合适的生命周期调用onDestroy()方法
619 620
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
620 621
621 622
//启动定位
622
        mlocationClient.startLocation();
623
            mlocationClient.startLocation();
624
        } catch (Exception e) {
625
            e.printStackTrace();
626
        }
627
623 628
    }
624 629
625 630

+ 31 - 20
app/src/main/java/com/electric/chargingpile/activity/ShareMapActivity.java

@ -28,6 +28,7 @@ import com.amap.api.maps.model.BitmapDescriptorFactory;
28 28
import com.amap.api.maps.model.CameraPosition;
29 29
import com.amap.api.maps.model.LatLng;
30 30
import com.amap.api.maps.model.MyLocationStyle;
31
import com.amap.api.services.core.AMapException;
31 32
import com.amap.api.services.core.LatLonPoint;
32 33
import com.amap.api.services.geocoder.GeocodeResult;
33 34
import com.amap.api.services.geocoder.GeocodeSearch;
@ -112,9 +113,14 @@ public class ShareMapActivity extends Activity implements View.OnClickListener,
112 113
            //获得地图的最大和最小缩放级别
113 114
            maxZoomLevel = aMap.getMaxZoomLevel();
114 115
            minZoomLevel = aMap.getMinZoomLevel();
115
            geocoderSearch = new GeocodeSearch(this);
116
            geocoderSearch.setOnGeocodeSearchListener(this);
117
            setUpMap();
116
            try {
117
                geocoderSearch = new GeocodeSearch(this);
118
                geocoderSearch.setOnGeocodeSearchListener(this);
119
                setUpMap();
120
            } catch (AMapException e) {
121
                e.printStackTrace();
122
            }
123
118 124
        }
119 125
    }
120 126
@ -399,24 +405,29 @@ public class ShareMapActivity extends Activity implements View.OnClickListener,
399 405
    public void activate(OnLocationChangedListener onLocationChangedListener) {
400 406
        mListener = onLocationChangedListener;
401 407
        if (mlocationClient == null) {
402
            mlocationClient = new AMapLocationClient(this);
403
            mLocationOption = new AMapLocationClientOption();
404
            //设置定位监听
405
            mlocationClient.setLocationListener(this);
406
            //设置为高精度定位模式
407
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
408
            //设置定位参数
409
            mlocationClient.setLocationOption(mLocationOption);
410
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
411
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
412
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
413
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
414
            // 设置是否只定位一次,默认为false
415
            mLocationOption.setOnceLocation(true);
408
            try {
409
                mlocationClient = new AMapLocationClient(this);
410
                mLocationOption = new AMapLocationClientOption();
411
                //设置定位监听
412
                mlocationClient.setLocationListener(this);
413
                //设置为高精度定位模式
414
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
415
                //设置定位参数
416
                mlocationClient.setLocationOption(mLocationOption);
417
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
418
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
419
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
420
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
421
                // 设置是否只定位一次,默认为false
422
                mLocationOption.setOnceLocation(true);
416 423
//            mLocationOption.setOnceLocationLatest(true);
417
            //设置是否强制刷新WIFI,默认为强制刷新
418
            mLocationOption.setWifiActiveScan(false);
419
            mlocationClient.startLocation();
424
                //设置是否强制刷新WIFI,默认为强制刷新
425
                mLocationOption.setWifiActiveScan(false);
426
                mlocationClient.startLocation();
427
            } catch (Exception e) {
428
                e.printStackTrace();
429
            }
430
420 431
421 432
        }
422 433
    }

+ 22 - 17
app/src/main/java/com/electric/chargingpile/activity/ShowBuildLocationActivity.java

@ -154,23 +154,28 @@ public class ShowBuildLocationActivity extends Activity implements AMap.OnCamera
154 154
    public void activate(OnLocationChangedListener onLocationChangedListener) {
155 155
        mListener = onLocationChangedListener;
156 156
        if (mlocationClient == null) {
157
            mlocationClient = new AMapLocationClient(this);
158
            mLocationOption = new AMapLocationClientOption();
159
            //设置定位监听
160
            mlocationClient.setLocationListener(this);
161
            //设置为高精度定位模式
162
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
163
            //设置定位参数
164
            mlocationClient.setLocationOption(mLocationOption);
165
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
166
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
167
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
168
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
169
            // 设置是否只定位一次,默认为false
170
            mLocationOption.setOnceLocation(true);
171
            //设置是否强制刷新WIFI,默认为强制刷新
172
            mLocationOption.setWifiActiveScan(false);
173
            mlocationClient.startLocation();
157
            try {
158
                mlocationClient = new AMapLocationClient(this);
159
                mLocationOption = new AMapLocationClientOption();
160
                //设置定位监听
161
                mlocationClient.setLocationListener(this);
162
                //设置为高精度定位模式
163
                mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
164
                //设置定位参数
165
                mlocationClient.setLocationOption(mLocationOption);
166
                // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
167
                // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
168
                // 在定位结束后,在合适的生命周期调用onDestroy()方法
169
                // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
170
                // 设置是否只定位一次,默认为false
171
                mLocationOption.setOnceLocation(true);
172
                //设置是否强制刷新WIFI,默认为强制刷新
173
                mLocationOption.setWifiActiveScan(false);
174
                mlocationClient.startLocation();
175
            } catch (Exception e) {
176
                e.printStackTrace();
177
            }
178
174 179
        }
175 180
    }
176 181

+ 18 - 9
app/src/main/java/com/electric/chargingpile/activity/SimpleNaviActivity.java

@ -8,6 +8,7 @@ import android.util.Log;
8 8
import android.view.Window;
9 9
import android.view.WindowManager;
10 10
11
import com.amap.api.maps.AMapException;
11 12
import com.amap.api.maps.model.BitmapDescriptor;
12 13
import com.amap.api.maps.model.BitmapDescriptorFactory;
13 14
import com.amap.api.navi.AMapNaviViewOptions;
@ -24,7 +25,7 @@ import com.amap.api.navi.model.AMapLaneInfo;
24 25
import com.amap.api.navi.model.AMapModelCross;
25 26
import com.amap.api.navi.model.AMapNaviCameraInfo;
26 27
import com.amap.api.navi.model.AMapNaviCross;
27
import com.amap.api.navi.model.AMapNaviInfo;
28
28 29
import com.amap.api.navi.model.AMapNaviLocation;
29 30
import com.amap.api.navi.model.AMapNaviPath;
30 31
import com.amap.api.navi.model.AMapNaviRouteNotifyData;
@ -33,7 +34,7 @@ import com.amap.api.navi.model.AMapServiceAreaInfo;
33 34
import com.amap.api.navi.model.AimLessModeCongestionInfo;
34 35
import com.amap.api.navi.model.AimLessModeStat;
35 36
import com.amap.api.navi.model.NaviInfo;
36
import com.autonavi.tbt.TrafficFacilityInfo;
37
37 38
import com.electric.chargingpile.R;
38 39
39 40
import java.util.List;
@ -73,7 +74,11 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
73 74
        options.setAfterRouteAutoGray(true);
74 75
        mAMapNaviView.setViewOptions(options);
75 76
76
        mAMapNavi = AMapNavi.getInstance(getApplicationContext());
77
        try {
78
            mAMapNavi = AMapNavi.getInstance(getApplicationContext());
79
        } catch (AMapException e) {
80
            e.printStackTrace();
81
        }
77 82
        mAMapNavi.addAMapNaviListener(this);
78 83
        mAMapNavi.setEmulatorNaviSpeed(60);
79 84
        mAMapNavi.setUseInnerVoice(true);
@ -189,9 +194,6 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
189 194
    public void onGpsOpenStatus(boolean b) {
190 195
    }
191 196
192
    @Override
193
    public void onNaviInfoUpdated(AMapNaviInfo aMapNaviInfo) {
194
    }
195 197
196 198
    @Override
197 199
    public void updateCameraInfo(AMapNaviCameraInfo[] aMapNaviCameraInfos) {
@ -215,9 +217,6 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
215 217
        }
216 218
    }
217 219
218
    @Override
219
    public void OnUpdateTrafficFacility(TrafficFacilityInfo trafficFacilityInfo) {
220
    }
221 220
222 221
    @Override
223 222
    public void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo) {
@ -302,6 +301,11 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
302 301
    }
303 302
304 303
    @Override
304
    public void onGpsSignalWeak(boolean b) {
305
306
    }
307
308
    @Override
305 309
    public void onNaviSetting() {
306 310
    }
307 311
@ -346,4 +350,9 @@ public class SimpleNaviActivity extends Activity implements AMapNaviListener, AM
346 350
    @Override
347 351
    public void onNaviViewShowMode(int i) {
348 352
    }
353
354
    @Override
355
    public void onPointerCaptureChanged(boolean hasCapture) {
356
357
    }
349 358
}

+ 15 - 10
app/src/main/java/com/electric/chargingpile/activity/SwitchCityActivity.java

@ -1310,27 +1310,32 @@ public class SwitchCityActivity extends Activity implements OnScrollListener, AM
1310 1310
    private void setUpMap() {
1311 1311
//        //声明mLocationOption对象
1312 1312
//        AMapLocationClientOption mLocationOption = null;
1313
        mlocationClient = new AMapLocationClient(this);
1314
//初始化定位参数
1315
        mLocationOption = new AMapLocationClientOption();
1313
        try {
1314
            mlocationClient = new AMapLocationClient(this);
1315
            //初始化定位参数
1316
            mLocationOption = new AMapLocationClientOption();
1316 1317
//设置定位监听
1317
        mlocationClient.setLocationListener(this);
1318
            mlocationClient.setLocationListener(this);
1318 1319
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
1319
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
1320
        mLocationOption.setOnceLocation(true);
1321
        //设置是否强制刷新WIFI,默认为强制刷新
1322
        mLocationOption.setWifiActiveScan(false);
1320
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
1321
            mLocationOption.setOnceLocation(true);
1322
            //设置是否强制刷新WIFI,默认为强制刷新
1323
            mLocationOption.setWifiActiveScan(false);
1323 1324
//设置定位间隔,单位毫秒,默认为2000ms
1324 1325
//        mLocationOption.setInterval(2000);
1325 1326
//设置定位参数
1326
        mlocationClient.setLocationOption(mLocationOption);
1327
            mlocationClient.setLocationOption(mLocationOption);
1327 1328
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
1328 1329
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
1329 1330
// 在定位结束后,在合适的生命周期调用onDestroy()方法
1330 1331
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
1331 1332
1332 1333
//启动定位
1333
        mlocationClient.startLocation();
1334
            mlocationClient.startLocation();
1335
        } catch (Exception e) {
1336
            e.printStackTrace();
1337
        }
1338
1334 1339
    }
1335 1340
1336 1341
    @Override

+ 16 - 10
app/src/main/java/com/electric/chargingpile/activity/UserCenterActivity.java

@ -34,6 +34,7 @@ import android.widget.ToggleButton;
34 34
35 35
import androidx.annotation.NonNull;
36 36
37
import com.amap.api.services.core.AMapException;
37 38
import com.amap.api.services.weather.LocalDayWeatherForecast;
38 39
import com.amap.api.services.weather.LocalWeatherForecast;
39 40
import com.amap.api.services.weather.LocalWeatherForecastResult;
@ -293,16 +294,21 @@ public class UserCenterActivity extends Activity implements View.OnClickListener
293 294
        loadDialog = new LoadingDialog(this);
294 295
        loadDialog.setCanceledOnTouchOutside(false);
295 296
        mquery = new WeatherSearchQuery(MainMapActivity.location_city, WeatherSearchQuery.WEATHER_TYPE_FORECAST);
296
        mweathersearch = new WeatherSearch(this);
297
        mweathersearch.setOnWeatherSearchListener(this);
298
        mweathersearch.setQuery(mquery);
299
        mweathersearch.searchWeatherAsyn(); //异步搜索
300
301
        mquery1 = new WeatherSearchQuery(MainMapActivity.location_city, WeatherSearchQuery.WEATHER_TYPE_LIVE);
302
        mweathersearch1 = new WeatherSearch(this);
303
        mweathersearch1.setOnWeatherSearchListener(this);
304
        mweathersearch1.setQuery(mquery1);
305
        mweathersearch1.searchWeatherAsyn(); //异步搜索
297
        try {
298
            mweathersearch = new WeatherSearch(this);
299
            mweathersearch.setOnWeatherSearchListener(this);
300
            mweathersearch.setQuery(mquery);
301
            mweathersearch.searchWeatherAsyn(); //异步搜索
302
303
            mquery1 = new WeatherSearchQuery(MainMapActivity.location_city, WeatherSearchQuery.WEATHER_TYPE_LIVE);
304
            mweathersearch1 = new WeatherSearch(this);
305
            mweathersearch1.setOnWeatherSearchListener(this);
306
            mweathersearch1.setQuery(mquery1);
307
            mweathersearch1.searchWeatherAsyn(); //异步搜索
308
        } catch (AMapException e) {
309
            e.printStackTrace();
310
        }
311
306 312
        sv = (ObservableScrollView) findViewById(R.id.sv);
307 313
        sv.setScrollViewListener(this);
308 314
        iv_qiandao = (ImageView) findViewById(R.id.iv_qiandao);

+ 15 - 10
app/src/main/java/com/electric/chargingpile/adapter/CityListAdapter.java

@ -289,27 +289,32 @@ public class CityListAdapter extends BaseAdapter implements AMapLocationListener
289 289
    private void setUpMap() {
290 290
//        //声明mLocationOption对象
291 291
//        AMapLocationClientOption mLocationOption = null;
292
        mlocationClient = new AMapLocationClient(mActivity);
293
//初始化定位参数
294
        mLocationOption = new AMapLocationClientOption();
292
        try {
293
            mlocationClient = new AMapLocationClient(mActivity);
294
            //初始化定位参数
295
            mLocationOption = new AMapLocationClientOption();
295 296
//设置定位监听
296
        mlocationClient.setLocationListener(this);
297
            mlocationClient.setLocationListener(this);
297 298
//设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
298
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
299
        mLocationOption.setOnceLocation(true);
300
        //设置是否强制刷新WIFI,默认为强制刷新
301
        mLocationOption.setWifiActiveScan(false);
299
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
300
            mLocationOption.setOnceLocation(true);
301
            //设置是否强制刷新WIFI,默认为强制刷新
302
            mLocationOption.setWifiActiveScan(false);
302 303
//设置定位间隔,单位毫秒,默认为2000ms
303 304
//        mLocationOption.setInterval(2000);
304 305
//设置定位参数
305
        mlocationClient.setLocationOption(mLocationOption);
306
            mlocationClient.setLocationOption(mLocationOption);
306 307
// 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
307 308
// 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
308 309
// 在定位结束后,在合适的生命周期调用onDestroy()方法
309 310
// 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
310 311
311 312
//启动定位
312
        mlocationClient.startLocation();
313
            mlocationClient.startLocation();
314
315
        } catch (Exception e) {
316
            e.printStackTrace();
317
        }
313 318
    }
314 319
315 320

+ 39 - 35
app/src/main/java/com/electric/chargingpile/adapter/ZhuangStatusadapter.java

@ -242,43 +242,47 @@ public class ZhuangStatusadapter extends BaseAdapter {
242 242
        final AMapLocationClient mlocationClient;
243 243
        //声明mLocationOption对象
244 244
        AMapLocationClientOption mLocationOption = null;
245
        mlocationClient = new AMapLocationClient(activity);
246
        //初始化定位参数
247
        mLocationOption = new AMapLocationClientOption();
248
        //设置定位监听
249
        mlocationClient.setLocationListener(new AMapLocationListener() {
250
            @Override
251
            public void onLocationChanged(AMapLocation amapLocation) {
252
                if (amapLocation != null) {
253
                    if (amapLocation.getErrorCode() == 0) {
254
                        //定位成功回调信息,设置相关消息
255
                        amapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见定位类型表
256
                        amapLocation.getLatitude();//获取纬度
257
                        amapLocation.getLongitude();//获取
258
                        amapLocation.getAccuracy();//获取精度信息
259
                        LogUtils.e(amapLocation.getLatitude() + "--" + amapLocation.getLongitude());
260
                        mlocationClient.stopLocation();
261
                        sendControlParkingDownLock(amapLocation, zhuangStatus);
262
                    } else {
263
                        //显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
264
                        Log.e("AmapError", "location Error, ErrCode:"
265
                                + amapLocation.getErrorCode() + ", errInfo:"
266
                                + amapLocation.getErrorInfo());
245
        try {
246
            mlocationClient = new AMapLocationClient(activity);
247
            //初始化定位参数
248
            mLocationOption = new AMapLocationClientOption();
249
            //设置定位监听
250
            mlocationClient.setLocationListener(new AMapLocationListener() {
251
                @Override
252
                public void onLocationChanged(AMapLocation amapLocation) {
253
                    if (amapLocation != null) {
254
                        if (amapLocation.getErrorCode() == 0) {
255
                            //定位成功回调信息,设置相关消息
256
                            amapLocation.getLocationType();//获取当前定位结果来源,如网络定位结果,详见定位类型表
257
                            amapLocation.getLatitude();//获取
258
                            amapLocation.getLongitude();//获取经度
259
                            amapLocation.getAccuracy();//获取精度信息
260
                            LogUtils.e(amapLocation.getLatitude() + "--" + amapLocation.getLongitude());
261
                            mlocationClient.stopLocation();
262
                            sendControlParkingDownLock(amapLocation, zhuangStatus);
263
                        } else {
264
                            //显示错误信息ErrCode是错误码,errInfo是错误信息,详见错误码表。
265
                            Log.e("AmapError", "location Error, ErrCode:"
266
                                    + amapLocation.getErrorCode() + ", errInfo:"
267
                                    + amapLocation.getErrorInfo());
268
                        }
267 269
                    }
268 270
                }
269
            }
270
        });
271
        //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
272
        mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
273
        //设置定位间隔,单位毫秒,默认为2000ms//        mLocationOption.setInterval(2000);
274
        //设置定位参数
275
        mlocationClient.setLocationOption(mLocationOption);
276
        // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
277
        // 注意设置合适的定位时间的间隔(最小间隔支持为1000ms),并且在合适时间调用stopLocation()方法来取消定位请求
278
        // 在定位结束后,在合适的生命周期调用onDestroy()方法
279
        // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
280
        //启动定位
281
        mlocationClient.startLocation();
271
            });
272
            //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
273
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
274
            //设置定位间隔,单位毫秒,默认为2000ms//        mLocationOption.setInterval(2000);
275
            //设置定位参数
276
            mlocationClient.setLocationOption(mLocationOption);
277
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
278
            // 注意设置合适的定位时间的间隔(最小间隔支持为1000ms),并且在合适时间调用stopLocation()方法来取消定位请求
279
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
280
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
281
            //启动定位
282
            mlocationClient.startLocation();
283
        } catch (Exception e) {
284
            e.printStackTrace();
285
        }
282 286
    }
283 287
284 288
    private void sendControlParkingDownLock(AMapLocation amapLocation, ZhuangStatus zhuangStatus) {

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

@ -13,6 +13,7 @@ import android.util.Log;
13 13
import androidx.multidex.MultiDexApplication;
14 14

15 15
import com.alibaba.fastjson.JSONException;
16
import com.amap.api.location.AMapLocationClient;
16 17
import com.amap.api.maps.model.LatLng;
17 18
import com.blankj.utilcode.util.LogUtils;
18 19
import com.blankj.utilcode.util.Utils;
@ -199,6 +200,9 @@ public class MainApplication extends MultiDexApplication {
199 200
        userCarIntentMode = ProfileManager.getInstance().getCarIntentModel(getApplicationContext());
200 201
        loginRemind();
201 202
        setFestival();
203
        if (ProfileManager.getInstance().getPrivacyAgreement(this)) {
204
            MainApplication.initSDK();
205
        }
202 206
    }
203 207

204 208
    public void initJPush() {
@ -392,6 +396,8 @@ public class MainApplication extends MultiDexApplication {
392 396
    }
393 397

394 398
    public static void initSDK() {
399
        AMapLocationClient.updatePrivacyShow(context,true,true);
400
        AMapLocationClient.updatePrivacyAgree(context,true);
395 401
        MobSDK.init(MainApplication.context);
396 402
        MobSDK.submitPolicyGrantResult(true,null);
397 403
        CrashReport.initCrashReport(MainApplication.context, "900010422", BuildConfig.DEBUG);

+ 7 - 9
app/src/main/java/com/electric/chargingpile/util/TTSController.java

@ -10,7 +10,7 @@ import com.amap.api.navi.model.AMapLaneInfo;
10 10
import com.amap.api.navi.model.AMapModelCross;
11 11
import com.amap.api.navi.model.AMapNaviCameraInfo;
12 12
import com.amap.api.navi.model.AMapNaviCross;
13
import com.amap.api.navi.model.AMapNaviInfo;
13
14 14
import com.amap.api.navi.model.AMapNaviLocation;
15 15
import com.amap.api.navi.model.AMapNaviRouteNotifyData;
16 16
import com.amap.api.navi.model.AMapNaviTrafficFacilityInfo;
@ -18,7 +18,7 @@ import com.amap.api.navi.model.AMapServiceAreaInfo;
18 18
import com.amap.api.navi.model.AimLessModeCongestionInfo;
19 19
import com.amap.api.navi.model.AimLessModeStat;
20 20
import com.amap.api.navi.model.NaviInfo;
21
import com.autonavi.tbt.TrafficFacilityInfo;
21
22 22
import com.blankj.utilcode.util.LogUtils;
23 23
import com.electric.chargingpile.R;
24 24
import com.iflytek.cloud.speech.SpeechConstant;
@ -279,11 +279,7 @@ public class TTSController implements SynthesizerListener, AMapNaviListener, AMa
279 279
280 280
    }
281 281
282
    @Override
283
    public void onNaviInfoUpdated(AMapNaviInfo arg0) {
284
        // TODO Auto-generated method stub
285 282
286
    }
287 283
288 284
    @Override
289 285
    public void updateCameraInfo(AMapNaviCameraInfo[] aMapNaviCameraInfos) {
@ -307,10 +303,7 @@ public class TTSController implements SynthesizerListener, AMapNaviListener, AMa
307 303
308 304
    }
309 305
310
    @Override
311
    public void OnUpdateTrafficFacility(TrafficFacilityInfo trafficFacilityInfo) {
312 306
313
    }
314 307
315 308
    @Override
316 309
    public void OnUpdateTrafficFacility(AMapNaviTrafficFacilityInfo aMapNaviTrafficFacilityInfo) {
@ -401,6 +394,11 @@ public class TTSController implements SynthesizerListener, AMapNaviListener, AMa
401 394
    }
402 395
403 396
    @Override
397
    public void onGpsSignalWeak(boolean b) {
398
399
    }
400
401
    @Override
404 402
    public void onNaviSetting() {
405 403
    }
406 404

BIN
app/src/main/jniLibs/arm64-v8a/libAMapSDK_MAP_v6_9_2.so


BIN
app/src/main/jniLibs/arm64-v8a/libAMapSDK_NAVI_v6_9_0.so


BIN
app/src/main/jniLibs/arm64-v8a/libAMapSDK_NAVI_v8_1_0.so


BIN
app/src/main/jniLibs/arm64-v8a/libneonui_shared.so


BIN
app/src/main/jniLibs/arm64-v8a/libneonuijni_public.so


BIN
app/src/main/jniLibs/armeabi-v7a/libAMapSDK_MAP_v6_9_2.so


BIN
app/src/main/jniLibs/armeabi-v7a/libAMapSDK_NAVI_v6_9_0.so


BIN
app/src/main/jniLibs/armeabi-v7a/libAMapSDK_NAVI_v8_1_0.so


BIN
app/src/main/jniLibs/armeabi-v7a/libneonui_shared.so


BIN
app/src/main/jniLibs/armeabi-v7a/libneonuijni_public.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_MAP_v6_9_2.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v6_9_0.so


BIN
app/src/main/jniLibs/armeabi/libAMapSDK_NAVI_v8_1_0.so


BIN
app/src/main/jniLibs/armeabi/libneonui_shared.so


BIN
app/src/main/jniLibs/armeabi/libneonuijni_public.so


上报停车位功能去除 · d240eb2b8a - Gogs: Go Git Service
Quellcode durchsuchen

上报停车位功能去除

huyuguo vor 4 Jahren
Ursprung
Commit
d240eb2b8a
35 geänderte Dateien mit 5 neuen und 601 gelöschten Zeilen
  1. 0 178
      app/src/main/java/com/electric/chargingpile/fragment/DetailsFragment.java
  2. 0 145
      app/src/main/java/com/electric/chargingpile/fragment/ReportParkingDialogFragment.java
  3. BIN
      app/src/main/res/drawable-hdpi/detail_no_parking.png
  4. BIN
      app/src/main/res/drawable-hdpi/detail_parking.png
  5. BIN
      app/src/main/res/drawable-hdpi/detail_parking_alert_first.png
  6. BIN
      app/src/main/res/drawable-hdpi/detail_parking_alert_second.png
  7. BIN
      app/src/main/res/drawable-hdpi/detail_parking_alert_third.png
  8. BIN
      app/src/main/res/drawable-hdpi/detail_report_parking.png
  9. BIN
      app/src/main/res/drawable-mdpi/detail_no_parking.png
  10. BIN
      app/src/main/res/drawable-mdpi/detail_parking.png
  11. BIN
      app/src/main/res/drawable-mdpi/detail_parking_alert_first.png
  12. BIN
      app/src/main/res/drawable-mdpi/detail_parking_alert_second.png
  13. BIN
      app/src/main/res/drawable-mdpi/detail_parking_alert_third.png
  14. BIN
      app/src/main/res/drawable-mdpi/detail_report_parking.png
  15. BIN
      app/src/main/res/drawable-xhdpi/detail_no_parking.png
  16. BIN
      app/src/main/res/drawable-xhdpi/detail_parking.png
  17. BIN
      app/src/main/res/drawable-xhdpi/detail_parking_alert_first.png
  18. BIN
      app/src/main/res/drawable-xhdpi/detail_parking_alert_second.png
  19. BIN
      app/src/main/res/drawable-xhdpi/detail_parking_alert_third.png
  20. BIN
      app/src/main/res/drawable-xhdpi/detail_report_parking.png
  21. BIN
      app/src/main/res/drawable-xxhdpi/detail_no_parking.png
  22. BIN
      app/src/main/res/drawable-xxhdpi/detail_parking.png
  23. BIN
      app/src/main/res/drawable-xxhdpi/detail_parking_alert_first.png
  24. BIN
      app/src/main/res/drawable-xxhdpi/detail_parking_alert_second.png
  25. BIN
      app/src/main/res/drawable-xxhdpi/detail_parking_alert_third.png
  26. BIN
      app/src/main/res/drawable-xxhdpi/detail_report_parking.png
  27. BIN
      app/src/main/res/drawable-xxxhdpi/detail_no_parking.png
  28. BIN
      app/src/main/res/drawable-xxxhdpi/detail_parking.png
  29. BIN
      app/src/main/res/drawable-xxxhdpi/detail_parking_alert_first.png
  30. BIN
      app/src/main/res/drawable-xxxhdpi/detail_parking_alert_second.png
  31. BIN
      app/src/main/res/drawable-xxxhdpi/detail_parking_alert_third.png
  32. BIN
      app/src/main/res/drawable-xxxhdpi/detail_report_parking.png
  33. 0 36
      app/src/main/res/layout/activity_new_zhan_details.xml
  34. 5 18
      app/src/main/res/layout/fragmen_details_new.xml
  35. 0 224
      app/src/main/res/layout/fragment_dialog_report_parking.xml

+ 0 - 178
app/src/main/java/com/electric/chargingpile/fragment/DetailsFragment.java

@ -522,7 +522,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
522 522
                            detail_up_or_down.setImageDrawable(getResources().getDrawable(R.drawable.icon_detail_up));
523 523
                        }
524 524
525
                        getVacancy();
526 525
                    } catch (Exception e) {
527 526
                        e.printStackTrace();
528 527
                    }
@ -789,7 +788,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
789 788
            }
790 789
        }
791 790
    };
792
    private ImageView parking_icon;
793 791
    private String zongjia;
794 792
795 793
    @Override
@ -933,8 +931,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
933 931
        iv_new_icon = (CircleImageView) v.findViewById(R.id.iv_new_icon);
934 932
        ll_yunyingshang = (LinearLayout) v.findViewById(R.id.ll_yunyingshang);
935 933
        view_789 = v.findViewById(R.id.view_789);
936
        parking_icon = v.findViewById(R.id.parking_icon);
937
        parking_icon.setOnClickListener(this);
938 934
    }
939 935
940 936
    @Override
@ -973,62 +969,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
973 969
                MobclickAgent.onEvent(getActivity(), "0209");
974 970
                startActivity(new Intent(getActivity(), ChargingQianDaoActivity.class));
975 971
                break;
976
//            case R.id.chat_share_bar: // 聊聊入口
977
//                MobclickAgent.onEvent(getContext(), "1122");
978
//                Intent i = new Intent(getContext(), ChatActivity.class);//聊聊页面
979
//                i.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
980
//                startActivity(i);
981
//                break;
982
            case R.id.parking_icon:  // 停车位相关操作
983
                LatLng latLng = new LatLng(Double.parseDouble(poi_wei), Double.parseDouble(poi_jing));
984
                if ("1".equals(freeStatus)) { // 有状态的站点
985
                    if ("0".equals(acableNum) && "0".equals(dcableNum)) { // 无空闲桩
986
                        ReportParkingDialogFragment reportParkingDialogFragment = ReportParkingDialogFragment.newInstance(ReportParkingDialogFragment.TYPE_THIRD);
987
                        reportParkingDialogFragment.show(getFragmentManager(), "没有充电车位");
988
                        MobclickAgent.onEvent(getContext(), "1127");
989
                    } else {
990
                        if (MainApplication.center == null) {
991
                            ToastUtil.showToast(getContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
992
                        } else {
993
                            double distance = AMapUtils.calculateLineDistance(MainApplication.center, latLng);
994
                            if (distance > 100) {
995
                                ReportParkingDialogFragment reportParkingDialogFragment = ReportParkingDialogFragment.newInstance(ReportParkingDialogFragment.TYPE_FIRST);
996
                                reportParkingDialogFragment.show(getFragmentManager(), "超过100米,无法上报充电车位");
997
                            } else {
998
                                ReportParkingDialogFragment reportParkingDialogFragment = ReportParkingDialogFragment.newInstance(ReportParkingDialogFragment.TYPE_SECOND);
999
                                reportParkingDialogFragment.setOnReportParkingDialogFragmentListener(new ReportParkingDialogFragment.OnReportParkingDialogFragmentListener() {
1000
                                    @Override
1001
                                    public void report() {
1002
                                        addVacancy();
1003
                                    }
1004
                                });
1005
                                reportParkingDialogFragment.show(getFragmentManager(), "上报车位");
1006
                            }
1007
                            MobclickAgent.onEvent(getContext(), "1126");
1008
                        }
1009
                    }
1010
                } else {
1011
                    if (MainApplication.center == null) {
1012
                        ToastUtil.showToast(getContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
1013
                    } else {
1014
                        double distance = AMapUtils.calculateLineDistance(MainApplication.center, latLng);
1015
                        if (distance > 100) {
1016
                            ReportParkingDialogFragment reportParkingDialogFragment = ReportParkingDialogFragment.newInstance(ReportParkingDialogFragment.TYPE_FIRST);
1017
                            reportParkingDialogFragment.show(getFragmentManager(), "超过100米,无法上报充电车位");
1018
                        } else {
1019
                            ReportParkingDialogFragment reportParkingDialogFragment = ReportParkingDialogFragment.newInstance(ReportParkingDialogFragment.TYPE_SECOND);
1020
                            reportParkingDialogFragment.setOnReportParkingDialogFragmentListener(new ReportParkingDialogFragment.OnReportParkingDialogFragmentListener() {
1021
                                @Override
1022
                                public void report() {
1023
                                    addVacancy();
1024
                                }
1025
                            });
1026
                            reportParkingDialogFragment.show(getFragmentManager(), "上报车位");
1027
                        }
1028
                        MobclickAgent.onEvent(getContext(), "1126");
1029
                    }
1030
                }
1031
                break;
1032 972
        }
1033 973
    }
1034 974
@ -1037,19 +977,13 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1037 977
        new Thread(new Runnable() {
1038 978
            @Override
1039 979
            public void run() {
1040
1041
//                Log.i("!!!!!", NewZhanDetailsActivity.zhan_id);
1042
1043 980
                String url = MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/zhan-info2?zhan_id=" + NewZhanDetailsActivity.zhan_id + "&version=" + MainApplication.current_code;
1044
//                Log.e(TAG, "run: url="+url );
1045 981
                submitPic(url);
1046 982
            }
1047 983
        }).start();
1048 984
    }
1049 985
1050 986
    private void submitPic(String sms) {
1051
1052
//        Log.e("url", sms);
1053 987
        Request request = new Request.Builder().url(sms).build();
1054 988
        Response response = null;
1055 989
        try {
@ -1459,7 +1393,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1459 1393
        mChart.getDescription().setEnabled(false);
1460 1394
        mChart.getXAxis().setAxisLineColor(R.color.grey);
1461 1395
        mChart.getLegend().setTextColor(MainApplication.context.getResources().getColor(R.color.ui_68));
1462
//        mChart.getLegend().setEnabled(false);
1463 1396
1464 1397
        // draw bars behind lines
1465 1398
        mChart.setDrawOrder(new CombinedChart.DrawOrder[]{
@ -1473,10 +1406,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1473 1406
        l.setOrientation(Legend.LegendOrientation.HORIZONTAL);
1474 1407
        l.setDrawInside(false);
1475 1408
1476
//        YAxis rightAxis = mChart.getAxisRight();
1477
//        rightAxis.setDrawGridLines(false);
1478
//        rightAxis.setAxisMinimum(0f); // this replaces setStartAtZero(true)
1479
1480 1409
        YAxis leftAxis = mChart.getAxisLeft();
1481 1410
        leftAxis.setDrawGridLines(true);
1482 1411
        leftAxis.setAxisLineColor(R.color.grey);
@ -1512,20 +1441,8 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1512 1441
        CombinedData data = new CombinedData();
1513 1442
1514 1443
        data.setData(generateLineData(num));
1515
//        data.setData(generateBarData());
1516
//        data.setData(generateBubbleData());
1517
//        data.setData(generateScatterData());
1518
//        data.setData(generateCandleData());
1519
1520
//        data.setValueTypeface(mTfLight);
1521
1522 1444
        xAxis.setAxisMaximum(data.getXMax());
1523
//        setData(mSeekBarX.getProgress() + 1, mSeekBarY.getProgress());
1524
//        mChart.setFitBars(true);
1525
//        mChart.invalidate();
1526
1527 1445
        mChart.setData(data);
1528
1529 1446
        mChart.invalidate();
1530 1447
    }
1531 1448
@ -1590,100 +1507,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1590 1507
        this.detailsFragmentListener = listener;
1591 1508
    }
1592 1509
1593
    /**
1594
     * 获取站空位
1595
     */
1596
    private void getVacancy() {
1597
        Map<String, String> map = new HashMap<>();
1598
        map.put("zhanid", NewZhanDetailsActivity.zhan_id + "");
1599
        CommonParams.addCommonParams(map);
1600
        String query = Util.convertMap2Query(map);
1601
1602
        String url = MainApplication.url + ":9080/get_vacancy?" + query;
1603
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1604
            @Override
1605
            public void onError(Call call, Exception e) {
1606
                loadingDialog.dismiss();
1607
                parking_icon.setVisibility(View.GONE);
1608
            }
1609
1610
            @Override
1611
            public void onResponse(String response) {
1612
                loadingDialog.dismiss();
1613
                vacancyCode = JsonUtils.getKeyResult(response, "rtnCode");
1614
                updateParkingIcon();
1615
            }
1616
        });
1617
    }
1618
1619
    /**
1620
     * 上传空车位
1621
     */
1622
1623
    private void addVacancy() {
1624
        if (!MainApplication.isLogin()) {
1625
            startActivity(new Intent(getActivity().getApplicationContext(), LoginActivity.class));
1626
            ToastUtil.showToast(getActivity().getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
1627
            return;
1628
        }
1629
1630
        loadingDialog.show();
1631
        MobclickAgent.onEvent(getContext(), "1128");
1632
        Map<String, String> map = new HashMap<>();
1633
        map.put("zhanid", NewZhanDetailsActivity.zhan_id + "");
1634
        map.put("userid", MainApplication.userId);
1635
        String timer = getMD5(String.valueOf((System.currentTimeMillis() / 1000 - MainMapActivity.cha) / 10) + "qwerty");
1636
        map.put("timer", timer);
1637
        CommonParams.addCommonParams(map);
1638
        String query = Util.convertMap2Query(map);
1639
        String url = MainApplication.url + ":9080/add_vacancy?" + query;
1640
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1641
            @Override
1642
            public void onError(Call call, Exception e) {
1643
                loadingDialog.dismiss();
1644
            }
1645
1646
            @Override
1647
            public void onResponse(String response) {
1648
                String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1649
                String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1650
                if ("0".equals(rtnCode)) {
1651
                    ToastUtil.showToast(getContext(), rtnMsg, Toast.LENGTH_SHORT);
1652
                    getVacancy();
1653
                } else {
1654
                    loadingDialog.dismiss();
1655
                    ToastUtil.showToast(getContext(), rtnMsg, Toast.LENGTH_SHORT);
1656
                }
1657
1658
            }
1659
        });
1660
    }
1661
1662
    private void updateParkingIcon() {
1663
        if ("2000".equals(vacancyCode)) { //
1664
            parking_icon.setVisibility(View.GONE);
1665
        } else {
1666
            parking_icon.setVisibility(View.VISIBLE);
1667
            if ("1".equals(freeStatus)) { // 有状态的站点
1668
                if ("0".equals(acableNum) && "0".equals(dcableNum)) { // 无空闲桩
1669
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_no_parking));
1670
                } else {
1671
                    if ("1002".equals(vacancyCode)) { // 无有空闲桩
1672
                        parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_report_parking));
1673
                    } else { // 有空闲桩
1674
                        parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_parking));
1675
                    }
1676
                }
1677
            } else {
1678
                if ("1002".equals(vacancyCode)) { // 无有空闲桩
1679
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_report_parking));
1680
                } else { // 有空闲桩
1681
                    parking_icon.setImageDrawable(getResources().getDrawable(R.drawable.detail_parking));
1682
                }
1683
            }
1684
        }
1685
    }
1686
1687 1510
    @Override
1688 1511
    public void onDestroyView() {
1689 1512
        try {
@ -1695,7 +1518,6 @@ public class DetailsFragment extends Fragment implements View.OnClickListener, O
1695 1518
    }
1696 1519
1697 1520
    public static String getMD5(String content) {
1698
1699 1521
        try {
1700 1522
1701 1523
            MessageDigest digest = MessageDigest.getInstance("MD5");

+ 0 - 145
app/src/main/java/com/electric/chargingpile/fragment/ReportParkingDialogFragment.java

@ -1,145 +0,0 @@
1
package com.electric.chargingpile.fragment;
2
3
import android.app.Dialog;
4
import android.os.Bundle;
5
import androidx.constraintlayout.widget.ConstraintLayout;
6
import androidx.fragment.app.DialogFragment;
7
import android.view.Gravity;
8
import android.view.View;
9
import android.view.Window;
10
import android.view.WindowManager;
11
import android.widget.Button;
12
import android.widget.ImageView;
13
14
import com.electric.chargingpile.R;
15
16
public class ReportParkingDialogFragment extends DialogFragment implements View.OnClickListener {
17
18
    public static final String TYPE_FIRST = "first";
19
    public static final String TYPE_SECOND = "second";
20
    public static final String TYPE_THIRD = "third";
21
22
    private static Dialog mDialog;
23
    private String mType;
24
    private ConstraintLayout container;
25
    private ConstraintLayout first;
26
    private ImageView first_close;
27
    private ConstraintLayout second;
28
    private ImageView second_close;
29
    private Button cancel_report;
30
    private Button report;
31
    private ConstraintLayout third;
32
    private ImageView third_close;
33
    private OnReportParkingDialogFragmentListener reportParkingDialogFragmentListener;
34
35
    public static ReportParkingDialogFragment newInstance(String type) {
36
        Bundle args = new Bundle();
37
        args.putSerializable("type", type);
38
        ReportParkingDialogFragment fragment = new ReportParkingDialogFragment();
39
        fragment.setArguments(args);
40
        return fragment;
41
    }
42
43
    @Override
44
    public Dialog onCreateDialog(Bundle savedInstanceState) {
45
        mDialog = new Dialog(getActivity(), R.style.CenterDialog);
46
        mDialog.setCancelable(true);
47
        mDialog.setCanceledOnTouchOutside(true);
48
49
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
50
        mDialog.setContentView(R.layout.fragment_dialog_report_parking);
51
52
        Window window = mDialog.getWindow();
53
        WindowManager.LayoutParams layoutParams = window.getAttributes();
54
        // 布局属性位于整个窗口底部
55
        layoutParams.gravity = Gravity.CENTER;
56
        // 布局属性宽度填充整个窗口,默认是有margin的
57
        layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
58
        window.setAttributes(layoutParams);
59
60
        initDialog();
61
        initListener();
62
63
        return mDialog;
64
    }
65
66
    private void initDialog() {
67
        mType = (String)getArguments().get("type");
68
        container = mDialog.findViewById(R.id.container);
69
        first = mDialog.findViewById(R.id.first);
70
        first_close = mDialog.findViewById(R.id.first_close);
71
72
        second = mDialog.findViewById(R.id.second);
73
        second_close = mDialog.findViewById(R.id.second_close);
74
        cancel_report = mDialog.findViewById(R.id.cancel_report);
75
        report = mDialog.findViewById(R.id.report);
76
77
        third = mDialog.findViewById(R.id.third);
78
        third_close = mDialog.findViewById(R.id.third_close);
79
80
81
        if (TYPE_FIRST.equals(mType)) {
82
            first.setVisibility(View.VISIBLE);
83
            second.setVisibility(View.GONE);
84
            third.setVisibility(View.GONE);
85
        } else if (TYPE_SECOND.equals(mType)) {
86
            first.setVisibility(View.GONE);
87
            second.setVisibility(View.VISIBLE);
88
            third.setVisibility(View.GONE);
89
        } else {
90
            first.setVisibility(View.GONE);
91
            second.setVisibility(View.GONE);
92
            third.setVisibility(View.VISIBLE);
93
        }
94
    }
95
96
    private void initListener() {
97
        container.setOnClickListener(this);
98
99
        first.setOnClickListener(this);
100
        first_close.setOnClickListener(this);
101
102
        second.setOnClickListener(this);
103
        second_close.setOnClickListener(this);
104
        cancel_report.setOnClickListener(this);
105
        report.setOnClickListener(this);
106
107
        third.setOnClickListener(this);
108
        third_close.setOnClickListener(this);
109
    }
110
111
    @Override
112
    public void onClick(View v) {
113
        switch (v.getId()) {
114
            case R.id.container:
115
                mDialog.dismiss();
116
                break;
117
            case R.id.first_close:
118
                mDialog.dismiss();
119
                break;
120
            case R.id.second_close:
121
                mDialog.dismiss();
122
                break;
123
            case R.id.cancel_report:
124
                mDialog.dismiss();
125
                break;
126
            case R.id.report:
127
                if (reportParkingDialogFragmentListener != null) {
128
                    reportParkingDialogFragmentListener.report();
129
                }
130
                mDialog.dismiss();
131
                break;
132
            case R.id.third_close:
133
                mDialog.dismiss();
134
                break;
135
        }
136
    }
137
138
    public interface OnReportParkingDialogFragmentListener {
139
        void report();
140
    }
141
142
    public void setOnReportParkingDialogFragmentListener(OnReportParkingDialogFragmentListener listener) {
143
        this.reportParkingDialogFragmentListener = listener;
144
    }
145
}

BIN
app/src/main/res/drawable-hdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-hdpi/detail_parking.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-hdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-hdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_parking.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-mdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-mdpi/detail_report_parking.png


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


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


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


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


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


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


BIN
app/src/main/res/drawable-xxhdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-xxhdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-xxhdpi/detail_report_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_no_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_first.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_second.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_parking_alert_third.png


BIN
app/src/main/res/drawable-xxxhdpi/detail_report_parking.png


+ 0 - 36
app/src/main/res/layout/activity_new_zhan_details.xml

@ -352,42 +352,6 @@
352 352
            android:textAppearance="?android:attr/textAppearanceMedium"
353 353
            android:textColor="@color/white" />
354 354
355
356
        <!--<TextView-->
357
        <!--android:id="@+id/tv_chenggong"-->
358
        <!--android:layout_width="wrap_content"-->
359
        <!--android:layout_height="wrap_content"-->
360
        <!--android:paddingLeft="8dp"-->
361
        <!--android:paddingRight="8dp"-->
362
        <!--android:paddingBottom="4dp"-->
363
        <!--android:paddingTop="4dp"-->
364
        <!--android:text="成功"-->
365
        <!--android:textColor="@color/white"-->
366
        <!--android:background="@drawable/textview_bglv"-->
367
        <!--android:textSize="16sp"-->
368
        <!--android:layout_marginRight="16dp"-->
369
        <!--android:layout_alignTop="@+id/tv_shibai"-->
370
        <!--android:layout_toLeftOf="@+id/tv_shibai"-->
371
        <!--android:layout_toStartOf="@+id/tv_shibai" />-->
372
373
        <!--<TextView-->
374
        <!--android:id="@+id/tv_shibai"-->
375
        <!--android:layout_width="wrap_content"-->
376
        <!--android:layout_height="wrap_content"-->
377
        <!--android:paddingLeft="8dp"-->
378
        <!--android:paddingRight="8dp"-->
379
        <!--android:paddingBottom="4dp"-->
380
        <!--android:paddingTop="4dp"-->
381
        <!--android:text="失败"-->
382
        <!--android:textColor="@color/white"-->
383
        <!--android:background="@drawable/textview_bgju"-->
384
        <!--android:textSize="16sp"-->
385
        <!--android:layout_marginRight="16dp"-->
386
        <!--android:layout_centerVertical="true"-->
387
        <!--android:layout_alignParentRight="true"-->
388
        <!--android:layout_alignParentEnd="true" />-->
389
390 355
    </LinearLayout>
391 356
392
393 357
</LinearLayout>

+ 5 - 18
app/src/main/res/layout/fragmen_details_new.xml

@ -448,8 +448,8 @@
448 448
                        android:layout_width="0dp"
449 449
                        android:layout_height="wrap_content"
450 450
                        android:layout_weight="3"
451
                        tools:background="#00ff00"
452
                        android:orientation="vertical">
451
                        android:orientation="vertical"
452
                        tools:background="#00ff00">
453 453
454 454
                        <LinearLayout
455 455
                            android:layout_width="wrap_content"
@ -489,8 +489,8 @@
489 489
                        android:layout_width="0dp"
490 490
                        android:layout_height="match_parent"
491 491
                        android:layout_weight="2"
492
                        tools:background="#ff0000"
493
                        android:gravity="center_vertical|right">
492
                        android:gravity="center_vertical|right"
493
                        tools:background="#ff0000">
494 494
495 495
                        <TextView
496 496
                            android:layout_width="wrap_content"
@ -499,6 +499,7 @@
499 499
                            android:text="电价详情"
500 500
                            android:textColor="@color/color_222222"
501 501
                            android:textSize="14sp" />
502
502 503
                        <ImageView
503 504
                            android:layout_width="wrap_content"
504 505
                            android:layout_height="wrap_content"
@ -827,19 +828,5 @@
827 828
            </RelativeLayout>
828 829
829 830
        </LinearLayout>
830
831 831
    </com.electric.chargingpile.view.CustomScrollView>
832
833
    <ImageView
834
        android:id="@+id/parking_icon"
835
        android:layout_width="wrap_content"
836
        android:layout_height="wrap_content"
837
        android:layout_marginRight="15dp"
838
        android:layout_marginBottom="15dp"
839
        android:src="@drawable/detail_report_parking"
840
        android:visibility="gone"
841
        app:layout_constraintBottom_toBottomOf="parent"
842
        app:layout_constraintRight_toRightOf="parent"
843
        tools:visibility="visible" />
844
845 832
</androidx.constraintlayout.widget.ConstraintLayout>

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

@ -1,224 +0,0 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    android:id="@+id/container"
6
    android:layout_width="match_parent"
7
    android:layout_height="match_parent"
8
    android:background="#a0000000">
9
10
    <androidx.constraintlayout.widget.ConstraintLayout
11
        android:id="@+id/first"
12
        android:layout_width="310dp"
13
        android:layout_height="255dp"
14
        android:visibility="gone"
15
        app:layout_constraintBottom_toBottomOf="parent"
16
        app:layout_constraintLeft_toLeftOf="parent"
17
        app:layout_constraintRight_toRightOf="parent"
18
        app:layout_constraintTop_toTopOf="parent">
19
20
        <ImageView
21
            android:layout_width="match_parent"
22
            android:layout_height="match_parent"
23
            android:src="@drawable/detail_parking_alert_first" />
24
25
        <ImageView
26
            android:id="@+id/first_close"
27
            android:layout_width="wrap_content"
28
            android:layout_height="wrap_content"
29
            android:layout_marginTop="40dp"
30
            android:padding="10dp"
31
            android:src="@drawable/report_parking_close"
32
            app:layout_constraintRight_toRightOf="parent"
33
            app:layout_constraintTop_toTopOf="parent" />
34
35
        <TextView
36
            android:id="@+id/first_msg"
37
            android:layout_width="match_parent"
38
            android:layout_height="wrap_content"
39
            android:layout_marginLeft="28dp"
40
            android:layout_marginTop="90dp"
41
            android:layout_marginRight="28dp"
42
            android:text="对不起,请在该充电站100米范围内上报“有充电车位”信息"
43
            android:textColor="#222222"
44
            android:textSize="14sp"
45
            app:layout_constraintLeft_toLeftOf="parent"
46
            app:layout_constraintRight_toRightOf="parent"
47
            app:layout_constraintTop_toTopOf="parent" />
48
49
        <TextView
50
            android:layout_width="match_parent"
51
            android:layout_height="wrap_content"
52
            android:layout_marginLeft="28dp"
53
            android:layout_marginTop="10dp"
54
            android:layout_marginRight="28dp"
55
            android:text="非常感谢,您的信息可以帮助到更多的充电用户"
56
            android:textColor="#bcbcbc"
57
            android:textSize="14sp"
58
            app:layout_constraintLeft_toLeftOf="parent"
59
            app:layout_constraintRight_toRightOf="parent"
60
            app:layout_constraintTop_toBottomOf="@+id/first_msg" />
61
62
        <TextView
63
            android:layout_width="match_parent"
64
            android:layout_height="wrap_content"
65
            android:layout_marginBottom="10dp"
66
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
67
            android:textAlignment="center"
68
            android:textColor="#a7a7a7"
69
            android:textSize="12sp"
70
            app:layout_constraintBottom_toBottomOf="parent"
71
            app:layout_constraintLeft_toLeftOf="parent"
72
            app:layout_constraintRight_toRightOf="parent" />
73
74
    </androidx.constraintlayout.widget.ConstraintLayout>
75
76
    <androidx.constraintlayout.widget.ConstraintLayout
77
        android:id="@+id/second"
78
        android:layout_width="310dp"
79
        android:layout_height="320dp"
80
        android:visibility="gone"
81
        app:layout_constraintBottom_toBottomOf="parent"
82
        app:layout_constraintLeft_toLeftOf="parent"
83
        app:layout_constraintRight_toRightOf="parent"
84
        app:layout_constraintTop_toTopOf="parent">
85
86
        <ImageView
87
            android:layout_width="match_parent"
88
            android:layout_height="match_parent"
89
            android:src="@drawable/detail_parking_alert_second" />
90
91
        <ImageView
92
            android:id="@+id/second_close"
93
            android:layout_width="wrap_content"
94
            android:layout_height="wrap_content"
95
            android:layout_marginTop="40dp"
96
            android:padding="10dp"
97
            android:src="@drawable/report_parking_close"
98
            app:layout_constraintRight_toRightOf="parent"
99
            app:layout_constraintTop_toTopOf="parent" />
100
101
        <TextView
102
            android:id="@+id/second_msg"
103
            android:layout_width="match_parent"
104
            android:layout_height="wrap_content"
105
            android:layout_marginLeft="28dp"
106
            android:layout_marginTop="90dp"
107
            android:layout_marginRight="28dp"
108
            android:text="您上报的“有充电车位”信息,可以作为其他用户到此充电的重要参考依据,务必真实上报"
109
            android:textColor="#222222"
110
            android:textSize="14sp"
111
            app:layout_constraintLeft_toLeftOf="parent"
112
            app:layout_constraintRight_toRightOf="parent"
113
            app:layout_constraintTop_toTopOf="parent" />
114
115
        <TextView
116
            android:id="@+id/second_desc"
117
            android:layout_width="match_parent"
118
            android:layout_height="wrap_content"
119
            android:layout_marginLeft="28dp"
120
            android:layout_marginTop="10dp"
121
            android:layout_marginRight="28dp"
122
            android:text="非常感谢,您的信息可以帮助到更多的充电用户"
123
            android:textColor="#bcbcbc"
124
            android:textSize="14sp"
125
            app:layout_constraintLeft_toLeftOf="parent"
126
            app:layout_constraintRight_toRightOf="parent"
127
            app:layout_constraintTop_toBottomOf="@+id/second_msg" />
128
129
        <LinearLayout
130
            android:layout_width="match_parent"
131
            android:layout_height="35dp"
132
            android:layout_marginTop="20dp"
133
            android:gravity="center"
134
            app:layout_constraintTop_toBottomOf="@+id/second_desc">
135
136
            <Button
137
                android:id="@+id/cancel_report"
138
                android:layout_width="100dp"
139
                android:layout_height="match_parent"
140
                android:background="@drawable/cancel_report_parking_shap"
141
                android:text="取消上报"
142
                android:textColor="#999999"
143
                android:textSize="13sp" />
144
145
            <Button
146
                android:id="@+id/report"
147
                android:layout_width="100dp"
148
                android:layout_height="match_parent"
149
                android:layout_marginLeft="10dp"
150
                android:background="@drawable/report_parking_shape"
151
                android:text="上报空停车位"
152
                android:textColor="#ffffff"
153
                android:textSize="13sp" />
154
155
        </LinearLayout>
156
157
158
        <TextView
159
            android:layout_width="match_parent"
160
            android:layout_height="wrap_content"
161
            android:layout_marginBottom="10dp"
162
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
163
            android:textAlignment="center"
164
            android:textColor="#a7a7a7"
165
            android:textSize="12sp"
166
            app:layout_constraintBottom_toBottomOf="parent"
167
            app:layout_constraintLeft_toLeftOf="parent"
168
            app:layout_constraintRight_toRightOf="parent" />
169
170
    </androidx.constraintlayout.widget.ConstraintLayout>
171
172
    <androidx.constraintlayout.widget.ConstraintLayout
173
        android:id="@+id/third"
174
        android:layout_width="310dp"
175
        android:layout_height="200dp"
176
        app:layout_constraintBottom_toBottomOf="parent"
177
        app:layout_constraintLeft_toLeftOf="parent"
178
        app:layout_constraintRight_toRightOf="parent"
179
        app:layout_constraintTop_toTopOf="parent">
180
181
        <ImageView
182
            android:layout_width="match_parent"
183
            android:layout_height="match_parent"
184
            android:src="@drawable/detail_parking_alert_third" />
185
186
        <ImageView
187
            android:id="@+id/third_close"
188
            android:layout_width="wrap_content"
189
            android:layout_height="wrap_content"
190
            android:layout_marginTop="40dp"
191
            android:padding="10dp"
192
            android:src="@drawable/report_parking_close"
193
            app:layout_constraintRight_toRightOf="parent"
194
            app:layout_constraintTop_toTopOf="parent" />
195
196
        <TextView
197
            android:id="@+id/third_msg"
198
            android:layout_width="match_parent"
199
            android:layout_height="wrap_content"
200
            android:layout_marginLeft="28dp"
201
            android:layout_marginTop="90dp"
202
            android:layout_marginRight="28dp"
203
            android:text="该充电站目前没有充电车位"
204
            android:textColor="#222222"
205
            android:textSize="14sp"
206
            app:layout_constraintLeft_toLeftOf="parent"
207
            app:layout_constraintRight_toRightOf="parent"
208
            app:layout_constraintTop_toTopOf="parent" />
209
210
        <TextView
211
            android:layout_width="match_parent"
212
            android:layout_height="wrap_content"
213
            android:layout_marginBottom="10dp"
214
            android:text="有任何疑问可以联系充电桩客服微信\nchongdianzhuang2"
215
            android:textAlignment="center"
216
            android:textColor="#a7a7a7"
217
            android:textSize="12sp"
218
            app:layout_constraintBottom_toBottomOf="parent"
219
            app:layout_constraintLeft_toLeftOf="parent"
220
            app:layout_constraintRight_toRightOf="parent" />
221
222
    </androidx.constraintlayout.widget.ConstraintLayout>
223
224
</androidx.constraintlayout.widget.ConstraintLayout>