Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Fix crash reporting and telemetry switches always show off. Fixes #844
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro committed Nov 27, 2018
1 parent f5e522d commit dcb38f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ private void initialize(Context aContext) {
mStateText = findViewById(R.id.honeycombSwitchStateText);
}

public void setChecked(boolean aChecked) {
mSwitch.setChecked(aChecked);
}

private CompoundButton.OnCheckedChangeListener mInternalSwitchListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ private void initialize(Context aContext) {
});

HoneycombSwitch crashSwitch = findViewById(R.id.crashReportingSwitch);
crashSwitch.setChecked(SettingsStore.getInstance(getContext()).isCrashReportingEnabled());
crashSwitch.setOnCheckedChangeListener((compoundButton, b) -> {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
Expand All @@ -129,6 +130,7 @@ private void initialize(Context aContext) {
});

HoneycombSwitch telemetrySwitch = findViewById(R.id.telemetry_switch);
telemetrySwitch.setChecked(SettingsStore.getInstance(getContext()).isTelemetryEnabled());
telemetrySwitch.setOnCheckedChangeListener((compoundButton, b) -> {
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
Expand Down

0 comments on commit dcb38f3

Please sign in to comment.