From 84e19d6c72f0b6241650de9344b258350dff257e Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sat, 29 Jul 2017 06:39:37 -0500 Subject: [PATCH] ProfileList: Add a simple menu Signed-off-by: Jason A. Donenfeld --- .../wireguard/android/ProfileListActivity.java | 16 ++++++++++++++++ app/src/main/res/drawable/ic_action_add.xml | 9 +++++++++ app/src/main/res/drawable/ic_settings.xml | 9 +++++++++ app/src/main/res/menu/profile_list.xml | 15 +++++++++++++++ app/src/main/res/values/strings.xml | 2 ++ 5 files changed, 51 insertions(+) create mode 100644 app/src/main/res/drawable/ic_action_add.xml create mode 100644 app/src/main/res/drawable/ic_settings.xml create mode 100644 app/src/main/res/menu/profile_list.xml diff --git a/app/src/main/java/com/wireguard/android/ProfileListActivity.java b/app/src/main/java/com/wireguard/android/ProfileListActivity.java index f56092e8..2b0946a9 100644 --- a/app/src/main/java/com/wireguard/android/ProfileListActivity.java +++ b/app/src/main/java/com/wireguard/android/ProfileListActivity.java @@ -8,6 +8,8 @@ import android.content.ServiceConnection; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.os.IBinder; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; @@ -43,6 +45,20 @@ public class ProfileListActivity extends Activity { }); } + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.profile_list, menu); + return true; + } + + public void onMenuNewAction(MenuItem item) { + + } + + public void onMenuSettings(MenuItem item) { + + } + @Override public void onStart() { super.onStart(); diff --git a/app/src/main/res/drawable/ic_action_add.xml b/app/src/main/res/drawable/ic_action_add.xml new file mode 100644 index 00000000..1a1552fc --- /dev/null +++ b/app/src/main/res/drawable/ic_action_add.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml new file mode 100644 index 00000000..a5ea4258 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/menu/profile_list.xml b/app/src/main/res/menu/profile_list.xml new file mode 100644 index 00000000..38374560 --- /dev/null +++ b/app/src/main/res/menu/profile_list.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8debebf8..435daa89 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,5 +2,7 @@ WireGuard Connected + Add Disconnected + Settings