showBoost部分の絵文字サイズを調整
This commit is contained in:
parent
aefcc7c798
commit
c39f230182
|
@ -186,6 +186,8 @@ open class TootAccount(
|
|||
emojiMapProfile = profile_emojis,
|
||||
emojiMapCustom = custom_emojis,
|
||||
authorDomain = this,
|
||||
enlargeCustomEmoji = emojiScaleUserName,
|
||||
enlargeEmoji = emojiScaleUserName,
|
||||
).decodeEmoji(sv)
|
||||
}
|
||||
|
||||
|
@ -284,6 +286,8 @@ open class TootAccount(
|
|||
unwrapEmojiImageTag = true,
|
||||
authorDomain = this,
|
||||
emojiSizeMode = accessInfo.emojiSizeMode(),
|
||||
enlargeCustomEmoji = emojiScaleUserName,
|
||||
enlargeEmoji = emojiScaleUserName,
|
||||
).decodeHTML(note)
|
||||
.replaceAllEx(reNoteLineFeed, " ")
|
||||
.trimEx()
|
||||
|
|
|
@ -25,9 +25,9 @@ import jp.juggler.subwaytooter.drawable.PreviewCardBorder
|
|||
import jp.juggler.subwaytooter.pref.PrefB
|
||||
import jp.juggler.subwaytooter.pref.PrefI
|
||||
import jp.juggler.subwaytooter.span.MyClickableSpan
|
||||
import jp.juggler.subwaytooter.util.emojiSizeMode
|
||||
import jp.juggler.subwaytooter.table.*
|
||||
import jp.juggler.subwaytooter.util.DecodeOptions
|
||||
import jp.juggler.subwaytooter.util.emojiSizeMode
|
||||
import jp.juggler.subwaytooter.view.MyNetworkImageView
|
||||
import jp.juggler.util.*
|
||||
import jp.juggler.util.data.*
|
||||
|
@ -349,7 +349,7 @@ fun ItemViewHolder.showBoost(
|
|||
setAcct(tvBoostedAcct, accessInfo, who)
|
||||
|
||||
// フォローの場合 decoded_display_name が2箇所で表示に使われるのを避ける必要がある
|
||||
if (reaction != null) {
|
||||
boostInvalidator.text = if (reaction != null) {
|
||||
val options = DecodeOptions(
|
||||
activity,
|
||||
accessInfo,
|
||||
|
@ -358,17 +358,16 @@ fun ItemViewHolder.showBoost(
|
|||
enlargeCustomEmoji = DecodeOptions.emojiScaleReaction,
|
||||
emojiSizeMode = accessInfo.emojiSizeMode(),
|
||||
)
|
||||
val ssb = reaction.toSpannableStringBuilder(options, boostStatus)
|
||||
ssb.append(" ")
|
||||
ssb.append(
|
||||
who.decodeDisplayNameCached(activity)
|
||||
.intoStringResource(activity, stringId)
|
||||
)
|
||||
boostInvalidator.text = ssb
|
||||
reaction.toSpannableStringBuilder(options, boostStatus).apply {
|
||||
append(" ")
|
||||
append(
|
||||
who.decodeDisplayNameCached(activity)
|
||||
.intoStringResource(activity, stringId)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
boostInvalidator.text =
|
||||
who.decodeDisplayNameCached(activity)
|
||||
.intoStringResource(activity, stringId)
|
||||
who.decodeDisplayNameCached(activity)
|
||||
.intoStringResource(activity, stringId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -166,10 +166,10 @@ class NetworkEmojiSpan constructor(
|
|||
val clipWidth = clipBounds.width()
|
||||
// 最後にgetSizeで返した幅と異なるか、現在のTextViewのClip幅より大きいなら
|
||||
// 再レイアウトを要求する
|
||||
if (emojiImageRect.emojiWidth != lastMeasuredWidth ){
|
||||
if (emojiImageRect.emojiWidth != lastMeasuredWidth) {
|
||||
log.i("requestLayout by width changed")
|
||||
invalidateCallback.requestLayout()
|
||||
}else if(emojiImageRect.emojiWidth > clipWidth) {
|
||||
} else if (emojiImageRect.emojiWidth > clipWidth) {
|
||||
log.i("requestLayout by clipWidth ${emojiImageRect.emojiWidth}/${clipWidth}")
|
||||
invalidateCallback.requestLayout()
|
||||
}
|
||||
|
@ -253,4 +253,8 @@ class NetworkEmojiSpan constructor(
|
|||
canvas.restore()
|
||||
}
|
||||
}
|
||||
|
||||
fun setScale(s: Float) {
|
||||
emojiImageRect.scale = s
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ fun SavedAccount?.emojiSizeMode(): EmojiSizeMode =
|
|||
*/
|
||||
class EmojiImageRect(
|
||||
private val sizeMode: EmojiSizeMode,
|
||||
val scale: Float = 1f,
|
||||
var scale: Float = 1f,
|
||||
val scaleRatio: Float = 1f,
|
||||
val descentRatio: Float = 0f,
|
||||
val maxEmojiWidth: Float,
|
||||
|
|
Loading…
Reference in New Issue