523 496
        <!-- &lt;!&ndash; 【可选】 一些常用的系统广播,增强信鸽service的复活机会,请根据需要选择。当然,你也可以添加APP自定义的一些广播让启动service &ndash;&gt; -->
524 497
        <!-- <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" /> -->
525 498
        <!-- <action android:name="android.intent.action.ACTION_POWER_CONNECTED" /> -->
526 499
        <!-- <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" /> -->
527 500
        <!-- </intent-filter> -->
528 501
        <!-- </receiver> -->
529
530
531 502
        <!-- 【必须】 (2.30及以上版新增)展示通知的activity -->
532 503
        <!-- 【注意】 如果被打开的activity是启动模式为SingleTop,SingleTask或SingleInstance,请根据通知的异常自查列表第8点处理 -->
533 504
        <!-- <activity -->
534 505
        <!-- android:name="com.tencent.android.tpush.XGPushActivity" -->
535 506
        <!-- android:exported="false"> -->
536 507
        <!-- <intent-filter> -->
537
538
539 508
        <!-- &lt;!&ndash; 若使用AndroidStudio,请设置android:name="android.intent.action" &ndash;&gt; -->
540 509
        <!-- <action android:name="android.intent.action" /> -->
541 510
        <!-- </intent-filter> -->
542 511
        <!-- </activity> -->
543
544
        <service android:name="com.amap.api.location.APSService" />
545
546
        <!-- 【必须】 信鸽service -->
512
        <service android:name="com.amap.api.location.APSService" /> <!-- 【必须】 信鸽service -->
547 513
        <!-- <service -->
548 514
        <!-- android:name="com.tencent.android.tpush.service.XGPushService" -->
549 515
        <!-- android:exported="true" -->
550 516
        <!-- android:persistent="true" -->
551 517
        <!-- android:process=":xg_service_v2" /> -->
552
553
554 518
        <!-- 【必须】 通知service,此选项有助于提高抵达率 -->
555 519
        <!-- <service -->
556 520
        <!-- android:name="com.tencent.android.tpush.rpc.XGRemoteService" -->
@ -559,8 +523,6 @@
559 523
        <!-- <action android:name="com.electric.chargingpile.PUSH_ACTION" /> -->
560 524
        <!-- </intent-filter> -->
561 525
        <!-- </service> -->
562
563
564 526
        <!-- 【必须】 请修改为APP的AccessId,“21”开头的10位数字,中间没空格 -->
565 527
        <!-- <meta-data -->
566 528
        <!-- android:name="XG_V2_ACCESS_ID" -->
@ -569,7 +531,6 @@
569 531
        <!-- <meta-data -->
570 532
        <!-- android:name="XG_V2_ACCESS_KEY" -->
571 533
        <!-- android:value="AT7Q84BLL26L" /> -->
572
573 534
        <activity
574 535
            android:name=".activity.FindActivity"
575 536
            android:launchMode="singleTask"
@ -637,9 +598,7 @@
637 598
        <activity
638 599
            android:name=".activity.InputCodeActivity"
639 600
            android:exported="true"
640
            android:screenOrientation="portrait" />
641
642
        <!-- <intent-filter > -->
601
            android:screenOrientation="portrait" /> <!-- <intent-filter > -->
643 602
        <!-- &lt;!&ndash; action随便设置,但必须保证唯一 &ndash;&gt; -->
644 603
        <!-- <action android:name="input_code"/> -->
645 604
        <!-- <category android:name="android.intent.category.DEFAULT"/> -->
@ -659,9 +618,7 @@
659 618
            android:screenOrientation="portrait" />
660 619
        <activity
661 620
            android:name=".activity.CreditActivity"
662
            android:screenOrientation="portrait" />
663
664
        <!-- 极光 -->
621
            android:screenOrientation="portrait" /> <!-- 极光 -->
665 622
        <activity
666 623
            android:name="cn.jpush.android.ui.PopWinActivity"
667 624
            android:exported="false"
@ -751,7 +708,6 @@
751 708
        <meta-data
752 709
            android:name="JPUSH_APPKEY"
753 710
            android:value="19fde8a6fe56b6918522bfa3" /> <!-- </>值来自开发者平台取得的AppKey -->
754
755 711
        <activity
