Hide debug report by default for both crash reports and feedback

This commit is contained in:
str4d
2016-07-15 23:36:37 +00:00
committed by Torsten Grote
parent a51d2f47af
commit 2170d291a2
3 changed files with 43 additions and 8 deletions

View File

@@ -53,8 +53,7 @@
android:inputType="textEmailAddress" android:inputType="textEmailAddress"
android:maxLines="1"/> android:maxLines="1"/>
<CheckBox <LinearLayout
android:id="@+id/include_debug_report"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/margin_large" android:layout_marginEnd="@dimen/margin_large"
@@ -62,7 +61,37 @@
android:layout_marginRight="@dimen/margin_large" android:layout_marginRight="@dimen/margin_large"
android:layout_marginStart="@dimen/margin_large" android:layout_marginStart="@dimen/margin_large"
android:layout_marginTop="@dimen/margin_small" android:layout_marginTop="@dimen/margin_small"
android:text="@string/include_debug_report"/> android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/debug_report"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/debug_report"
android:textColor="@color/briar_text_primary"/>
<CheckBox
android:id="@+id/include_debug_report"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="false"
android:text="@string/include_debug_report"
android:visibility="gone"/>
<ImageView
android:id="@+id/chevron"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/margin_large"
android:layout_marginStart="@dimen/margin_large"
android:clickable="true"
android:src="@drawable/selector_chevron"
android:tint="@color/briar_button_positive"/>
</LinearLayout>
<ScrollView <ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -80,7 +109,8 @@
android:paddingLeft="@dimen/margin_large" android:paddingLeft="@dimen/margin_large"
android:paddingRight="@dimen/margin_large" android:paddingRight="@dimen/margin_large"
android:paddingStart="@dimen/margin_large" android:paddingStart="@dimen/margin_large"
android:paddingTop="@dimen/margin_small"/> android:paddingTop="@dimen/margin_small"
android:visibility="gone"/>
</ScrollView> </ScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -8,6 +8,7 @@
<string name="describe_crash">Describe what happened</string> <string name="describe_crash">Describe what happened</string>
<string name="enter_feedback">Enter your feedback</string> <string name="enter_feedback">Enter your feedback</string>
<string name="optional_contact_email">Optional contact email</string> <string name="optional_contact_email">Optional contact email</string>
<string name="debug_report">Debug report:</string>
<string name="include_debug_report">Include 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="could_not_load_report_data">Could not load report data.</string>
<string name="dev_report_saved">Report saved. It will be sent the next time you log into Briar.</string> <string name="dev_report_saved">Report saved. It will be sent the next time you log into Briar.</string>

View File

@@ -71,6 +71,7 @@ public class DevReportActivity extends BaseCrashReportDialog
private EditText userCommentView = null; private EditText userCommentView = null;
private EditText userEmailView = null; private EditText userEmailView = null;
private CheckBox includeDebugReport = null; private CheckBox includeDebugReport = null;
private View chevron = null;
private LinearLayout report = null; private LinearLayout report = null;
private View progress = null; private View progress = null;
private View share = null; private View share = null;
@@ -97,7 +98,9 @@ public class DevReportActivity extends BaseCrashReportDialog
TextView title = (TextView) findViewById(R.id.title); TextView title = (TextView) findViewById(R.id.title);
userCommentView = (EditText) findViewById(R.id.user_comment); userCommentView = (EditText) findViewById(R.id.user_comment);
userEmailView = (EditText) findViewById(R.id.user_email); userEmailView = (EditText) findViewById(R.id.user_email);
TextView debugReport = (TextView) findViewById(R.id.debug_report);
includeDebugReport = (CheckBox) findViewById(R.id.include_debug_report); includeDebugReport = (CheckBox) findViewById(R.id.include_debug_report);
chevron = findViewById(R.id.chevron);
report = (LinearLayout) findViewById(R.id.report_content); report = (LinearLayout) findViewById(R.id.report_content);
progress = findViewById(R.id.progress_wheel); progress = findViewById(R.id.progress_wheel);
share = findViewById(R.id.share_dev_report); share = findViewById(R.id.share_dev_report);
@@ -107,13 +110,14 @@ public class DevReportActivity extends BaseCrashReportDialog
userCommentView.setHint(isFeedback() ? R.string.enter_feedback : userCommentView.setHint(isFeedback() ? R.string.enter_feedback :
R.string.describe_crash); R.string.describe_crash);
debugReport.setVisibility(isFeedback() ? GONE : VISIBLE);
includeDebugReport.setVisibility(isFeedback() ? VISIBLE : GONE); includeDebugReport.setVisibility(isFeedback() ? VISIBLE : GONE);
report.setVisibility(isFeedback() ? GONE : VISIBLE);
includeDebugReport.setOnClickListener(new View.OnClickListener() { chevron.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (includeDebugReport.isChecked()) chevron.setSelected(!chevron.isSelected());
if (chevron.isSelected())
refresh(); refresh();
else else
report.setVisibility(GONE); report.setVisibility(GONE);
@@ -137,7 +141,7 @@ public class DevReportActivity extends BaseCrashReportDialog
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
if (!isFeedback() && !reviewing) showCrashDialog(); if (!isFeedback() && !reviewing) showCrashDialog();
if (!isFeedback() || includeDebugReport.isChecked()) refresh(); if (chevron.isSelected()) refresh();
} }
@Override @Override