mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-30 00:01:19 +00:00
Added menu with link to issue tracker.
This commit is contained in:
parent
6f500f7c89
commit
65bc9c46da
3 changed files with 36 additions and 1 deletions
8
res/menu/menu.xml
Normal file
8
res/menu/menu.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/report_issue"
|
||||||
|
android:title="@string/report_issue" />
|
||||||
|
|
||||||
|
</menu>
|
|
@ -3,6 +3,13 @@
|
||||||
|
|
||||||
<string name="app_name">Syncthing</string>
|
<string name="app_name">Syncthing</string>
|
||||||
|
|
||||||
|
<!-- Text for WebGuiActivity loading view -->
|
||||||
<string name="web_gui_loading">Waiting for GUI</string>
|
<string name="web_gui_loading">Waiting for GUI</string>
|
||||||
|
|
||||||
|
<!-- Menu item "report issue" that opens issue tracker -->
|
||||||
|
<string name="report_issue">Report Issue</string>
|
||||||
|
|
||||||
|
<!-- URL of the issue tracker -->
|
||||||
|
<string name="issue_tracker_url" translatable="false">https://github.com/Nutomic/syncthing-android/issues</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -2,8 +2,11 @@ package com.nutomic.syncthingandroid;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
|
@ -71,4 +74,21 @@ public class WebGuiActivity extends Activity {
|
||||||
mWebView.loadUrl(SYNCTHING_URL);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue