导入 v0.1.0 / v0.2.0 源码:五模块首版、交互重构、重复任务、任务分布

- 源码镜像 src/main(81 个文件):首页双模式、任务、项目、统计、设置
- 补齐 README / LICENSE / CHANGELOG / CONTRIBUTING / .gitignore
- 不含构建配置、签名材料、编译产物与备份数据
This commit is contained in:
XIGE
2026-11-28 00:25:22 +08:00
parent f87c29f232
commit d52deeff5e
85 changed files with 6215 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
<?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"
android:background="@color/bg">
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divider" />
<LinearLayout
android:id="@+id/navBar"
android:layout_width="match_parent"
android:layout_height="58dp"
android:orientation="horizontal"
android:background="@color/surface"
android:paddingStart="6dp"
android:paddingEnd="6dp" />
</LinearLayout>

View File

@@ -0,0 +1,225 @@
<?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"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="16dp"
android:paddingBottom="14dp">
<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/nav_focus"
style="@style/T.Title" />
<LinearLayout
android:id="@+id/modeSwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/bg_segment_track"
android:padding="3dp">
<TextView
android:id="@+id/segFocus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:text="@string/mode_focus"
android:textSize="13sp" />
<TextView
android:id="@+id/segBreak"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:text="@string/mode_break"
android:textSize="13sp" />
</LinearLayout>
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:minHeight="6dp" />
<!-- 整块可触摸:纵向拖动调时长,横向滑动切换倒计时/正计时 -->
<FrameLayout
android:id="@+id/dialWrap"
android:layout_width="268dp"
android:layout_height="268dp"
android:layout_gravity="center_horizontal">
<com.focusbox.app.widget.RingView
android:id="@+id/ring"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="2dp"
android:paddingEnd="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/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="25:00"
style="@style/T.Timer" />
<TextView
android:id="@+id/tvModeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="@string/count_down"
style="@style/T.Caption" />
<LinearLayout
android:id="@+id/dots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
</LinearLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/pageDots"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:orientation="horizontal"
android:gravity="center_vertical" />
<TextView
android:id="@+id/tvDialHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:text="@string/dial_hint"
style="@style/T.Caption" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:id="@+id/btnReset"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_icon_btn"
android:padding="14dp"
android:src="@drawable/ic_refresh"
android:contentDescription="@string/reset" />
<TextView
android:id="@+id/btnMain"
android:layout_width="0dp"
android:layout_height="54dp"
android:layout_weight="1"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@drawable/bg_btn_primary"
android:gravity="center"
android:text="@string/start"
android:textColor="@color/on_brand"
android:textSize="16sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/btnSkip"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/bg_icon_btn"
android:padding="14dp"
android:src="@drawable/ic_skip"
android:contentDescription="@string/skip" />
</LinearLayout>
<Space
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:minHeight="10dp" />
<LinearLayout
android:id="@+id/taskCard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_card"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:paddingTop="12dp"
android:paddingBottom="12dp">
<View
android:id="@+id/taskDot"
android:layout_width="9dp"
android:layout_height="9dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/tvTask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/no_task"
android:textSize="14sp"
android:textColor="@color/text"
android:maxLines="1"
android:ellipsize="end" />
<TextView
android:id="@+id/tvTaskMeta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/current_task"
style="@style/T.Caption" />
</LinearLayout>
<TextView
android:id="@+id/tvTaskAction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="10dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:text="@string/pick_task"
android:textSize="13sp"
android:textColor="@color/brand" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,87 @@
<?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="14dp"
android:paddingTop="16dp"
android:paddingBottom="6dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/projects_title"
style="@style/T.Title" />
<TextView
android:id="@+id/tvSummary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
style="@style/T.Meta" />
</LinearLayout>
<TextView
android:id="@+id/btnArchived"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:layout_marginEnd="8dp"
android:background="@drawable/bg_chip_off"
android:text="@string/show_archived"
android:textSize="12sp"
android:textColor="@color/text_secondary" />
<ImageView
android:id="@+id/btnAdd"
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/bg_icon_btn"
android:padding="10dp"
android:src="@drawable/ic_plus"
android:contentDescription="@string/add_project" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="10dp"
android:paddingBottom="18dp"
android:scrollbars="none" />
<TextView
android:id="@+id/tvEmpty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:lineSpacingExtra="6dp"
android:text="@string/empty_projects"
android:textColor="@color/text_tertiary"
android:textSize="14sp"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,33 @@
<?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">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="16dp"
android:paddingBottom="8dp"
android:text="@string/settings_title"
style="@style/T.Title" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbars="none"
android:clipToPadding="false">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingBottom="24dp" />
</ScrollView>
</LinearLayout>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,88 @@
<?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="14dp"
android:paddingTop="16dp"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/tasks_title"
style="@style/T.Title" />
<TextView
android:id="@+id/tvCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
style="@style/T.Meta" />
</LinearLayout>
<ImageView
android:id="@+id/btnAdd"
android:layout_width="42dp"
android:layout_height="42dp"
android:background="@drawable/bg_icon_btn"
android:padding="10dp"
android:src="@drawable/ic_plus"
android:contentDescription="@string/add_task" />
</LinearLayout>
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:clipToPadding="false"
android:scrollbars="none">
<LinearLayout
android:id="@+id/chipRow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" />
</HorizontalScrollView>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="8dp"
android:paddingBottom="18dp"
android:scrollbars="none" />
<TextView
android:id="@+id/tvEmpty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:lineSpacingExtra="6dp"
android:text="@string/empty_tasks"
android:textColor="@color/text_tertiary"
android:textSize="14sp"
android:visibility="gone" />
</FrameLayout>
</LinearLayout>

