Merge branch 'acra-dialog-styles' into 'master'
Use custom layout for ACRA report dialog, not default one. Styling the default dialog was difficult and it doesn't obey some of the guidelines provided by the Android design docs: https://www.google.com/design/spec/components/dialogs.html#dialogs-specs (see "Content Guidelines") This change introduces a custom dialog extending the base ACRA reporting activity. Specifically, it introduces a padding of 24dp around the dialog contents. I couldn't find design specs on the specific spacing between different elements _within_ the dialog, so I used the same spacing of 20dp suggested to use between the title and the main body of the dialog. At the very least, this change should make it easier to update styles in the future if somebody suggests improvements to the layout of the dialog. ### Before  ### After  See merge request !186
This commit is contained in:
commit
87fb293348
@ -376,7 +376,8 @@
|
|||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value=".FDroid" />
|
android:value=".FDroid" />
|
||||||
</activity>
|
</activity>
|
||||||
<activity android:name="org.acra.CrashReportDialog"
|
<activity
|
||||||
|
android:name="org.fdroid.fdroid.CrashReportActivity"
|
||||||
android:theme="@style/AlertDialogThemeDark"
|
android:theme="@style/AlertDialogThemeDark"
|
||||||
android:process=":error_report"
|
android:process=":error_report"
|
||||||
android:launchMode="singleInstance"
|
android:launchMode="singleInstance"
|
||||||
|
43
F-Droid/res/layout/crash_report_dialog.xml
Normal file
43
F-Droid/res/layout/crash_report_dialog.xml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="24dp"
|
||||||
|
android:paddingRight="24dp"
|
||||||
|
android:paddingBottom="24dp"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/text1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/crash_dialog_text"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@android:id/text2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="@string/crash_dialog_comment_prompt"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@android:id/input"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
44
F-Droid/src/org/fdroid/fdroid/CrashReportActivity.java
Normal file
44
F-Droid/src/org/fdroid/fdroid/CrashReportActivity.java
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
package org.fdroid.fdroid;
|
||||||
|
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import org.acra.BaseCrashReportDialog;
|
||||||
|
|
||||||
|
public class CrashReportActivity extends BaseCrashReportDialog implements DialogInterface.OnDismissListener, DialogInterface.OnClickListener {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
final AlertDialog dialog = new AlertDialog.Builder(this)
|
||||||
|
.setTitle(R.string.crash_dialog_title)
|
||||||
|
.setView(R.layout.crash_report_dialog)
|
||||||
|
.setPositiveButton(R.string.ok, this)
|
||||||
|
.setNegativeButton(R.string.cancel, this)
|
||||||
|
.create();
|
||||||
|
|
||||||
|
dialog.setCanceledOnTouchOutside(false);
|
||||||
|
dialog.setOnDismissListener(this);
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
if (which == DialogInterface.BUTTON_POSITIVE) {
|
||||||
|
final String comment = ((EditText) findViewById(android.R.id.input)).getText().toString();
|
||||||
|
sendCrash(comment, "");
|
||||||
|
} else {
|
||||||
|
cancelReports();
|
||||||
|
}
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -67,9 +67,7 @@ import sun.net.www.protocol.bluetooth.Handler;
|
|||||||
|
|
||||||
@ReportsCrashes(mailTo = "reports@f-droid.org",
|
@ReportsCrashes(mailTo = "reports@f-droid.org",
|
||||||
mode = ReportingInteractionMode.DIALOG,
|
mode = ReportingInteractionMode.DIALOG,
|
||||||
resDialogTitle = R.string.crash_dialog_title,
|
reportDialogClass = CrashReportActivity.class
|
||||||
resDialogText = R.string.crash_dialog_text,
|
|
||||||
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt
|
|
||||||
)
|
)
|
||||||
public class FDroidApp extends Application {
|
public class FDroidApp extends Application {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user