diff options
| author | Felix Bechstein <f@ub0r.de> | 2017-08-02 11:15:31 +0200 |
|---|---|---|
| committer | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2017-08-02 10:15:31 +0100 |
| commit | e169235d961d93105f210d0c3c4dc29a21008c68 (patch) | |
| tree | 1f684e80351d7b47662675485faef295ec6a281b /app/src/main/java/com/zeapo/pwdstore/utils | |
| parent | 37329a67f7f1fb009daeffa4844245be6f370ae0 (diff) | |
| download | HardenedPass-e169235d961d93105f210d0c3c4dc29a21008c68.tar.gz HardenedPass-e169235d961d93105f210d0c3c4dc29a21008c68.zip | |
Fix more lint (#325)
* fix/ignore lint errors, run lint on travis
* fix/ignore some lint warnings
Diffstat (limited to 'app/src/main/java/com/zeapo/pwdstore/utils')
3 files changed, 7 insertions, 23 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 a36b1124..f1d2c36b 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java @@ -1,5 +1,6 @@ package com.zeapo.pwdstore.utils; +import android.annotation.SuppressLint; import android.app.Activity; import android.graphics.Color; import android.support.annotation.NonNull; @@ -83,7 +84,7 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec } @NonNull - protected View.OnLongClickListener getOnLongClickListener(ViewHolder holder, PasswordItem pass) { + View.OnLongClickListener getOnLongClickListener(ViewHolder holder, PasswordItem pass) { return new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { @@ -93,6 +94,7 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec } // Replace the contents of a view (invoked by the layout manager) + @SuppressLint("SetTextI18n") @Override public void onBindViewHolder(final ViewHolder holder, int position) { final PasswordItem pass = getValues().get(position); @@ -118,7 +120,7 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter<EntryRec holder.itemView.setBackgroundResource(R.color.deep_orange_200); holder.type.setTextColor(Color.BLACK); } else { - holder.itemView.setBackgroundResource(Color.alpha(1)); + holder.itemView.setBackgroundColor(Color.alpha(1)); holder.type.setTextColor(ContextCompat.getColor(activity, R.color.grey_500)); } } diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordItem.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordItem.java index cfdb829d..f45abc38 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordItem.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordItem.java @@ -18,11 +18,8 @@ public class PasswordItem implements Comparable{ /** Create a password item * * Make it protected so that we use a builder - * @param name - * @param parent - * @param type */ - protected PasswordItem(String name, PasswordItem parent, char type, File file, File rootDir) { + private PasswordItem(String name, PasswordItem parent, char type, File file, File rootDir) { this.name = name; this.parent = parent; this.type = type; @@ -31,38 +28,24 @@ public class PasswordItem implements Comparable{ } /** Create a new Category item - * - * @param name - * @param parent - * @return */ public static PasswordItem newCategory(String name, File file, PasswordItem parent, File rootDir) { return new PasswordItem(name, parent, TYPE_CATEGORY, file, rootDir); } /** Create a new parentless category item - * - * @param name - * @return */ public static PasswordItem newCategory(String name, File file, File rootDir) { return new PasswordItem(name, null, TYPE_CATEGORY, file, rootDir); } /** Create a new password item - * - * @param name - * @param parent - * @return */ public static PasswordItem newPassword(String name, File file, PasswordItem parent, File rootDir) { return new PasswordItem(name, parent, TYPE_PASSWORD, file, rootDir); } /** Create a new parentless password item - * - * @param name - * @return */ public static PasswordItem newPassword(String name, File file, File rootDir) { return new PasswordItem(name, null, TYPE_PASSWORD, file, rootDir); @@ -72,7 +55,7 @@ public class PasswordItem implements Comparable{ return this.type; } - public String getName(){ + private String getName(){ return this.name; } diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java index d97e3294..b1ee7ed0 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRepository.java @@ -19,7 +19,6 @@ import java.io.File; import java.io.FileFilter; import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import java.util.Set; import static java.util.Collections.sort; @@ -168,7 +167,7 @@ public class PasswordRepository { Log.d("REPO", "current path: " + path.getPath()); ArrayList<File> files = new ArrayList<>(Arrays.asList(path.listFiles((FileFilter) FileFilterUtils.directoryFileFilter()))); - files.addAll(new ArrayList<>((List<File>) FileUtils.listFiles(path, new String[]{"gpg"}, false))); + files.addAll(new ArrayList<>(FileUtils.listFiles(path, new String[]{"gpg"}, false))); return new ArrayList<>(files); } |
