[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] menu entry for restore backup
commit 7600b4c58cead4021ad7b427b3634f54e06709d3
Author: arrase <arrase@xxxxxxxxx>
Date: Tue Nov 22 01:24:23 2016 +0100
menu entry for restore backup
---
.../android/ui/hs/HiddenServicesActivity.java | 20 ++++++++++++++++++++
app/src/main/res/menu/hs_menu.xml | 6 ++++++
app/src/main/res/values/strings.xml | 1 +
3 files changed, 27 insertions(+)
diff --git a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
index 24bbd70..a10c3e2 100644
--- a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
@@ -8,6 +8,8 @@ import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
+import android.view.Menu;
+import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
@@ -87,6 +89,24 @@ public class HiddenServicesActivity extends AppCompatActivity {
});
}
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.hs_menu, menu);
+ return true;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ int id = item.getItemId();
+
+ if (id == R.id.menu_restore_backup) {
+ // TODO: Restore backup
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
class HSObserver extends ContentObserver {
HSObserver(Handler handler) {
super(handler);
diff --git a/app/src/main/res/menu/hs_menu.xml b/app/src/main/res/menu/hs_menu.xml
new file mode 100644
index 0000000..cfe580d
--- /dev/null
+++ b/app/src/main/res/menu/hs_menu.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_restore_backup"
+ android:title="@string/restore_backup" />
+</menu>
\ 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 05408dc..adeba6f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -346,4 +346,5 @@
<string name="please_grant_permissions_for_external_storage">Please grant permissions for external storage</string>
<string name="permission_granted">Permission granted</string>
<string name="permission_denied">Permission denied</string>
+ <string name="restore_backup">Restore Backup</string>
</resources>
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits