修改包名
This commit is contained in:
268
app/src/main/res/layout/device_index_fragment.xml
Normal file
268
app/src/main/res/layout/device_index_fragment.xml
Normal file
@@ -0,0 +1,268 @@
|
||||
<?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="match_parent"
|
||||
android:background="@color/device_home_background"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical"
|
||||
tools:locale="zh">
|
||||
|
||||
<!-- Fragment content only. MainActivity owns system insets and the bottom TabBar. -->
|
||||
<LinearLayout
|
||||
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">
|
||||
|
||||
<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" />
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_notifications"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/device_home_notifications"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="19dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_notifications"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_notification_dot"
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_gravity="top|end"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/device_home_notification_dot"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
</FrameLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_add_device"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:clickable="true"
|
||||
android:contentDescription="@string/device_home_add_device"
|
||||
android:focusable="true"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="19dp"
|
||||
app:cardElevation="4dp"
|
||||
app:cardPreventCornerOverlap="false">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_add_device"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:contentDescription="@null"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
</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: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
|
||||
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:padding="9dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<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:padding="11dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<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:padding="9dp"
|
||||
android:src="@mipmap/ic_launcher" />
|
||||
|
||||
<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" />
|
||||
|
||||
<!-- Two columns. Item margins leave 12dp between cards and room for their shadows. -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_devices"
|
||||
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"
|
||||
android:paddingBottom="12dp"
|
||||
android:scrollbars="none"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:itemCount="4"
|
||||
tools:listitem="@layout/device_index_item" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user