フィルタされた投稿のユーザ名を表示する設定

This commit is contained in:
tateisu 2023-02-10 21:35:32 +09:00
parent 0e28b9d716
commit 8594241947
5 changed files with 27 additions and 13 deletions

View File

@ -395,7 +395,10 @@ val appSettingRoot = AppSettingItem(null, SettingType.Section, R.string.app_sett
)
sw(PrefB.bpEnablePixelfed, R.string.enable_connect_to_pixelfed_server)
sw(PrefB.bpShowFilteredWord, R.string.show_filtered_word)
sw(PrefB.bpShowUsernameFilteredPost,R.string.show_username_on_filtered_post)
sw(PrefB.bpEnableDomainTimeline, R.string.enable_domain_timeline)
}

View File

@ -58,18 +58,20 @@ fun ItemViewHolder.showStatus(
val filteredWord = status.filteredWord
if (filteredWord != null) {
PrefI.ipEventBgColorFiltered.value.notZero()?.let{
PrefI.ipEventBgColorFiltered.value.notZero()?.let {
viewRoot.backgroundColor = it
}
showMessageHolder(
TootMessageHolder(
if (PrefB.bpShowFilteredWord.value) {
"${activity.getString(R.string.filtered)} / $filteredWord"
} else {
activity.getString(R.string.filtered)
}
)
)
val text = StringBuilder().apply {
append(activity.getString(R.string.filtered))
if (PrefB.bpShowFilteredWord.value) {
append(" / $filteredWord")
}
if (PrefB.bpShowUsernameFilteredPost.value) {
val s = status.reblog ?: status
append(" / ${s.account.display_name} @${s.account.acct}")
}
}.toString()
showMessageHolder(TootMessageHolder(text))
return
}
@ -211,8 +213,10 @@ private fun ItemViewHolder.showSpoilerTextAndContent(status: TootStatus) {
// 予約投稿でも使う
fun ItemViewHolder.setContentVisibility(shown: Boolean) {
llContents.visibility = if (shown) View.VISIBLE else View.GONE
btnContentWarning.contentDescription = activity.getString(if (shown) R.string.hide else R.string.show)
btnContentWarning.imageResource = if (shown) R.drawable.outline_compress_24 else R.drawable.outline_expand_24
btnContentWarning.contentDescription =
activity.getString(if (shown) R.string.hide else R.string.show)
btnContentWarning.imageResource =
if (shown) R.drawable.outline_compress_24 else R.drawable.outline_expand_24
statusShowing?.let { status ->
val r = status.auto_cw

View File

@ -355,4 +355,9 @@ object PrefB {
"MisskeyNotificationCheck",
false
)
val bpShowUsernameFilteredPost = BooleanPref(
"ShowUsernameFilteredPost",
false
)
}

View File

@ -1252,4 +1252,5 @@
<string name="incorrect_chars">文字 \"%1$s\" は使えません</string>
<string name="approved">承認されました。</string>
<string name="account_list">アカウント一覧</string>
</resources>
<string name="show_username_on_filtered_post">フィルタされた投稿にユーザ名を表示する</string>
</resources>

View File

@ -1253,4 +1253,5 @@
<string name="glide_test">glide test</string>
<string name="default_post_account_default_action">viewing column account(phone), or ask always(tablet)</string>
<string name="quick_post_account">Quick post account</string>
<string name="show_username_on_filtered_post">Show username on filtered post</string>
</resources>