- kotlin 1.8.20, ksp 1.8.20-1.0.11, koin 3.3.3
- 添付ファイルがない時に空行が増えてたバグの修正
This commit is contained in:
parent
f3ee170dee
commit
1026983132
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="1.8.0" />
|
<option name="version" value="1.8.20" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
|
@ -7,9 +7,8 @@ import java.util.regex.Pattern
|
||||||
plugins {
|
plugins {
|
||||||
id("com.android.application")
|
id("com.android.application")
|
||||||
id("org.jetbrains.kotlin.android")
|
id("org.jetbrains.kotlin.android")
|
||||||
// id("org.jetbrains.kotlin.kapt")
|
|
||||||
id("org.jetbrains.kotlin.plugin.serialization")
|
id("org.jetbrains.kotlin.plugin.serialization")
|
||||||
id("com.google.devtools.ksp").version("1.8.0-1.0.9")
|
id("com.google.devtools.ksp").version("$kspVersion")
|
||||||
id("io.gitlab.arturbosch.detekt")
|
id("io.gitlab.arturbosch.detekt")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,8 @@ class ItemViewHolder(
|
||||||
|
|
||||||
internal lateinit var listAdapter: ItemListAdapter
|
internal lateinit var listAdapter: ItemListAdapter
|
||||||
|
|
||||||
|
val bindBenchmark = Benchmark(log, "Item-bind", 40L)
|
||||||
|
|
||||||
lateinit var llBoosted: View
|
lateinit var llBoosted: View
|
||||||
lateinit var ivBoostAvatar: MyNetworkImageView
|
lateinit var ivBoostAvatar: MyNetworkImageView
|
||||||
lateinit var ivBoosted: ImageView
|
lateinit var ivBoosted: ImageView
|
||||||
|
|
|
@ -46,7 +46,7 @@ fun ItemViewHolder.bind(
|
||||||
bSimpleList: Boolean,
|
bSimpleList: Boolean,
|
||||||
item: TimelineItem,
|
item: TimelineItem,
|
||||||
) {
|
) {
|
||||||
val b = Benchmark(ItemViewHolder.log, "Item-bind", 40L)
|
bindBenchmark.start()
|
||||||
|
|
||||||
this.listAdapter = listAdapter
|
this.listAdapter = listAdapter
|
||||||
this.column = column
|
this.column = column
|
||||||
|
@ -72,6 +72,7 @@ fun ItemViewHolder.bind(
|
||||||
v === tvConversationIconsMore ||
|
v === tvConversationIconsMore ||
|
||||||
v === tvConversationParticipants ||
|
v === tvConversationParticipants ||
|
||||||
v === tvFilterPhrase -> fontBold
|
v === tvFilterPhrase -> fontBold
|
||||||
|
|
||||||
else -> fontNormal
|
else -> fontNormal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,64 +133,66 @@ fun ItemViewHolder.bind(
|
||||||
this.viewRoot.setBackgroundColor(0)
|
this.viewRoot.setBackgroundColor(0)
|
||||||
this.boostedAction = defaultBoostedAction
|
this.boostedAction = defaultBoostedAction
|
||||||
|
|
||||||
llOpenSticker.visibility = View.GONE
|
|
||||||
llBoosted.visibility = View.GONE
|
|
||||||
llReply.visibility = View.GONE
|
|
||||||
llFollow.visibility = View.GONE
|
|
||||||
llStatus.visibility = View.GONE
|
|
||||||
llSearchTag.visibility = View.GONE
|
|
||||||
btnGapHead.visibility = View.GONE
|
btnGapHead.visibility = View.GONE
|
||||||
btnGapTail.visibility = View.GONE
|
btnGapTail.visibility = View.GONE
|
||||||
llList.visibility = View.GONE
|
|
||||||
llFollowRequest.visibility = View.GONE
|
|
||||||
tvMessageHolder.visibility = View.GONE
|
|
||||||
llTrendTag.visibility = View.GONE
|
|
||||||
llFilter.visibility = View.GONE
|
|
||||||
tvMediaDescriptions.forEach { it.visibility = View.GONE }
|
|
||||||
llCardOuter.visibility = View.GONE
|
|
||||||
tvCardText.visibility = View.GONE
|
|
||||||
flCardImage.visibility = View.GONE
|
flCardImage.visibility = View.GONE
|
||||||
|
llBoosted.visibility = View.GONE
|
||||||
|
llCardOuter.visibility = View.GONE
|
||||||
llConversationIcons.visibility = View.GONE
|
llConversationIcons.visibility = View.GONE
|
||||||
|
llFilter.visibility = View.GONE
|
||||||
|
llFollow.visibility = View.GONE
|
||||||
|
llFollowRequest.visibility = View.GONE
|
||||||
|
llList.visibility = View.GONE
|
||||||
|
llOpenSticker.visibility = View.GONE
|
||||||
|
llReply.visibility = View.GONE
|
||||||
|
llSearchTag.visibility = View.GONE
|
||||||
|
llStatus.visibility = View.GONE
|
||||||
|
llTrendTag.visibility = View.GONE
|
||||||
|
tvCardText.visibility = View.GONE
|
||||||
|
tvMediaCount.visibility = View.GONE
|
||||||
|
tvMessageHolder.visibility = View.GONE
|
||||||
|
|
||||||
|
tvMediaDescriptions.forEach { it.visibility = View.GONE }
|
||||||
|
|
||||||
removeExtraView()
|
removeExtraView()
|
||||||
|
|
||||||
var c: Int
|
val colorTextContent = column.getContentColor()
|
||||||
c = column.getContentColor()
|
this.colorTextContent = colorTextContent
|
||||||
this.colorTextContent = c
|
this.contentColorCsl = ColorStateList.valueOf(colorTextContent)
|
||||||
this.contentColorCsl = ColorStateList.valueOf(c)
|
|
||||||
|
|
||||||
tvBoosted.setTextColor(c)
|
tvApplication.setTextColor(colorTextContent)
|
||||||
tvReply.setTextColor(c)
|
tvBoosted.setTextColor(colorTextContent)
|
||||||
tvFollowerName.setTextColor(c)
|
tvCardText.setTextColor(colorTextContent)
|
||||||
tvName.setTextColor(c)
|
tvContent.setTextColor(colorTextContent)
|
||||||
tvMentions.setTextColor(c)
|
tvContentWarning.setTextColor(colorTextContent)
|
||||||
tvContentWarning.setTextColor(c)
|
tvConversationIconsMore.setTextColor(colorTextContent)
|
||||||
tvContent.setTextColor(c)
|
tvConversationParticipants.setTextColor(colorTextContent)
|
||||||
//NSFWは文字色固定 btnShowMedia.setTextColor( c );
|
tvFilterPhrase.setTextColor(colorTextContent)
|
||||||
tvApplication.setTextColor(c)
|
tvFollowerName.setTextColor(colorTextContent)
|
||||||
tvMessageHolder.setTextColor(c)
|
tvMediaCount.setTextColor(colorTextContent)
|
||||||
tvTrendTagName.setTextColor(c)
|
tvMentions.setTextColor(colorTextContent)
|
||||||
tvTrendTagCount.setTextColor(c)
|
tvMessageHolder.setTextColor(colorTextContent)
|
||||||
cvTagHistory.setColor(c)
|
tvName.setTextColor(colorTextContent)
|
||||||
tvFilterPhrase.setTextColor(c)
|
tvReply.setTextColor(colorTextContent)
|
||||||
tvMediaDescriptions.forEach { it.setTextColor(c) }
|
tvTrendTagCount.setTextColor(colorTextContent)
|
||||||
tvCardText.setTextColor(c)
|
tvTrendTagName.setTextColor(colorTextContent)
|
||||||
tvConversationIconsMore.setTextColor(c)
|
|
||||||
tvConversationParticipants.setTextColor(c)
|
|
||||||
|
|
||||||
(llCardOuter.background as? PreviewCardBorder)?.let {
|
tvMediaDescriptions.forEach { it.setTextColor(colorTextContent) }
|
||||||
val rgb = c and 0xffffff
|
cvTagHistory.setColor(colorTextContent)
|
||||||
val alpha = max(1, c ushr (24 + 1)) // 本来の値の半分にする
|
|
||||||
it.color = rgb or (alpha shl 24)
|
|
||||||
}
|
|
||||||
|
|
||||||
c = column.getAcctColor()
|
//NSFWは文字色固定 btnShowMedia.setTextColor( colorTextContent );
|
||||||
this.acctColor = c
|
|
||||||
tvBoostedTime.setTextColor(c)
|
(llCardOuter.background as? PreviewCardBorder)?.color =
|
||||||
tvTime.setTextColor(c)
|
colorPreviewCardBorder(colorTextContent)
|
||||||
tvTrendTagDesc.setTextColor(c)
|
|
||||||
tvFilterDetail.setTextColor(c)
|
val colorTextAcct = column.getAcctColor()
|
||||||
tvFilterPhrase.setTextColor(c)
|
this.acctColor = colorTextAcct
|
||||||
|
|
||||||
|
tvBoostedTime.setTextColor(colorTextAcct)
|
||||||
|
tvFilterDetail.setTextColor(colorTextAcct)
|
||||||
|
tvFilterPhrase.setTextColor(colorTextAcct)
|
||||||
|
tvTime.setTextColor(colorTextAcct)
|
||||||
|
tvTrendTagDesc.setTextColor(colorTextAcct)
|
||||||
|
|
||||||
// 以下のビューの文字色はsetAcct() で設定される
|
// 以下のビューの文字色はsetAcct() で設定される
|
||||||
// tvBoostedAcct.setTextColor(c)
|
// tvBoostedAcct.setTextColor(c)
|
||||||
|
@ -239,9 +242,17 @@ fun ItemViewHolder.bind(
|
||||||
showStatusOrReply(item.last_status)
|
showStatusOrReply(item.last_status)
|
||||||
showConversationIcons(item)
|
showConversationIcons(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
is TootScheduled -> showScheduled(item)
|
is TootScheduled -> showScheduled(item)
|
||||||
}
|
}
|
||||||
b.report()
|
bindBenchmark.report()
|
||||||
|
}
|
||||||
|
|
||||||
|
// プレビューカードの枠の色はテキストより薄め
|
||||||
|
private fun colorPreviewCardBorder(src: Int): Int {
|
||||||
|
val rgb = src and 0xffffff
|
||||||
|
val alpha = max(1, src ushr (24 + 1)) // 本来の値の半分にする
|
||||||
|
return rgb or (alpha shl 24)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ItemViewHolder.removeExtraView() {
|
fun ItemViewHolder.removeExtraView() {
|
||||||
|
@ -428,6 +439,7 @@ fun ItemViewHolder.showSearchTag(tag: TootTag) {
|
||||||
tvTrendTagName.text = tag.url?.ellipsizeDot3(256)
|
tvTrendTagName.text = tag.url?.ellipsizeDot3(256)
|
||||||
tvTrendTagDesc.text = tag.name + "\n" + tag.description
|
tvTrendTagDesc.text = tag.name + "\n" + tag.description
|
||||||
}
|
}
|
||||||
|
|
||||||
TootTag.TagType.Tag -> {
|
TootTag.TagType.Tag -> {
|
||||||
tvTrendTagName.text = "#${tag.name.ellipsizeDot3(256)}"
|
tvTrendTagName.text = "#${tag.name.ellipsizeDot3(256)}"
|
||||||
tvTrendTagDesc.text = listOf(
|
tvTrendTagDesc.text = listOf(
|
||||||
|
@ -703,6 +715,7 @@ val Column.canRelativeTime
|
||||||
ColumnType.CONVERSATION_WITH_REFERENCE,
|
ColumnType.CONVERSATION_WITH_REFERENCE,
|
||||||
ColumnType.STATUS_HISTORY,
|
ColumnType.STATUS_HISTORY,
|
||||||
-> false
|
-> false
|
||||||
|
|
||||||
else -> true
|
else -> true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,14 @@ class Benchmark(
|
||||||
val caption: String,
|
val caption: String,
|
||||||
private val minMs: Long = 33L,
|
private val minMs: Long = 33L,
|
||||||
) {
|
) {
|
||||||
private val timeStart = SystemClock.elapsedRealtime()
|
private var timeStart = SystemClock.elapsedRealtime()
|
||||||
|
|
||||||
fun report() {
|
fun report() {
|
||||||
val duration = SystemClock.elapsedRealtime() - timeStart
|
val duration = SystemClock.elapsedRealtime() - timeStart
|
||||||
if (duration >= minMs) log.d("$caption ${duration}ms")
|
if (duration >= minMs) log.d("$caption ${duration}ms")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun start() {
|
||||||
|
timeStart = SystemClock.elapsedRealtime()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,12 @@ buildscript {
|
||||||
ext.javaSourceCompatibility = JavaVersion.VERSION_1_8
|
ext.javaSourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
ext.javaTargetCompatibility = JavaVersion.VERSION_1_8
|
ext.javaTargetCompatibility = JavaVersion.VERSION_1_8
|
||||||
ext.junitVersion = "4.13.2"
|
ext.junitVersion = "4.13.2"
|
||||||
ext.koinVersion = "3.1.3"
|
ext.koinVersion = "3.3.3"
|
||||||
ext.kotlinJvmToolchain = 17
|
ext.kotlinJvmToolchain = 17
|
||||||
ext.kotlinJvmTarget = "1.8"
|
ext.kotlinJvmTarget = "1.8"
|
||||||
ext.kotlinVersion = "1.8.0"
|
ext.kotlinVersion = "1.8.20"
|
||||||
ext.kotlinxCoroutinesVersion = "1.6.4"
|
ext.kotlinxCoroutinesVersion = "1.6.4"
|
||||||
|
ext.kspVersion = "1.8.20-1.0.11"
|
||||||
ext.materialVersion = "1.8.0"
|
ext.materialVersion = "1.8.0"
|
||||||
ext.okhttpVersion = "4.10.0"
|
ext.okhttpVersion = "4.10.0"
|
||||||
ext.preferenceVersion = "1.2.0"
|
ext.preferenceVersion = "1.2.0"
|
||||||
|
|
Loading…
Reference in New Issue