From 65bc9c46da75af273476ee3f1c99c27f1e13f317 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 6 May 2014 12:41:31 +0200 Subject: [PATCH] Added menu with link to issue tracker. --- res/menu/menu.xml | 8 +++++++ res/values/strings.xml | 7 ++++++ .../syncthingandroid/WebGuiActivity.java | 22 ++++++++++++++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 res/menu/menu.xml diff --git a/res/menu/menu.xml b/res/menu/menu.xml new file mode 100644 index 00000000..c1860004 --- /dev/null +++ b/res/menu/menu.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/res/values/strings.xml b/res/values/strings.xml index b2341ab1..51111a2a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -3,6 +3,13 @@ Syncthing + Waiting for GUI + + Report Issue + + + https://github.com/Nutomic/syncthing-android/issues + diff --git a/src/com/nutomic/syncthingandroid/WebGuiActivity.java b/src/com/nutomic/syncthingandroid/WebGuiActivity.java index 7f1ea9b7..98721491 100644 --- a/src/com/nutomic/syncthingandroid/WebGuiActivity.java +++ b/src/com/nutomic/syncthingandroid/WebGuiActivity.java @@ -2,8 +2,11 @@ package com.nutomic.syncthingandroid; import android.app.Activity; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.os.Handler; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; @@ -63,12 +66,29 @@ public class WebGuiActivity extends Activity { mLoadingView = findViewById(R.id.loading); ProgressBar pb = (ProgressBar) mLoadingView.findViewById(R.id.progress); pb.setIndeterminate(true); - + mWebView = (WebView) findViewById(R.id.webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.setWebViewClient(new WebViewClient()); mWebView.setWebViewClient(mWebViewClient); mWebView.loadUrl(SYNCTHING_URL); } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.menu, menu); + return true; + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.report_issue: + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.issue_tracker_url)))); + return true; + default: + return super.onOptionsItemSelected(item); + } + } }