Fix compile errors

pull/1266/head
Alex Baker 5 years ago
parent 97c1d83968
commit 5048a8d580

@ -46,13 +46,15 @@ class Filter {
val valuesAsMap: Map<String, Any>?
get() = if (Strings.isNullOrEmpty(values)) null else AndroidUtilities.mapFromSerializedString(values)
fun getColor(): Int = color ?: 0
@Suppress("RedundantNullableReturnType")
fun getColor(): Int? = color ?: 0
fun setColor(color: Int?) {
this.color = color
}
fun getIcon(): Int = icon ?: FILTER
@Suppress("RedundantNullableReturnType")
fun getIcon(): Int? = icon ?: FILTER
fun setIcon(icon: Int?) {
this.icon = icon

@ -52,13 +52,15 @@ class GoogleTaskList : Parcelable {
icon = parcel.readInt()
}
fun getColor(): Int = color ?: 0
@Suppress("RedundantNullableReturnType")
fun getColor(): Int? = color ?: 0
fun setColor(color: Int?) {
this.color = color
}
fun getIcon(): Int = icon ?: LIST
@Suppress("RedundantNullableReturnType")
fun getIcon(): Int? = icon ?: LIST
fun setIcon(icon: Int?) {
this.icon = icon
@ -74,8 +76,8 @@ class GoogleTaskList : Parcelable {
writeString(title)
writeInt(order)
writeLong(lastSync)
writeInt(getColor())
writeInt(getIcon())
writeInt(getColor()!!)
writeInt(getIcon()!!)
}
}

@ -66,13 +66,15 @@ class TagData : Parcelable {
}
}
fun getColor(): Int = color ?: 0
@Suppress("RedundantNullableReturnType")
fun getColor(): Int? = color ?: 0
fun setColor(color: Int?) {
this.color = color
}
fun getIcon(): Int = icon ?: LABEL
@Suppress("RedundantNullableReturnType")
fun getIcon(): Int? = icon ?: LABEL
fun setIcon(icon: Int?) {
this.icon = icon
@ -87,7 +89,7 @@ class TagData : Parcelable {
writeString(name)
writeInt(color!!)
writeString(tagOrdering)
writeInt(getIcon())
writeInt(getIcon()!!)
writeInt(order)
}
}

@ -35,7 +35,7 @@ internal class TagRecyclerAdapter(
private fun getColor(tagData: TagData): Int {
if (tagData.getColor() != 0) {
val themeColor = colorProvider.getThemeColor(tagData.getColor(), true)
val themeColor = colorProvider.getThemeColor(tagData.getColor()!!, true)
if (inventory.purchasedThemes() || themeColor.isFree) {
return themeColor.primaryColor
}
@ -44,7 +44,7 @@ internal class TagRecyclerAdapter(
}
private fun getIcon(tagData: TagData): Int? =
if (tagData.getIcon() < 1000 || inventory.hasPro) getIconResId(tagData.getIcon()) else null
tagData.getIcon()?.takeIf { it < 1000 || inventory.hasPro }?.let { getIconResId(it) }
fun submitList(tagData: List<TagData>?) {
differ.submitList(tagData)

Loading…
Cancel
Save