v0.3.0:今日筛选含逾期与今日完成、统计今日区间、重复任务自动滚动、通知自定义布局
This commit is contained in:
@@ -29,12 +29,23 @@
|
||||
android:background="@drawable/bg_segment_track"
|
||||
android:padding="3dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/segToday"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/range_today"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/segWeek"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/range_week"
|
||||
@@ -44,8 +55,8 @@
|
||||
android:id="@+id/segMonth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/range_month"
|
||||
@@ -55,8 +66,8 @@
|
||||
android:id="@+id/segAll"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/range_all"
|
||||
|
||||
68
src/main/res/layout/notif_timer.xml
Normal file
68
src/main/res/layout/notif_timer.xml
Normal file
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
常驻计时通知的自定义布局(RemoteViews)。
|
||||
|
||||
为什么不用系统模板:模板第一行固定是应用名,无法替换成任务名;
|
||||
这里自己排两行 —— 第一行任务名,第二行系统 Chronometer 走时。
|
||||
Chronometer 由 SystemUI 渲染,锁屏与息屏下照常走字,不受应用进程被限流的影响。
|
||||
|
||||
注意:RemoteViews 只支持有限控件(LinearLayout / TextView / Chronometer / ImageButton 等),
|
||||
高度压到 64dp 以内,避免在折叠态被系统裁切。
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="64dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="6dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNotifTask"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="?android:attr/textColorPrimary" />
|
||||
|
||||
<Chronometer
|
||||
android:id="@+id/notifChrono"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="13sp"
|
||||
android:textColor="?android:attr/textColorSecondary" />
|
||||
</LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/notifPause"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:padding="10dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_pause"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:contentDescription="@string/notif_action_pause" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/notifStop"
|
||||
android:layout_width="44dp"
|
||||
android:layout_height="44dp"
|
||||
android:padding="10dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/ic_stop"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:contentDescription="@string/notif_action_stop" />
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user