756 712
            android:name=".activity.ShowBuildLocationActivity"
757 713
            android:screenOrientation="portrait" />
@ -852,11 +808,10 @@
852 808
            android:screenOrientation="portrait" />
853 809
        <activity
854 810
            android:name=".activity.TLDLoadingActivity"
855
            android:screenOrientation="portrait" />
856
        <!--<activity-->
857
        <!--android:name=".activity.MyCaptureActivity"-->
858
        <!--android:launchMode="singleTask"-->
859
        <!--android:screenOrientation="portrait" />-->
811
            android:screenOrientation="portrait" /> <!-- <activity -->
812
        <!-- android:name=".activity.MyCaptureActivity" -->
813
        <!-- android:launchMode="singleTask" -->
814
        <!-- android:screenOrientation="portrait" /> -->
860 815
        <activity
861 816
            android:name=".activity.MemberCoinRecordActivity"
862 817
            android:screenOrientation="portrait" />

+ 15 - 0
app/src/main/java/com/electric/chargingpile/activity/UserPageActivity.java

@ -0,0 +1,15 @@
1
package com.electric.chargingpile.activity;
2
3
import android.support.v7.app.AppCompatActivity;
4
import android.os.Bundle;
5
6
import com.electric.chargingpile.R;
7
8
public class UserPageActivity extends AppCompatActivity {
9
10
    @Override
11
    protected void onCreate(Bundle savedInstanceState) {
12
        super.onCreate(savedInstanceState);
13
        setContentView(R.layout.activity_user_page);
14
    }
15
}

+ 1 - 1
app/src/main/java/com/electric/chargingpile/fragment/ChatRecommendFragment.java

@ -99,7 +99,7 @@ public class ChatRecommendFragment extends Fragment implements View.OnClickListe
99 99
        recyclerView.addItemDecoration(new ChatRecommendItemDecoration()); // 设置边距
100 100
        // 静默加载模式不能设置footerview
101 101
        recyclerView.setAdapter(chatRecommendAdapter);
102
//        refreshView.setPinnedTime(1000);
102
        refreshView.setPinnedTime(0);
