- 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"?>
|
||||
<project version="4">
|
||||
<component name="KotlinJpsPluginSettings">
|
||||
<option name="version" value="1.8.0" />
|
||||
<option name="version" value="1.8.20" />
|
||||
</component>
|
||||
</project>
|
|
@ -7,9 +7,8 @@ import java.util.regex.Pattern
|
|||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
// id("org.jetbrains.kotlin.kapt")
|
||||
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")
|
||||
}
|
||||
|
||||
|
|
|
@ -89,6 +89,8 @@ class ItemViewHolder(
|
|||
|
||||
internal lateinit var listAdapter: ItemListAdapter
|
||||
|
||||
val bindBenchmark = Benchmark(log, "Item-bind", 40L)
|
||||
|
||||
lateinit var llBoosted: View
|
||||
lateinit var ivBoostAvatar: MyNetworkImageView
|
||||
lateinit var ivBoosted: ImageView
|
||||
|
|
|
@ -46,7 +46,7 @@ fun ItemViewHolder.bind(
|
|||
bSimpleList: Boolean,
|
||||
item: TimelineItem,
|
||||
) {
|
||||
val b = Benchmark(ItemViewHolder.log, "Item-bind", 40L)
|
||||
bindBenchmark.start()
|
||||
|
||||
this.listAdapter = listAdapter
|
||||
this.column = column
|
||||
|
@ -72,6 +72,7 @@ fun ItemViewHolder.bind(
|
|||
v === tvConversationIconsMore ||
|
||||
v === tvConversationParticipants ||
|
||||
v === tvFilterPhrase -> fontBold
|
||||
|
||||
else -> fontNormal
|
||||
}
|
||||
}
|
||||
|
@ -132,64 +133,66 @@ fun ItemViewHolder.bind(
|
|||
this.viewRoot.setBackgroundColor(0)
|
||||
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
|
||||
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
|
||||
llBoosted.visibility = View.GONE
|
||||
llCardOuter.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()
|
||||
|
||||
var c: Int
|
||||
c = column.getContentColor()
|
||||
this.colorTextContent = c
|
||||
this.contentColorCsl = ColorStateList.valueOf(c)
|
||||
val colorTextContent = column.getContentColor()
|
||||
this.colorTextContent = colorTextContent
|
||||
this.contentColorCsl = ColorStateList.valueOf(colorTextContent)
|
||||
|
||||
tvBoosted.setTextColor(c)
|
||||
tvReply.setTextColor(c)
|
||||
tvFollowerName.setTextColor(c)
|
||||
tvName.setTextColor(c)
|
||||
tvMentions.setTextColor(c)
|
||||
tvContentWarning.setTextColor(c)
|
||||
tvContent.setTextColor(c)
|
||||
//NSFWは文字色固定 btnShowMedia.setTextColor( c );
|
||||
tvApplication.setTextColor(c)
|
||||
tvMessageHolder.setTextColor(c)
|
||||
tvTrendTagName.setTextColor(c)
|
||||
tvTrendTagCount.setTextColor(c)
|
||||
cvTagHistory.setColor(c)
|
||||
tvFilterPhrase.setTextColor(c)
|
||||
tvMediaDescriptions.forEach { it.setTextColor(c) }
|
||||
tvCardText.setTextColor(c)
|
||||
tvConversationIconsMore.setTextColor(c)
|
||||
tvConversationParticipants.setTextColor(c)
|
||||
tvApplication.setTextColor(colorTextContent)
|
||||
tvBoosted.setTextColor(colorTextContent)
|
||||
tvCardText.setTextColor(colorTextContent)
|
||||
tvContent.setTextColor(colorTextContent)
|
||||
tvContentWarning.setTextColor(colorTextContent)
|
||||
tvConversationIconsMore.setTextColor(colorTextContent)
|
||||
tvConversationParticipants.setTextColor(colorTextContent)
|
||||
tvFilterPhrase.setTextColor(colorTextContent)
|
||||
tvFollowerName.setTextColor(colorTextContent)
|
||||
tvMediaCount.setTextColor(colorTextContent)
|
||||
tvMentions.setTextColor(colorTextContent)
|
||||
tvMessageHolder.setTextColor(colorTextContent)
|
||||
tvName.setTextColor(colorTextContent)
|
||||
tvReply.setTextColor(colorTextContent)
|
||||
tvTrendTagCount.setTextColor(colorTextContent)
|
||||
tvTrendTagName.setTextColor(colorTextContent)
|
||||
|
||||
(llCardOuter.background as? PreviewCardBorder)?.let {
|
||||
val rgb = c and 0xffffff
|
||||
val alpha = max(1, c ushr (24 + 1)) // 本来の値の半分にする
|
||||
it.color = rgb or (alpha shl 24)
|
||||
}
|
||||
tvMediaDescriptions.forEach { it.setTextColor(colorTextContent) }
|
||||
cvTagHistory.setColor(colorTextContent)
|
||||
|
||||
c = column.getAcctColor()
|
||||
this.acctColor = c
|
||||
tvBoostedTime.setTextColor(c)
|
||||
tvTime.setTextColor(c)
|
||||
tvTrendTagDesc.setTextColor(c)
|
||||
tvFilterDetail.setTextColor(c)
|
||||
tvFilterPhrase.setTextColor(c)
|
||||
//NSFWは文字色固定 btnShowMedia.setTextColor( colorTextContent );
|
||||
|
||||
(llCardOuter.background as? PreviewCardBorder)?.color =
|
||||
colorPreviewCardBorder(colorTextContent)
|
||||
|
||||
val colorTextAcct = column.getAcctColor()
|
||||
this.acctColor = colorTextAcct
|
||||
|
||||
tvBoostedTime.setTextColor(colorTextAcct)
|
||||
tvFilterDetail.setTextColor(colorTextAcct)
|
||||
tvFilterPhrase.setTextColor(colorTextAcct)
|
||||
tvTime.setTextColor(colorTextAcct)
|
||||
tvTrendTagDesc.setTextColor(colorTextAcct)
|
||||
|
||||
// 以下のビューの文字色はsetAcct() で設定される
|
||||
// tvBoostedAcct.setTextColor(c)
|
||||
|
@ -239,9 +242,17 @@ fun ItemViewHolder.bind(
|
|||
showStatusOrReply(item.last_status)
|
||||
showConversationIcons(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() {
|
||||
|
@ -428,6 +439,7 @@ fun ItemViewHolder.showSearchTag(tag: TootTag) {
|
|||
tvTrendTagName.text = tag.url?.ellipsizeDot3(256)
|
||||
tvTrendTagDesc.text = tag.name + "\n" + tag.description
|
||||
}
|
||||
|
||||
TootTag.TagType.Tag -> {
|
||||
tvTrendTagName.text = "#${tag.name.ellipsizeDot3(256)}"
|
||||
tvTrendTagDesc.text = listOf(
|
||||
|
@ -703,6 +715,7 @@ val Column.canRelativeTime
|
|||
ColumnType.CONVERSATION_WITH_REFERENCE,
|
||||
ColumnType.STATUS_HISTORY,
|
||||
-> false
|
||||
|
||||
else -> true
|
||||
}
|
||||
|
||||
|
|
|
@ -24,10 +24,14 @@ class Benchmark(
|
|||
val caption: String,
|
||||
private val minMs: Long = 33L,
|
||||
) {
|
||||
private val timeStart = SystemClock.elapsedRealtime()
|
||||
private var timeStart = SystemClock.elapsedRealtime()
|
||||
|
||||
fun report() {
|
||||
val duration = SystemClock.elapsedRealtime() - timeStart
|
||||
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.javaTargetCompatibility = JavaVersion.VERSION_1_8
|
||||
ext.junitVersion = "4.13.2"
|
||||
ext.koinVersion = "3.1.3"
|
||||
ext.koinVersion = "3.3.3"
|
||||
ext.kotlinJvmToolchain = 17
|
||||
ext.kotlinJvmTarget = "1.8"
|
||||
ext.kotlinVersion = "1.8.0"
|
||||
ext.kotlinVersion = "1.8.20"
|
||||
ext.kotlinxCoroutinesVersion = "1.6.4"
|
||||
ext.kspVersion = "1.8.20-1.0.11"
|
||||
ext.materialVersion = "1.8.0"
|
||||
ext.okhttpVersion = "4.10.0"
|
||||
ext.preferenceVersion = "1.2.0"
|
||||
|
|
Loading…
Reference in New Issue