设备,碳排,个人中心
This commit is contained in:
5
app/src/main/res/color/carbon_filter_text.xml
Normal file
5
app/src/main/res/color/carbon_filter_text.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@android:color/white" />
|
||||
<item android:color="@color/carbon_label" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/device_home_icon_tint.xml
Normal file
5
app/src/main/res/color/device_home_icon_tint.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_activated="true" android:color="#C8C8C8" />
|
||||
<item android:color="#2CC58B" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/device_timer_repeat_text.xml
Normal file
5
app/src/main/res/color/device_timer_repeat_text.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@color/device_data_orange" />
|
||||
<item android:color="#3D444D" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/device_timer_switch_track.xml
Normal file
5
app/src/main/res/color/device_timer_switch_track.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_checked="true" android:color="@color/device_data_orange" />
|
||||
<item android:color="#E1E5EA" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/device_timer_time_text.xml
Normal file
5
app/src/main/res/color/device_timer_time_text.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_activated="true" android:color="@color/device_data_green" />
|
||||
<item android:color="@color/device_data_legend" />
|
||||
</selector>
|
||||
5
app/src/main/res/color/mine_history_filter_text.xml
Normal file
5
app/src/main/res/color/mine_history_filter_text.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true" android:color="@android:color/white" />
|
||||
<item android:color="#6B7280" />
|
||||
</selector>
|
||||
BIN
app/src/main/res/drawable-xhdpi/device_home_location.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/device_home_location.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 618 B |
BIN
app/src/main/res/drawable-xhdpi/device_home_weather_sunny.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/device_home_weather_sunny.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 651 B |
5
app/src/main/res/drawable/carbon_icon_bg.xml
Normal file
5
app/src/main/res/drawable/carbon_icon_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/carbon_accent_background" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/carbon_legend_dot.xml
Normal file
4
app/src/main/res/drawable/carbon_legend_dot.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/carbon_chart_light" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/carbon_metric_accent_bg.xml
Normal file
5
app/src/main/res/drawable/carbon_metric_accent_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/carbon_accent_background" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/carbon_metric_bg.xml
Normal file
5
app/src/main/res/drawable/carbon_metric_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/carbon_tile_background" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
11
app/src/main/res/drawable/carbon_metric_filter_bg.xml
Normal file
11
app/src/main/res/drawable/carbon_metric_filter_bg.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"><shape>
|
||||
<solid android:color="@color/device_data_orange" /><corners android:radius="999dp" />
|
||||
<stroke android:width="1dp" android:color="@color/device_data_orange" />
|
||||
</shape></item>
|
||||
<item><shape>
|
||||
<solid android:color="@android:color/white" /><corners android:radius="999dp" />
|
||||
<stroke android:width="1dp" android:color="@color/carbon_divider" />
|
||||
</shape></item>
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/carbon_period_bg.xml
Normal file
7
app/src/main/res/drawable/carbon_period_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"><shape>
|
||||
<solid android:color="@color/device_data_orange" /><corners android:radius="8dp" />
|
||||
</shape></item>
|
||||
<item><shape><solid android:color="@android:color/transparent" /><corners android:radius="8dp" /></shape></item>
|
||||
</selector>
|
||||
4
app/src/main/res/drawable/carbon_points_earned_bg.xml
Normal file
4
app/src/main/res/drawable/carbon_points_earned_bg.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/carbon_accent_background" />
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/carbon_points_spent_bg.xml
Normal file
4
app/src/main/res/drawable/carbon_points_spent_bg.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@color/carbon_points_spent_background" />
|
||||
</shape>
|
||||
10
app/src/main/res/drawable/device_data_power_bg.xml
Normal file
10
app/src/main/res/drawable/device_data_power_bg.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="315"
|
||||
android:startColor="#F0F9F5"
|
||||
android:endColor="#E7F5EF" />
|
||||
<corners
|
||||
android:radius="14dp" />
|
||||
</shape>
|
||||
21
app/src/main/res/drawable/device_data_status_bg.xml
Normal file
21
app/src/main/res/drawable/device_data_status_bg.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_activated="true">
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#EBF7F1" />
|
||||
<corners
|
||||
android:radius="999dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#ECEEF1" />
|
||||
<corners
|
||||
android:radius="999dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/device_data_status_dot.xml
Normal file
7
app/src/main/res/drawable/device_data_status_dot.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid
|
||||
android:color="@color/device_data_green" />
|
||||
</shape>
|
||||
13
app/src/main/res/drawable/device_data_switch_bg.xml
Normal file
13
app/src/main/res/drawable/device_data_switch_bg.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="#33FFFFFF">
|
||||
<item>
|
||||
<shape>
|
||||
<solid
|
||||
android:color="@color/device_data_orange" />
|
||||
<corners
|
||||
android:radius="20dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
10
app/src/main/res/drawable/device_data_temperature_bg.xml
Normal file
10
app/src/main/res/drawable/device_data_temperature_bg.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="315"
|
||||
android:startColor="#FFF6EE"
|
||||
android:endColor="#FFEDDC" />
|
||||
<corners
|
||||
android:radius="14dp" />
|
||||
</shape>
|
||||
14
app/src/main/res/drawable/device_home_griddle_icon.xml
Normal file
14
app/src/main/res/drawable/device_home_griddle_icon.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="26dp"
|
||||
android:height="26dp"
|
||||
android:viewportWidth="32"
|
||||
android:viewportHeight="32">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#2CC58B"
|
||||
android:strokeWidth="1.7"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M13,10 C11,7 14,3 18,3 C23,3 25,10 21,12 M8,9 L8,12 M6.5,10.5 L9.5,10.5 M3,15 L29,15 L29,19 L3,19 Z M6,19 L6,28 L26,28 L26,19 M12,23 L20,23" />
|
||||
</vector>
|
||||
5
app/src/main/res/drawable/device_preview_action_bg.xml
Normal file
5
app/src/main/res/drawable/device_preview_action_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#F7F8FA" />
|
||||
<corners android:radius="10dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#FFF1E8" />
|
||||
<corners android:radius="7dp" />
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/device_timer_cancel_bg.xml
Normal file
7
app/src/main/res/drawable/device_timer_cancel_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid
|
||||
android:color="#F6F7F9" />
|
||||
</shape>
|
||||
7
app/src/main/res/drawable/device_timer_confirm_bg.xml
Normal file
7
app/src/main/res/drawable/device_timer_confirm_bg.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid
|
||||
android:color="@color/device_data_orange" />
|
||||
</shape>
|
||||
5
app/src/main/res/drawable/device_timer_picker_bg.xml
Normal file
5
app/src/main/res/drawable/device_timer_picker_bg.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/device_preview_background" />
|
||||
<corners android:topLeftRadius="24dp" android:topRightRadius="24dp" />
|
||||
</shape>
|
||||
27
app/src/main/res/drawable/device_timer_repeat_bg.xml
Normal file
27
app/src/main/res/drawable/device_timer_repeat_bg.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_selected="true">
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#FFF4EA" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FFD9BA" />
|
||||
<corners
|
||||
android:radius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid
|
||||
android:color="@android:color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#E3E7EB" />
|
||||
<corners
|
||||
android:radius="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
5
app/src/main/res/drawable/device_timer_switch_thumb.xml
Normal file
5
app/src/main/res/drawable/device_timer_switch_thumb.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke android:width="0.5dp" android:color="#10000000" />
|
||||
</shape>
|
||||
21
app/src/main/res/drawable/device_timer_time_bg.xml
Normal file
21
app/src/main/res/drawable/device_timer_time_bg.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:state_activated="true">
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#EBF7F1" />
|
||||
<corners
|
||||
android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#F6F7F9" />
|
||||
<corners
|
||||
android:radius="8dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
8
app/src/main/res/drawable/ic_carbon_chevron.xml
Normal file
8
app/src/main/res/drawable/ic_carbon_chevron.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#C4C9D0"
|
||||
android:strokeWidth="2" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M9,6 L15,12 L9,18" />
|
||||
</vector>
|
||||
8
app/src/main/res/drawable/ic_carbon_details.xml
Normal file
8
app/src/main/res/drawable/ic_carbon_details.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FF6900"
|
||||
android:strokeWidth="2" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M7,3 L17,3 Q20,3 20,6 L20,18 Q20,21 17,21 L7,21 Q4,21 4,18 L4,6 Q4,3 7,3 M8,8 L16,8 M8,12 L16,12 M8,16 L12,16" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_carbon_points_bag.xml
Normal file
7
app/src/main/res/drawable/ic_carbon_points_bag.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M7,8L7,6C7,3.2 9.2,1 12,1C14.8,1 17,3.2 17,6L17,8 M5,8L19,8C20.1,8 21,8.9 21,10L21,21C21,22.1 20.1,23 19,23L5,23C3.9,23 3,22.1 3,21L3,10C3,8.9 3.9,8 5,8Z" android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="@color/device_data_orange" android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_carbon_points_device.xml
Normal file
7
app/src/main/res/drawable/ic_carbon_points_device.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M3,4L21,4C22,4 23,5 23,6L23,18C23,19 22,20 21,20L3,20C2,20 1,19 1,18L1,6C1,5 2,4 3,4Z M1,10L23,10 M5,15L9,15" android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="@color/device_data_orange" android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_carbon_points_flame.xml
Normal file
7
app/src/main/res/drawable/ic_carbon_points_flame.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M12,2C13,7 19,8 19,14C19,19 16,22 12,22C8,22 5,19 5,15C5,12 7,10 8,8C7,13 10,14 12,12C14,10 12,7 12,2Z M12,22C8,19 11,16 12,15C12,17 15,18 14,20" android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="@color/device_data_orange" android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_carbon_points_gift.xml
Normal file
7
app/src/main/res/drawable/ic_carbon_points_gift.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M2,9L22,9L22,13L2,13Z M3,13L3,22L21,22L21,13 M12,9L12,22 M12,9C7,9 5,7 6,4C7,1 11,3 12,9C13,3 17,1 18,4C19,7 17,9 12,9Z" android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="@color/device_data_orange" android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_carbon_points_invite.xml
Normal file
7
app/src/main/res/drawable/ic_carbon_points_invite.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:pathData="M13,7A4,4 0,1 1,5,7A4,4 0,1 1,13,7 M2,21C2,16 5,14 9,14C13,14 16,16 16,21 M20,4L20,10 M17,7L23,7" android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="@color/device_data_orange" android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round" android:strokeLineJoin="round" />
|
||||
</vector>
|
||||
8
app/src/main/res/drawable/ic_carbon_trend.xml
Normal file
8
app/src/main/res/drawable/ic_carbon_trend.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FF6900"
|
||||
android:strokeWidth="2" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M3,17 L9,11 L14,16 L21,7 M14,7 L21,7 L21,14" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_data_diagnosis.xml
Normal file
15
app/src/main/res/drawable/ic_device_data_diagnosis.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FF6900"
|
||||
android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M14,3 C17,1 20,2 22,4 L18,7 L18,10 L21,10 C21,14 18,16 14,14 L6,22 C4,24 1,21 3,19 L11,11 C9,8 10,5 12,4 L12,8 L15,8 L16,5 Z" />
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/ic_device_data_info.xml
Normal file
14
app/src/main/res/drawable/ic_device_data_info.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FF6900"
|
||||
android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round"
|
||||
android:pathData="M12,2 A10,10 0,1 1,12 22 A10,10 0,1 1,12 2 M12,11 L12,17 M12,7 L12,7.3" />
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/ic_device_data_power.xml
Normal file
11
app/src/main/res/drawable/ic_device_data_power.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#34C759"
|
||||
android:pathData="M13,1 L5,14 L11,14 L10,23 L19,10 L13,10 Z" />
|
||||
</vector>
|
||||
11
app/src/main/res/drawable/ic_device_data_temperature.xml
Normal file
11
app/src/main/res/drawable/ic_device_data_temperature.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="#FF6900"
|
||||
android:pathData="M12,2 C10,6 4,10 4,15 A8,8 0,0 0,20 15 C20,10 14,5 12,2 Z" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_data_timer.xml
Normal file
15
app/src/main/res/drawable/ic_device_data_timer.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FF6900"
|
||||
android:strokeWidth="1.8"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M9,2 L15,2 M12,5 A8,8 0,1 1,12 21 A8,8 0,1 1,12 5 M12,8 L12,13 L15,15" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_info_device.xml
Normal file
15
app/src/main/res/drawable/ic_device_info_device.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#C95700"
|
||||
android:strokeWidth="1.7"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M7,3 L17,3 M7,7 L17,7 C23,7 23,19 17,19 L7,19 C1,19 1,7 7,7 Z M8,11 L16,11 C19,11 19,15 16,15 L8,15 C5,15 5,11 8,11 Z" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_info_leaf.xml
Normal file
15
app/src/main/res/drawable/ic_device_info_leaf.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#0E9F6E"
|
||||
android:strokeWidth="1.7"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M21,3 C10,1 3,5 3,12 C3,18 9,21 15,16 C19,12 20,7 21,3 M2,22 L16,8" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_info_shield.xml
Normal file
15
app/src/main/res/drawable/ic_device_info_shield.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#0E9F6E"
|
||||
android:strokeWidth="1.7"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M12,2 L21,6 L20,14 C19,18 16,21 12,23 C8,21 5,18 4,14 L3,6 Z M8,12 L11,15 L16,9" />
|
||||
</vector>
|
||||
14
app/src/main/res/drawable/ic_device_timer_close.xml
Normal file
14
app/src/main/res/drawable/ic_device_timer_close.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#111418"
|
||||
android:strokeWidth="2.2"
|
||||
android:strokeLineCap="round"
|
||||
android:pathData="M7,7 L17,17 M17,7 L7,17" />
|
||||
</vector>
|
||||
15
app/src/main/res/drawable/ic_device_timer_confirm.xml
Normal file
15
app/src/main/res/drawable/ic_device_timer_confirm.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="18dp"
|
||||
android:height="18dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/transparent"
|
||||
android:strokeColor="#FFFFFF"
|
||||
android:strokeWidth="2.3"
|
||||
android:strokeLineCap="round"
|
||||
android:strokeLineJoin="round"
|
||||
android:pathData="M5,12 L10,17 L19,8" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_mine_device_offline.xml
Normal file
7
app/src/main/res/drawable/ic_mine_device_offline.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="@android:color/transparent" android:strokeColor="@color/mine_record_muted"
|
||||
android:strokeWidth="2" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M9,7 L15,7 A5,5 0,0 1,15,17 L9,17 A5,5 0,0 1,9,7 Z" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_mine_device_online.xml
Normal file
7
app/src/main/res/drawable/ic_mine_device_online.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
|
||||
<path android:fillColor="@android:color/transparent" android:strokeColor="@color/mine_device_green"
|
||||
android:strokeWidth="2" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M6,6 L18,6 Q21,6 21,9 L21,15 Q21,18 18,18 L6,18 Q3,18 3,15 L3,9 Q3,6 6,6 Z M8,10 L16,10" />
|
||||
</vector>
|
||||
7
app/src/main/res/drawable/ic_personal_info_chevron.xml
Normal file
7
app/src/main/res/drawable/ic_personal_info_chevron.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="15dp" android:height="15dp" android:viewportWidth="15" android:viewportHeight="15">
|
||||
<path android:fillColor="@android:color/transparent" android:strokeColor="#C4C9D0"
|
||||
android:strokeWidth="1.25" android:strokeLineCap="round" android:strokeLineJoin="round"
|
||||
android:pathData="M6,3.5 L10,7.5 L6,11.5" />
|
||||
</vector>
|
||||
4
app/src/main/res/drawable/mine_device_offline_bg.xml
Normal file
4
app/src/main/res/drawable/mine_device_offline_bg.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/mine_device_offline_background" /><corners android:radius="12dp" />
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/mine_device_offline_pill.xml
Normal file
4
app/src/main/res/drawable/mine_device_offline_pill.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/mine_device_offline_background" /><corners android:radius="999dp" />
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/mine_device_online_bg.xml
Normal file
4
app/src/main/res/drawable/mine_device_online_bg.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/mine_device_online_background" /><corners android:radius="12dp" />
|
||||
</shape>
|
||||
4
app/src/main/res/drawable/mine_device_online_pill.xml
Normal file
4
app/src/main/res/drawable/mine_device_online_pill.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@color/mine_device_online_background" /><corners android:radius="999dp" />
|
||||
</shape>
|
||||
9
app/src/main/res/drawable/mine_history_filter_bg.xml
Normal file
9
app/src/main/res/drawable/mine_history_filter_bg.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true"><shape>
|
||||
<solid android:color="@color/device_home_orange" /><corners android:radius="999dp" />
|
||||
</shape></item>
|
||||
<item><shape>
|
||||
<solid android:color="#F5F6F8" /><corners android:radius="999dp" />
|
||||
</shape></item>
|
||||
</selector>
|
||||
9
app/src/main/res/drawable/personal_info_save_bg.xml
Normal file
9
app/src/main/res/drawable/personal_info_save_bg.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="#33FFFFFF">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/device_home_orange" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<corners android:radius="16dp" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/personal_nickname_input_bg.xml
Normal file
6
app/src/main/res/drawable/personal_nickname_input_bg.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke android:width="1dp" android:color="@color/personal_info_divider" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
459
app/src/main/res/layout/carbon_layout.xml
Normal file
459
app/src/main/res/layout/carbon_layout.xml
Normal file
@@ -0,0 +1,459 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".carbon.CarbonActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/carbon_title}"
|
||||
app:titleTextColor="@{@color/carbon_text}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="28dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<!-- 累计环保贡献:三列数值与等效环保贡献说明。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="26dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:background="@drawable/carbon_icon_bg"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/ic_device_info_leaf"
|
||||
app:tint="@color/device_data_orange"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/carbon_contribution" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:layout_marginTop="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_total_reduction"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeMaxTextSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_total_reduction"
|
||||
style="@style/CarbonTotalValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="30dp"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="14sp"
|
||||
app:autoSizeMaxTextSize="22sp"
|
||||
app:autoSizeStepGranularity="0.5sp"
|
||||
tools:text="156.8" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_unit_co2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_total_charcoal"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeMaxTextSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_total_charcoal"
|
||||
style="@style/CarbonTotalValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="30dp"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="14sp"
|
||||
app:autoSizeMaxTextSize="22sp"
|
||||
app:autoSizeStepGranularity="0.5sp"
|
||||
tools:text="112.3" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_unit_kg" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_total_saved_label"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeMaxTextSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_total_money"
|
||||
style="@style/CarbonTotalValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="30dp"
|
||||
android:maxLines="1"
|
||||
android:textColor="@color/device_data_orange"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="14sp"
|
||||
app:autoSizeMaxTextSize="22sp"
|
||||
app:autoSizeStepGranularity="0.5sp"
|
||||
tools:text="¥156.8" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/carbon_total_saved" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_tree_hint"
|
||||
style="@style/CarbonHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="143"
|
||||
android:minHeight="16dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:textColor="@color/carbon_green"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
tools:text="Total Reduction ≈ 12 Trees" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_driving_hint"
|
||||
style="@style/CarbonHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="153"
|
||||
android:minHeight="16dp"
|
||||
android:textColor="@color/device_data_orange"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="8sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
tools:text="About 780 km Less Driving" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 核心指标:三行两列,减排量和电费节省使用浅橙底。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:text="@string/carbon_core_metrics" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:layout_marginTop="8dp">
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_power"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:label="@{@string/carbon_power}"
|
||||
app:highlighted="@{false}" />
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_reduction"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:label="@{@string/carbon_reduction}"
|
||||
app:highlighted="@{true}" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_charcoal"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:label="@{@string/carbon_charcoal}"
|
||||
app:highlighted="@{false}" />
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_money"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:label="@{@string/carbon_money}"
|
||||
app:highlighted="@{true}" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_coal"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="12dp"
|
||||
app:label="@{@string/carbon_coal}"
|
||||
app:highlighted="@{false}" />
|
||||
|
||||
<include
|
||||
android:id="@+id/metric_trees"
|
||||
layout="@layout/item_carbon_metric"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:label="@{@string/carbon_trees}"
|
||||
app:highlighted="@{false}" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_carbon_trend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="62dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingVertical="14dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:background="@drawable/carbon_icon_bg"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/ic_carbon_trend"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/carbon_trend" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_carbon_chevron"
|
||||
android:importantForAccessibility="no" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_carbon_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="62dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingVertical="14dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="34dp"
|
||||
android:layout_height="34dp"
|
||||
android:background="@drawable/carbon_icon_bg"
|
||||
android:padding="9dp"
|
||||
android:src="@drawable/ic_carbon_details"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/carbon_details" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_carbon_chevron"
|
||||
android:importantForAccessibility="no" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
279
app/src/main/res/layout/carbon_points_layout.xml
Normal file
279
app/src/main/res/layout/carbon_points_layout.xml
Normal file
@@ -0,0 +1,279 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".carbon.CarbonPointsActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/carbon_points_title}"
|
||||
app:titleTextColor="@{@color/carbon_text}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="28dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<!-- 积分余额与月度净增独立于下方的流水筛选。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="96dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:paddingVertical="18dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonPointsSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:text="@string/carbon_points_balance" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_balance"
|
||||
style="@style/CarbonPointsSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/device_data_orange"
|
||||
tools:text="2,860 Points" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="60dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonPointsSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="20dp"
|
||||
android:text="@string/carbon_points_monthly_net" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_monthly_net"
|
||||
style="@style/CarbonPointsSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/carbon_green"
|
||||
tools:text="+420 Points" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
android:background="@drawable/carbon_metric_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_all"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_points_all" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_earned"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_points_earned" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_spent"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_points_spent" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_today"
|
||||
style="@style/CarbonPointsRange"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="65"
|
||||
android:text="@string/carbon_points_today" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_week"
|
||||
style="@style/CarbonPointsRange"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="88"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/carbon_points_week" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_month"
|
||||
style="@style/CarbonPointsRange"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="96"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/carbon_points_month" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="73" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="3dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_records_title"
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/carbon_points_all_records" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_count"
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:text="75 Records" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_carbon_points"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/item_carbon_points"
|
||||
tools:itemCount="5" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_empty"
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp"
|
||||
android:visibility="gone"
|
||||
android:text="@string/carbon_points_empty" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_points_more"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center"
|
||||
android:textSize="13.33sp"
|
||||
android:textColor="@color/device_data_orange"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:text="@string/carbon_points_load_more" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
169
app/src/main/res/layout/carbon_reduction_details_layout.xml
Normal file
169
app/src/main/res/layout/carbon_reduction_details_layout.xml
Normal file
@@ -0,0 +1,169 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".carbon.CarbonReductionDetailsActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/carbon_reduction_details_title}"
|
||||
app:titleTextColor="@{@color/carbon_text}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="28dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@color/carbon_accent_background">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_summary_month"
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="16dp"
|
||||
android:textSize="12sp"
|
||||
tools:text="June 2026 Summary" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_summary"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/carbon_summary_text"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="10sp"
|
||||
app:autoSizeMaxTextSize="14sp"
|
||||
tools:text="Power 16.4kWh · Power Reduction 3.6kg CO₂e" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="6dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonTableHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="91"
|
||||
android:text="@string/carbon_record_date" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonTableHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="53"
|
||||
android:text="@string/carbon_record_type" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonTableHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="76"
|
||||
android:text="@string/carbon_record_reduction" />
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonTableHeader"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="86"
|
||||
android:text="@string/carbon_record_bill" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_carbon_reduction"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/item_carbon_reduction"
|
||||
tools:itemCount="8" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_more"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:gravity="center"
|
||||
android:textSize="13.33sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="@color/device_data_orange"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:text="@string/carbon_view_more" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
346
app/src/main/res/layout/carbon_trend_layout.xml
Normal file
346
app/src/main/res/layout/carbon_trend_layout.xml
Normal file
@@ -0,0 +1,346 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".carbon.CarbonTrendActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/carbon_trend_title}"
|
||||
app:titleTextColor="@{@color/carbon_text}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="28dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<!-- 能源占比使用可绑定数据的原生环形图。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:text="@string/carbon_composition" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<com.github.mikephil.charting.charts.PieChart
|
||||
android:id="@+id/chart_carbon_composition"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:importantForAccessibility="no" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="20dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:background="@drawable/carbon_legend_dot"
|
||||
android:backgroundTint="@color/carbon_chart_light" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/carbon_composition_power"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/carbon_muted" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_trend_power_share"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="45%" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="12dp">
|
||||
|
||||
<View
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:background="@drawable/carbon_legend_dot"
|
||||
android:backgroundTint="@color/device_data_orange" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/carbon_composition_charcoal"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/carbon_muted" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_trend_charcoal_share"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="55%" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:text="@string/carbon_period" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:padding="4dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/carbon_metric_bg">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_period_day"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_period_day" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_period_week"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_period_week" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_period_month"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_period_month" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_period_year"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/carbon_period_bg"
|
||||
android:text="@string/carbon_period_year" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:text="@string/carbon_trend_chart" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_metric_power"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="68"
|
||||
android:background="@drawable/carbon_metric_filter_bg"
|
||||
android:text="@string/carbon_metric_power"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeMaxTextSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_metric_reduction"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="87"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/carbon_metric_filter_bg"
|
||||
android:text="@string/carbon_metric_reduction"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeMaxTextSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_metric_charcoal"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_weight="80"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/carbon_metric_filter_bg"
|
||||
android:text="@string/carbon_metric_charcoal"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeMaxTextSize="12sp" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="55" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_metric_savings"
|
||||
style="@style/CarbonFilter"
|
||||
android:layout_width="74dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/carbon_metric_filter_bg"
|
||||
android:text="@string/carbon_metric_savings" />
|
||||
|
||||
<!-- 原生组合图:顶部圆角柱、深色折线及可滑动查值的数据点。 -->
|
||||
<com.github.mikephil.charting.charts.CombinedChart
|
||||
android:id="@+id/chart_carbon_trend"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="198dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:contentDescription="@string/carbon_trend_chart" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_trend_hint"
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:accessibilityLiveRegion="polite"
|
||||
android:text="@string/carbon_chart_hint" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
652
app/src/main/res/layout/device_data_view_layout.xml
Normal file
652
app/src/main/res/layout/device_data_view_layout.xml
Normal file
@@ -0,0 +1,652 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".device.control.DeviceDataViewActivity"
|
||||
tools:locale="en">
|
||||
<!-- 复用公共标题栏,真实系统状态栏由 Activity 设置。 -->
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/device_preview_title}"
|
||||
app:titleTextColor="@{@color/device_home_text}" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="none">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="19dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="36dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<!-- 即时设备数据:浅绿功率卡、浅橙温度卡。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_data_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_data_panel" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_data_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:paddingHorizontal="7dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/device_data_status_bg">
|
||||
<View
|
||||
android:id="@+id/view_data_status_dot"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/device_data_status_dot" />
|
||||
<TextView
|
||||
android:id="@+id/tv_data_status"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/device_data_running"
|
||||
android:textSize="9.5sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_green" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="104dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/device_data_power_bg">
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_device_data_power"
|
||||
android:importantForAccessibility="no" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
<TextView
|
||||
android:id="@+id/tv_data_power"
|
||||
style="@style/DeviceDataMetricValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1,200"
|
||||
android:textColor="@color/device_data_green" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:text="@string/device_data_unit_w"
|
||||
android:textSize="11.5sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_green" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/device_data_power" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="104dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:background="@drawable/device_data_temperature_bg">
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_device_data_temperature"
|
||||
android:importantForAccessibility="no" />
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
<TextView
|
||||
android:id="@+id/tv_data_temperature"
|
||||
style="@style/DeviceDataMetricValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="185"
|
||||
android:textColor="@color/device_data_orange" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:text="@string/device_data_unit_celsius"
|
||||
android:textSize="11.5sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_orange" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/device_data_temperature" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 图例与折线使用相同颜色;图表由原生 MPAndroidChart 绘制。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_data_chart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
android:layout_marginTop="12dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_data_realtime" />
|
||||
<TextView
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/device_data_period"
|
||||
android:id="@+id/tv_data_chart_period" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<View
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:backgroundTint="@color/device_data_orange"
|
||||
android:background="@drawable/device_data_status_bg" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/device_data_legend_temperature"
|
||||
android:textColor="@color/device_data_legend"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_data_chart_temperature"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_orange"
|
||||
android:text="@string/device_data_chart_empty" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<View
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:backgroundTint="@color/device_data_power_line"
|
||||
android:background="@drawable/device_data_status_bg" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/device_data_legend_power"
|
||||
android:textColor="@color/device_data_legend"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_data_chart_power"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_power_line"
|
||||
android:text="@string/device_data_chart_empty" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
<View
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:backgroundTint="@color/device_data_usage_line"
|
||||
android:background="@drawable/device_data_status_bg" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/device_data_legend_usage"
|
||||
android:textColor="@color/device_data_legend"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tv_data_chart_usage"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:textSize="13sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_usage_line"
|
||||
android:text="@string/device_data_chart_empty" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<com.github.mikephil.charting.charts.LineChart
|
||||
android:id="@+id/chart_device_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="202dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:contentDescription="@string/device_data_chart_description" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 暂留三个快捷入口,点击时说明业务尚未接入。 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_data_timer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="66dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_device_data_timer"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataAction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/device_data_timer" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_data_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="66dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_device_data_info"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataAction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/device_data_info" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_data_diagnosis"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="66dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:src="@drawable/ic_device_data_diagnosis"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataAction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@string/device_data_diagnosis" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_data_today"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
android:layout_marginTop="12dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="96dp"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_data_today" />
|
||||
<TextView
|
||||
android:id="@+id/tv_data_since"
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="since 08:10" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:baselineAligned="false">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
<TextView
|
||||
android:id="@+id/tv_data_electricity"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1.8"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#111418" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/device_data_unit_kwh"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/device_data_electricity"
|
||||
android:textSize="8.5sp"
|
||||
android:textStyle="bold"
|
||||
android:letterSpacing="0.06"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="33dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
<TextView
|
||||
android:id="@+id/tv_data_charcoal"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2.3"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#111418" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/device_data_unit_kg"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/device_data_charcoal"
|
||||
android:textSize="8.5sp"
|
||||
android:textStyle="bold"
|
||||
android:letterSpacing="0.06"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="33dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="bottom">
|
||||
<TextView
|
||||
android:id="@+id/tv_data_runtime"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2.4"
|
||||
android:textSize="14sp"
|
||||
android:textColor="#111418" />
|
||||
<TextView
|
||||
style="@style/DeviceDataMetricLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="1dp"
|
||||
android:text="@string/device_data_unit_h"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/device_data_runtime"
|
||||
android:textSize="8.5sp"
|
||||
android:textStyle="bold"
|
||||
android:letterSpacing="0.06"
|
||||
android:gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 当前仅模拟电源状态切换,不执行真实设备控制。 -->
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/btn_data_power"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="50dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="14dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_data_switch"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:background="@drawable/device_data_switch_bg"
|
||||
android:backgroundTint="@null"
|
||||
android:elevation="6dp"
|
||||
android:outlineSpotShadowColor="#47FF6900"
|
||||
android:outlineAmbientShadowColor="#47FF6900"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:textAllCaps="false" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -55,12 +55,84 @@
|
||||
android:src="@mipmap/icon_top_right_add" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 天气为固定示例;点击城市仅演示权限申请,后续再接入实际信息提供方。 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginHorizontal="33dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="106dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_home_weather"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/device_home_weather_sunny" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_weather"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_weather_demo"
|
||||
android:textColor="#9E9E9E"
|
||||
android:textSize="12sp"
|
||||
tools:text="26°C · Sunny" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_home_location"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="19dp"
|
||||
android:layout_weight="1"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/device_home_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_location"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_location_pending"
|
||||
android:textColor="#9E9E9E"
|
||||
android:textSize="12sp"
|
||||
tools:text="Addis Ababa" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_home_statistics"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="133dp"
|
||||
android:layout_marginHorizontal="29dp"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:outlineAmbientShadowColor="@color/device_home_orange"
|
||||
android:outlineSpotShadowColor="@color/device_home_orange"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
android:background="@drawable/device_home_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:padding="14dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
android:src="@drawable/device_home_griddle_icon"
|
||||
android:tint="@color/device_home_icon_tint" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_device_status"
|
||||
|
||||
440
app/src/main/res/layout/device_info_layout.xml
Normal file
440
app/src/main/res/layout/device_info_layout.xml
Normal file
@@ -0,0 +1,440 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".device.control.DeviceInfoActivity"
|
||||
tools:locale="en">
|
||||
<!-- 沿用公共标题栏和返回交互。 -->
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/device_info_title}"
|
||||
app:titleTextColor="@{@color/device_home_text}" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="none">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="19dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<!-- 今日用电、木炭节省、碳减排和电费节省。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_info_today"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/ic_device_info_leaf"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_info_today" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_date"
|
||||
style="@style/DeviceDataCaption"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:text="Wed, 5 Nov" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_today_power" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_today_power"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="1.8 kWh" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_charcoal" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_charcoal"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="2.3 kg" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_carbon" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_carbon"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/device_data_green"
|
||||
tools:text="3.1 kg CO₂e" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_electricity_saved" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_electricity_saved"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Br 3.56" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 在线状态及设备身份、累计运行数据。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_info_device"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/ic_device_info_device"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_info_device" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_info_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:paddingHorizontal="7dp"
|
||||
android:paddingVertical="3dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/device_data_status_bg">
|
||||
<View
|
||||
android:id="@+id/view_info_status_dot"
|
||||
android:layout_width="5dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/device_data_status_dot" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_status"
|
||||
style="@style/DeviceDataText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/device_home_online"
|
||||
android:textSize="9.5sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_data_green" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_serial" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_serial"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="CHS-4F2A-0917" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_firmware" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_firmware"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="V2.1.0" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_total_power" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_total_power"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="156.8 kWh" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_total_runtime" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_total_runtime"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="320 h" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<!-- 保修和维护日期根据当前语言格式展示。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_info_service"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="7dp"
|
||||
android:src="@drawable/ic_device_info_shield"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_info_service" />
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="38dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_warranty" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_warranty"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Mar 2027" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="38dp"
|
||||
android:paddingVertical="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceInfoLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_info_last_service" />
|
||||
<TextView
|
||||
android:id="@+id/tv_info_last_service"
|
||||
style="@style/DeviceInfoValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="14 Aug 2026" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
604
app/src/main/res/layout/device_preview.xml
Normal file
604
app/src/main/res/layout/device_preview.xml
Normal file
@@ -0,0 +1,604 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/device_preview_background"
|
||||
android:fitsSystemWindows="true"
|
||||
android:orientation="vertical"
|
||||
tools:locale="en">
|
||||
|
||||
<!-- 复用通用标题栏,通过可选参数设置本页标题和深色文字。 -->
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/device_preview_title}"
|
||||
app:titleTextColor="@{@color/device_home_text}" />
|
||||
|
||||
<!-- 内容允许滚动,小屏幕和较大字体下仍能查看底部卡片。 -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="25dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="24dp">
|
||||
|
||||
<!-- 设备基础信息,图标和产品图暂用 ic_launcher 占位。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_preview_device"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="166dp"
|
||||
android:paddingBottom="7dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_device_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_preview_device_icon"
|
||||
android:layout_width="46dp"
|
||||
android:layout_height="46dp"
|
||||
android:background="@drawable/device_home_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:padding="10dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_device_name"
|
||||
style="@style/DevicePreviewHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:minHeight="19dp"
|
||||
android:text="@string/device_preview_name" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_online"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:minHeight="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<View
|
||||
android:id="@+id/view_preview_online_dot"
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:background="@drawable/device_home_status_dot" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_online"
|
||||
style="@style/DevicePreviewText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/device_home_online"
|
||||
android:textColor="@color/device_home_online"
|
||||
android:textSize="11.5sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_preview_product"
|
||||
android:layout_width="164dp"
|
||||
android:layout_height="116dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="43dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_realtime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/ll_preview_device_header"
|
||||
android:layout_toStartOf="@id/iv_preview_product"
|
||||
android:layout_marginTop="18dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/device_preview_power_label"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_power"
|
||||
style="@style/DevicePreviewText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:minHeight="22dp"
|
||||
android:text="@string/device_preview_demo_power"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:minHeight="15dp"
|
||||
android:text="@string/device_preview_temperature_label"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_temperature"
|
||||
style="@style/DevicePreviewText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:minHeight="22dp"
|
||||
android:text="@string/device_preview_demo_temperature"
|
||||
android:textSize="17sp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 今日减排及积分,所有示例数据都保留独立控件 ID 便于后续绑定。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_preview_carbon"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="159dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="21dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingTop="9dp"
|
||||
android:paddingBottom="9dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_carbon_details"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="17dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/device_preview_carbon_title" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_point_right"
|
||||
android:tint="@color/device_home_offline" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="9dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="14dp"
|
||||
android:text="@string/device_preview_electricity_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_electricity"
|
||||
style="@style/DevicePreviewValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:text="@string/device_preview_demo_electricity" />
|
||||
|
||||
<Space
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="7dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="14dp"
|
||||
android:text="@string/device_preview_money_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_money"
|
||||
style="@style/DevicePreviewValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:text="@string/device_preview_demo_money"
|
||||
android:textColor="@color/device_home_orange" />
|
||||
|
||||
<Space
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="7dp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="14dp"
|
||||
android:text="@string/device_preview_carbon_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_carbon"
|
||||
style="@style/DevicePreviewValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="19dp"
|
||||
android:text="@string/device_preview_demo_carbon" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="132dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="66dp"
|
||||
android:layout_height="66dp">
|
||||
|
||||
<!-- 复用配网页面的圆头橙色进度环;此处 74 为静态展示值。 -->
|
||||
<com.ckkj.griddle.custom.view.ProvisionProgressView
|
||||
android:id="@+id/preview_points_progress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:importantForAccessibility="no"
|
||||
app:provisionProgress="74"
|
||||
app:provisionStrokeWidth="6dp"
|
||||
app:provisionInset="0dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_points"
|
||||
style="@style/DevicePreviewText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:minHeight="17dp"
|
||||
android:text="@string/device_preview_demo_points"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:minHeight="11dp"
|
||||
android:text="@string/device_preview_points_label"
|
||||
android:textColor="@color/device_home_muted"
|
||||
android:textSize="8.5sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_equivalent"
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center"
|
||||
android:minHeight="12dp"
|
||||
android:text="@string/device_preview_equivalent"
|
||||
android:textColor="@color/device_home_muted"
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="11dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 今日节省卡片。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_preview_savings"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_weight="1"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="160dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="11dp">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewSmallHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="17dp"
|
||||
android:text="@string/device_preview_savings_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:minHeight="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_preview_charcoal_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_charcoal"
|
||||
style="@style/DevicePreviewValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/device_preview_demo_charcoal"
|
||||
android:textSize="12.5sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:minHeight="16dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_preview_saving_label" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_preview_saving"
|
||||
style="@style/DevicePreviewValue"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/device_preview_demo_saving"
|
||||
android:textSize="12.5sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_preview_savings"
|
||||
android:layout_width="81dp"
|
||||
android:layout_height="53dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="18dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<!-- 快捷操作暂只保留入口控件,业务点击由后续页面逻辑接入。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_preview_actions"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="160dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="11dp">
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewSmallHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="17dp"
|
||||
android:text="@string/device_preview_actions_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_stats"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="7dp"
|
||||
android:minHeight="34dp"
|
||||
android:background="@drawable/device_preview_action_bg"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="9dp"
|
||||
android:paddingVertical="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/device_preview_action_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:padding="4dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_status"
|
||||
style="@style/DevicePreviewAction"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_preview_stats" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:minHeight="34dp"
|
||||
android:background="@drawable/device_preview_action_bg"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="9dp"
|
||||
android:paddingVertical="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/device_preview_action_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:padding="4dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
style="@style/DevicePreviewAction"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_preview_control" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_preview_carbon_points"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:minHeight="34dp"
|
||||
android:background="@drawable/device_preview_action_bg"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="9dp"
|
||||
android:paddingVertical="6dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/device_preview_action_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:padding="4dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_carbon_points"
|
||||
style="@style/DevicePreviewAction"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_preview_carbon_points" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
165
app/src/main/res/layout/device_timer_layout.xml
Normal file
165
app/src/main/res/layout/device_timer_layout.xml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".device.control.DeviceTimerActivity"
|
||||
tools:locale="en">
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/device_timer_title}"
|
||||
app:titleTextColor="@{@color/device_home_text}" />
|
||||
<!-- 滚动容器兼容较大字体,正常尺寸下保持设计稿的顶部单卡片布局。 -->
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="none">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingTop="11dp"
|
||||
android:paddingBottom="24dp">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="20dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:text="@string/device_timer_heading" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="54dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceTimerRowLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_timer_start" />
|
||||
<!-- 时间块可见尺寸 54×28dp,外层将触摸区域扩展为 54×48dp。 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_timer_start_time"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground">
|
||||
<TextView
|
||||
android:id="@+id/tv_timer_start_time"
|
||||
style="@style/DeviceTimerTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/device_timer_time_bg"
|
||||
android:importantForAccessibility="no"
|
||||
tools:text="18:00" />
|
||||
</FrameLayout>
|
||||
<!-- 复用已有 SwitchButton,内边距扩大触摸区域,实际轨道为 44×26dp。 -->
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:id="@+id/switch_timer_start"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:paddingHorizontal="2dp"
|
||||
android:paddingVertical="11dp"
|
||||
android:contentDescription="@string/device_timer_start"
|
||||
android:checked="true"
|
||||
app:kswThumbDrawable="@drawable/device_timer_switch_thumb"
|
||||
app:kswThumbWidth="20dp"
|
||||
app:kswThumbHeight="20dp"
|
||||
app:kswThumbMargin="3dp"
|
||||
app:kswThumbRangeRatio="1.9"
|
||||
app:kswThumbRadius="10dp"
|
||||
app:kswBackRadius="13dp"
|
||||
app:kswBackColor="@color/device_timer_switch_track" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/device_data_grid" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="54dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical">
|
||||
<TextView
|
||||
style="@style/DeviceTimerRowLabel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:text="@string/device_timer_off" />
|
||||
<!-- 时间块可见尺寸 54×28dp,外层将触摸区域扩展为 54×48dp。 -->
|
||||
<FrameLayout
|
||||
android:id="@+id/fl_timer_off_time"
|
||||
android:layout_width="54dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginEnd="22dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground">
|
||||
<TextView
|
||||
android:id="@+id/tv_timer_off_time"
|
||||
style="@style/DeviceTimerTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="28dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/device_timer_time_bg"
|
||||
android:importantForAccessibility="no"
|
||||
tools:text="20:00" />
|
||||
</FrameLayout>
|
||||
<!-- 复用已有 SwitchButton,内边距扩大触摸区域,实际轨道为 44×26dp。 -->
|
||||
<com.kyleduo.switchbutton.SwitchButton
|
||||
android:id="@+id/switch_timer_off"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:paddingHorizontal="2dp"
|
||||
android:paddingVertical="11dp"
|
||||
android:contentDescription="@string/device_timer_off"
|
||||
android:checked="false"
|
||||
app:kswThumbDrawable="@drawable/device_timer_switch_thumb"
|
||||
app:kswThumbWidth="20dp"
|
||||
app:kswThumbHeight="20dp"
|
||||
app:kswThumbMargin="3dp"
|
||||
app:kswThumbRangeRatio="1.9"
|
||||
app:kswThumbRadius="10dp"
|
||||
app:kswBackRadius="13dp"
|
||||
app:kswBackColor="@color/device_timer_switch_track" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@@ -60,7 +60,8 @@
|
||||
android:minHeight="30dp"
|
||||
android:text="@string/wifi_connect_keep_nearby"
|
||||
android:textColor="#C4C9D0"
|
||||
android:textSize="10sp" />
|
||||
android:textSize="10sp"
|
||||
android:gravity="center"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
215
app/src/main/res/layout/dialog_device_timer_picker.xml
Normal file
215
app/src/main/res/layout/dialog_device_timer_picker.xml
Normal file
@@ -0,0 +1,215 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/device_timer_picker_bg"
|
||||
android:paddingHorizontal="19dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<!-- 顶部取消和确认只作用于当前编辑草稿。 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:clipChildren="false">
|
||||
<FrameLayout
|
||||
android:id="@+id/btn_timer_picker_cancel"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/device_timer_picker_cancel"
|
||||
android:clipChildren="false">
|
||||
<View
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/device_timer_cancel_bg" />
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_device_timer_close"
|
||||
android:importantForAccessibility="no" />
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textSize="15sp"
|
||||
android:text="@string/device_timer_picker_title" />
|
||||
<FrameLayout
|
||||
android:id="@+id/btn_timer_picker_confirm"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:foreground="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:contentDescription="@string/device_timer_picker_confirm"
|
||||
android:clipChildren="false">
|
||||
<View
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/device_timer_confirm_bg"
|
||||
android:elevation="6dp"
|
||||
android:outlineSpotShadowColor="#47FF6900"
|
||||
android:outlineAmbientShadowColor="#47FF6900" />
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_device_timer_confirm"
|
||||
android:elevation="7dp"
|
||||
android:importantForAccessibility="no" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
<!-- 三行平面滚轮,共享中间的白色选中行;上、下行保留浅灰色数字。 -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="168dp"
|
||||
android:layout_marginTop="24dp">
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/device_timer_wheel_row"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="2dp"
|
||||
android:orientation="horizontal">
|
||||
<com.ckkj.griddle.custom.view.TimerWheelView
|
||||
android:id="@+id/wheel_timer_hour"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/device_timer_picker_hour" />
|
||||
<LinearLayout
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/device_timer_wheel_row"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/device_timer_picker_colon"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#C9CFD6"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/device_timer_wheel_row"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/device_timer_picker_colon"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#C9CFD6"
|
||||
android:importantForAccessibility="no" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/device_timer_wheel_row"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/device_timer_picker_colon"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#C9CFD6"
|
||||
android:importantForAccessibility="no" />
|
||||
</LinearLayout>
|
||||
<com.ckkj.griddle.custom.view.TimerWheelView
|
||||
android:id="@+id/wheel_timer_minute"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/device_timer_picker_minute" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
<!-- 重复规则为本地演示,确认时与时间一起回传,开机和关机分别保存。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="34dp"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="99dp"
|
||||
android:padding="16dp"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
style="@style/DeviceDataHeading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_timer_repeat" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:orientation="horizontal"
|
||||
android:baselineAligned="false">
|
||||
<TextView
|
||||
android:id="@+id/tv_repeat_daily"
|
||||
style="@style/DeviceTimerRepeatOption"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:text="@string/device_timer_repeat_daily" />
|
||||
<TextView
|
||||
android:id="@+id/tv_repeat_weekdays"
|
||||
style="@style/DeviceTimerRepeatOption"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="@string/device_timer_repeat_weekdays" />
|
||||
<TextView
|
||||
android:id="@+id/tv_repeat_weekends"
|
||||
style="@style/DeviceTimerRepeatOption"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="@string/device_timer_repeat_weekends" />
|
||||
<TextView
|
||||
android:id="@+id/tv_repeat_custom"
|
||||
style="@style/DeviceTimerRepeatOption"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="32dp"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="8dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:text="@string/device_timer_repeat_custom" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
56
app/src/main/res/layout/dialog_personal_nickname.xml
Normal file
56
app/src/main/res/layout/dialog_personal_nickname.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="18dp"
|
||||
android:paddingTop="22dp"
|
||||
android:paddingBottom="18dp"
|
||||
tools:locale="en">
|
||||
|
||||
<TextView
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/personal_nickname_dialog_title"
|
||||
android:textColor="@color/personal_info_title_text"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_nickname"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="46dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/personal_nickname_input_bg"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="@string/personal_nickname_input_hint"
|
||||
android:imeOptions="actionDone"
|
||||
android:inputType="textCapWords"
|
||||
android:maxLength="30"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:paddingVertical="0dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/personal_nickname_input_text"
|
||||
android:textColorHint="@color/personal_nickname_input_text"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_nickname_save"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:background="@drawable/personal_info_save_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center"
|
||||
android:letterSpacing="-0.010625"
|
||||
android:text="@string/personal_nickname_save"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
@@ -1,40 +1,59 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<!-- 可选标题参数,页面无需修改通用标题栏内部控件。 -->
|
||||
<variable
|
||||
name="title"
|
||||
type="String" />
|
||||
|
||||
<variable
|
||||
name="titleTextColor"
|
||||
type="Integer" />
|
||||
</data>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relative_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp">
|
||||
<ImageView
|
||||
android:id="@+id/img_back"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/img_back_black"
|
||||
android:paddingLeft="@dimen/dp_7"
|
||||
android:paddingRight="@dimen/dp_7"
|
||||
android:layout_marginLeft="@dimen/dp_10"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/relative_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_white"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:gravity="center"
|
||||
android:layout_toRightOf="@+id/img_back"
|
||||
android:layout_toLeftOf="@+id/img_right_icon"
|
||||
android:text="asdasdasdasd"
|
||||
android:singleLine="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
<ImageView
|
||||
android:id="@+id/img_right_icon"
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:visibility="invisible"/>
|
||||
android:layout_height="48dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_back"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerVertical="true"
|
||||
android:src="@mipmap/img_back_black"
|
||||
android:paddingLeft="@dimen/dp_7"
|
||||
android:paddingRight="@dimen/dp_7"
|
||||
android:layout_marginLeft="@dimen/dp_10" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@{titleTextColor == null ? @color/color_white : titleTextColor}"
|
||||
android:textSize="@dimen/sp_18"
|
||||
android:gravity="center"
|
||||
android:layout_toRightOf="@+id/img_back"
|
||||
android:layout_toLeftOf="@+id/img_right_icon"
|
||||
android:text="@{title}"
|
||||
android:singleLine="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_right_icon"
|
||||
android:layout_width="@dimen/dp_23"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="@dimen/dp_16"
|
||||
android:visibility="invisible" />
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
|
||||
72
app/src/main/res/layout/item_carbon_metric.xml
Normal file
72
app/src/main/res/layout/item_carbon_metric.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="label"
|
||||
type="String" />
|
||||
|
||||
<variable
|
||||
name="highlighted"
|
||||
type="boolean" />
|
||||
</data>
|
||||
|
||||
<!-- 固定六项指标复用该布局;保留两列排列,放大字体时允许卡片增高。 -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="94dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="14dp"
|
||||
android:background="@{highlighted ? @drawable/carbon_metric_accent_bg : @drawable/carbon_metric_bg}">
|
||||
|
||||
<TextView
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="16dp"
|
||||
android:gravity="center"
|
||||
android:text="@{label}"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/carbon_label"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:maxLines="1"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="9sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
app:autoSizeStepGranularity="0.5sp"
|
||||
tools:text="Standard Coal Saved" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_metric_value"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="27dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:textColor="@{highlighted ? @color/device_data_orange : @color/carbon_text}"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="12sp"
|
||||
app:autoSizeMaxTextSize="20sp"
|
||||
app:autoSizeStepGranularity="0.5sp"
|
||||
tools:text="45.2 kWh" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_metric_growth"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="15dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textSize="11sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="@color/carbon_green"
|
||||
tools:text="+12%" />
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
73
app/src/main/res/layout/item_carbon_points.xml
Normal file
73
app/src/main/res/layout/item_carbon_points.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="66dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="12dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_point_record_icon"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:padding="10dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:background="@drawable/carbon_points_earned_bg"
|
||||
tools:src="@drawable/ic_carbon_points_gift" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_point_record_title"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="#292929"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="Redeemed Product" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_point_record_meta"
|
||||
style="@style/CarbonCaption"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="start"
|
||||
tools:text="Spent · 2026-06-30 14:32" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_point_record_amount"
|
||||
style="@style/CarbonText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="end"
|
||||
tools:text="-1,000 points"
|
||||
tools:textColor="@color/carbon_points_red" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_point_record_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
</LinearLayout>
|
||||
55
app/src/main/res/layout/item_carbon_reduction.xml
Normal file
55
app/src/main/res/layout/item_carbon_reduction.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="38dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_date"
|
||||
style="@style/CarbonRecordCell"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="91"
|
||||
tools:text="2026-06-30" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_type"
|
||||
style="@style/CarbonRecordCell"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="53"
|
||||
tools:text="Power" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_amount"
|
||||
style="@style/CarbonRecordCell"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="76"
|
||||
tools:text="2.1kWh" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_reduction_bill"
|
||||
style="@style/CarbonRecordCell"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="86"
|
||||
android:textColor="@color/device_data_orange"
|
||||
tools:text="Save ¥3.20" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_reduction_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/carbon_divider" />
|
||||
</LinearLayout>
|
||||
10
app/src/main/res/layout/item_device_timer_wheel.xml
Normal file
10
app/src/main/res/layout/item_device_timer_wheel.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/tv_timer_wheel_value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/device_timer_wheel_row"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="27sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/device_timer_wheel_unselected" />
|
||||
83
app/src/main/res/layout/item_my_device.xml
Normal file
83
app/src/main/res/layout/item_my_device.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="14dp"
|
||||
android:clipChildren="false">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="3dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="80dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="14dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_my_device"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp"
|
||||
android:padding="14dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_mine_device_online"
|
||||
android:background="@drawable/mine_device_online_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_device_name"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="#252529"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
tools:text="Kitchen Electric Griddle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_device_reduction"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="#6B7280"
|
||||
tools:text="Today's Reduction 1.24kg" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_device_status"
|
||||
style="@style/MineText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="24dp"
|
||||
android:minWidth="53dp"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="@color/mine_device_green"
|
||||
android:background="@drawable/mine_device_online_pill"
|
||||
tools:text="Online" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
43
app/src/main/res/layout/item_points_history_month.xml
Normal file
43
app/src/main/res/layout/item_points_history_month.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="20dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_month"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="-6dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="12sp"
|
||||
tools:text="2026-09" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_history_month_records"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="7dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
tools:listitem="@layout/item_points_history_record"
|
||||
tools:itemCount="4" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
60
app/src/main/res/layout/item_points_history_record.xml
Normal file
60
app/src/main/res/layout/item_points_history_record.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="57dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingVertical="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginEnd="12dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_record_type"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="19dp"
|
||||
android:textSize="14sp"
|
||||
android:gravity="center_vertical"
|
||||
tools:text="Spent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_record_date"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="3dp"
|
||||
android:textSize="11sp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="2026-9-28 10:50:24" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_record_amount"
|
||||
style="@style/MineText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/mine_history_amount"
|
||||
tools:text="−200" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/view_history_record_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/mine_record_divider" />
|
||||
</LinearLayout>
|
||||
@@ -50,6 +50,9 @@
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_mine_profile"
|
||||
style="@style/MineCard"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:layout_height="119dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
@@ -802,4 +805,4 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
191
app/src/main/res/layout/my_devices_layout.xml
Normal file
191
app/src/main/res/layout/my_devices_layout.xml
Normal file
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".mine.MyDevicesActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/mine_devices_title}"
|
||||
app:titleTextColor="@{@color/mine_history_amount}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:paddingBottom="28dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="76dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp"
|
||||
android:layout_margin="4dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingVertical="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices_total"
|
||||
style="@style/MyDevicesSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="27dp"
|
||||
android:textColor="@color/mine_history_amount"
|
||||
tools:text="3" />
|
||||
|
||||
<TextView
|
||||
style="@style/MyDevicesSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/mine_devices_total" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/mine_record_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices_online"
|
||||
style="@style/MyDevicesSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="27dp"
|
||||
android:textColor="@color/mine_device_green"
|
||||
tools:text="2" />
|
||||
|
||||
<TextView
|
||||
style="@style/MyDevicesSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/mine_devices_online" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/mine_record_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices_offline"
|
||||
style="@style/MyDevicesSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="27dp"
|
||||
android:textColor="@color/device_home_orange"
|
||||
tools:text="1" />
|
||||
|
||||
<TextView
|
||||
style="@style/MyDevicesSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/mine_devices_offline" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="48dp"
|
||||
android:background="@color/mine_record_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="4dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices_reduction"
|
||||
style="@style/MyDevicesSummaryValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="27dp"
|
||||
android:textColor="@color/mine_history_amount"
|
||||
tools:text="3.6kg" />
|
||||
|
||||
<TextView
|
||||
style="@style/MyDevicesSummaryLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/mine_devices_reduction" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_my_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_my_device"
|
||||
tools:itemCount="3" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices_empty"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="@string/mine_devices_empty" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
197
app/src/main/res/layout/personal_info_layout.xml
Normal file
197
app/src/main/res/layout/personal_info_layout.xml
Normal file
@@ -0,0 +1,197 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/personal_info_background"
|
||||
tools:context=".mine.PersonalInfoActivity"
|
||||
tools:locale="en">
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/personal_info_title}"
|
||||
app:titleTextColor="@{@color/personal_info_title_text}" />
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="26dp"
|
||||
android:paddingEnd="29dp"
|
||||
android:paddingBottom="32dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
<!-- 头像沿用现有默认资源,有缓存头像时由 Glide 展示。 -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_personal_avatar"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="76dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="12dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:contentDescription="@string/personal_info_avatar_hint"
|
||||
app:cardCornerRadius="38dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
<ImageView
|
||||
android:id="@+id/iv_personal_avatar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@mipmap/icon_mine_user_head_defaul" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
<TextView
|
||||
android:id="@+id/tv_personal_avatar_hint"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:textSize="11sp"
|
||||
android:textColor="@color/personal_info_muted"
|
||||
android:text="@string/personal_info_avatar_hint"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
<TextView
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginStart="-3dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textSize="11sp"
|
||||
android:letterSpacing="0.027272728"
|
||||
android:textColor="@color/personal_info_muted"
|
||||
android:text="@string/personal_info_basic" />
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="22dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="1dp">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_personal_nickname"
|
||||
style="@style/PersonalInfoRow">
|
||||
<TextView
|
||||
style="@style/PersonalInfoLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/personal_info_nickname" />
|
||||
<TextView
|
||||
android:id="@+id/tv_personal_nickname"
|
||||
style="@style/PersonalInfoValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:hint="@string/personal_info_nickname_hint"
|
||||
tools:text="Tom" />
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_personal_info_chevron" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/personal_info_divider" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_personal_phone"
|
||||
style="@style/PersonalInfoRow">
|
||||
<TextView
|
||||
style="@style/PersonalInfoLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/personal_info_phone" />
|
||||
<TextView
|
||||
android:id="@+id/tv_personal_phone"
|
||||
style="@style/PersonalInfoValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:hint="@string/personal_info_contact_hint"
|
||||
tools:text="13234545678" />
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_personal_info_chevron" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/personal_info_divider" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_personal_email"
|
||||
style="@style/PersonalInfoRow">
|
||||
<TextView
|
||||
style="@style/PersonalInfoLabel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/personal_info_email" />
|
||||
<TextView
|
||||
android:id="@+id/tv_personal_email"
|
||||
style="@style/PersonalInfoValue"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="12dp"
|
||||
android:hint="@string/personal_info_contact_hint"
|
||||
tools:text="Tom@qq.com" />
|
||||
<ImageView
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="7dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_personal_info_chevron" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
<TextView
|
||||
android:id="@+id/btn_personal_save"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="28dp"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:letterSpacing="-0.022500001"
|
||||
android:textColor="@android:color/white"
|
||||
android:text="@string/personal_info_save"
|
||||
android:background="@drawable/personal_info_save_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
154
app/src/main/res/layout/points_history_layout.xml
Normal file
154
app/src/main/res/layout/points_history_layout.xml
Normal file
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:fitsSystemWindows="true"
|
||||
android:background="@color/device_preview_background"
|
||||
tools:context=".mine.PointsHistoryActivity"
|
||||
tools:locale="en">
|
||||
|
||||
<include
|
||||
android:id="@+id/include_title"
|
||||
layout="@layout/include_activity_top_title_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
app:title="@{@string/mine_history_title}"
|
||||
app:titleTextColor="@{@color/mine_history_amount}" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="28dp"
|
||||
android:paddingBottom="28dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="162dp"
|
||||
android:layout_marginTop="6dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="1dp"
|
||||
app:cardPreventCornerOverlap="false"
|
||||
app:cardBackgroundColor="@android:color/white">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="20dp">
|
||||
|
||||
<TextView
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="16dp"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:gravity="center"
|
||||
android:text="@string/mine_history_available" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_balance"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:gravity="center"
|
||||
android:textSize="28sp"
|
||||
android:fontFamily="sans-serif-black"
|
||||
android:textStyle="bold"
|
||||
android:maxLines="1"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="20sp"
|
||||
android:autoSizeMaxTextSize="28sp"
|
||||
tools:text="200.00 Points" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_history_redeem"
|
||||
style="@style/MineText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:letterSpacing="-0.0275"
|
||||
android:text="@string/mine_history_redeem"
|
||||
android:background="@drawable/personal_info_save_bg"
|
||||
android:clickable="true"
|
||||
android:focusable="true" />
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_all"
|
||||
style="@style/MineHistoryFilter"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/mine_history_all" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_earned"
|
||||
style="@style/MineHistoryFilter"
|
||||
android:layout_width="74dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/mine_history_earned" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_spent"
|
||||
style="@style/MineHistoryFilter"
|
||||
android:layout_width="67dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="10dp"
|
||||
android:text="@string/mine_history_spent" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_points_history"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:overScrollMode="never"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
tools:listitem="@layout/item_points_history_month"
|
||||
tools:itemCount="2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_history_empty"
|
||||
style="@style/MineMuted"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="96dp"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:text="@string/mine_history_empty" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
35
app/src/main/res/values-en/carbon_detail_strings.xml
Normal file
35
app/src/main/res/values-en/carbon_detail_strings.xml
Normal file
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="carbon_trend_title">Carbon Trend</string>
|
||||
<string name="carbon_reduction_details_title">Reduction Details</string>
|
||||
<string name="carbon_composition">Carbon Details</string>
|
||||
<string name="carbon_composition_center">Power vs\nCharcoal</string>
|
||||
<string name="carbon_composition_power">Power Consumption</string>
|
||||
<string name="carbon_composition_charcoal">Charcoal Replacement</string>
|
||||
<string name="carbon_period">Time Period</string>
|
||||
<string name="carbon_period_day">Day</string>
|
||||
<string name="carbon_period_week">Week</string>
|
||||
<string name="carbon_period_month">Month</string>
|
||||
<string name="carbon_period_year">Year</string>
|
||||
<string name="carbon_trend_chart">Carbon Trend Chart</string>
|
||||
<string name="carbon_metric_power">Power</string>
|
||||
<string name="carbon_metric_reduction">Reduction</string>
|
||||
<string name="carbon_metric_charcoal">Charcoal</string>
|
||||
<string name="carbon_metric_savings">Savings</string>
|
||||
<string name="carbon_chart_hint">Swipe to view data point details</string>
|
||||
<string name="carbon_chart_selected">%1$s · %2$s %3$s · Trend %4$s</string>
|
||||
<string name="carbon_chart_accessibility">%1$s trend chart. Swipe horizontally to inspect values</string>
|
||||
<string name="carbon_chart_month">%1$d</string>
|
||||
<string name="carbon_chart_day">Jun %1$d</string>
|
||||
<string name="carbon_month_summary">%1$s Summary</string>
|
||||
<string name="carbon_reduction_summary">Power %1$skWh · Power Reduction %2$skg CO₂e</string>
|
||||
<string name="carbon_record_date">Date</string>
|
||||
<string name="carbon_record_type">Power</string>
|
||||
<string name="carbon_record_reduction">Reduction</string>
|
||||
<string name="carbon_record_bill">Bill</string>
|
||||
<string name="carbon_record_power">Power</string>
|
||||
<string name="carbon_record_saved">Save ¥%1$s</string>
|
||||
<string name="carbon_view_more">View More</string>
|
||||
<string name="carbon_all_loaded">All records shown</string>
|
||||
<string name="carbon_loading">Loading…</string>
|
||||
</resources>
|
||||
27
app/src/main/res/values-en/carbon_points_resources.xml
Normal file
27
app/src/main/res/values-en/carbon_points_resources.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="carbon_points_title">Carbon Points</string>
|
||||
<string name="carbon_points_balance">Carbon Balance</string>
|
||||
<string name="carbon_points_monthly_net">Monthly Net</string>
|
||||
<string name="carbon_points_value">%1$s Points</string>
|
||||
<string name="carbon_points_all">All</string>
|
||||
<string name="carbon_points_earned">Earned</string>
|
||||
<string name="carbon_points_spent">Spent</string>
|
||||
<string name="carbon_points_today">Today</string>
|
||||
<string name="carbon_points_week">This Week</string>
|
||||
<string name="carbon_points_month">This Month</string>
|
||||
<string name="carbon_points_all_records">All Records</string>
|
||||
<string name="carbon_points_earned_records">Earned Records</string>
|
||||
<string name="carbon_points_spent_records">Spent Records</string>
|
||||
<string name="carbon_points_record_count">%1$s Records</string>
|
||||
<string name="carbon_points_load_more">Load More</string>
|
||||
<string name="carbon_points_empty">No points records</string>
|
||||
<string name="carbon_points_redeem">Redeemed Product</string>
|
||||
<string name="carbon_points_invite">Invited Friend to Bind Device</string>
|
||||
<string name="carbon_points_cooking">Completed a Cooking Session</string>
|
||||
<string name="carbon_points_activation">First Device Activation</string>
|
||||
<string name="carbon_points_registration">Registration Bonus</string>
|
||||
<string name="carbon_points_record_meta">%1$s · %2$s</string>
|
||||
<string name="carbon_points_record_spent">%1$s points</string>
|
||||
|
||||
</resources>
|
||||
21
app/src/main/res/values-en/carbon_strings.xml
Normal file
21
app/src/main/res/values-en/carbon_strings.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="carbon_title">Carbon Stats</string>
|
||||
<string name="carbon_contribution">Total Eco Contribution</string>
|
||||
<string name="carbon_total_reduction">Total Reduction</string>
|
||||
<string name="carbon_total_charcoal">Total Reduction</string>
|
||||
<string name="carbon_total_saved_label">Total Reduction</string>
|
||||
<string name="carbon_total_saved">Total Saved</string>
|
||||
<string name="carbon_tree_hint">Total Reduction ≈ %1$s Trees</string>
|
||||
<string name="carbon_driving_hint">About %1$s km Less Driving</string>
|
||||
<string name="carbon_core_metrics">Core Metrics Card</string>
|
||||
<string name="carbon_power">Power Used</string>
|
||||
<string name="carbon_reduction">Carbon Reduction</string>
|
||||
<string name="carbon_charcoal">Charcoal Saved</string>
|
||||
<string name="carbon_money">Electricity Saved</string>
|
||||
<string name="carbon_coal">Standard Coal Saved</string>
|
||||
<string name="carbon_trees">Tree Equivalent</string>
|
||||
<string name="carbon_trend">Carbon Trend</string>
|
||||
<string name="carbon_details">Reduction Details</string>
|
||||
<string name="carbon_trees_value">%1$s Trees</string>
|
||||
</resources>
|
||||
28
app/src/main/res/values-en/device_data_view_strings.xml
Normal file
28
app/src/main/res/values-en/device_data_view_strings.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_data_panel">Device Control Panel</string>
|
||||
<string name="device_data_running">Running</string>
|
||||
<string name="device_data_stopped">Stopped</string>
|
||||
<string name="device_data_power">CURRENT POWER</string>
|
||||
<string name="device_data_temperature">CURRENT TEMPERATURE</string>
|
||||
<string name="device_data_realtime">Real-time Data</string>
|
||||
<string name="device_data_period">Last 5 months</string>
|
||||
<string name="device_data_selected_month">Last 5 months · %1$s</string>
|
||||
<string name="device_data_legend_temperature">Temp °C</string>
|
||||
<string name="device_data_legend_power">Power W</string>
|
||||
<string name="device_data_legend_usage">Usage min</string>
|
||||
<string name="device_data_timer">Timer</string>
|
||||
<string name="device_data_info">Device info</string>
|
||||
<string name="device_data_diagnosis">Diagnosis</string>
|
||||
<string name="device_data_today">Today</string>
|
||||
<string name="device_data_since">since %1$s</string>
|
||||
<string name="device_data_electricity">POWER</string>
|
||||
<string name="device_data_charcoal">CHARCOAL</string>
|
||||
<string name="device_data_runtime">RUNTIME</string>
|
||||
<string name="device_data_switch">Power Switch</string>
|
||||
<string name="device_data_demo_on">Demo: device on; no real command sent</string>
|
||||
<string name="device_data_demo_off">Demo: device stopped; no real command sent</string>
|
||||
<string name="device_data_action_hint">%1$s is not connected yet</string>
|
||||
<string name="device_data_chart_description">Temperature, average power and usage over the last 5 months</string>
|
||||
<string name="device_data_chart_point">%1$s: temperature %2$.0f°C, average power %3$.0fW, usage %4$.0f minutes.</string>
|
||||
</resources>
|
||||
6
app/src/main/res/values-en/device_home_demo_strings.xml
Normal file
6
app/src/main/res/values-en/device_home_demo_strings.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_home_power_value">%1$dw</string>
|
||||
<string name="device_home_temperature_value">%1$d°C</string>
|
||||
<string name="device_home_demo_device_hint">Demo device. Device control is not connected yet.</string>
|
||||
</resources>
|
||||
12
app/src/main/res/values-en/device_home_weather_strings.xml
Normal file
12
app/src/main/res/values-en/device_home_weather_strings.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_home_weather_demo">26°C · Sunny</string>
|
||||
<string name="device_home_location_pending">Tap to locate</string>
|
||||
<string name="device_home_location_demo">Addis Ababa</string>
|
||||
<string name="device_home_location_demo_hint">Location access allowed. Showing a simulated location.</string>
|
||||
<string name="device_home_location_permission_title">Location permission</string>
|
||||
<string name="device_home_location_permission_description">Location access will be used for city and weather features. This is a permission demo with sample data. Your actual location is not read.</string>
|
||||
<string name="device_home_location_permission_required">Please allow location access and try again</string>
|
||||
<string name="device_home_location_permission_settings">Location access is disabled. Please allow it in app settings to continue the permission demo.</string>
|
||||
<string name="device_home_location_settings_unavailable">Unable to open settings. Please check location access manually.</string>
|
||||
</resources>
|
||||
17
app/src/main/res/values-en/device_info_strings.xml
Normal file
17
app/src/main/res/values-en/device_info_strings.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_info_title">Device Info & Today\'s Data</string>
|
||||
<string name="device_info_today">Today\'s Data</string>
|
||||
<string name="device_info_today_power">Power used today</string>
|
||||
<string name="device_info_charcoal">Charcoal saved</string>
|
||||
<string name="device_info_carbon">Carbon reduction</string>
|
||||
<string name="device_info_electricity_saved">Electricity saved</string>
|
||||
<string name="device_info_device">Device Info</string>
|
||||
<string name="device_info_serial">Serial number</string>
|
||||
<string name="device_info_firmware">Firmware</string>
|
||||
<string name="device_info_total_power">Total power</string>
|
||||
<string name="device_info_total_runtime">Total runtime</string>
|
||||
<string name="device_info_service">Warranty & Service</string>
|
||||
<string name="device_info_warranty">Covered until</string>
|
||||
<string name="device_info_last_service">Last service</string>
|
||||
</resources>
|
||||
20
app/src/main/res/values-en/device_preview_strings.xml
Normal file
20
app/src/main/res/values-en/device_preview_strings.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_preview_title">Smart Electric Griddle</string>
|
||||
<string name="device_preview_name">Kitchen Electric Griddle</string>
|
||||
<string name="device_preview_power_label">Current Power</string>
|
||||
<string name="device_preview_temperature_label">Current Temperature</string>
|
||||
<string name="device_preview_carbon_title">Carbon Reduction Today</string>
|
||||
<string name="device_preview_electricity_label">Today\'s Electricity Usage</string>
|
||||
<string name="device_preview_money_label">Money Saved Today</string>
|
||||
<string name="device_preview_carbon_label">Today\'s Carbon Reduction</string>
|
||||
<string name="device_preview_points_label">My Points</string>
|
||||
<string name="device_preview_equivalent">Total Reduction = 32 Trees</string>
|
||||
<string name="device_preview_savings_title">Today\'s Savings</string>
|
||||
<string name="device_preview_charcoal_label">Charcoal Saved</string>
|
||||
<string name="device_preview_saving_label">Electricity Saved</string>
|
||||
<string name="device_preview_actions_title">Quick Actions</string>
|
||||
<string name="device_preview_stats">Stats</string>
|
||||
<string name="device_preview_control">Device Control</string>
|
||||
<string name="device_preview_carbon_points">Carbon Points</string>
|
||||
</resources>
|
||||
14
app/src/main/res/values-en/device_timer_picker_strings.xml
Normal file
14
app/src/main/res/values-en/device_timer_picker_strings.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_timer_picker_title">Set Timer</string>
|
||||
<string name="device_timer_picker_cancel">Cancel timer settings</string>
|
||||
<string name="device_timer_picker_confirm">Confirm time</string>
|
||||
<string name="device_timer_picker_hour">Hours</string>
|
||||
<string name="device_timer_picker_minute">Minutes</string>
|
||||
<string name="device_timer_repeat">Repeat</string>
|
||||
<string name="device_timer_repeat_daily">Daily</string>
|
||||
<string name="device_timer_repeat_weekdays">Weekdays</string>
|
||||
<string name="device_timer_repeat_weekends">Weekends</string>
|
||||
<string name="device_timer_repeat_custom">Custom</string>
|
||||
<string name="device_timer_repeat_required">Select at least one day</string>
|
||||
</resources>
|
||||
9
app/src/main/res/values-en/device_timer_strings.xml
Normal file
9
app/src/main/res/values-en/device_timer_strings.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="device_timer_title">Timer</string>
|
||||
<string name="device_timer_heading">Device Timer</string>
|
||||
<string name="device_timer_start">Scheduled start</string>
|
||||
<string name="device_timer_off">Scheduled off</string>
|
||||
<string name="device_timer_pick_start">Set scheduled start time, currently %1$s</string>
|
||||
<string name="device_timer_pick_off">Set scheduled off time, currently %1$s</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="mine_devices_title">My Devices</string>
|
||||
<string name="mine_devices_total">All Devices</string>
|
||||
<string name="mine_devices_online">Online</string>
|
||||
<string name="mine_devices_offline">Offline</string>
|
||||
<string name="mine_devices_reduction">Reduction</string>
|
||||
<string name="mine_devices_default_name">Kitchen Electric Griddle</string>
|
||||
<string name="mine_devices_today_reduction">Today\'s Reduction</string>
|
||||
<string name="mine_devices_yesterday_reduction">Yesterday\'s Reduction</string>
|
||||
<string name="mine_devices_kg">%1$skg</string>
|
||||
<string name="mine_devices_empty">No devices</string>
|
||||
<string name="mine_history_title">Points History</string>
|
||||
<string name="mine_history_available">Current Available Credits</string>
|
||||
<string name="mine_history_balance_value">%1$s Points</string>
|
||||
<string name="mine_history_redeem">Redeem Now</string>
|
||||
<string name="mine_history_all">All</string>
|
||||
<string name="mine_history_earned">Earned</string>
|
||||
<string name="mine_history_spent">Spent</string>
|
||||
<string name="mine_history_empty">No points records</string>
|
||||
|
||||
</resources>
|
||||
18
app/src/main/res/values-en/personal_info_resources.xml
Normal file
18
app/src/main/res/values-en/personal_info_resources.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="personal_info_title">Personal Info</string>
|
||||
<string name="personal_info_avatar_hint">Tap to change avatar</string>
|
||||
<string name="personal_info_basic">Basic Info</string>
|
||||
<string name="personal_info_nickname">Nickname</string>
|
||||
<string name="personal_info_phone">Phone Number</string>
|
||||
<string name="personal_info_email">Email</string>
|
||||
<string name="personal_info_nickname_hint">Not set</string>
|
||||
<string name="personal_info_contact_hint">Not linked</string>
|
||||
<string name="personal_info_save">Save Changes</string>
|
||||
<string name="personal_info_save_pending">Editing preview only. Profile saving is not connected; changes have not been submitted.</string>
|
||||
<string name="personal_info_nickname_required">Please enter a nickname</string>
|
||||
<string name="personal_info_phone_invalid">Enter 6–15 digits, optionally starting with +</string>
|
||||
<string name="personal_info_email_invalid">Please enter a valid email address</string>
|
||||
<string name="personal_info_picker_unavailable">No image picker is available</string>
|
||||
|
||||
</resources>
|
||||
6
app/src/main/res/values-en/personal_nickname_strings.xml
Normal file
6
app/src/main/res/values-en/personal_nickname_strings.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="personal_nickname_dialog_title">Edit Nickname</string>
|
||||
<string name="personal_nickname_input_hint">Enter nickname</string>
|
||||
<string name="personal_nickname_save">Save</string>
|
||||
</resources>
|
||||
65
app/src/main/res/values/carbon_detail_resources.xml
Normal file
65
app/src/main/res/values/carbon_detail_resources.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="carbon_chart_light">#FFB37A</color>
|
||||
<color name="carbon_chart_bar_light">#73FF6900</color>
|
||||
<color name="carbon_summary_text">#7A4A1E</color>
|
||||
<style name="CarbonFilter" parent="CarbonText">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textColor">@color/carbon_filter_text</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:clickable">true</item>
|
||||
<item name="android:focusable">true</item>
|
||||
</style>
|
||||
<style name="CarbonRecordCell" parent="CarbonText">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">@color/carbon_total_text</item>
|
||||
<item name="android:paddingHorizontal">4dp</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:autoSizeTextType">uniform</item>
|
||||
<item name="android:autoSizeMinTextSize">9sp</item>
|
||||
<item name="android:autoSizeMaxTextSize">12sp</item>
|
||||
<item name="android:autoSizeStepGranularity">0.5sp</item>
|
||||
</style>
|
||||
<style name="CarbonTableHeader" parent="CarbonRecordCell">
|
||||
<item name="android:textSize">11sp</item>
|
||||
<item name="android:textColor">@color/carbon_label</item>
|
||||
<item name="android:fontFamily">sans-serif-medium</item>
|
||||
<item name="android:autoSizeMaxTextSize">11sp</item>
|
||||
</style>
|
||||
|
||||
<string name="carbon_trend_title">碳排放趋势</string>
|
||||
<string name="carbon_reduction_details_title">减排明细</string>
|
||||
<string name="carbon_composition">碳排放构成</string>
|
||||
<string name="carbon_composition_center">用电与\n木炭替代</string>
|
||||
<string name="carbon_composition_power">电力消耗</string>
|
||||
<string name="carbon_composition_charcoal">木炭替代</string>
|
||||
<string name="carbon_period">统计周期</string>
|
||||
<string name="carbon_period_day">日</string>
|
||||
<string name="carbon_period_week">周</string>
|
||||
<string name="carbon_period_month">月</string>
|
||||
<string name="carbon_period_year">年</string>
|
||||
<string name="carbon_trend_chart">碳排放趋势图</string>
|
||||
<string name="carbon_metric_power">用电</string>
|
||||
<string name="carbon_metric_reduction">减排</string>
|
||||
<string name="carbon_metric_charcoal">节炭</string>
|
||||
<string name="carbon_metric_savings">节省</string>
|
||||
<string name="carbon_chart_hint">滑动查看数据点详情</string>
|
||||
<string name="carbon_chart_selected">%1$s · %2$s %3$s · 趋势 %4$s</string>
|
||||
<string name="carbon_chart_accessibility">当前显示%1$s趋势图,可左右滑动查看数值</string>
|
||||
<string name="carbon_chart_month">%1$d月</string>
|
||||
<string name="carbon_chart_day">6月%1$d日</string>
|
||||
<string name="carbon_chart_co2_value" translatable="false">%1$s kg CO₂e</string>
|
||||
<string name="carbon_month_summary">%1$s汇总</string>
|
||||
<string name="carbon_reduction_summary">用电 %1$s kWh · 碳减排 %2$s kg CO₂e</string>
|
||||
<string name="carbon_record_date">日期</string>
|
||||
<string name="carbon_record_type">类型</string>
|
||||
<string name="carbon_record_reduction">节电量</string>
|
||||
<string name="carbon_record_bill">账单</string>
|
||||
<string name="carbon_record_power">用电</string>
|
||||
<string name="carbon_record_kwh" translatable="false">%1$skWh</string>
|
||||
<string name="carbon_record_saved">省 ¥%1$s</string>
|
||||
<string name="carbon_view_more">查看更多</string>
|
||||
<string name="carbon_all_loaded">已全部显示</string>
|
||||
<string name="carbon_loading">加载中…</string>
|
||||
</resources>
|
||||
49
app/src/main/res/values/carbon_points_resources.xml
Normal file
49
app/src/main/res/values/carbon_points_resources.xml
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="carbon_points_title">减排积分</string>
|
||||
<string name="carbon_points_balance">积分余额</string>
|
||||
<string name="carbon_points_monthly_net">本月净增</string>
|
||||
<string name="carbon_points_value">%1$s 积分</string>
|
||||
<string name="carbon_points_all">全部</string>
|
||||
<string name="carbon_points_earned">收入</string>
|
||||
<string name="carbon_points_spent">支出</string>
|
||||
<string name="carbon_points_today">今天</string>
|
||||
<string name="carbon_points_week">本周</string>
|
||||
<string name="carbon_points_month">本月</string>
|
||||
<string name="carbon_points_all_records">全部记录</string>
|
||||
<string name="carbon_points_earned_records">收入记录</string>
|
||||
<string name="carbon_points_spent_records">支出记录</string>
|
||||
<string name="carbon_points_record_count">%1$s 条记录</string>
|
||||
<string name="carbon_points_load_more">加载更多</string>
|
||||
<string name="carbon_points_empty">暂无积分流水</string>
|
||||
<string name="carbon_points_redeem">兑换商品</string>
|
||||
<string name="carbon_points_invite">邀请好友绑定设备</string>
|
||||
<string name="carbon_points_cooking">完成一次烹饪</string>
|
||||
<string name="carbon_points_activation">首次激活设备</string>
|
||||
<string name="carbon_points_registration">注册奖励</string>
|
||||
<string name="carbon_points_record_meta">%1$s · %2$s</string>
|
||||
<string name="carbon_points_record_spent">%1$s 积分</string>
|
||||
<color name="carbon_points_red">#E5484D</color>
|
||||
<color name="carbon_points_spent_background">#FDECEC</color>
|
||||
<style name="CarbonPointsSummaryLabel" parent="CarbonText">
|
||||
<item name="android:gravity">center</item>
|
||||
<item name="android:textSize">15sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:autoSizeTextType">uniform</item>
|
||||
<item name="android:autoSizeMinTextSize">11sp</item>
|
||||
<item name="android:autoSizeMaxTextSize">15sp</item>
|
||||
</style>
|
||||
<style name="CarbonPointsSummaryValue" parent="CarbonPointsSummaryLabel">
|
||||
<item name="android:textSize">24sp</item>
|
||||
<item name="android:autoSizeMinTextSize">16sp</item>
|
||||
<item name="android:autoSizeMaxTextSize">24sp</item>
|
||||
</style>
|
||||
<style name="CarbonPointsRange" parent="CarbonFilter">
|
||||
<item name="android:background">@drawable/carbon_metric_filter_bg</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:autoSizeTextType">uniform</item>
|
||||
<item name="android:autoSizeMinTextSize">10sp</item>
|
||||
<item name="android:autoSizeMaxTextSize">12sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
58
app/src/main/res/values/carbon_resources.xml
Normal file
58
app/src/main/res/values/carbon_resources.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="carbon_text">#252529</color>
|
||||
<color name="carbon_total_text">#1F2329</color>
|
||||
<color name="carbon_muted">#9AA0A6</color>
|
||||
<color name="carbon_label">#6B7280</color>
|
||||
<color name="carbon_green">#22A45D</color>
|
||||
<color name="carbon_tile_background">#F5F6F8</color>
|
||||
<color name="carbon_accent_background">#FFF3EA</color>
|
||||
<color name="carbon_divider">#EDEFF2</color>
|
||||
|
||||
<style name="CarbonText" parent="DevicePreviewText">
|
||||
<item name="android:textColor">@color/carbon_text</item>
|
||||
</style>
|
||||
<style name="CarbonHeading" parent="CarbonText">
|
||||
<item name="android:textSize">16sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
<style name="CarbonCaption" parent="CarbonText">
|
||||
<item name="android:textSize">11sp</item>
|
||||
<item name="android:textColor">@color/carbon_muted</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
<style name="CarbonTotalValue" parent="CarbonText">
|
||||
<item name="android:textSize">22sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
<item name="android:textColor">@color/carbon_total_text</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
<style name="CarbonHint" parent="CarbonText">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
<string name="carbon_title">碳排放统计</string>
|
||||
<string name="carbon_contribution">累计环保贡献</string>
|
||||
<string name="carbon_total_reduction">累计减排</string>
|
||||
<string name="carbon_total_charcoal">累计节炭</string>
|
||||
<string name="carbon_total_saved_label">累计节省</string>
|
||||
<string name="carbon_total_saved">累计节省</string>
|
||||
<string name="carbon_unit_co2" translatable="false">kg CO₂e</string>
|
||||
<string name="carbon_unit_kg" translatable="false">kg</string>
|
||||
<string name="carbon_tree_hint">累计减排 ≈ %1$s 棵树</string>
|
||||
<string name="carbon_driving_hint">相当于少开车 %1$s km</string>
|
||||
<string name="carbon_core_metrics">核心指标</string>
|
||||
<string name="carbon_power">用电量</string>
|
||||
<string name="carbon_reduction">碳减排量</string>
|
||||
<string name="carbon_charcoal">节省木炭</string>
|
||||
<string name="carbon_money">节省电费</string>
|
||||
<string name="carbon_coal">节省标准煤</string>
|
||||
<string name="carbon_trees">等效植树</string>
|
||||
<string name="carbon_trend">碳排放趋势</string>
|
||||
<string name="carbon_details">减排明细</string>
|
||||
<string name="carbon_kwh_value" translatable="false">%1$s kWh</string>
|
||||
<string name="carbon_kg_value" translatable="false">%1$s kg</string>
|
||||
<string name="carbon_money_value" translatable="false">¥%1$s</string>
|
||||
<string name="carbon_trees_value">%1$s 棵</string>
|
||||
</resources>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user