Closes #1265: Adds checkbox to crash reporter
This commit is contained in:
parent
d58f5f6e53
commit
0bf8b83e03
|
@ -16,7 +16,6 @@ import kotlinx.android.synthetic.main.fragment_crash_reporter.*
|
|||
import mozilla.components.lib.crash.Crash
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.ext.requireComponents
|
||||
import org.mozilla.fenix.utils.Settings
|
||||
|
||||
class CrashReporterFragment : Fragment() {
|
||||
override fun onCreateView(
|
||||
|
@ -35,13 +34,13 @@ class CrashReporterFragment : Fragment() {
|
|||
|
||||
// TODO TelemetryWrapper.crashReporterOpened()
|
||||
|
||||
closeTabButton.setOnClickListener {
|
||||
close_tab_button.setOnClickListener {
|
||||
val selectedSession = requireComponents.core.sessionManager.selectedSession
|
||||
|
||||
selectedSession?.let { session -> requireComponents.useCases.tabsUseCases.removeTab.invoke(session) }
|
||||
// TODO TelemetryWrapper.crashReporterClosed(wantsSubmitCrashReport)
|
||||
|
||||
if (Settings.getInstance(context!!).isCrashReportingEnabled) {
|
||||
if (send_crash_checkbox.isChecked) {
|
||||
requireComponents.analytics.crashReporter.submitReport(crash)
|
||||
}
|
||||
|
||||
|
|
|
@ -34,8 +34,23 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/crash_tab_image" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/send_crash_checkbox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:buttonTint="@color/crash_page_accent"
|
||||
android:checked="true"
|
||||
android:text="@string/tab_crash_send_report"
|
||||
android:textColor="@color/light_mode_text_color"
|
||||
android:textSize="15sp"
|
||||
app:layout_constraintBottom_toTopOf="@id/close_tab_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintWidth_percent="0.9"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/restoreTabButton"
|
||||
android:id="@+id/restore_tab_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="@dimen/crash_reporter_close_tab_button_horizontal_margin"
|
||||
|
@ -54,7 +69,7 @@
|
|||
app:layout_constraintWidth_percent="0.4" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/closeTabButton"
|
||||
android:id="@+id/close_tab_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="@dimen/crash_reporter_close_tab_button_horizontal_margin"
|
||||
|
|
Loading…
Reference in New Issue