diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java index 2bcfd7ef..857c8276 100644 --- a/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java +++ b/app/src/main/java/com/zeapo/pwdstore/utils/PasswordRecyclerAdapter.java @@ -1,10 +1,11 @@ package com.zeapo.pwdstore.utils; import android.graphics.Color; -import android.support.v7.widget.PopupMenu; +import android.support.v7.view.ActionMode; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; +import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -15,11 +16,15 @@ import com.zeapo.pwdstore.PasswordStore; import com.zeapo.pwdstore.R; import java.util.ArrayList; +import java.util.Set; +import java.util.TreeSet; public class PasswordRecyclerAdapter extends RecyclerView.Adapter { private final PasswordStore activity; private final ArrayList values; private final PasswordFragment.OnFragmentInteractionListener listener; + private final Set selectedItems; + private ActionMode mActionMode; // Provide a reference to the views for each data item // Complex data items may need more than one view per item, and @@ -44,6 +49,7 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter(); } // Create new views (invoked by the layout manager) @@ -89,33 +95,75 @@ public class PasswordRecyclerAdapter extends RecyclerView.Adapter + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/selected_rectangle.xml b/app/src/main/res/drawable/selected_rectangle.xml new file mode 100644 index 00000000..ec8d2ad8 --- /dev/null +++ b/app/src/main/res/drawable/selected_rectangle.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/password_row_layout.xml b/app/src/main/res/layout/password_row_layout.xml index ab6f31af..99ee58eb 100644 --- a/app/src/main/res/layout/password_row_layout.xml +++ b/app/src/main/res/layout/password_row_layout.xml @@ -3,7 +3,7 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@drawable/rectangle" + android:background="@drawable/password_row_background" android:layout_marginTop="4dp" android:layout_marginBottom="4dp" android:layout_gravity="start|center_vertical">