From f48f6230a29324831917c79881ad9f2c77aba14b Mon Sep 17 00:00:00 2001 From: Len Chan Date: Tue, 19 Sep 2017 23:19:18 +0800 Subject: [PATCH] add option: always show all sensitive content without warning --- .../keylesspalace/tusky/adapter/StatusBaseViewHolder.java | 6 ++++-- .../com/keylesspalace/tusky/fragment/TimelineFragment.java | 1 - app/src/main/res/values/strings.xml | 1 + app/src/main/res/xml/preferences.xml | 5 +++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java index 279773a4..cc5160ff 100644 --- a/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java +++ b/app/src/main/java/com/keylesspalace/tusky/adapter/StatusBaseViewHolder.java @@ -1,6 +1,7 @@ package com.keylesspalace.tusky.adapter; import android.content.Context; +import android.content.SharedPreferences; import android.graphics.drawable.Drawable; import android.preference.PreferenceManager; import android.support.annotation.DrawableRes; @@ -226,8 +227,9 @@ class StatusBaseViewHolder extends RecyclerView.ViewHolder { }); } } - - if (sensitive) { + SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(context); + Boolean isAlwayShowSensitive = pm.getBoolean("alwayShowSensitiveMedia",false); + if (sensitive && (!isAlwayShowSensitive)) { sensitiveMediaWarning.setVisibility(showingSensitive ? View.GONE : View.VISIBLE); sensitiveMediaWarning.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java index 103f7e81..723fa0ef 100644 --- a/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java +++ b/app/src/main/java/com/keylesspalace/tusky/fragment/TimelineFragment.java @@ -270,7 +270,6 @@ public class TimelineFragment extends SFragment implements if (status.reblog != null) { status.reblog.reblogged = reblog; } - StatusViewData newViewData = new StatusViewData.Builder(statuses.getPairedItem(position)) .setReblogged(reblog) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7a8251a6..57453fed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -213,6 +213,7 @@ %ds Follows you + Always show all nsfw content diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index 4d618c61..ab655157 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -19,6 +19,11 @@ android:title="@string/pref_title_show_media_preview" android:defaultValue="true" /> + +