}
31 31
32 32
    @Override
33 33
    public String toString() {
34
        return "HomePageBean{" +
34
        return "TopicHomePageBean{" +
35 35
                "list=" + list +
36 36
                ", topicVo=" + topicVo +
37 37
                '}';

+ 38 - 0
app/src/main/java/com/electric/chargingpile/data/UserHomePageBean.java

@ -0,0 +1,38 @@
1
package com.electric.chargingpile.data;
2
3
import java.util.ArrayList;
4
5
public class UserHomePageBean {
6
    public ArrayList<ChatRecommendBean> list;
7
    public UserVo userVo;
8
    public String shareUrl;
9
    public class UserVo {
10
        public long userId;
11
        public String nickName;
12
        public String headImgUrl;
13
        public String carName;
14
        public String phone;
15
        public String topicNums;
16
17
        @Override
18
        public String toString() {
19
            return "UserVo{" +
20
                    "userId=" + userId +
21
                    ", nickName='" + nickName + '\'' +
22
                    ", headImgUrl='" + headImgUrl + '\'' +
23
                    ", carName='" + carName + '\'' +
24
                    ", phone='" + phone + '\'' +
25
                    ", topicNums='" + topicNums + '\'' +
26
                    '}';
27
        }
28
    }
29
30
    @Override
31
    public String toString() {
32
        return "UserHomePageBean{" +
33
                "list=" + list +
34
                ", userVo=" + userVo +
35
                ", shareUrl='" + shareUrl + '\'' +
36
                '}';
37
    }
38
}

+ 45 - 0
app/src/main/java/com/electric/chargingpile/data/UserPageBeanLab.java

@ -0,0 +1,45 @@
1
package com.electric.chargingpile.data;
2
3
import android.content.Context;
4
5
import java.util.ArrayList;
6
import java.util.List;
7
8
public class UserPageBeanLab {
9
    private static UserPageBeanLab beanLab;
10
    private List<ChatRecommendBean> beans;
11
12
    public static UserPageBeanLab get(Context context) {
13
        if (beanLab == null) {
14
            beanLab = new UserPageBeanLab(context);
15
        }
16
17
        return beanLab;
18
    }
19
20
    private UserPageBeanLab(Context context) {
21
        beans = new ArrayList<>();
22
    }
23
24
    public List<ChatRecommendBean> beans() {
25
        return beans;
26
    }
27
28
    public ChatRecommendBean bean(int topicId) {
29
        for (ChatRecommendBean bean : beans) {
30
            if (bean.topicId == topicId) {
31
                return bean;
32
            }
33
        }
34
        return null;
35
    }
36
37
    public void clear() {
38
        beans.clear();
39
    }
40
41
42
    public void add(List<ChatRecommendBean> list) {
43
        beans.addAll(list);
44
    }
45
}

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


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


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


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


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


+ 5 - 5
app/src/main/res/layout/activity_no_net.xml

@ -2,11 +2,11 @@
2 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    android:layout_width="match_parent"
4 4
    android:layout_height="match_parent"
5
    android:background="@color/white"
6
    android:id="@+id/no_net_view">
5
    android:background="#f4f4f4"
6
    android:id="@+id/noNetView">
7 7

8 8
    <TextView
9
        android:id="@+id/banquan"
9
        android:id="@+id/noNetLabel"
10 10
        android:layout_width="wrap_content"
11 11
        android:layout_height="wrap_content"
12 12
        android:layout_marginTop="130dp"
@ -17,12 +17,12 @@
17 17
        android:textColor="#555555" />
18 18

19 19
    <TextView
20
        android:id="@+id/request_refresh"
20
        android:id="@+id/noNetTry"
21 21
        android:layout_width="144dp"
22 22
        android:layout_height="40dp"
23 23
        android:layout_centerHorizontal="true"
24 24
        android:layout_marginTop="20dp"
25
        android:layout_below="@+id/banquan"
25
        android:layout_below="@+id/noNetLabel"
26 26
        android:text="点击重新尝试"
27 27
        android:gravity="center"
28 28
        android:textSize="14sp"

+ 206 - 3
app/src/main/res/layout/activity_user_page.xml

@ -7,29 +7,232 @@
7 7
    tools:context=".activity.UserPageActivity">
8 8
9 9
    <android.support.constraint.ConstraintLayout
10
        android:id="@+id/topView"
10 11
        android:layout_width="0dp"
11 12
        android:layout_height="174dp"
13
        android:background="#ffffff"
12 14
        app:layout_constraintEnd_toEndOf="parent"
13 15
        app:layout_constraintStart_toStartOf="parent"
14 16
        app:layout_constraintTop_toTopOf="parent">
15 17
16 18
        <ImageView
19
            android:id="@+id/userPageBg"
17 20
            android:layout_width="0dp"
18
            android:layout_height="150dp"
19
            android:background="@drawable/user_page_bg"
21
            android:layout_height="0dp"
22
            android:scaleType="fitXY"
23
            android:src="@drawable/user_page_bg"
24
            app:layout_constraintBottom_toTopOf="@+id/topicNumInfo"
20 25
            app:layout_constraintLeft_toLeftOf="parent"
21 26
            app:layout_constraintRight_toRightOf="parent"
22
            app:layout_constraintTop_toTopOf="parent" />
27
            app:layout_constraintTop_toTopOf="parent"
28
            tools:background="#ff0000" />
23 29
24 30
25 31
        <android.support.constraint.ConstraintLayout
32
            android:id="@+id/navBar"
26 33
            android:layout_width="0dp"
27 34
            android:layout_height="44dp"
28 35
            app:layout_constraintEnd_toEndOf="parent"
29 36
            app:layout_constraintStart_toStartOf="parent"
30 37
            app:layout_constraintTop_toTopOf="parent">
31 38
39
            <ImageView
40
                android:id="@+id/backPress"
41
                android:layout_width="wrap_content"
42
                android:layout_height="match_parent"
43
                android:contentDescription="@null"
44
                android:paddingLeft="15dp"
45
                android:paddingRight="15dp"
46
                android:src="@drawable/app_white_back_icon"
47
                app:layout_constraintBottom_toBottomOf="parent"
48
                app:layout_constraintStart_toStartOf="parent"
49
                app:layout_constraintTop_toTopOf="parent" />
50
51
            <ImageView
52
                android:id="@+id/morePress"
53
                android:layout_width="wrap_content"
54
                android:layout_height="match_parent"
55
                android:contentDescription="@null"
56
                android:paddingLeft="15dp"
57
                android:paddingRight="15dp"
58
                android:src="@drawable/app_header_more_icon"
59
                app:layout_constraintBottom_toBottomOf="parent"
60
                app:layout_constraintEnd_toEndOf="parent"
61
                app:layout_constraintTop_toTopOf="parent" />
62
        </android.support.constraint.ConstraintLayout>
63
64
        <android.support.constraint.ConstraintLayout
65
            android:id="@+id/userInfo"
66
            android:layout_width="0dp"
67
            android:layout_height="64dp"
68
            app:layout_constraintLeft_toLeftOf="parent"
69
            app:layout_constraintRight_toRightOf="parent"
70
            app:layout_constraintTop_toBottomOf="@+id/navBar">
71
72
            <com.electric.chargingpile.view.RoundImageView
73
                android:id="@+id/userHead"
74
                android:layout_width="56dp"
75
                android:layout_height="56dp"
76
                android:layout_gravity="center"
77
                android:layout_marginLeft="16dp"
78
                android:layout_marginTop="4dp"
79
                android:layout_marginBottom="4dp"
80
                android:background="@drawable/icon_user1118"
81
                android:scaleType="fitXY"
82
                app:layout_constraintBottom_toBottomOf="parent"
83
                app:layout_constraintStart_toStartOf="parent"
84
                app:layout_constraintTop_toTopOf="parent"
85
                app:type="circle" />
86
87
            <TextView
88
                android:id="@+id/nickName"
89
                android:layout_width="wrap_content"
90
                android:layout_height="wrap_content"
91
                android:layout_marginLeft="10dp"
92
                android:layout_marginTop="8dp"
93
                android:textColor="#ffffff"
94
                android:textSize="16sp"
95
                app:layout_constraintLeft_toRightOf="@+id/userHead"
96
                app:layout_constraintTop_toTopOf="parent"
97
                tools:text="吉利帝豪车主" />
98
99
            <TextView
100
                android:id="@+id/carName"
101
                android:layout_width="wrap_content"
102
                android:layout_height="wrap_content"
103
                android:layout_marginLeft="10dp"
104
                android:layout_marginTop="2dp"
105
                android:textColor="#ffffff"
106
                android:textSize="12sp"
107
                app:layout_constraintLeft_toRightOf="@+id/userHead"
108
                app:layout_constraintTop_toBottomOf="@+id/nickName"
109
                tools:text="比亚迪 元EV" />
110
111
            <android.support.constraint.ConstraintLayout
112
                android:id="@+id/userEdit"
113
                android:layout_width="90dp"
114
                android:layout_height="match_parent"
115
                android:visibility="gone"
116
                app:layout_constraintBottom_toBottomOf="parent"
117
                app:layout_constraintRight_toRightOf="parent"
118
                app:layout_constraintTop_toTopOf="parent"
119
                tools:visibility="visible">
120
121
                <ImageView
122
                    android:layout_width="wrap_content"
123
                    android:layout_height="wrap_content"
124
                    android:src="@drawable/app_header_edit_icon"
125
                    app:layout_constraintBottom_toBottomOf="parent"
126
                    app:layout_constraintEnd_toEndOf="parent"
127
                    app:layout_constraintStart_toStartOf="parent"
128
                    app:layout_constraintTop_toTopOf="parent" />
129
            </android.support.constraint.ConstraintLayout>
130
131
        </android.support.constraint.ConstraintLayout>
132
133
        <android.support.constraint.ConstraintLayout
134
            android:id="@+id/topicNumInfo"
135
            android:layout_width="0dp"
136
            android:layout_height="44dp"
137
            app:layout_constraintBottom_toBottomOf="parent"
138
            app:layout_constraintLeft_toLeftOf="parent"
139
            app:layout_constraintRight_toRightOf="parent">
140
141
            <android.support.constraint.ConstraintLayout
142
                android:layout_width="wrap_content"
143
                android:layout_height="wrap_content"
144
                app:layout_constraintBottom_toBottomOf="parent"
145
                app:layout_constraintEnd_toEndOf="parent"
146
                app:layout_constraintStart_toStartOf="parent"
147
                app:layout_constraintTop_toTopOf="parent">
148
149
                <TextView
150
                    android:id="@+id/topicNumLabel"
151
                    android:layout_width="wrap_content"
152
                    android:layout_height="wrap_content"
153
                    android:text="帖子"
154
                    android:textColor="#222222"
155
                    android:textSize="16sp"
156
                    app:layout_constraintBottom_toBottomOf="parent"
157
                    app:layout_constraintLeft_toLeftOf="parent"
158
                    app:layout_constraintTop_toTopOf="parent" />
159
160
                <TextView
161
                    android:layout_width="wrap_content"
162
                    android:layout_height="wrap_content"
163
                    android:paddingLeft="5dp"
164
                    android:textColor="#555555"
165
                    android:textSize="14sp"
166
                    app:layout_constraintBottom_toBottomOf="parent"
167
                    app:layout_constraintLeft_toRightOf="@+id/topicNumLabel"
168
                    app:layout_constraintTop_toTopOf="parent"
169
                    tools:text="2345" />
170
            </android.support.constraint.ConstraintLayout>
171
172
            <ImageView
173
                android:layout_width="match_parent"
174
                android:layout_height="1dp"
175
                android:background="#dddddd"
176
                app:layout_constraintBottom_toBottomOf="parent"
177
                app:layout_constraintLeft_toLeftOf="parent"
178
                app:layout_constraintRight_toRightOf="parent" />
32 179
        </android.support.constraint.ConstraintLayout>
33 180
34 181
    </android.support.constraint.ConstraintLayout>
182
183
    <!-- 列表 -->
184
185
    <com.andview.refreshview.XRefreshView
186
        android:id="@+id/xRefreshView"
187
        android:layout_width="0dp"
188
        android:layout_height="0dp"
189
        app:layout_constraintBottom_toBottomOf="parent"
190
        app:layout_constraintLeft_toLeftOf="parent"
191
        app:layout_constraintRight_toRightOf="parent"
192
        app:layout_constraintTop_toBottomOf="@+id/topView">
193
194
        <android.support.v7.widget.RecyclerView
195
            android:id="@+id/recyclerView"
196
            android:layout_width="match_parent"
197
            android:layout_height="match_parent"
198
            android:paddingTop="15dp">
199
200
        </android.support.v7.widget.RecyclerView>
201
    </com.andview.refreshview.XRefreshView>
202
203
    <include
204
        layout="@layout/activity_no_net"
205
        android:layout_width="0dp"
206
        android:layout_height="0dp"
207
        android:visibility="gone"
208
        app:layout_constraintBottom_toBottomOf="parent"
209
        app:layout_constraintLeft_toLeftOf="parent"
210
        app:layout_constraintRight_toRightOf="parent"
211
        app:layout_constraintTop_toBottomOf="@+id/topView" />
212
213
    <android.support.constraint.ConstraintLayout
214
        android:id="@+id/zeroTopicNum"
215
        android:layout_width="0dp"
216
        android:layout_height="0dp"
217
        android:visibility="gone"
218
        app:layout_constraintBottom_toBottomOf="parent"
219
        app:layout_constraintLeft_toLeftOf="parent"
220
        app:layout_constraintRight_toRightOf="parent"
221
        app:layout_constraintTop_toBottomOf="@+id/topView">
222
223
        <TextView
224
            android:layout_width="wrap_content"
225
            android:layout_height="wrap_content"
226
            android:gravity="center"
227
            android:text="快来分享吧\n小主大家都很期待你的精彩内容哦"
228
            android:textColor="#555555"
229
            android:textSize="14sp"
230
            app:layout_constraintBottom_toBottomOf="parent"
231
            app:layout_constraintLeft_toLeftOf="parent"
232
            app:layout_constraintRight_toRightOf="parent"
233
            app:layout_constraintTop_toTopOf="parent"
234
            app:layout_constraintVertical_bias="0.35000002" />
235
236
    </android.support.constraint.ConstraintLayout>
237
35 238
</android.support.constraint.ConstraintLayout>

修改直流桩可显示电压,交流只显示功率 · f3a4f0f7f4 - Gogs: Go Git Service
Quellcode durchsuchen

修改直流桩可显示电压,交流只显示功率

hy vor 4 Jahren
Ursprung
Commit
f3a4f0f7f4

+ 28 - 21
app/src/main/java/com/electric/chargingpile/adapter/ZhuangStatusadapter.java

@ -167,32 +167,16 @@ public class ZhuangStatusadapter extends BaseAdapter {
167 167
            }
168 168
169 169
            holder.llZhuangControl.setVisibility(View.GONE);
170
            if ("0".equals(status.getNationalStandard())) {
171
                holder.tvType.setVisibility(View.GONE);
172
            } else {
173
                holder.tvType.setVisibility(View.VISIBLE);
174
                switch (status.getNationalStandard()) {
175
                    case "1":
176
                        holder.tvType.setText("国标2011");
177
                        break;
178
                    case "2":
179
                        holder.tvType.setText("国标2015");
180
                        break;
181
                    case "3":
182
                        holder.tvType.setText("国标2015,国标2011");
183
                }
184
            }
170
185 171
            String type, power, have_gun;
186 172
            if ("1".equals(status.getEleType())) {
187 173
                type = "直流快充";
174
                power= status.getPower()+ "kw"+"/"+ status.getWattmeter()+"V";
188 175
            } else {
189 176
                type = "交流慢充";
177
                power= status.getPower()+ "kw";
190 178
            }
191
            if ("0".equals(status.getPower())) {
192
                power = "";
193
            } else {
194
                power = " | " + status.getPower() + "kw";
195
            }
179
            holder.tvType.setText(power);
196 180
            //"has_gun": "0",//1有枪,2没有枪,0 没有这个桩的信息
197 181
            switch (status.getHas_gun()) {
198 182
                case "1":
@ -205,7 +189,30 @@ public class ZhuangStatusadapter extends BaseAdapter {
205 189
                    have_gun = "";
206 190
                    break;
207 191
            }
208
            holder.tvInfo.setText(type + power + have_gun);
192
193
            String gbFormat="";
194
            switch (status.getNationalStandard()) {
195
                case "1":
196
                    gbFormat=" | 国标2011";
197
                    break;
198
                case "2":
199
                    gbFormat=(" | 国标2015");
200
                    break;
201
                case "3":
202
                    gbFormat=(" | 国标2015,国标2011");
203
            }
204
            StringBuilder builderStr = new StringBuilder();
205
            if (gbFormat==""){
206
                builderStr.append(type)
207
                        .append(have_gun);
208
            }else{
209
                builderStr.append(type)
210
                        .append(gbFormat)
211
                        .append(have_gun);
212
213
            }
214
            holder.tvInfo.setText(builderStr);
215
209 216
        } catch (Exception e) {
210 217
            e.printStackTrace();
211 218
        }

+ 10 - 0
app/src/main/java/com/electric/chargingpile/data/ZhuangStatus.java

@ -20,6 +20,7 @@ public class ZhuangStatus {
20 20
     * soc : 0
21 21
     * nationalStandard : 1
22 22
     * order : 1
23
     * wattmeter :177   功率
23 24
     */
24 25
25 26
    private String pile_id;
@ -34,8 +35,17 @@ public class ZhuangStatus {
34 35
    private String status;
35 36
    private String soc;
36 37
    private String nationalStandard;
38
    private String wattmeter;
37 39
    private int order;
38 40
41
    public String getWattmeter() {
42
        return wattmeter;
43
    }
44
45
    public void setWattmeter(String wattmeter) {
46
        this.wattmeter = wattmeter;
47
    }
48
39 49
    public String getPile_id() {
40 50
        return pile_id;
41 51
    }

+ 11 - 3
app/src/main/res/layout/item_zhuang_status.xml

@ -1,6 +1,7 @@
1 1
<?xml version="1.0" encoding="utf-8"?>
2 2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 3
    xmlns:app="http://schemas.android.com/apk/res-auto"
4
    xmlns:tools="http://schemas.android.com/tools"
4 5
    android:id="@+id/rl_layout"
5 6
    android:orientation="vertical"
6 7
    android:layout_width="match_parent"
@ -8,6 +9,8 @@
8 9
    android:minHeight="96dp">
9 10
10 11
    <TextView
12
        tools:textColor="#f1f1"
13
        tools:text="空闲"
11 14
        android:id="@+id/tv_zhuang_staus"
12 15
        android:layout_width="wrap_content"
13 16
        android:layout_height="wrap_content"
@ -70,22 +73,26 @@
70 73
        android:layout_marginRight="15dp">
71 74
72 75
        <TextView
76
            android:textStyle="bold"
77
            tools:text="桩编码:1101050408103"
73 78
            android:id="@+id/tv_pile_id"
74 79
            android:layout_width="wrap_content"
75 80
            android:layout_height="wrap_content"
76 81
            android:singleLine="true"
77 82
            android:ellipsize="end"
78
            android:textColor="@color/ui_62"
83
            android:textColor="@color/color_text"
79 84
            android:textSize="14sp"
80 85
            android:layout_marginBottom="6dp"/>
81 86
82 87
        <TextView
88
89
            tools:text="90w"
83 90
            android:id="@+id/tv_zhuang_type"
84 91
            android:layout_width="wrap_content"
85 92
            android:layout_height="wrap_content"
86 93
            android:singleLine="true"
87 94
            android:ellipsize="end"
88
            android:textColor="@color/ui_65"
95
            android:textColor="@color/color_text"
89 96
            android:textSize="12sp"
90 97
            android:layout_marginBottom="4dp"/>
91 98
@ -127,10 +134,11 @@
127 134
        </LinearLayout>
128 135
129 136
        <TextView
137
            tools:text="直流快充 | 国标2015 | 有枪 "
130 138
            android:id="@+id/tv_zhuang_info"
131 139
            android:layout_width="wrap_content"
132 140
            android:layout_height="wrap_content"
133
            android:textColor="@color/ui_65"
141
            android:textColor="@color/color_text"
134 142
            android:textSize="12sp"
135 143
            android:layout_marginBottom="15dp"/>
136 144

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

@ -203,6 +203,7 @@
203 203
    <color name="color_e32727">#ffe32727</color>
204 204
    <color name="color_707070">#ff707070</color>
205 205
    <color name="color_f5f6f7">#F5F6F7</color>
206
    <color name="color_text">#1A1B1F</color>
206 207

207 208

208 209


cdzApp - Gogs: Go Git Service

充电桩app代码

1145873331@qq.com 7082cc0853 remove лет назад: 7
..
src 704d721c80 add ijkplayer library лет назад: 7
.gitignore 704d721c80 add ijkplayer library лет назад: 7
build.gradle 7082cc0853 remove лет назад: 7
proguard-rules.pro 704d721c80 add ijkplayer library лет назад: 7