Skip to content

Commit

Permalink
Fix senstivity
Browse files Browse the repository at this point in the history
  • Loading branch information
swentel committed Aug 2, 2020
1 parent e99c9ba commit f789ec6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ public boolean supports(String feature) {
case FEATURE_SPOILER:
case FEATURE_MEDIA_UPLOAD_DESCRIPTION:
supported = false;
break;
break;
case FEATURE_POST_SENSITIVITY:
supported = Preferences.getPreference(getContext(), "pref_key_post_sensitivity", false);
break;
}

return supported;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public boolean supports(String feature) {
case FEATURE_LOCATION:
case FEATURE_POST_STATUS:
case FEATURE_SPOILER:
case FEATURE_POST_SENSITIVITY:
supported = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void onClick(DialogInterface dialog, int index) {
}

sensitivity = findViewById(R.id.postSensitivity);
if (sensitivity != null && Preferences.getPreference(getApplicationContext(), "pref_key_post_sensitivity", false)) {
if (sensitivity != null && post.supports(Post.FEATURE_POST_SENSITIVITY)) {
sensitivity.setVisibility(View.VISIBLE);
}

Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/indieweb/indigenous/post/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public interface Post {
String FEATURE_AUDIO = "FEATURE_POST_AUDIO";
String FEATURE_LOCATION = "FEATURE_POST_LOCATION";
String FEATURE_POST_STATUS = "FEATURE_POST_STATUS";
String FEATURE_POST_SENSITIVITY = "FEATURE_POST_SENSITIVITY";
String FEATURE_MEDIA_UPLOAD_DESCRIPTION = "FEATURE_MEDIA_UPLOAD_DESCRIPTION";
String FEATURE_SPOILER = "FEATURE_POST_SPOILER";
String POST_PARAM_H = "h";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ public static String parseNetworkError(VolleyError error, Context context, int n
if (networkResponse != null && networkResponse.statusCode != 0 && networkResponse.data != null) {
int code = networkResponse.statusCode;
String result = new String(networkResponse.data).trim();
//Log.d("indigenous_debug", "Error: " + result);
returnMessage = String.format(context.getString(network_fail), code, result);
}
}
Expand Down

0 comments on commit f789ec6

Please sign in to comment.