diff --git a/briar-android/res/layout/activity_dev_report.xml b/briar-android/res/layout/activity_dev_report.xml
index 37fac97b8..8d1c8ac39 100644
--- a/briar-android/res/layout/activity_dev_report.xml
+++ b/briar-android/res/layout/activity_dev_report.xml
@@ -118,19 +118,5 @@
android:indeterminate="true"
android:visibility="gone"/>
-
-
\ No newline at end of file
diff --git a/briar-android/res/menu/dev_report_actions.xml b/briar-android/res/menu/dev_report_actions.xml
new file mode 100644
index 000000000..0567cb5d6
--- /dev/null
+++ b/briar-android/res/menu/dev_report_actions.xml
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/briar-android/res/values/strings.xml b/briar-android/res/values/strings.xml
index 0820b287c..8de476351 100644
--- a/briar-android/res/values/strings.xml
+++ b/briar-android/res/values/strings.xml
@@ -11,6 +11,7 @@
Debug report:
Include debug report?
Could not load report data.
+ Send report
Report saved. It will be sent the next time you log into Briar.
Signed into Briar
Touch to open Briar.
diff --git a/briar-android/src/org/briarproject/android/report/DevReportActivity.java b/briar-android/src/org/briarproject/android/report/DevReportActivity.java
index 26dcaafae..01eea151a 100644
--- a/briar-android/src/org/briarproject/android/report/DevReportActivity.java
+++ b/briar-android/src/org/briarproject/android/report/DevReportActivity.java
@@ -10,8 +10,10 @@ import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
import android.view.View;
-import android.view.View.OnClickListener;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
@@ -78,7 +80,7 @@ public class DevReportActivity extends BaseCrashReportDialog
private View chevron = null;
private LinearLayout report = null;
private View progress = null;
- private View share = null;
+ private MenuItem sendReport = null;
private boolean reviewing = false;
private AppCompatDelegate getDelegate() {
@@ -118,7 +120,6 @@ public class DevReportActivity extends BaseCrashReportDialog
chevron = findViewById(R.id.chevron);
report = (LinearLayout) findViewById(R.id.report_content);
progress = findViewById(R.id.progress_wheel);
- share = findViewById(R.id.share_dev_report);
//noinspection ConstantConditions
getDelegate().getSupportActionBar().setTitle(
@@ -140,12 +141,6 @@ public class DevReportActivity extends BaseCrashReportDialog
report.setVisibility(GONE);
}
});
- share.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- processReport();
- }
- });
String userEmail = prefs.getString(ACRA.PREF_USER_EMAIL_ADDRESS, "");
userEmailView.setText(userEmail);
@@ -173,6 +168,31 @@ public class DevReportActivity extends BaseCrashReportDialog
getDelegate().onPostResume();
}
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ // Inflate the menu items for use in the action bar
+ MenuInflater inflater = getDelegate().getMenuInflater();
+ inflater.inflate(R.menu.dev_report_actions, menu);
+ sendReport = menu.findItem(R.id.action_send_report);
+
+ return super.onCreateOptionsMenu(menu);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(final MenuItem item) {
+ // Handle presses on the action bar items
+ switch (item.getItemId()) {
+ case android.R.id.home:
+ onBackPressed();
+ return true;
+ case R.id.action_send_report:
+ processReport();
+ return true;
+ default:
+ return super.onOptionsItemSelected(item);
+ }
+ }
+
@Override
public void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
@@ -305,7 +325,7 @@ public class DevReportActivity extends BaseCrashReportDialog
private void processReport() {
userCommentView.setEnabled(false);
userEmailView.setEnabled(false);
- share.setEnabled(false);
+ sendReport.setEnabled(false);
progress.setVisibility(VISIBLE);
final boolean includeReport =
!isFeedback() || includeDebugReport.isChecked();