Skip to content

Commit

Permalink
Merge pull request #117 from guardianproject/dev_npex
Browse files Browse the repository at this point in the history
Rename obscure options and use string resources
  • Loading branch information
N-Pex authored Aug 5, 2017
2 parents 2765417 + a2c8544 commit f0ef85f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ public interface ImageRegionOptionsRecyclerViewAdapterListener {
private int mCurrentItem = 0;

private class ObscureOption {
public String name;
public int name;
public int icon;
public int operation;
public ObscureOption(String name, int icon, int operation) {
public ObscureOption(int name, int icon, int operation) {
this.name = name;
this.icon = icon;
this.operation = operation;
}
}

private ObscureOption[] options = new ObscureOption[] {
new ObscureOption("Redact", R.drawable.ic_context_fill, ImageRegion.REDACT),
new ObscureOption("Pixelate", R.drawable.ic_context_pixelate, ImageRegion.PIXELATE),
new ObscureOption("CrowdPixel", R.drawable.ic_context_pixelate_crowd, ImageRegion.BG_PIXELATE),
new ObscureOption("Mask", R.drawable.ic_context_mask, ImageRegion.MASK),
new ObscureOption("Clear Tag", R.drawable.ic_context_delete, -1)
new ObscureOption(R.string.obscure_option_redact, R.drawable.ic_context_fill, ImageRegion.REDACT),
new ObscureOption(R.string.obscure_option_pixelate, R.drawable.ic_context_pixelate, ImageRegion.PIXELATE),
new ObscureOption(R.string.obscure_option_inverse, R.drawable.ic_context_pixelate_crowd, ImageRegion.BG_PIXELATE),
new ObscureOption(R.string.obscure_option_mask, R.drawable.ic_context_mask, ImageRegion.MASK),
new ObscureOption(R.string.obscure_option_remove, R.drawable.ic_context_delete, -1)
};

public ImageRegionOptionsRecyclerViewAdapter(Context context) {
Expand Down Expand Up @@ -82,7 +82,7 @@ public int getItemCount() {

@Override
public long getItemId(int position) {
return options[position].name.hashCode();
return options[position].name;
}

@Override
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,11 @@
<string name="gallery_need_permission">We need your permission to access your photos. Please tap anywhere to allow it.</string>

<string name="processing_complete">Obscured successfully!</string>

<string name="obscure_option_remove">Remove</string>
<string name="obscure_option_redact">Redact</string>
<string name="obscure_option_pixelate">Pixelate</string>
<string name="obscure_option_inverse">Inverse</string>
<string name="obscure_option_mask">Mask</string>

</resources>

0 comments on commit f0ef85f

Please sign in to comment.