From 3ddd8788c79d1286837d66394967935e31e852d1 Mon Sep 17 00:00:00 2001 From: Jakob Nixdorf Date: Mon, 3 Jul 2017 16:48:53 +0200 Subject: [PATCH] Add menu to the entries to rename --- .../flocke/andotp/EntriesCardAdapter.java | 37 ++++++++++++++++--- .../shadowice/flocke/andotp/MainActivity.java | 5 +-- .../main/res/drawable/ic_more_vert_gray.xml | 9 +++++ app/src/main/res/layout/card_layout.xml | 31 +++++++--------- app/src/main/res/menu/menu_popup.xml | 8 ++++ app/src/main/res/values/strings.xml | 1 + 6 files changed, 64 insertions(+), 27 deletions(-) create mode 100644 app/src/main/res/drawable/ic_more_vert_gray.xml create mode 100644 app/src/main/res/menu/menu_popup.xml diff --git a/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java b/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java index 285464b5..8cefcdbe 100644 --- a/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java +++ b/app/src/main/java/org/shadowice/flocke/andotp/EntriesCardAdapter.java @@ -25,8 +25,11 @@ package org.shadowice.flocke.andotp; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; +import android.support.v7.widget.PopupMenu; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; @@ -138,27 +141,49 @@ public class EntriesCardAdapter extends RecyclerView.Adapter + + diff --git a/app/src/main/res/layout/card_layout.xml b/app/src/main/res/layout/card_layout.xml index 2c726d0f..cc6cbaac 100644 --- a/app/src/main/res/layout/card_layout.xml +++ b/app/src/main/res/layout/card_layout.xml @@ -23,31 +23,20 @@ android:layout_alignParentTop="true" android:layout_alignParentStart="true" /> - - - - - - + android:layout_below="@+id/textViewOTP" + android:textAppearance="?android:attr/textAppearanceMedium" /> @@ -63,6 +52,14 @@ android:textStyle="bold" /> + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_popup.xml b/app/src/main/res/menu/menu_popup.xml new file mode 100644 index 00000000..935941b9 --- /dev/null +++ b/app/src/main/res/menu/menu_popup.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index eabfb42b..bfc78797 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,6 +10,7 @@ %d s About + Edit label Export (JSON) Import (JSON) Import / Export