diff --git a/briar-android/res/layout/activity_dev_report.xml b/briar-android/res/layout/activity_dev_report.xml index 37fac97b85a428f35d03bb07a45fa069d1c9a427..8d1c8ac39e30c7c61f48157c70017e89372ef04e 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"/> - <android.support.design.widget.FloatingActionButton - android:id="@+id/share_dev_report" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" - android:layout_marginBottom="@dimen/margin_large" - android:layout_marginEnd="@dimen/margin_large" - android:layout_marginRight="@dimen/margin_large" - android:background="@color/briar_accent" - android:src="@drawable/social_share" - android:tint="@color/action_bar_text"/> - </RelativeLayout> </LinearLayout> \ 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 0000000000000000000000000000000000000000..0567cb5d69e956c9309c6274fe93fb8ffd822d38 --- /dev/null +++ b/briar-android/res/menu/dev_report_actions.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto"> + + <item + android:id="@+id/action_send_report" + android:icon="@drawable/social_send_now_white" + android:title="@string/send_report" + app:showAsAction="always"/> + +</menu> \ No newline at end of file diff --git a/briar-android/res/values/strings.xml b/briar-android/res/values/strings.xml index 0820b287c4166780fdf8621b76500e0ca1481625..8de4763514ca5495126ee0f1b9e001cd7c0c5271 100644 --- a/briar-android/res/values/strings.xml +++ b/briar-android/res/values/strings.xml @@ -11,6 +11,7 @@ <string name="debug_report">Debug report:</string> <string name="include_debug_report">Include debug report?</string> <string name="could_not_load_report_data">Could not load report data.</string> + <string name="send_report">Send report</string> <string name="dev_report_saved">Report saved. It will be sent the next time you log into Briar.</string> <string name="ongoing_notification_title">Signed into Briar</string> <string name="ongoing_notification_text">Touch to open Briar.</string> diff --git a/briar-android/src/org/briarproject/android/report/DevReportActivity.java b/briar-android/src/org/briarproject/android/report/DevReportActivity.java index 26dcaafae081bc91e2da028901aec739d0e58726..01eea151a2afb6acf06f6c545b752222c5ccfad2 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();