アプリ設定の「プレビューカードを取得しない」を削除。「プレビューカードを表示しない」を追加。

This commit is contained in:
tateisu 2018-11-20 09:33:57 +09:00
parent eab4cfb927
commit b976e47fe5
6 changed files with 28 additions and 22 deletions

View File

@ -2996,20 +2996,21 @@ class Column(
)
}
// カードを取得する
if(! Pref.bpDontRetrievePreviewCard(context)) {
this.list_tmp?.forEach { o ->
if(o is TootStatus && o.card == null)
o.card = parseItem(
::TootCard,
client.request("/api/v1/statuses/" + o.id + "/card")?.jsonObject
)
}
}
// マストドン2.6でTLにカード情報がレンダリングされたことにより、
// 個別にカードを取得する機能は ST3.0.7で廃止される
// この機能はRate limitの問題を引き起こすことが多かった
// if(! Pref.bpDontRetrievePreviewCard(context)) {
// this.list_tmp?.forEach { o ->
// // カードを取得する
// if(o is TootStatus && o.card == null)
// o.card = parseItem(
// ::TootCard,
// client.request("/api/v1/statuses/" + o.id + "/card")?.jsonObject
// )
// }
// }
//
return result
}
}
@ -6884,7 +6885,7 @@ class Column(
else -> defaultColorHeaderBg
}
fun setHeaderBackground( view : View) {
fun setHeaderBackground(view : View) {
ViewCompat.setBackground(
view,
Styler.getAdaptiveRippleDrawable(

View File

@ -1060,8 +1060,7 @@ internal class ItemViewHolder(
}
}
// カードの表示(会話ビューのみ)
showPreviewCard(activity, status)
showPreviewCard(status)
// if( status.decoded_tags == null ){
// tvTags.setVisibility( View.GONE );
@ -1784,7 +1783,10 @@ internal class ItemViewHolder(
}
}
private fun showPreviewCard(activity : ActMain, status : TootStatus) {
private fun showPreviewCard(status : TootStatus) {
if(Pref.bpDontShowPreviewCard(activity.pref)) return
val card = status.card ?: return
// 会話カラムで返信ステータスなら捏造したカードを表示しない

View File

@ -335,11 +335,12 @@ object Pref {
R.id.swSendAccessTokenToAppServer
)
val bpDontRetrievePreviewCard = BooleanPref(
"DontRetrievePreviewCard",
true,
R.id.swDontRetrievePreviewCard
val bpDontShowPreviewCard = BooleanPref(
"DontShowPreviewCard",
false,
R.id.swDontShowPreviewCard
)
val bpScrollTopFromColumnStrip = BooleanPref(
"ScrollTopFromColumnStrip",
false,

View File

@ -316,13 +316,13 @@
<TextView
style="@style/setting_row_label"
android:text="@string/dont_retrieve_preview_card"
android:text="@string/dont_show_preview_card"
/>
<LinearLayout style="@style/setting_row_form">
<Switch
android:id="@+id/swDontRetrievePreviewCard"
android:id="@+id/swDontShowPreviewCard"
style="@style/setting_horizontal_stretch"
android:gravity="center"
/>

View File

@ -803,5 +803,6 @@
<string name="content_acct_color">内容のAcctの文字色</string>
<string name="content_text_color">内容の本文の文字色</string>
<string name="quick_toot_bar_background_color">簡易投稿入力の背景色</string>
<string name="dont_show_preview_card">プレビューカードを表示しない</string>
</resources>

View File

@ -821,5 +821,6 @@
<string name="content_acct_color">Content acct color</string>
<string name="content_text_color">Content text color</string>
<string name="quick_toot_bar_background_color">Quick toot bar background color</string>
<string name="dont_show_preview_card">Don\'t show preview card</string>
</resources>