mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
Add menu items to visit the webpage or report bugs.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package org.webodf;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import com.phonegap.DroidGap;
|
||||
|
||||
@@ -30,4 +35,49 @@ public class WebODFActivity extends DroidGap {
|
||||
sendJavascript("invokeString = '" + escapedPath + "';");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
MenuInflater inflater = getMenuInflater();
|
||||
inflater.inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle item selection
|
||||
switch (item.getItemId()) {
|
||||
case R.id.report_bug:
|
||||
reportIssue();
|
||||
return true;
|
||||
case R.id.about:
|
||||
about();
|
||||
return true;
|
||||
case R.id.visit_website:
|
||||
visitWebODFWebsite();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
private void visitWebODFWebsite() {
|
||||
String url = "http://webodf.org/";
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
private void about() {
|
||||
String url = "http://webodf.org/about/";
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
startActivity(i);
|
||||
}
|
||||
|
||||
private void reportIssue() {
|
||||
String url = "http://webodf.org/redmine/projects/webodf/issues";
|
||||
Intent i = new Intent(Intent.ACTION_VIEW);
|
||||
i.setData(Uri.parse(url));
|
||||
startActivity(i);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user