From c200566bcaec971e1756afe5ebf96baf09e88816 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 2 Jan 2019 22:44:52 +0530 Subject: Bump minSdk to 21 (#466) * Bump minSdk to 21 Signed-off-by: Harsh Shandilya * PasswordGenerator: Constify things Signed-off-by: Harsh Shandilya * Deprecate PRNG fixes The problem being fixed doesn't exist on SDK 21 and above. Signed-off-by: Harsh Shandilya * treewide: Switch to lambdas Signed-off-by: Harsh Shandilya * treewide: Formatting fixes Signed-off-by: Harsh Shandilya * treewide: Remove useless casts and add missing annotations Signed-off-by: Harsh Shandilya --- .../zeapo/pwdstore/utils/EntryRecyclerAdapter.java | 45 ++++++++++------------ 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java') 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 cabc0dcf..c108cb52 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/EntryRecyclerAdapter.java @@ -3,15 +3,14 @@ package com.zeapo.pwdstore.utils; import android.annotation.SuppressLint; import android.app.Activity; import android.graphics.Color; -import androidx.annotation.NonNull; -import androidx.core.content.ContextCompat; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; - +import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; +import androidx.recyclerview.widget.RecyclerView; import com.zeapo.pwdstore.R; import java.util.ArrayList; @@ -19,9 +18,9 @@ import java.util.Set; import java.util.TreeSet; public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter { + final Set selectedItems = new TreeSet<>(); private final Activity activity; private final ArrayList values; - final Set selectedItems = new TreeSet<>(); EntryRecyclerAdapter(Activity activity, ArrayList values) { this.activity = activity; @@ -85,18 +84,13 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter false; } // Replace the contents of a view (invoked by the layout manager) @SuppressLint("SetTextI18n") @Override - public void onBindViewHolder(final ViewHolder holder, int position) { + public void onBindViewHolder(@NonNull final ViewHolder holder, int position) { final PasswordItem pass = getValues().get(position); holder.name.setText(pass.toString()); if (pass.getType() == PasswordItem.TYPE_CATEGORY) { @@ -127,6 +121,17 @@ public abstract class EntryRecyclerAdapter extends RecyclerView.Adapter