From f5fbb1b05e812a1ee5b2730eccfbfd41fecb4b8e Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 28 May 2022 15:08:52 +0200 Subject: [PATCH] Alert dialog for crash reports --- app/build.gradle | 2 +- .../java/app/fedilab/android/MainApplication.java | 12 +++++++----- .../app/fedilab/android/ui/drawer/StatusAdapter.java | 1 - 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cfcd2a57d..e7ca274c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -103,7 +103,7 @@ dependencies { implementation "com.github.chrisbanes:PhotoView:2.3.0" implementation "ch.acra:acra-mail:5.9.3" implementation "ch.acra:acra-limiter:5.9.3" - implementation "ch.acra:acra-notification:5.9.3" + implementation "ch.acra:acra-dialog:5.9.3" implementation "com.madgag.spongycastle:bctls-jdk15on:1.58.0.0" implementation 'com.github.UnifiedPush:android-connector:2.0.0' diff --git a/app/src/main/java/app/fedilab/android/MainApplication.java b/app/src/main/java/app/fedilab/android/MainApplication.java index 451f1150e..3de73cd4d 100644 --- a/app/src/main/java/app/fedilab/android/MainApplication.java +++ b/app/src/main/java/app/fedilab/android/MainApplication.java @@ -29,8 +29,8 @@ import com.jaredrummler.cyanea.prefs.CyaneaTheme; import org.acra.ACRA; import org.acra.ReportField; import org.acra.config.CoreConfigurationBuilder; +import org.acra.config.DialogConfigurationBuilder; import org.acra.config.MailSenderConfigurationBuilder; -import org.acra.config.NotificationConfigurationBuilder; import org.acra.data.StringFormat; import java.util.List; @@ -89,11 +89,13 @@ public class MainApplication extends MultiDexApplication { .withReportFileName("crash_report.txt") .withSubject("[Fedilab] - Crash Report " + BuildConfig.VERSION_CODE) .build(), - new NotificationConfigurationBuilder() + new DialogConfigurationBuilder() .withResIcon(R.mipmap.ic_launcher) - .withChannelName(getString(R.string.set_crash_reports)) - .withTitle(getString(R.string.crash_title)) - .withText(getString(R.string.crash_message)) + .withText(getString(R.string.crash_title)) + .withCommentPrompt(getString(R.string.crash_message)) + .withResTheme(R.style.DialogDark) + .withPositiveButtonText(getString(R.string.send_email)) + .withNegativeButtonText(getString(R.string.cancel)) .build() ).withReportContent( ReportField.INSTALLATION_ID, diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 9e9f5e54c..608ac56d8 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -812,7 +812,6 @@ public class StatusAdapter extends RecyclerView.Adapter holder.binding.mediaContainer.setVisibility(View.GONE); } else { holder.binding.statusContent.setVisibility(View.VISIBLE); - } } else { holder.binding.statusContent.setVisibility(View.GONE);