|
发表于 2024-6-22 14:28:57
|
显示全部楼层
感谢,已经实现了。本以为挺复杂,其实有现成的字段。
在安卓端源码CMSApiJson.kt下的CMSDocumentInfoJson类里加一个名叫hasRead的布尔变量,再改一下copyToTodoListItem方法的输出字符串就解决了。
参考代码,做的比较简单没用图片标记已读未读:
/**
* 文章对象
*/
data class CMSDocumentInfoJson(var id: String = "",
var createTime: String = "",
var updateTime: String = "",
var sequence: String = "",
var title: String = "",
var appId: String = "",
var categoryId: String = "",
var categoryName: String = "",
var categoryAlias: String = "",
var form: String = "",
var formName: String = "",
var creatorPerson: String = "",
var creatorIdentity: String = "",
var creatorDepartment: String = "",
var creatorCompany: String = "",
var docStatus: String = "",
var publishTime: String = "",
var isNewDocument: Boolean = false,
var attachmentList: List<String> = ArrayList(),
var hasRead: Boolean = false
) {
/**
*
*/
fun copyToTodoListItem(): ToDoFragmentListViewItemVO {
val time = if (this.publishTime.length>9) {this.publishTime.substring(0, 10)}else{ this.publishTime}
return if(this.hasRead) {
ToDoFragmentListViewItemVO(this.id,
O2.BUSINESS_TYPE_MESSAGE_CENTER,
this.title,
"【" + this.categoryName + "】",
time)
} else{
ToDoFragmentListViewItemVO(this.id,
O2.BUSINESS_TYPE_MESSAGE_CENTER,
"(未读)"+this.title,
"【" + this.categoryName + "】",
time)
}
} |
|