103 103
//        refreshView.setMoveForHorizontal(true);
104 104
105 105
        refreshView.setXRefreshViewListener(new XRefreshView.SimpleXRefreshListener() {

app/src/main/res/drawable-hdpi/app_personal_header_bg_icon.png → app/src/main/res/drawable-hdpi/user_page_bg.png


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


+ 17 - 17
app/src/main/res/layout/activity_personal_page.xml

@ -9,9 +9,9 @@
9 9
        android:id="@+id/personal_header_view"
10 10
        android:layout_width="match_parent"
11 11
        android:layout_height="wrap_content"
12
        android:background="@drawable/user_page_bg"
12 13
        android:minHeight="180dp"
13
        android:orientation="vertical"
14
        android:background="@drawable/app_personal_header_bg_icon">
14
        android:orientation="vertical">
15 15
16 16
        <RelativeLayout
17 17
            android:id="@+id/rl_title"
@ -47,24 +47,24 @@
47 47
            android:layout_height="60dp">
48 48
49 49
            <!--<ImageView-->
50
                <!--android:id="@+id/user_avater"-->
51
                <!--android:layout_width="56dp"-->
52
                <!--android:layout_height="56dp"-->
53
                <!--android:layout_centerVertical="true"-->
54
                <!--android:contentDescription="@null"-->
55
                <!--android:src="@drawable/ic_category_1"-->
56
                <!--android:layout_marginLeft="16dp"/>-->
50
            <!--android:id="@+id/user_avater"-->
51
            <!--android:layout_width="56dp"-->
52
            <!--android:layout_height="56dp"-->
53
            <!--android:layout_centerVertical="true"-->
54
            <!--android:contentDescription="@null"-->
55
            <!--android:src="@drawable/ic_category_1"-->
56
            <!--android:layout_marginLeft="16dp"/>-->
57 57
58 58
            <com.electric.chargingpile.view.RoundImageView
59 59
                android:id="@+id/user_avater"
60 60
                android:layout_width="56dp"
61 61
                android:layout_height="56dp"
62 62
                android:layout_centerVertical="true"
63
                android:scaleType="fitXY"
64 63
                android:layout_gravity="center"
65 64
                android:layout_marginLeft="16dp"
66
                app:type="circle"
67
                android:background="@drawable/icon_user1118" />
65
                android:background="@drawable/icon_user1118"
66
                android:scaleType="fitXY"
67
                app:type="circle" />
68 68
69 69
            <TextView
70 70
                android:id="@+id/username_text"
@ -75,20 +75,20 @@
75 75
                android:layout_toRightOf="@+id/user_avater"
76 76
                android:text=""
77 77
                android:textColor="#ffffff"
78
                android:textSize="16sp"/>
78
                android:textSize="16sp" />
79 79
80 80
            <TextView
81 81
                android:id="@+id/username_content"
82 82
                android:layout_width="wrap_content"
83 83
                android:layout_height="wrap_content"
84
                android:layout_below="@+id/username_text"
85
                android:layout_alignParentBottom="true"
84 86
                android:layout_marginLeft="10dp"
85 87
                android:layout_marginTop="3dp"
86
                android:layout_alignParentBottom="true"
87
                android:layout_below="@+id/username_text"
88 88
                android:layout_toRightOf="@+id/user_avater"
89 89
                android:text=""
90 90
                android:textColor="#ffffff"
91
                android:textSize="12sp"/>
91
                android:textSize="12sp" />
92 92
93 93
            <ImageView
94 94
                android:id="@+id/user_edit"
@ -97,7 +97,7 @@
97 97
                android:layout_alignParentRight="true"
98 98
                android:layout_marginRight="15dp"
99 99
                android:src="@drawable/app_header_edit_icon"
100
                android:visibility="gone"/>
100
                android:visibility="gone" />
101 101
102 102
        </RelativeLayout>
103 103
    </LinearLayout>

+ 101 - 80
app/src/main/res/layout/activity_topic_detail_header.xml

@ -4,110 +4,129 @@
4 4
    xmlns:tools="http://schemas.android.com/tools"
5 5
    android:id="@+id/topicDetailHeader"
6 6
    android:layout_width="match_parent"
7
    android:layout_height="260dp">
7
    android:layout_height="wrap_content">
8 8
9 9
    <android.support.constraint.ConstraintLayout
10
        android:id="@+id/topicInfo"
10 11
        android:layout_width="0dp"
11
        android:layout_height="200dp"
12
        android:layout_height="wrap_content"
12 13
        android:background="#ffffff"
13 14
        app:layout_constraintEnd_toEndOf="parent"
14 15
        app:layout_constraintStart_toStartOf="parent"
15 16
        app:layout_constraintTop_toTopOf="parent">
16 17
17
        <ImageView
18
            android:id="@+id/headImage"
19
            android:layout_width="71dp"
20
            android:layout_height="60dp"
21
            android:layout_marginStart="15dp"
22
            android:layout_marginTop="15dp"
23
            app:layout_constraintStart_toStartOf="parent"
24
            app:layout_constraintTop_toTopOf="parent"
25
            tools:srcCompat="@tools:sample/avatars" />
26
27
        <TextView
28
            android:id="@+id/name"
18
        <android.support.constraint.ConstraintLayout
19
            android:id="@+id/topicTitle"
29 20
            android:layout_width="0dp"
30
            android:layout_height="0dp"
31
            android:layout_marginStart="5dp"
32
            android:layout_marginTop="5dp"
33
            android:layout_marginEnd="15dp"
34
            android:layout_marginBottom="5dp"
35
            android:gravity="center_vertical"
36
            android:maxLines="2"
37
            android:textColor="#222222"
38
            android:textSize="17sp"
39
            android:textStyle="bold"
40
            app:layout_constraintBottom_toBottomOf="@+id/headImage"
41
            app:layout_constraintEnd_toEndOf="parent"
42
            app:layout_constraintStart_toEndOf="@+id/headImage"
43
            app:layout_constraintTop_toTopOf="@+id/headImage"
44
            tools:text="#车主说车#" />
21
            android:layout_height="90dp"
22
            app:layout_constraintLeft_toLeftOf="parent"
23
            app:layout_constraintRight_toRightOf="parent"
24
            app:layout_constraintTop_toTopOf="parent">
25
26
            <ImageView
27
                android:id="@+id/headImage"
28
                android:layout_width="71dp"
29
                android:layout_height="60dp"
30
                android:layout_marginStart="15dp"
31
                android:layout_marginTop="15dp"
32
                app:layout_constraintStart_toStartOf="parent"
33
                app:layout_constraintTop_toTopOf="parent"
34
                tools:srcCompat="@tools:sample/avatars" />
35
36
            <TextView
37
                android:id="@+id/name"
38
                android:layout_width="0dp"
39
                android:layout_height="0dp"
40
                android:layout_marginStart="5dp"
41
                android:layout_marginTop="5dp"
42
                android:layout_marginEnd="15dp"
43
                android:layout_marginBottom="5dp"
44
                android:gravity="center_vertical"
45
                android:maxLines="2"
46
                android:textColor="#222222"
47
                android:textSize="17sp"
48
                android:textStyle="bold"
49
                app:layout_constraintBottom_toBottomOf="@+id/headImage"
50
                app:layout_constraintEnd_toEndOf="parent"
51
                app:layout_constraintStart_toEndOf="@+id/headImage"
52
                app:layout_constraintTop_toTopOf="@+id/headImage"
53
                tools:text="#车主说车#" />
54
55
        </android.support.constraint.ConstraintLayout>
56
45 57
46 58
        <TextView
47 59
            android:id="@+id/desc"
48 60
            android:layout_width="0dp"
49 61
            android:layout_height="wrap_content"
50 62
            android:layout_marginStart="15dp"
51
            android:layout_marginTop="15dp"
52 63
            android:layout_marginEnd="15dp"
53
            android:ellipsize="end"
54
            android:maxLines="3"
55 64
            android:textColor="#555555"
56 65
            android:textSize="15sp"
57 66
            app:layout_constraintEnd_toEndOf="parent"
58 67
            app:layout_constraintStart_toStartOf="parent"
59
            app:layout_constraintTop_toBottomOf="@+id/headImage"
60
            tools:text="电动小汽车,炫13.98万元起,魅15.98万元起,太值了!NEDC综合续航510km" />
68
            app:layout_constraintTop_toBottomOf="@+id/topicTitle"
69
            tools:text="电动小汽车,炫13.98万元起,魅15.98万元起" />
61 70
62
        <TextView
63
            android:id="@+id/readLabel"
64
            android:layout_width="wrap_content"
65
            android:layout_height="wrap_content"
66
            android:layout_marginStart="15dp"
67
            android:layout_marginBottom="14dp"
68
            android:text="阅读"
69
            android:textColor="#555555"
70
            android:textSize="12sp"
71
        <android.support.constraint.ConstraintLayout
72
            android:layout_width="0dp"
73
            android:layout_height="48dp"
71 74
            app:layout_constraintBottom_toBottomOf="parent"
72
            app:layout_constraintStart_toStartOf="parent" />
75
            app:layout_constraintLeft_toLeftOf="parent"
76
            app:layout_constraintRight_toRightOf="parent"
77
            app:layout_constraintTop_toBottomOf="@+id/desc">
73 78
74
        <TextView
75
            android:id="@+id/read"
76
            android:layout_width="wrap_content"
77
            android:layout_height="wrap_content"
78
            android:layout_marginStart="5dp"
79
            android:gravity="center_vertical"
80
            android:textSize="12sp"
81
            app:layout_constraintBottom_toBottomOf="@+id/readLabel"
82
            app:layout_constraintLeft_toRightOf="@+id/readLabel"
83
            app:layout_constraintTop_toTopOf="@+id/readLabel"
84
            tools:text="8" />
79
            <TextView
80
                android:id="@+id/readLabel"
81
                android:layout_width="wrap_content"
82
                android:layout_height="wrap_content"
83
                android:layout_marginLeft="15dp"
84
                android:text="阅读"
85
                android:textColor="#555555"
86
                android:textSize="12sp"
87
                app:layout_constraintBottom_toBottomOf="parent"
88
                app:layout_constraintLeft_toLeftOf="parent"
89
                app:layout_constraintTop_toTopOf="parent" />
85 90
86
        <TextView
87
            android:id="@+id/joinLabel"
88
            android:layout_width="wrap_content"
89
            android:layout_height="wrap_content"
90
            android:layout_marginStart="30dp"
91
            android:gravity="center_vertical"
92
            android:text="参与"
93
            android:textColor="#555555"
94
            android:textSize="12sp"
95
            app:layout_constraintBottom_toBottomOf="@+id/read"
96
            app:layout_constraintStart_toEndOf="@+id/read"
97
            app:layout_constraintTop_toTopOf="@+id/read" />
91
            <TextView
92
                android:id="@+id/read"
93
                android:layout_width="wrap_content"
94
                android:layout_height="wrap_content"
95
                android:layout_marginStart="5dp"
96
                android:gravity="center_vertical"
97
                android:textSize="12sp"
98
                app:layout_constraintBottom_toBottomOf="@+id/readLabel"
99
                app:layout_constraintLeft_toRightOf="@+id/readLabel"
100
                app:layout_constraintTop_toTopOf="@+id/readLabel"
101
                tools:text="8" />
98 102
99
        <TextView
100
            android:id="@+id/join"
101
            android:layout_width="wrap_content"
102
            android:layout_height="wrap_content"
103
            android:layout_marginStart="5dp"
104
            android:gravity="center_vertical"
105
            android:textColor="#555555"
106
            android:textSize="12sp"
107
            app:layout_constraintBottom_toBottomOf="@+id/joinLabel"
108
            app:layout_constraintStart_toEndOf="@+id/joinLabel"
109
            app:layout_constraintTop_toTopOf="@+id/joinLabel"
110
            tools:text="32" />
103
            <TextView
104
                android:id="@+id/joinLabel"
105
                android:layout_width="wrap_content"
106
                android:layout_height="wrap_content"
107
                android:layout_marginStart="30dp"
108
                android:gravity="center_vertical"
109
                android:text="参与"
110
                android:textColor="#555555"
111
                android:textSize="12sp"
112
                app:layout_constraintBottom_toBottomOf="@+id/read"
113
                app:layout_constraintStart_toEndOf="@+id/read"
114
                app:layout_constraintTop_toTopOf="@+id/read" />
115
116
            <TextView
117
                android:id="@+id/join"
118
                android:layout_width="wrap_content"
119
                android:layout_height="wrap_content"
120
                android:layout_marginStart="5dp"
121
                android:gravity="center_vertical"
122
                android:textColor="#555555"
123
                android:textSize="12sp"
124
                app:layout_constraintBottom_toBottomOf="@+id/joinLabel"
125
                app:layout_constraintStart_toEndOf="@+id/joinLabel"
126
                app:layout_constraintTop_toTopOf="@+id/joinLabel"
127
                tools:text="32" />
128
129
        </android.support.constraint.ConstraintLayout>
111 130
    </android.support.constraint.ConstraintLayout>
112 131
113 132
    <android.support.constraint.ConstraintLayout
@ -115,9 +134,11 @@
115 134
        android:layout_height="50dp"
116 135
        android:background="#ffffff"
117 136
        android:orientation="horizontal"
137
        android:layout_marginTop="10dp"
118 138
        app:layout_constraintBottom_toBottomOf="parent"
119 139
        app:layout_constraintEnd_toEndOf="parent"
120
        app:layout_constraintStart_toStartOf="parent">
140
        app:layout_constraintStart_toStartOf="parent"
141
        app:layout_constraintTop_toBottomOf="@+id/topicInfo">
121 142
122 143
        <android.support.constraint.ConstraintLayout
123 144
            android:id="@+id/sortConstrainLayout"

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

@ -0,0 +1,35 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<android.support.constraint.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
    tools:context=".activity.UserPageActivity">
8
9
    <android.support.constraint.ConstraintLayout
10
        android:layout_width="0dp"
11
        android:layout_height="174dp"
12
        app:layout_constraintEnd_toEndOf="parent"
13
        app:layout_constraintStart_toStartOf="parent"
14
        app:layout_constraintTop_toTopOf="parent">
15
16
        <ImageView
17
            android:layout_width="0dp"
18
            android:layout_height="150dp"
19
            android:background="@drawable/user_page_bg"
20
            app:layout_constraintLeft_toLeftOf="parent"
21
            app:layout_constraintRight_toRightOf="parent"
22
            app:layout_constraintTop_toTopOf="parent" />
23
24
25
        <android.support.constraint.ConstraintLayout
26
            android:layout_width="0dp"
27
            android:layout_height="44dp"
28
            app:layout_constraintEnd_toEndOf="parent"
29
            app:layout_constraintStart_toStartOf="parent"
30
            app:layout_constraintTop_toTopOf="parent">
31
32
        </android.support.constraint.ConstraintLayout>
33
34
    </android.support.constraint.ConstraintLayout>
35
</android.support.constraint.ConstraintLayout>

相机权限设置 · 2eba1d95a9 - Gogs: Go Git Service
ソースを参照

相机权限设置

huyuguo 6 年 前
親
コミット
2eba1d95a9
共有2 個のファイルを変更した、44 個の追加 と 60 個の削除を含む
  1. 43 59
      app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java
  2. 1 1
      app/src/main/res/layout/activity_permission_agreement.xml

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

@ -125,9 +125,11 @@ import com.electric.chargingpile.util.LoadingDialog;
125 125
import com.electric.chargingpile.util.Md5Util;
126 126
import com.electric.chargingpile.util.OkHttpUtil;
127 127
import com.electric.chargingpile.util.SharedPreferencesUtil;
128
import com.electric.chargingpile.util.SystemTypeUtil;
128 129
import com.electric.chargingpile.util.ToastUtil;
129 130
import com.electric.chargingpile.util.Util;
130 131
import com.electric.chargingpile.util.ZhanDBHelper;
132
import com.electric.chargingpile.view.AlertDialogCommon;
131 133
import com.electric.chargingpile.view.AlertDialogTwo;
132 134
import com.electric.chargingpile.view.AlertDialogUpdate;
133 135
import com.electric.chargingpile.view.SlideAdView;
@ -1337,7 +1339,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
1337 1339
        } else {
1338 1340
            iVpoint.setVisibility(View.GONE);
1339 1341
        }
1340
        saveTask();
1341 1342
        if (MainApplication.haveActivity == false) {
1342 1343
            if (MainApplication.isLogin() && MainApplication.isAppStart == true) {
1343 1344
                userChargingCheck();
@ -2501,27 +2502,8 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2501 2502
                }
2502 2503
                if (!MainApplication.isLogin()) {
2503 2504
                    startActivity(new Intent(getApplication(), LoginActivity.class));
2504
                } else if (!cameraTask()) {
2505
                    EasyPermissions.requestPermissions(
2506
                            this,
2507
                            "该功能需要开启摄像头权限,是否前往开启?",
2508
                            RC_CAMERA_PERM,
2509
                            Manifest.permission.CAMERA);
2510 2505
                } else {
2511
                    Intent iintent = new Intent(getApplicationContext(), com.google.zxing.client.android.CaptureActivity.class);
2512
                    iintent.putExtra("url", MainApplication.url);
2513
                    iintent.putExtra("user_id", MainApplication.userId);
2514
                    iintent.putExtra("user_password", MainApplication.userPassword);
2515
                    iintent.putExtra("user_phone", ProfileManager.getInstance().getUsername(getApplicationContext()));
2516
                    LogUtils.e(ProfileManager.getInstance().getUsername(getApplicationContext()));
2517
                    iintent.putExtra("cha", MainMapActivity.cha);
2518
                    iintent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
2519
                    startActivity(iintent);
2520
                    overridePendingTransition(0, 0);
2521
                    if (count == 1) {
2522
                        MobclickAgent.onEvent(getApplicationContext(), "0104");
2523
                        count = 2;
2524
                    }
2506
                    requestCameraPermission();
2525 2507
                }
2526 2508
                break;
2527 2509
@ -2789,16 +2771,27 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2789 2771
2790 2772
    @Override
2791 2773
    public void onPermissionsDenied(int requestCode, List<String> perms) {
2792
        for (String s : perms) {
2793
            LogUtils.e(s);
2794
        }
2795 2774
2796
        if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
2797
            new AppSettingsDialog.Builder(MainMapActivity.this).build().show();
2798
            // TODO add by hyg20200525
2799
//            new AppSettingsDialog.Builder(MainMapActivity.this,
2800
//                    "该功能需要开启摄像头权限,是否前往开启?").build().show();
2775
//        if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
2776
//            new AppSettingsDialog.Builder(MainMapActivity.this).build().show();
2777
//        }
2778
2779
        if (requestCode == RC_CAMERA_PERM) {
2780
            new AlertDialogCommon(MainMapActivity.this).builder()
2781
                    .setMsg("为保证您正常、安全的使用充电桩,需要获取您的相机权限,请允许。")
2782
                    .setPositiveButton("去设置", new View.OnClickListener() {
2783
                        @Override
2784
                        public void onClick(View v) {
2785
                            SystemTypeUtil.goToPermissionManager(MainMapActivity.this);
2786
                        }
2787
                    }).setNegativeButton("取消", new View.OnClickListener() {
2788
                @Override
2789
                public void onClick(View v) {
2790
                    android.os.Process.killProcess(android.os.Process.myPid());
2791
                }
2792
            }).show();
2801 2793
        }
2794
2802 2795
    }
2803 2796
2804 2797
    @Override
@ -2807,10 +2800,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2807 2800
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
2808 2801
    }
2809 2802
2810
    private boolean hasCameraPermission() {
2811
        return EasyPermissions.hasPermissions(this, Manifest.permission.CAMERA);
2812
    }
2813
2814 2803
    private boolean isPermissionOK() {
2815 2804
        return EasyPermissions.hasPermissions(this,
2816 2805
                Manifest.permission.CAMERA,
@ -2819,37 +2808,32 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
2819 2808
        );
2820 2809
    }
2821 2810
2822
    @AfterPermissionGranted(RC_SAVE_PERM)
2823
    public boolean saveTask() {
2824
        if (isPermissionOK()) {
2825
            // Have permission, do the thing!
2826
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
2827
            return true;
2828
        } else {
2829
            // Ask for one permission
2830
//            EasyPermissions.requestPermissions(
2831
//                    this,
2832
//                    "该功能需要开启摄像头权限,是否前往开启?",
2833
//                    RC_CAMERA_PERM,
2834
//                    Manifest.permission.CAMERA);
2835
            return false;
2836
        }
2811
    private boolean hasCameraPermission() {
2812
        return EasyPermissions.hasPermissions(this, Manifest.permission.CAMERA);
2837 2813
    }
2838 2814
2839 2815
    @AfterPermissionGranted(RC_CAMERA_PERM)
2840
    public boolean cameraTask() {
2816
    public void requestCameraPermission() {
2841 2817
        if (hasCameraPermission()) {
2842
            // Have permission, do the thing!
2843
//            Toast.makeText(this, "TODO: Camera things", Toast.LENGTH_LONG).show();
2844
            return true;
2818
            Intent intent = new Intent(getApplicationContext(), com.google.zxing.client.android.CaptureActivity.class);
2819
            intent.putExtra("url", MainApplication.url);
2820
            intent.putExtra("user_id", MainApplication.userId);
2821
            intent.putExtra("user_password", MainApplication.userPassword);
2822
            intent.putExtra("user_phone", ProfileManager.getInstance().getUsername(getApplicationContext()));
2823
            intent.putExtra("cha", MainMapActivity.cha);
2824
            intent.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
2825
            startActivity(intent);
2826
            overridePendingTransition(0, 0);
2827
            if (count == 1) {
2828
                MobclickAgent.onEvent(getApplicationContext(), "0104");
2829
                count = 2;
2830
            }
2845 2831
        } else {
2846
            // Ask for one permission
2847
//            EasyPermissions.requestPermissions(
2848
//                    this,
2849
//                    "该功能需要开启摄像头权限,是否前往开启?",
2850
//                    RC_CAMERA_PERM,
2851
//                    Manifest.permission.CAMERA);
2852
            return false;
2832
            EasyPermissions.requestPermissions(
2833
                    this,
2834
                    "扫码充电需要开启摄像头权限,是否前往开启?",
2835
                    RC_CAMERA_PERM,
2836
                    Manifest.permission.CAMERA);
2853 2837
        }
2854 2838
    }
2855 2839

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

@ -188,7 +188,7 @@
188 188
                    <TextView
189 189
                        android:layout_width="wrap_content"
190 190
                        android:layout_height="wrap_content"
191
                        android:text="摄像头权限"
191
                        android:text="相机权限"
192 192
                        android:textColor="#444444"
193 193
                        android:textSize="16sp"
194 194
                        android:textStyle="bold" />