更新
This commit is contained in:
@@ -1,378 +1,412 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<FrameLayout
|
||||
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="match_parent"
|
||||
android:background="@color/f9f9f9"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
tools:locale="zh">
|
||||
android:background="@color/home_index_background">
|
||||
|
||||
<!-- Fragment content only. MainActivity owns system insets and the bottom TabBar. -->
|
||||
<LinearLayout
|
||||
<com.ckkj.griddle.custom.view.AdaptiveContentLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginHorizontal="29dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
app:maxContentWidth="720dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_home_title"
|
||||
style="@style/DeviceHomeText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center_vertical"
|
||||
android:letterSpacing="-0.018"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_title"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
<!-- 整页滚动兼容折叠横屏和大字体,设备宫格不再单独嵌套滚动。 -->
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_notifications"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_notice" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_add_device"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:contentDescription="@null"
|
||||
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="11dp"
|
||||
android:outlineAmbientShadowColor="@color/device_home_orange"
|
||||
android:outlineSpotShadowColor="@color/device_home_orange"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="10dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_charcoal_saved"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="18dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_charcoal_saved"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:background="@drawable/device_home_stat_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_charcoal" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charcoal_saved"
|
||||
style="@style/DeviceHomeStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_zero_charcoal"
|
||||
android:textSize="14sp"
|
||||
tools:text="128 kg" />
|
||||
|
||||
<TextView
|
||||
style="@style/DeviceHomeStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/device_home_charcoal_saved" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="91dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="#66FFFFFF" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_balance"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="14dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_balance"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:background="@drawable/device_home_stat_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_balance" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_balance"
|
||||
style="@style/DeviceHomeStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_zero"
|
||||
android:textSize="26sp"
|
||||
tools:text="2,847" />
|
||||
|
||||
<TextView
|
||||
style="@style/DeviceHomeStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/device_home_balance" />
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="91dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="#66FFFFFF" />
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_saving_birr"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="18dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_saving_birr"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:background="@drawable/device_home_stat_icon_bg"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_birr" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_saving_birr"
|
||||
style="@style/DeviceHomeStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="19dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_zero"
|
||||
android:textSize="14sp"
|
||||
tools:text="9998" />
|
||||
|
||||
<TextView
|
||||
style="@style/DeviceHomeStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginTop="7dp"
|
||||
android:text="@string/device_home_saving_birr" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices"
|
||||
style="@style/DeviceHomeText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginHorizontal="29dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/device_home_my_devices"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="23dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_weight="1"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<!-- Two columns. Item margins leave room for card shadows. -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="12dp"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="4"
|
||||
tools:listitem="@layout/device_index_item" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/sv_empty_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:fillViewport="true"
|
||||
android:scrollbars="none">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_empty_devices"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="3dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- 首页只绘制业务内容,系统状态栏和底部导航由 MainActivity 处理。 -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="34dp">
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty_devices"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_add_device" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="26dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_empty_devices"
|
||||
style="@style/DeviceHomeText"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv_home_title"
|
||||
style="@style/HomeIndexText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_empty_message"
|
||||
android:textColor="#1F2329"
|
||||
android:textSize="16sp"
|
||||
android:layout_marginEnd="28dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_title"
|
||||
android:textSize="26sp"
|
||||
app:autoSizeTextType="uniform"
|
||||
app:autoSizeMinTextSize="18sp"
|
||||
app:autoSizeMaxTextSize="26sp"
|
||||
app:autoSizeStepGranularity="1sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/btn_empty_add_device"
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_marginBottom="28dp"
|
||||
android:clickable="true"
|
||||
<ImageView
|
||||
android:id="@+id/iv_notifications"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/home_index_action_background"
|
||||
android:elevation="5dp"
|
||||
android:outlineProvider="background"
|
||||
android:contentDescription="@string/device_home_notifications"
|
||||
android:src="@mipmap/icon_home_notifications" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_add_device"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="10dp"
|
||||
android:background="@drawable/home_index_action_background"
|
||||
android:elevation="5dp"
|
||||
android:outlineProvider="background"
|
||||
android:contentDescription="@string/device_home_add_device"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
android:src="@mipmap/icon_home_add_device" />
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 天气为固定示例;点击城市仅演示权限申请,后续再接入实际信息提供方。 -->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_home_weather"
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_home_weather" />
|
||||
|
||||
<TextView
|
||||
style="@style/DeviceHomeText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_add_device"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
android:id="@+id/tv_home_weather"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fontFamily="sans-serif"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_weather_demo"
|
||||
android:textColor="#222222"
|
||||
android:textSize="14sp"
|
||||
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="10dp"
|
||||
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="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_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"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:text="@string/device_home_location_pending"
|
||||
android:textColor="#222222"
|
||||
android:textSize="14sp"
|
||||
tools:text="Addis Ababa" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</ScrollView>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_home_statistics"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="134dp"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_charcoal_saved"
|
||||
style="@style/HomeIndexStatColumn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_charcoal_saved"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@mipmap/icon_home_charcoal" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charcoal_saved"
|
||||
style="@style/HomeIndexStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_home_zero_charcoal" />
|
||||
|
||||
<TextView
|
||||
style="@style/HomeIndexStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_home_charcoal_saved" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
style="@style/HomeIndexStatDivider"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="44dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_balance"
|
||||
style="@style/HomeIndexStatColumn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_balance"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@mipmap/icon_home_balance" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_balance"
|
||||
style="@style/HomeIndexStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_home_zero" />
|
||||
|
||||
<TextView
|
||||
style="@style/HomeIndexStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_home_balance" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
style="@style/HomeIndexStatDivider"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="44dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_electricity_saved"
|
||||
style="@style/HomeIndexStatColumn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_electricity_saved"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@mipmap/icon_home_electricity" />
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_electricity_saved"
|
||||
style="@style/HomeIndexStatValue"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/device_home_zero" />
|
||||
|
||||
<TextView
|
||||
style="@style/HomeIndexStatLabel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/home_index_electricity_saved" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_my_devices"
|
||||
style="@style/HomeIndexText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="24dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/device_home_my_devices"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="18.5dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<!-- 两列设备卡片统一边距,随外层页面滚动。 -->
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:nestedScrollingEnabled="false"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="12dp"
|
||||
android:scrollbars="none"
|
||||
android:visibility="gone"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="4"
|
||||
tools:listitem="@layout/device_index_item" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/sv_empty_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbars="none">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_empty_devices"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="5.5dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="34dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_empty_devices"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/icon_add_device" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_empty_devices"
|
||||
style="@style/HomeIndexText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="21dp"
|
||||
android:layout_marginHorizontal="12dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_empty_message"
|
||||
android:textColor="#1F2329"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/btn_empty_add_device"
|
||||
android:layout_width="104dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="38dp"
|
||||
android:layout_marginBottom="28dp"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/device_home_add_device"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:cardBackgroundColor="@color/device_home_orange"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="0dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<TextView
|
||||
style="@style/HomeIndexText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/device_home_add_device"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="14sp" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</com.ckkj.griddle.custom.view.AdaptiveContentLayout>
|
||||
</FrameLayout>
|
||||
|
||||
Reference in New Issue
Block a user