diff options
| author | Felix Bechstein <f@ub0r.de> | 2017-07-25 15:23:50 +0200 |
|---|---|---|
| committer | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2017-07-25 14:23:50 +0100 |
| commit | 5da9e67545644925902b04a11306289add29c033 (patch) | |
| tree | de8ec31c4fe216157b7680a4defdee86429a4122 /app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java | |
| parent | 5cba6c62d7b4628dfaf482dd883e333f93d323d4 (diff) | |
| download | HardenedPass-5da9e67545644925902b04a11306289add29c033.tar.gz HardenedPass-5da9e67545644925902b04a11306289add29c033.zip | |
Fix lint warnings (#319)
* Fix lint errors/warnings
Fix a lot of lint errors and warnings.
Most things are automatically applied fixes done with android studio:
* externalize strings
* remove unused code / classes / layouts / imports
* migrate some fields to local variables
* Remove dead code from comments
Removed code that is commented out long ago.
* remove unused resources
* colors
* strings
* drawables
* layouts
* menus
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java')
| -rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java b/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java index 5247c6a3..a36b1124 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java @@ -19,10 +19,10 @@ import java.util.TreeSet; public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRecyclerAdapter.ViewHolder> { private final Activity activity; - protected final ArrayList<PasswordItem> values; - protected final Set<Integer> selectedItems = new TreeSet<>(); + private final ArrayList<PasswordItem> values; + final Set<Integer> selectedItems = new TreeSet<>(); - public EntryRecyclerAdapter(Activity activity, ArrayList<PasswordItem> values) { + EntryRecyclerAdapter(Activity activity, ArrayList<PasswordItem> values) { this.activity = activity; this.values = values; } @@ -52,7 +52,7 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec this.notifyItemInserted(getItemCount()); } - public void toggleSelection(int position) { + void toggleSelection(int position) { if (!selectedItems.remove(position)) { selectedItems.add(position); } @@ -106,11 +106,6 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec } holder.type.setText(pass.getFullPathToParent()); - if (pass.getType() == PasswordItem.TYPE_CATEGORY) { -// holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_200)); - } else { -// holder.card.setCardBackgroundColor(activity.getResources().getColor(R.color.blue_grey_50)); - } holder.view.setOnClickListener(getOnClickListener(holder, pass)); @@ -134,14 +129,14 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec // Provide a reference to the views for each data item // Complex data items may need more than one view per item, and // you provide access to all the views for a data item in a view holder - public static class ViewHolder extends RecyclerView.ViewHolder { + static class ViewHolder extends RecyclerView.ViewHolder { // each data item is just a string in this case - public View view; - public TextView name; - public TextView type; - public ImageView typeImage; + public final View view; + public final TextView name; + final TextView type; + final ImageView typeImage; - public ViewHolder(View v) { + ViewHolder(View v) { super(v); view = v; name = (TextView) view.findViewById(R.id.label); |
