Merge pull request #386 from lenchan139/master
add option: always show all sensitive content without warning
This commit is contained in:
commit
1297a35e9b
|
@ -1,6 +1,7 @@
|
||||||
package com.keylesspalace.tusky.adapter;
|
package com.keylesspalace.tusky.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.DrawableRes;
|
import android.support.annotation.DrawableRes;
|
||||||
|
@ -225,8 +226,9 @@ class StatusBaseViewHolder extends RecyclerView.ViewHolder {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
if (sensitive) {
|
Boolean isAlwayShowSensitive = pm.getBoolean("alwayShowSensitiveMedia",false);
|
||||||
|
if (sensitive && (!isAlwayShowSensitive)) {
|
||||||
sensitiveMediaWarning.setVisibility(showingSensitive ? View.GONE : View.VISIBLE);
|
sensitiveMediaWarning.setVisibility(showingSensitive ? View.GONE : View.VISIBLE);
|
||||||
sensitiveMediaWarning.setOnClickListener(new View.OnClickListener() {
|
sensitiveMediaWarning.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -270,7 +270,6 @@ public class TimelineFragment extends SFragment implements
|
||||||
if (status.reblog != null) {
|
if (status.reblog != null) {
|
||||||
status.reblog.reblogged = reblog;
|
status.reblog.reblogged = reblog;
|
||||||
}
|
}
|
||||||
|
|
||||||
StatusViewData newViewData =
|
StatusViewData newViewData =
|
||||||
new StatusViewData.Builder(statuses.getPairedItem(position))
|
new StatusViewData.Builder(statuses.getPairedItem(position))
|
||||||
.setReblogged(reblog)
|
.setReblogged(reblog)
|
||||||
|
|
|
@ -217,6 +217,7 @@
|
||||||
<string name="abbreviated_seconds_ago">%ds</string>
|
<string name="abbreviated_seconds_ago">%ds</string>
|
||||||
|
|
||||||
<string name="follows_you">Follows you</string>
|
<string name="follows_you">Follows you</string>
|
||||||
|
<string name="pref_title_alway_show_sensitive_media">Always show all nsfw content</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
android:title="@string/pref_title_show_media_preview"
|
android:title="@string/pref_title_show_media_preview"
|
||||||
android:defaultValue="true" />
|
android:defaultValue="true" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="alwayShowSensitiveMedia"
|
||||||
|
android:title="@string/pref_title_alway_show_sensitive_media"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/pref_title_browser_settings">
|
<PreferenceCategory android:title="@string/pref_title_browser_settings">
|
||||||
<CheckBoxPreference
|
<CheckBoxPreference
|
||||||
|
|
Loading…
Reference in New Issue