- Rename Token -> InternalToken
- Rename TokenPersistence -> InternalTokenPersistence
- Instantiate token persistence whenever needed
- Introduce notion of an internal token
- Let TokenAdapter hide edit menu item for non-internal tokens
---
.../freeotp/BaseReorderableAdapter.java | 97 +++++++++++-----------
.../freeotp/{Token.java => InternalToken.java} | 14 ++--
...sistence.java => InternalTokenPersistence.java} | 49 +++++++----
.../org/fedorahosted/freeotp/MainActivity.java | 7 +-
.../org/fedorahosted/freeotp/TokenAdapter.java | 23 +++--
.../java/org/fedorahosted/freeotp/TokenLayout.java | 8 +-
.../org/fedorahosted/freeotp/add/AddActivity.java | 4 +-
.../org/fedorahosted/freeotp/add/ScanActivity.java | 6 +-
.../fedorahosted/freeotp/edit/DeleteActivity.java | 11 +--
.../fedorahosted/freeotp/edit/EditActivity.java | 13 +--
app/src/main/res/menu/editable_token.xml | 33 ++++++++
app/src/main/res/menu/token.xml | 6 --
12 files changed, 168 insertions(+), 103 deletions(-)
rename app/src/main/java/org/fedorahosted/freeotp/{Token.java => InternalToken.java}
(95%)
rename app/src/main/java/org/fedorahosted/freeotp/{TokenPersistence.java =>
InternalTokenPersistence.java} (65%)
create mode 100644 app/src/main/res/menu/editable_token.xml
diff --git a/app/src/main/java/org/fedorahosted/freeotp/BaseReorderableAdapter.java
b/app/src/main/java/org/fedorahosted/freeotp/BaseReorderableAdapter.java
index 3a46587..ad32b16 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/BaseReorderableAdapter.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/BaseReorderableAdapter.java
@@ -45,57 +45,58 @@ public abstract class BaseReorderableAdapter extends BaseAdapter {
if (convertView == null) {
int type = getItemViewType(position);
convertView = createView(parent, type);
+ if(isMovable()) {
+ convertView.setOnDragListener(new OnDragListener() {
+ @Override
+ public boolean onDrag(View dstView, DragEvent event) {
+ Reference<View> ref = (Reference<View>)
event.getLocalState();
+ final View srcView = ref.reference;
+
+ switch (event.getAction()) {
+ case DragEvent.ACTION_DRAG_ENTERED:
+ srcView.setVisibility(View.VISIBLE);
+ dstView.setVisibility(View.INVISIBLE);
+
+ move(((Integer) srcView.getTag(KEY)).intValue(),
+ ((Integer) dstView.getTag(KEY)).intValue());
+ ref.reference = dstView;
+ break;
+
+ case DragEvent.ACTION_DRAG_ENDED:
+ srcView.post(new Runnable() {
+ @Override
+ public void run() {
+ srcView.setVisibility(View.VISIBLE);
+ }
+ });
+ break;
+ }
- convertView.setOnDragListener(new OnDragListener() {
- @Override
- public boolean onDrag(View dstView, DragEvent event) {
- Reference<View> ref = (Reference<View>)
event.getLocalState();
- final View srcView = ref.reference;
-
- switch (event.getAction()) {
- case DragEvent.ACTION_DRAG_ENTERED:
- srcView.setVisibility(View.VISIBLE);
- dstView.setVisibility(View.INVISIBLE);
-
- move(((Integer) srcView.getTag(KEY)).intValue(),
- ((Integer) dstView.getTag(KEY)).intValue());
- ref.reference = dstView;
- break;
-
- case DragEvent.ACTION_DRAG_ENDED:
- srcView.post(new Runnable() {
- @Override
- public void run() {
- srcView.setVisibility(View.VISIBLE);
- }
- });
- break;
+ return true;
}
-
- return true;
- }
- });
-
- convertView.setOnLongClickListener(new OnLongClickListener() {
- @Override
- public boolean onLongClick(final View view) {
- // Force a reset of any states
- notifyDataSetChanged();
-
- // Start the drag on the main loop to allow
- // the above state reset to settle.
- view.post(new Runnable() {
- @Override
- public void run() {
- ClipData data = ClipData.newPlainText("",
"");
- DragShadowBuilder sb = new View.DragShadowBuilder(view);
- view.startDrag(data, sb, new Reference<View>(view),
0);
- }
});
- return true;
- }
- });
+ convertView.setOnLongClickListener(new OnLongClickListener() {
+ @Override
+ public boolean onLongClick(final View view) {
+ // Force a reset of any states
+ notifyDataSetChanged();
+
+ // Start the drag on the main loop to allow
+ // the above state reset to settle.
+ view.post(new Runnable() {
+ @Override
+ public void run() {
+ ClipData data = ClipData.newPlainText("",
"");
+ DragShadowBuilder sb = new
View.DragShadowBuilder(view);
+ view.startDrag(data, sb, new
Reference<View>(view), 0);
+ }
+ });
+
+ return true;
+ }
+ });
+ }
}
convertView.setTag(KEY, Integer.valueOf(position));
@@ -103,6 +104,8 @@ public abstract class BaseReorderableAdapter extends BaseAdapter {
return convertView;
}
+ protected abstract boolean isMovable();
+
protected abstract void move(int fromPosition, int toPosition);
protected abstract void bindView(View view, int position);
diff --git a/app/src/main/java/org/fedorahosted/freeotp/Token.java
b/app/src/main/java/org/fedorahosted/freeotp/InternalToken.java
similarity index 95%
rename from app/src/main/java/org/fedorahosted/freeotp/Token.java
rename to app/src/main/java/org/fedorahosted/freeotp/InternalToken.java
index 98febfb..bec97de 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/Token.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/InternalToken.java
@@ -33,7 +33,7 @@ import android.net.Uri;
import com.google.android.apps.authenticator.Base32String;
import com.google.android.apps.authenticator.Base32String.DecodingException;
-public class Token {
+public class InternalToken {
public static class TokenUriInvalidException extends Exception {
private static final long serialVersionUID = -1108624734612362345L;
}
@@ -56,7 +56,7 @@ public class Token {
private long counter;
private int period;
- private Token(Uri uri, boolean internal) throws TokenUriInvalidException {
+ private InternalToken(Uri uri, boolean internal) throws TokenUriInvalidException {
if (!uri.getScheme().equals("otpauth"))
throw new TokenUriInvalidException();
@@ -182,15 +182,15 @@ public class Token {
return "";
}
- public Token(String uri, boolean internal) throws TokenUriInvalidException {
+ public InternalToken(String uri, boolean internal) throws TokenUriInvalidException {
this(Uri.parse(uri), internal);
}
- public Token(Uri uri) throws TokenUriInvalidException {
+ public InternalToken(Uri uri) throws TokenUriInvalidException {
this(uri, false);
}
- public Token(String uri) throws TokenUriInvalidException {
+ public InternalToken(String uri) throws TokenUriInvalidException {
this(Uri.parse(uri));
}
@@ -303,4 +303,8 @@ public class Token {
return null;
}
+
+ public boolean isInternal() {
+ return true;
+ }
}
diff --git a/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java
b/app/src/main/java/org/fedorahosted/freeotp/InternalTokenPersistence.java
similarity index 65%
rename from app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java
rename to app/src/main/java/org/fedorahosted/freeotp/InternalTokenPersistence.java
index 3d450f9..78af8c8 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/TokenPersistence.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/InternalTokenPersistence.java
@@ -1,11 +1,28 @@
+/*
+ * FreeOTP
+ *
+ * Authors: Nathaniel McCallum <npmccallum(a)redhat.com>
+ *
+ * Copyright (C) 2013 Nathaniel McCallum, Red Hat
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.fedorahosted.freeotp;
import java.lang.reflect.Type;
import java.util.LinkedList;
import java.util.List;
-import org.fedorahosted.freeotp.Token.TokenUriInvalidException;
-
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
@@ -15,7 +32,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
-public class TokenPersistence {
+public class InternalTokenPersistence {
private static final String NAME = "tokens";
private static final String ORDER = "tokenOrder";
private final SharedPreferences prefs;
@@ -32,12 +49,12 @@ public class TokenPersistence {
return prefs.edit().putString(ORDER, gson.toJson(order));
}
- public static Token addWithToast(Context ctx, String uri) {
+ public InternalToken addWithToast(Context ctx, String uri) {
try {
- Token token = new Token(uri);
- new TokenPersistence(ctx).add(token);
+ InternalToken token = new InternalToken(uri);
+ add(token);
return token;
- } catch (TokenUriInvalidException e) {
+ } catch (InternalToken.TokenUriInvalidException e) {
Toast.makeText(ctx, R.string.invalid_token, Toast.LENGTH_SHORT).show();
e.printStackTrace();
}
@@ -45,7 +62,7 @@ public class TokenPersistence {
return null;
}
- public TokenPersistence(Context ctx) {
+ public InternalTokenPersistence(Context ctx) {
prefs = ctx.getApplicationContext().getSharedPreferences(NAME,
Context.MODE_PRIVATE);
gson = new Gson();
}
@@ -54,17 +71,17 @@ public class TokenPersistence {
return getTokenOrder().size();
}
- public Token get(int position) {
+ public InternalToken get(int position) {
String key = getTokenOrder().get(position);
String str = prefs.getString(key, null);
try {
- return gson.fromJson(str, Token.class);
+ return gson.fromJson(str, InternalToken.class);
} catch (JsonSyntaxException jse) {
// Backwards compatibility for URL-based persistence.
try {
- return new Token(str, true);
- } catch (TokenUriInvalidException tuie) {
+ return new InternalToken(str, true);
+ } catch (InternalToken.TokenUriInvalidException tuie) {
tuie.printStackTrace();
}
}
@@ -72,7 +89,7 @@ public class TokenPersistence {
return null;
}
- public void add(Token token) throws TokenUriInvalidException {
+ public void add(InternalToken token) throws InternalToken.TokenUriInvalidException {
String key = token.getID();
if (prefs.contains(key))
@@ -103,7 +120,11 @@ public class TokenPersistence {
setTokenOrder(order).remove(key).apply();
}
- public void save(Token token) {
+ public void save(InternalToken token) {
prefs.edit().putString(token.getID(), gson.toJson(token)).apply();
}
+
+ public boolean isMovable() {
+ return true;
+ }
}
diff --git a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
index f1cc81b..1b9812d 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/MainActivity.java
@@ -53,6 +53,7 @@ import android.widget.GridView;
public class MainActivity extends Activity implements OnMenuItemClickListener {
private TokenAdapter mTokenAdapter;
+ private InternalTokenPersistence mTokenPersistence;
private DataSetObserver mDataSetObserver;
@Override
@@ -60,8 +61,8 @@ public class MainActivity extends Activity implements
OnMenuItemClickListener {
super.onCreate(savedInstanceState);
onNewIntent(getIntent());
setContentView(R.layout.main);
-
- mTokenAdapter = new TokenAdapter(this);
+ mTokenPersistence = new InternalTokenPersistence(this);
+ mTokenAdapter = new TokenAdapter(this, mTokenPersistence);
((GridView) findViewById(R.id.grid)).setAdapter(mTokenAdapter);
// Don't permit screenshots since these might contain OTP codes.
@@ -134,6 +135,6 @@ public class MainActivity extends Activity implements
OnMenuItemClickListener {
Uri uri = intent.getData();
if (uri != null)
- TokenPersistence.addWithToast(this, uri.toString());
+ mTokenPersistence.addWithToast(this, uri.toString());
}
}
diff --git a/app/src/main/java/org/fedorahosted/freeotp/TokenAdapter.java
b/app/src/main/java/org/fedorahosted/freeotp/TokenAdapter.java
index e7adf36..b2f035e 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/TokenAdapter.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/TokenAdapter.java
@@ -39,13 +39,13 @@ import java.util.HashMap;
import java.util.Map;
public class TokenAdapter extends BaseReorderableAdapter {
- private final TokenPersistence mTokenPersistence;
+ private final InternalTokenPersistence mTokenPersistence;
private final LayoutInflater mLayoutInflater;
private final ClipboardManager mClipMan;
private final Map<String, TokenCode> mTokenCodes;
- public TokenAdapter(Context ctx) {
- mTokenPersistence = new TokenPersistence(ctx);
+ public TokenAdapter(Context ctx, InternalTokenPersistence tokenPersistence) {
+ mTokenPersistence = tokenPersistence;
mLayoutInflater = (LayoutInflater)
ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mClipMan = (ClipboardManager) ctx.getSystemService(Context.CLIPBOARD_SERVICE);
mTokenCodes = new HashMap<String, TokenCode>();
@@ -68,7 +68,7 @@ public class TokenAdapter extends BaseReorderableAdapter {
}
@Override
- public Token getItem(int position) {
+ public InternalToken getItem(int position) {
return mTokenPersistence.get(position);
}
@@ -87,9 +87,11 @@ public class TokenAdapter extends BaseReorderableAdapter {
protected void bindView(View view, final int position) {
final Context ctx = view.getContext();
TokenLayout tl = (TokenLayout) view;
- Token token = getItem(position);
+ InternalToken token = getItem(position);
- tl.bind(token, R.menu.token, new PopupMenu.OnMenuItemClickListener() {
+ int menu = token.isInternal() ? R.menu.editable_token : R.menu.token;
+
+ tl.bind(token, menu, new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Intent i;
@@ -115,10 +117,10 @@ public class TokenAdapter extends BaseReorderableAdapter {
tl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- TokenPersistence tp = new TokenPersistence(ctx);
+ InternalTokenPersistence tp = TokenAdapter.this.mTokenPersistence;
// Increment the token.
- Token token = tp.get(position);
+ InternalToken token = tp.get(position);
TokenCode codes = token.generateCodes();
tp.save(token);
@@ -142,4 +144,9 @@ public class TokenAdapter extends BaseReorderableAdapter {
protected View createView(ViewGroup parent, int type) {
return mLayoutInflater.inflate(R.layout.token, parent, false);
}
+
+ @Override
+ protected boolean isMovable() {
+ return mTokenPersistence.isMovable();
+ }
}
diff --git a/app/src/main/java/org/fedorahosted/freeotp/TokenLayout.java
b/app/src/main/java/org/fedorahosted/freeotp/TokenLayout.java
index f2dbbd0..a4660ad 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/TokenLayout.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/TokenLayout.java
@@ -26,7 +26,7 @@ public class TokenLayout extends FrameLayout implements
View.OnClickListener, Ru
private PopupMenu mPopupMenu;
private TokenCode mCodes;
- private Token.TokenType mType;
+ private InternalToken.TokenType mType;
private String mPlaceholder;
private long mStartTime;
@@ -58,7 +58,7 @@ public class TokenLayout extends FrameLayout implements
View.OnClickListener, Ru
mMenu.setOnClickListener(this);
}
- public void bind(Token token, int menu, PopupMenu.OnMenuItemClickListener micl) {
+ public void bind(InternalToken token, int menu, PopupMenu.OnMenuItemClickListener
micl) {
mCodes = null;
// Setup menu.
@@ -106,7 +106,7 @@ public class TokenLayout extends FrameLayout implements
View.OnClickListener, Ru
view.startAnimation(a);
}
- public void start(Token.TokenType type, TokenCode codes, boolean animate) {
+ public void start(InternalToken.TokenType type, TokenCode codes, boolean animate) {
mCodes = codes;
mType = type;
@@ -147,7 +147,7 @@ public class TokenLayout extends FrameLayout implements
View.OnClickListener, Ru
// Update the fields
mCode.setText(code);
mProgressInner.setProgress(mCodes.getCurrentProgress());
- if (mType != Token.TokenType.HOTP)
+ if (mType != InternalToken.TokenType.HOTP)
mProgressOuter.setProgress(mCodes.getTotalProgress());
postDelayed(this, 100);
diff --git a/app/src/main/java/org/fedorahosted/freeotp/add/AddActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/add/AddActivity.java
index 6c6d3dd..d996a4d 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/add/AddActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/add/AddActivity.java
@@ -25,7 +25,7 @@ import java.net.URLEncoder;
import java.util.Locale;
import org.fedorahosted.freeotp.R;
-import org.fedorahosted.freeotp.TokenPersistence;
+import org.fedorahosted.freeotp.InternalTokenPersistence;
import android.app.Activity;
import android.content.Intent;
@@ -130,7 +130,7 @@ public class AddActivity extends Activity implements
View.OnClickListener, Compo
}
// Add the token
- if (TokenPersistence.addWithToast(this, uri) != null)
+ if (new InternalTokenPersistence(this).addWithToast(this, uri) != null)
finish();
break;
diff --git a/app/src/main/java/org/fedorahosted/freeotp/add/ScanActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/add/ScanActivity.java
index 263b267..68fa5cf 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/add/ScanActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/add/ScanActivity.java
@@ -23,8 +23,8 @@ package org.fedorahosted.freeotp.add;
import java.util.List;
import org.fedorahosted.freeotp.R;
-import org.fedorahosted.freeotp.Token;
-import org.fedorahosted.freeotp.TokenPersistence;
+import org.fedorahosted.freeotp.InternalToken;
+import org.fedorahosted.freeotp.InternalTokenPersistence;
import android.annotation.TargetApi;
import android.app.Activity;
@@ -98,7 +98,7 @@ public class ScanActivity extends Activity implements
SurfaceHolder.Callback {
@Override
protected void onPostExecute(String result) {
super.onPostExecute(result);
- Token token = TokenPersistence.addWithToast(ScanActivity.this, result);
+ InternalToken token = new
InternalTokenPersistence(ScanActivity.this).addWithToast(ScanActivity.this, result);
if (token == null || token.getImage() == null) {
finish();
return;
diff --git a/app/src/main/java/org/fedorahosted/freeotp/edit/DeleteActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/edit/DeleteActivity.java
index 4da2013..edad048 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/edit/DeleteActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/edit/DeleteActivity.java
@@ -1,8 +1,8 @@
package org.fedorahosted.freeotp.edit;
import org.fedorahosted.freeotp.R;
-import org.fedorahosted.freeotp.Token;
-import org.fedorahosted.freeotp.TokenPersistence;
+import org.fedorahosted.freeotp.InternalToken;
+import org.fedorahosted.freeotp.InternalTokenPersistence;
import android.os.Bundle;
import android.view.View;
@@ -12,12 +12,13 @@ import android.widget.TextView;
import com.squareup.picasso.Picasso;
public class DeleteActivity extends BaseActivity {
+ private InternalTokenPersistence mTokenPersistence;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.delete);
-
- Token token = new TokenPersistence(this).get(getPosition());
+ mTokenPersistence = new InternalTokenPersistence(this);
+ InternalToken token = mTokenPersistence.get(getPosition());
((TextView) findViewById(R.id.issuer)).setText(token.getIssuer());
((TextView) findViewById(R.id.label)).setText(token.getLabel());
Picasso.with(this)
@@ -35,7 +36,7 @@ public class DeleteActivity extends BaseActivity {
findViewById(R.id.delete).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- new TokenPersistence(DeleteActivity.this).delete(getPosition());
+ mTokenPersistence.delete(getPosition());
finish();
}
});
diff --git a/app/src/main/java/org/fedorahosted/freeotp/edit/EditActivity.java
b/app/src/main/java/org/fedorahosted/freeotp/edit/EditActivity.java
index 575d1ad..5f61379 100644
--- a/app/src/main/java/org/fedorahosted/freeotp/edit/EditActivity.java
+++ b/app/src/main/java/org/fedorahosted/freeotp/edit/EditActivity.java
@@ -21,8 +21,8 @@
package org.fedorahosted.freeotp.edit;
import org.fedorahosted.freeotp.R;
-import org.fedorahosted.freeotp.Token;
-import org.fedorahosted.freeotp.TokenPersistence;
+import org.fedorahosted.freeotp.InternalToken;
+import org.fedorahosted.freeotp.InternalTokenPersistence;
import android.content.Intent;
import android.net.Uri;
@@ -50,6 +50,7 @@ public class EditActivity extends BaseActivity implements TextWatcher,
View.OnCl
private Uri mImageCurrent;
private Uri mImageDefault;
private Uri mImageDisplay;
+ private InternalTokenPersistence mTokenPersistence;
private void showImage(Uri uri) {
mImageDisplay = uri;
@@ -73,7 +74,8 @@ public class EditActivity extends BaseActivity implements TextWatcher,
View.OnCl
setContentView(R.layout.edit);
// Get token values.
- Token token = new TokenPersistence(this).get(getPosition());
+ mTokenPersistence = new InternalTokenPersistence(this);
+ InternalToken token = mTokenPersistence.get(getPosition());
mIssuerCurrent = token.getIssuer();
mLabelCurrent = token.getLabel();
mImageCurrent = token.getImage();
@@ -150,12 +152,11 @@ public class EditActivity extends BaseActivity implements
TextWatcher, View.OnCl
break;
case R.id.save:
- TokenPersistence tp = new TokenPersistence(this);
- Token token = tp.get(getPosition());
+ InternalToken token = mTokenPersistence.get(getPosition());
token.setIssuer(mIssuer.getText().toString());
token.setLabel(mLabel.getText().toString());
token.setImage(mImageDisplay);
- tp.save(token);
+ mTokenPersistence.save(token);
case R.id.cancel:
finish();
diff --git a/app/src/main/res/menu/editable_token.xml
b/app/src/main/res/menu/editable_token.xml
new file mode 100644
index 0000000..a5a28e9
--- /dev/null
+++ b/app/src/main/res/menu/editable_token.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ - FreeOTP
+ -
+ - Authors: Nathaniel McCallum <npmccallum(a)redhat.com>
+ -
+ - Copyright (C) 2014 Nathaniel McCallum, Red Hat
+ -
+ - Licensed under the Apache License, Version 2.0 (the "License");
+ - you may not use this file except in compliance with the License.
+ - You may obtain a copy of the License at
+ -
+ -
http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+<menu
xmlns:android="http://schemas.android.com/apk/res/android" >
+ <item
+ android:id="@+id/action_edit"
+ android:icon="@drawable/ic_action_edit"
+ android:title="@string/edit"
+ />
+
+ <item
+ android:id="@+id/action_delete"
+ android:icon="@android:drawable/ic_menu_delete"
+ android:title="@string/delete"
+ />
+</menu>
diff --git a/app/src/main/res/menu/token.xml b/app/src/main/res/menu/token.xml
index a5a28e9..0af483c 100644
--- a/app/src/main/res/menu/token.xml
+++ b/app/src/main/res/menu/token.xml
@@ -20,12 +20,6 @@
-->
<menu
xmlns:android="http://schemas.android.com/apk/res/android" >
<item
- android:id="@+id/action_edit"
- android:icon="@drawable/ic_action_edit"
- android:title="@string/edit"
- />
-
- <item
android:id="@+id/action_delete"
android:icon="@android:drawable/ic_menu_delete"
android:title="@string/delete"
--
1.9.1