添加任务列表里启用状态颜色标识。设置实时距离文字的绿色与任务列表的绿色协调一致。
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Sat Jan 24 21:01:09 HKT 2026
|
#Tue Mar 17 07:11:43 GMT 2026
|
||||||
stageCount=13
|
stageCount=13
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.12
|
baseVersion=15.12
|
||||||
publishVersion=15.12.12
|
publishVersion=15.12.12
|
||||||
buildCount=0
|
buildCount=6
|
||||||
baseBetaVersion=15.12.13
|
baseBetaVersion=15.12.13
|
||||||
|
|||||||
@@ -331,7 +331,11 @@ public class PositionTaskListView extends LinearLayout {
|
|||||||
String distanceCond = task.isGreaterThan() ? "大于" : "小于";
|
String distanceCond = task.isGreaterThan() ? "大于" : "小于";
|
||||||
simpleHolder.tvSimpleDistanceCond.setText(String.format("条件:距离 %s %d 米", distanceCond, task.getDiscussDistance()));
|
simpleHolder.tvSimpleDistanceCond.setText(String.format("条件:距离 %s %d 米", distanceCond, task.getDiscussDistance()));
|
||||||
// 启用状态
|
// 启用状态
|
||||||
simpleHolder.tvSimpleIsEnable.setText(task.isEnable() ? "状态:已启用" : "状态:已禁用");
|
simpleHolder.tvSimpleIsEnable.setText(task.isEnable() ? "状态:已启用" : "状态:已禁用");
|
||||||
|
// 修改为从colors.xml读取颜色
|
||||||
|
simpleHolder.tvSimpleIsEnable.setTextColor(task.isEnable()
|
||||||
|
? getContext().getResources().getColor(R.color.colorEnableGreen)
|
||||||
|
: getContext().getResources().getColor(R.color.colorGrayText));
|
||||||
// isBingo红点(任务触发时显示,未触发时隐藏)
|
// isBingo红点(任务触发时显示,未触发时隐藏)
|
||||||
simpleHolder.vBingoDot.setVisibility(task.isBingo() ? View.VISIBLE : View.GONE);
|
simpleHolder.vBingoDot.setVisibility(task.isBingo() ? View.VISIBLE : View.GONE);
|
||||||
} else if (holder instanceof TaskContentViewHolder) {
|
} else if (holder instanceof TaskContentViewHolder) {
|
||||||
@@ -380,7 +384,7 @@ public class PositionTaskListView extends LinearLayout {
|
|||||||
// 步骤3:刷新Adapter(局部刷新+范围通知,避免列表错乱)
|
// 步骤3:刷新Adapter(局部刷新+范围通知,避免列表错乱)
|
||||||
notifyItemRemoved(position);
|
notifyItemRemoved(position);
|
||||||
notifyItemRangeChanged(position, mAdapterData.size());
|
notifyItemRangeChanged(position, mAdapterData.size());
|
||||||
|
|
||||||
LogUtils.d(TAG, "Adapter已移除任务,刷新列表(位置索引=" + position + ")");
|
LogUtils.d(TAG, "Adapter已移除任务,刷新列表(位置索引=" + position + ")");
|
||||||
|
|
||||||
// 步骤4:通知外部(如Activity)任务已更新
|
// 步骤4:通知外部(如Activity)任务已更新
|
||||||
@@ -457,7 +461,7 @@ public class PositionTaskListView extends LinearLayout {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private String genSelectedTimeText(long timeMillis) {
|
private String genSelectedTimeText(long timeMillis) {
|
||||||
// 2. 格式化时间字符串(Java 7 用 SimpleDateFormat,需处理 ParseException)
|
// 2. 格式化时间字符串(Java 7 用 SimpleDateFormat,需处理 ParseException)
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault());
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<color name="background_light">#F5F5F5</color> <!-- 浅灰背景(备用,提升页面质感) -->
|
<color name="background_light">#F5F5F5</color> <!-- 浅灰背景(备用,提升页面质感) -->
|
||||||
|
|
||||||
<!-- 扩展颜色(避免后续新增功能时再次缺失) -->
|
<!-- 扩展颜色(避免后续新增功能时再次缺失) -->
|
||||||
<color name="green">#4CAF50</color> <!-- 绿色(备用:如“启用”状态标识) -->
|
<color name="green">#2E8B57</color> <!-- 绿色(备用:如“启用”状态标识) -->
|
||||||
<color name="yellow">#FFC107</color> <!-- 黄色(备用:如“提醒”标识) -->
|
<color name="yellow">#FFC107</color> <!-- 黄色(备用:如“提醒”标识) -->
|
||||||
<color name="color_text_primary">#333333</color>
|
<color name="color_text_primary">#333333</color>
|
||||||
<color name="color_gray">#999999</color>
|
<color name="color_gray">#999999</color>
|
||||||
|
|||||||
Reference in New Issue
Block a user