|
@@ -0,0 +1,381 @@
|
|
|
+<?xml version="1.0" encoding="utf-8"?>
|
|
|
+<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent"
|
|
|
+ android:background="#F2F3F5">
|
|
|
+
|
|
|
+ <!-- AppBar/Toolbar -->
|
|
|
+ <com.google.android.material.appbar.MaterialToolbar
|
|
|
+ android:id="@+id/toolbar"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:background="#fff"
|
|
|
+ app:title="个人中心"
|
|
|
+ app:titleTextColor="#222"
|
|
|
+ app:menu="@menu/profile_toolbar_menu"
|
|
|
+ app:popupTheme="@style/ThemeOverlay.Material3.Light"/>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/layoutNotLogin"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:gravity="center"
|
|
|
+ android:visibility="gone"
|
|
|
+ android:padding="32dp">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="未登录"
|
|
|
+ android:textSize="20sp"
|
|
|
+ android:textColor="#222"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:layout_marginBottom="24dp"/>
|
|
|
+ <Button
|
|
|
+ android:id="@+id/btnGoLogin"
|
|
|
+ android:layout_width="160dp"
|
|
|
+ android:layout_height="48dp"
|
|
|
+ android:text="登录"
|
|
|
+ android:textColor="#fff"
|
|
|
+ android:backgroundTint="#165DFF"/>
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/layoutProfileDetail"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:gravity="center_horizontal">
|
|
|
+ <androidx.core.widget.NestedScrollView
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_marginTop="56dp"
|
|
|
+ android:fillViewport="true"
|
|
|
+ android:paddingBottom="76dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="16dp"
|
|
|
+ android:gravity="center_horizontal">
|
|
|
+
|
|
|
+ <!-- 用户信息区 -->
|
|
|
+ <androidx.cardview.widget.CardView
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginBottom="16dp"
|
|
|
+ app:cardCornerRadius="20dp"
|
|
|
+ app:cardElevation="4dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="20dp"
|
|
|
+ android:gravity="center_horizontal">
|
|
|
+
|
|
|
+ <FrameLayout
|
|
|
+ android:layout_width="96dp"
|
|
|
+ android:layout_height="96dp"
|
|
|
+ android:layout_gravity="center_horizontal">
|
|
|
+ <ImageView
|
|
|
+ android:id="@+id/ivAvatar"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:src="@mipmap/ic_launcher_round"
|
|
|
+ android:scaleType="centerCrop"
|
|
|
+ android:background="@drawable/bg_avatar_circle"/>
|
|
|
+ <ImageButton
|
|
|
+ android:id="@+id/btnEditAvatar"
|
|
|
+ android:layout_width="32dp"
|
|
|
+ android:layout_height="32dp"
|
|
|
+ android:layout_gravity="bottom|end"
|
|
|
+ android:backgroundTint="#165DFF"
|
|
|
+ android:background="@drawable/bg_btn_circle"
|
|
|
+ android:src="@drawable/ic_camera"
|
|
|
+ android:contentDescription="编辑头像"
|
|
|
+ android:tint="#fff"
|
|
|
+ android:elevation="4dp"/>
|
|
|
+ </FrameLayout>
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvProfileName"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="小明同学"
|
|
|
+ android:textSize="22sp"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:textColor="#222"
|
|
|
+ android:layout_marginTop="12dp"/>
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvProfileGrade"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="初中三年级"
|
|
|
+ android:textSize="15sp"
|
|
|
+ android:textColor="#86909C"
|
|
|
+ android:layout_marginTop="2dp"/>
|
|
|
+ <com.google.android.material.chip.ChipGroup
|
|
|
+ android:id="@+id/chipGroupTags"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginTop="10dp"
|
|
|
+ app:singleLine="false">
|
|
|
+ <com.google.android.material.chip.Chip
|
|
|
+ style="@style/Widget.Material3.Chip.Assist"
|
|
|
+ android:text="数学爱好者"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ app:chipBackgroundColor="@color/chip_primary_bg"
|
|
|
+ app:chipStrokeColor="@color/chip_primary_bg"
|
|
|
+ app:chipStrokeWidth="0dp"
|
|
|
+ android:textColor="#165DFF"/>
|
|
|
+ <com.google.android.material.chip.Chip
|
|
|
+ style="@style/Widget.Material3.Chip.Assist"
|
|
|
+ android:text="学习进步奖"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ app:chipBackgroundColor="@color/chip_secondary_bg"
|
|
|
+ app:chipStrokeColor="@color/chip_secondary_bg"
|
|
|
+ app:chipStrokeWidth="0dp"
|
|
|
+ android:textColor="#36BFFA"/>
|
|
|
+ <com.google.android.material.chip.Chip
|
|
|
+ style="@style/Widget.Material3.Chip.Assist"
|
|
|
+ android:text="连续学习5天"
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ app:chipBackgroundColor="@color/chip_accent_bg"
|
|
|
+ app:chipStrokeColor="@color/chip_accent_bg"
|
|
|
+ app:chipStrokeWidth="0dp"
|
|
|
+ android:textColor="#722ED1"/>
|
|
|
+ </com.google.android.material.chip.ChipGroup>
|
|
|
+
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="horizontal"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_marginTop="20dp">
|
|
|
+ <include layout="@layout/item_profile_stat_card"/>
|
|
|
+ <include layout="@layout/item_profile_stat_card"/>
|
|
|
+ <include layout="@layout/item_profile_stat_card"/>
|
|
|
+ <include layout="@layout/item_profile_stat_card"/>
|
|
|
+ </LinearLayout>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.cardview.widget.CardView>
|
|
|
+
|
|
|
+ <!-- 图表区 -->
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="horizontal"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_marginBottom="16dp">
|
|
|
+ <androidx.cardview.widget.CardView
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="220dp"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:layout_marginEnd="8dp"
|
|
|
+ app:cardCornerRadius="20dp"
|
|
|
+ app:cardElevation="4dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="16dp">
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="学习时间分布"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:textColor="#222"/>
|
|
|
+ <View
|
|
|
+ android:id="@+id/barChart"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="0dp"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:background="#E5E6EB"/>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.cardview.widget.CardView>
|
|
|
+ <androidx.cardview.widget.CardView
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="220dp"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:layout_marginStart="8dp"
|
|
|
+ app:cardCornerRadius="20dp"
|
|
|
+ app:cardElevation="4dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="16dp">
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="学习科目分布"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:textColor="#222"/>
|
|
|
+ <View
|
|
|
+ android:id="@+id/pieChart"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="0dp"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:background="#E5E6EB"/>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.cardview.widget.CardView>
|
|
|
+ </LinearLayout>
|
|
|
+
|
|
|
+ <!-- 成就区 -->
|
|
|
+ <androidx.cardview.widget.CardView
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_marginBottom="16dp"
|
|
|
+ app:cardCornerRadius="20dp"
|
|
|
+ app:cardElevation="4dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="16dp">
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="学习成就"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:textColor="#222"/>
|
|
|
+ <GridLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:columnCount="4"
|
|
|
+ android:rowCount="1"
|
|
|
+ android:layout_marginTop="12dp">
|
|
|
+ <include layout="@layout/item_profile_achievement_card"/>
|
|
|
+ <include layout="@layout/item_profile_achievement_card"/>
|
|
|
+ <include layout="@layout/item_profile_achievement_card"/>
|
|
|
+ <include layout="@layout/item_profile_achievement_card"/>
|
|
|
+ </GridLayout>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.cardview.widget.CardView>
|
|
|
+
|
|
|
+ <!-- 设置区 -->
|
|
|
+ <androidx.cardview.widget.CardView
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ app:cardCornerRadius="20dp"
|
|
|
+ app:cardElevation="4dp">
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="vertical"
|
|
|
+ android:padding="16dp">
|
|
|
+ <TextView
|
|
|
+ android:layout_width="wrap_content"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="学习设置"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textStyle="bold"
|
|
|
+ android:textColor="#222"/>
|
|
|
+ <include layout="@layout/item_profile_setting_switch"/>
|
|
|
+ <include layout="@layout/item_profile_setting_switch"/>
|
|
|
+ <include layout="@layout/item_profile_setting_switch"/>
|
|
|
+ <include layout="@layout/item_profile_setting_switch"/>
|
|
|
+ <include layout="@layout/item_profile_setting_switch"/>
|
|
|
+ <LinearLayout
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:orientation="horizontal"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_marginTop="16dp">
|
|
|
+ <Button
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:text="通知设置"
|
|
|
+ android:textColor="#4E5969"
|
|
|
+ android:backgroundTint="#F2F3F5"/>
|
|
|
+ <Space android:layout_width="8dp" android:layout_height="wrap_content"/>
|
|
|
+ <Button
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:text="账号安全"
|
|
|
+ android:textColor="#4E5969"
|
|
|
+ android:backgroundTint="#F2F3F5"/>
|
|
|
+ <Space android:layout_width="8dp" android:layout_height="wrap_content"/>
|
|
|
+ <Button
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:text="帮助中心"
|
|
|
+ android:textColor="#4E5969"
|
|
|
+ android:backgroundTint="#F2F3F5"/>
|
|
|
+ </LinearLayout>
|
|
|
+ <Button
|
|
|
+ android:id="@+id/btnLogout"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="wrap_content"
|
|
|
+ android:text="退出登录"
|
|
|
+ android:textColor="#F53F3F"
|
|
|
+ android:backgroundTint="#fff"
|
|
|
+ android:layout_marginTop="24dp"/>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.cardview.widget.CardView>
|
|
|
+ </LinearLayout>
|
|
|
+ </androidx.core.widget.NestedScrollView>
|
|
|
+ </LinearLayout>
|
|
|
+ <LinearLayout
|
|
|
+ android:id="@+id/bottomNav"
|
|
|
+ android:layout_width="match_parent"
|
|
|
+ android:layout_height="60dp"
|
|
|
+ android:orientation="horizontal"
|
|
|
+ android:background="#fff"
|
|
|
+ android:elevation="8dp"
|
|
|
+ android:gravity="center"
|
|
|
+ android:layout_gravity="bottom"
|
|
|
+ android:layout_marginTop="16dp">
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvHome"
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:gravity="center"
|
|
|
+ android:text="首页"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textColor="#888"/>
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvGoal"
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:gravity="center"
|
|
|
+ android:text="学习目标"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textColor="#888"/>
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvHistory"
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:gravity="center"
|
|
|
+ android:text="学习历史"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textColor="#888"/>
|
|
|
+
|
|
|
+ <TextView
|
|
|
+ android:id="@+id/tvProfile"
|
|
|
+ android:layout_width="0dp"
|
|
|
+ android:layout_height="match_parent"
|
|
|
+ android:layout_weight="1"
|
|
|
+ android:gravity="center"
|
|
|
+ android:text="个人中心"
|
|
|
+ android:textSize="16sp"
|
|
|
+ android:textColor="#007AFF"/>
|
|
|
+ </LinearLayout>
|
|
|
+</androidx.coordinatorlayout.widget.CoordinatorLayout>
|