diff options
author | Samuel Holland <samuel@sholland.org> | 2017-07-29 06:39:37 -0500 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-07-29 06:39:37 -0500 |
commit | 84e19d6c72f0b6241650de9344b258350dff257e (patch) | |
tree | 1f3a5c82d7d090f0b2011d4a3709e910b69510cc /app/src/main | |
parent | 411b0716f2747b6607c7394f5871a2f19824da8d (diff) |
ProfileList: Add a simple menu
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/com/wireguard/android/ProfileListActivity.java | 16 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_action_add.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_settings.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/menu/profile_list.xml | 15 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 2 |
5 files changed, 51 insertions, 0 deletions
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; @@ -44,6 +46,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(); Intent intent = new Intent(this, ProfileService.class); 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 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" + android:fillColor="#FFFFFF"/> +</vector> 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 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="48dp" + android:height="48dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z" + android:fillColor="#FFFFFF"/> +</vector> 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 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + <item + android:alphabeticShortcut="n" + android:icon="@drawable/ic_action_add" + android:onClick="onMenuNewAction" + android:showAsAction="ifRoom" + android:title="@string/create" /> + <item + android:alphabeticShortcut="s" + android:icon="@drawable/ic_settings" + android:onClick="onMenuSettings" + android:showAsAction="never" + android:title="@string/settings"/> +</menu> 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 @@ <resources> <string name="app_name">WireGuard</string> <string name="connected">Connected</string> + <string name="create">Add</string> <string name="disconnected">Disconnected</string> + <string name="settings">Settings</string> </resources> |