Integrate crash reporting (#418)

Disable minify to get proper logs

Enable it by default

Integrate crash reporting

Reviewed-on: https://gitea.com/gitnex/GitNex/pulls/418
Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
M M Arif
2020-04-17 23:39:49 +00:00
committed by 6543
parent 30165f27ba
commit 0c6c596208
9 changed files with 138 additions and 6 deletions

View File

@@ -76,6 +76,7 @@ public class SettingsFragment extends Fragment {
Switch counterBadgesSwitch = v.findViewById(R.id.switchCounterBadge);
Switch pdfModeSwitch = v.findViewById(R.id.switchPdfMode);
Switch crashReportsSwitch = v.findViewById(R.id.crashReportsSwitch);
TextView helpTranslate = v.findViewById(R.id.helpTranslate);
helpTranslate.setOnClickListener(v12 -> {
@@ -158,6 +159,13 @@ public class SettingsFragment extends Fragment {
pdfModeSwitch.setChecked(false);
}
if(tinyDb.getBoolean("crashReportingEnabled")) {
crashReportsSwitch.setChecked(true);
}
else {
crashReportsSwitch.setChecked(false);
}
// fileviewer srouce code theme selection dialog
sourceCodeThemeFrame.setOnClickListener(view -> {
@@ -239,6 +247,20 @@ public class SettingsFragment extends Fragment {
});
// crash reports switcher
crashReportsSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {
if(isChecked) {
tinyDb.putBoolean("crashReportingEnabled", true);
Toasty.info(getContext(), getResources().getString(R.string.settingsSave));
}
else {
tinyDb.putBoolean("crashReportingEnabled", false);
Toasty.info(getContext(), getResources().getString(R.string.settingsSave));
}
});
// theme selection dialog
themeFrame.setOnClickListener(view -> {