View File

@@ -0,0 +1,19 @@
<?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="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:background="?attr/selectableItemBackground"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="16dp"
android:paddingBottom="12dp">
<TextView
android:id="@+id/tvFooter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12sp"
android:textColor="@color/text_tertiary" />
</LinearLayout>

View File

@@ -0,0 +1,66 @@
<?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="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="@drawable/bg_card"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:paddingStart="14dp"
android:paddingEnd="8dp"
android:paddingTop="14dp"
android:paddingBottom="14dp">
<View
android:id="@+id/colorBar"
android:layout_width="4dp"
android:layout_height="38dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="12dp"
android:orientation="vertical">
<TextView
android:id="@+id/tvName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:textStyle="bold"
android:textColor="@color/text"
android:maxLines="1"
android:ellipsize="end" />
<TextView
android:id="@+id/tvMeta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:maxLines="1"
android:ellipsize="end"
style="@style/T.Caption" />
<ProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="4dp"
android:layout_marginTop="9dp"
android:max="100"
android:progressDrawable="@drawable/progress_line" />
</LinearLayout>
<ImageView
android:id="@+id/btnMore"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginStart="6dp"
android:padding="9dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_more"
android:contentDescription="@string/edit" />
</LinearLayout>

View File

@@ -0,0 +1,78 @@
<?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="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:background="?attr/selectableItemBackground"
android:paddingStart="20dp"
android:paddingEnd="12dp"
android:paddingTop="11dp"
android:paddingBottom="11dp">
<FrameLayout
android:id="@+id/checkWrap"
android:layout_width="30dp"
android:layout_height="30dp">
<View
android:id="@+id/checkCircle"
android:layout_width="21dp"
android:layout_height="21dp"
android:layout_gravity="center" />
<ImageView
android:id="@+id/checkMark"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_gravity="center"
android:src="@drawable/ic_check"
android:visibility="invisible" />
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:textColor="@color/text"
android:maxLines="2"
android:ellipsize="end" />
<TextView
android:id="@+id/tvMeta"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:maxLines="2"
android:ellipsize="end"
style="@style/T.Caption" />
<TextView
android:id="@+id/tvNote"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:maxLines="2"
android:ellipsize="end"
android:textColor="@color/text_secondary"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<ImageView
android:id="@+id/btnPlay"
android:layout_width="34dp"
android:layout_height="34dp"
android:padding="8dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_play"
android:contentDescription="@string/start" />
</LinearLayout>

View File

@@ -0,0 +1,96 @@
<?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="wrap_content"
android:orientation="vertical"
android:background="@drawable/bg_sheet">
<View
android:layout_width="36dp"
android:layout_height="4dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@color/divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:paddingTop="14dp"
android:paddingBottom="22dp">
<TextView
android:id="@+id/sheetTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_project"
style="@style/T.Title" />
<EditText
android:id="@+id/etName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:background="@drawable/bg_field"
android:paddingStart="14dp"
android:paddingEnd="14dp"
android:paddingTop="13dp"
android:paddingBottom="13dp"
android:hint="@string/project_name_hint"
android:textColor="@color/text"
android:textColorHint="@color/text_tertiary"
android:textSize="15sp"
android:inputType="text"
android:maxLines="1" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:text="@string/project_color"
style="@style/T.Section" />
<LinearLayout
android:id="@+id/colorRow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:id="@+id/btnDelete"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:background="@drawable/bg_btn_ghost"
android:gravity="center"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/delete"
android:textSize="14sp"
android:textColor="@color/danger"
android:visibility="gone" />
<TextView
android:id="@+id/btnSave"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:layout_marginStart="10dp"
android:background="@drawable/bg_btn_primary"
android:gravity="center"
android:text="@string/save"
android:textSize="16sp"
android:textStyle="bold"
android:textColor="@color/on_brand" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

File diff suppressed because it is too large Load Diff