Files
FocusBox/src/main/res/layout/fragment_stats.xml

292 lines
12 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="16dp"
android:paddingBottom="8dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/stats_title"
style="@style/T.Title" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:clipToPadding="false"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingBottom="22dp">
<!-- 今日 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/bg_card"
android:padding="16dp">
<FrameLayout
android:layout_width="92dp"
android:layout_height="92dp">
<com.focusbox.app.widget.RingView
android:id="@+id/todayRing"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="2dp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:gravity="center">
<TextView
android:id="@+id/tvGoalPct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0%"
android:textSize="19sp"
android:textStyle="bold"
android:textColor="@color/title" />
<TextView
android:id="@+id/tvGoalHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:text="@string/today"
style="@style/T.Caption" />
</LinearLayout>
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="18dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/focus_minutes"
style="@style/T.Meta" />
<TextView
android:id="@+id/tvTodayMinutes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0 分钟"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/title" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/pomodoro_count"
style="@style/T.Meta" />
<TextView
android:id="@+id/tvTodayPomo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/title" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/completed_tasks"
style="@style/T.Meta" />
<TextView
android:id="@+id/tvTodayDone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/title" />
</LinearLayout>
<TextView
android:id="@+id/tvStreak"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
style="@style/T.Caption" />
</LinearLayout>
</LinearLayout>
<!-- 趋势 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:background="@drawable/bg_card"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/trend_title"
style="@style/T.Section" />
<TextView
android:id="@+id/tvTrendTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/T.Caption" />
</LinearLayout>
<com.focusbox.app.widget.BarChartView
android:id="@+id/barChart"
android:layout_width="match_parent"
android:layout_height="148dp"
android:layout_marginTop="10dp" />
</LinearLayout>
<!-- 热力图 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:background="@drawable/bg_card"
android:padding="16dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/heatmap_title"
style="@style/T.Section" />
<TextView
android:id="@+id/tvHeatHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/T.Caption" />
</LinearLayout>
<com.focusbox.app.widget.HeatmapView
android:id="@+id/heatmap"
android:layout_width="match_parent"
android:layout_height="112dp"
android:layout_marginTop="8dp" />
<LinearLayout
android:id="@+id/heatLegend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="8dp"
android:orientation="horizontal"
android:gravity="center_vertical" />
</LinearLayout>
<!-- 项目分布:自带 日/周/月/年 与左右翻页 -->
<com.focusbox.app.ui.stats.PeriodDistributionCard
android:id="@+id/cardProject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
<!-- 任务分布 -->
<com.focusbox.app.ui.stats.PeriodDistributionCard
android:id="@+id/cardTask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp" />
<!-- 累计 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:background="@drawable/bg_card"
android:padding="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/summary_title"
style="@style/T.Section" />
<LinearLayout
android:id="@+id/summaryGrid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>