Refactor "trending hashtags" code (#3595)
- Fix codeformatting - Add new refreshing state - Disable LogConditional lint rule - Update lint-baseline
This commit is contained in:
parent
071e00774e
commit
f23c0cc634
13 changed files with 335 additions and 480 deletions
|
|
@ -15,9 +15,6 @@
|
|||
|
||||
package com.keylesspalace.tusky.viewdata
|
||||
|
||||
import com.keylesspalace.tusky.entity.TrendingTag
|
||||
import com.keylesspalace.tusky.entity.end
|
||||
import com.keylesspalace.tusky.entity.start
|
||||
import java.util.Date
|
||||
|
||||
sealed class TrendingViewData {
|
||||
|
|
@ -31,18 +28,13 @@ sealed class TrendingViewData {
|
|||
get() = start.toString() + end.toString()
|
||||
}
|
||||
|
||||
fun asHeaderOrNull(): Header? {
|
||||
val tag = (this as? Tag)?.tag
|
||||
?: return null
|
||||
return Header(tag.start(), tag.end())
|
||||
}
|
||||
|
||||
data class Tag(
|
||||
val tag: TrendingTag
|
||||
val name: String,
|
||||
val usage: List<Long>,
|
||||
val accounts: List<Long>,
|
||||
val maxTrendingValue: Long
|
||||
) : TrendingViewData() {
|
||||
override val id: String
|
||||
get() = tag.name
|
||||
get() = name
|
||||
}
|
||||
|
||||
fun asTagOrNull() = this as? Tag
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue