アプリ設定の文言変更

This commit is contained in:
tateisu 2021-12-04 17:55:28 +09:00
parent 82f7ec7f26
commit ece2c8eac3
5 changed files with 15 additions and 17 deletions

View File

@ -11,6 +11,7 @@ import jp.juggler.subwaytooter.table.MediaShown
import jp.juggler.subwaytooter.util.DecodeOptions
import jp.juggler.subwaytooter.util.HTMLDecoder
import jp.juggler.util.ellipsize
import jp.juggler.util.textOrGone
import jp.juggler.util.vg
private fun addLinkAndCaption(
@ -70,16 +71,10 @@ fun ItemViewHolder.showPreviewCard(status: TootStatus, fadeText: Boolean) {
forceHtml = true,
mentionDefaultHostDomain = status.account
).decodeHTML(sb.toString())
if (text.isNotEmpty()) {
tvCardText.visibility = View.VISIBLE
tvCardText.text = text
bShowOuter = true
val fadeAlpha = ActMain.eventFadeAlpha
if (fadeAlpha < 1f) {
val a = if (fadeText) fadeAlpha else 1f
tvCardText.alpha = a
}
if (text.isNotEmpty()) {
tvCardText.textOrGone = text
bShowOuter = true
}
}
}

View File

@ -131,14 +131,10 @@ fun ItemViewHolder.showStatus(
tvContentWarning.alpha = a
tvContent.alpha = a
tvApplication.alpha = a
tvCardText.alpha = a
}
if (status.decoded_mentions.isEmpty()) {
tvMentions.visibility = View.GONE
} else {
tvMentions.visibility = View.VISIBLE
tvMentions.text = status.decoded_mentions
}
tvMentions.textOrGone =status.decoded_mentions
tvContent.text = modifiedContent
contentInvalidator.register(modifiedContent)

View File

@ -13,6 +13,7 @@ import android.view.WindowInsetsController
import android.view.WindowManager
import android.view.inputmethod.InputMethodManager
import android.widget.CompoundButton
import android.widget.TextView
import androidx.annotation.ColorInt
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.SwitchCompat
@ -272,3 +273,9 @@ private fun AppCompatActivity.setNavigationBarColorCompat(@ColorInt c: Int) {
}
}
}
var TextView.textOrGone :CharSequence?
get() = text
set(value){
vg(value?.isNotEmpty() ==true)?.text = value
}

View File

@ -1107,5 +1107,5 @@
<string name="url_parse_failed">URLの指定が変です</string>
<string name="url_of_user_or_status">ユーザや投稿のURL</string>
<string name="unbookmark">ブックマーク解除</string>
<string name="event_text_alpha">一部の通知の本文アルファ値(0.01.0, デフォルト:1)</string>
<string name="event_text_alpha">一部の通知の本文アルファ値(0.01.0, デフォルト:1。アプリ再起動が必要)</string>
</resources>

View File

@ -1118,5 +1118,5 @@
<string name="url_of_user_or_status">URL of user or status</string>
<string name="url_parse_failed">parse error.</string>
<string name="unbookmark">Unbookmark</string>
<string name="event_text_alpha">Text alpha value for some notifications (0.01.0, default:1)</string>
<string name="event_text_alpha">Text alpha for some notifications (0.01.0, default:1. app restart required)</string>
</resources>