Skip to content

Commit

Permalink
Remove broken custom coloring for reset button
Browse files Browse the repository at this point in the history
  • Loading branch information
seadowg committed Aug 30, 2023
1 parent 6a4b12a commit 73db551
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.odk.collect.android.preferences.dialogs;

import static org.odk.collect.android.fragments.dialogs.ResetSettingsResultDialog.RESET_SETTINGS_RESULT_DIALOG_TAG;
import static org.odk.collect.android.utilities.ProjectResetter.ResetAction.RESET_PREFERENCES;

import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.View;
Expand All @@ -27,9 +29,6 @@

import timber.log.Timber;

import static org.odk.collect.android.fragments.dialogs.ResetSettingsResultDialog.RESET_SETTINGS_RESULT_DIALOG_TAG;
import static org.odk.collect.android.utilities.ProjectResetter.ResetAction.RESET_PREFERENCES;

public class ResetDialogPreferenceFragmentCompat extends PreferenceDialogFragmentCompat implements CompoundButton.OnCheckedChangeListener {

@Inject
Expand Down Expand Up @@ -220,16 +219,8 @@ public void adjustResetButtonAccessibility() {
if (preferences.isChecked() || instances.isChecked() || forms.isChecked()
|| layers.isChecked() || cache.isChecked()) {
((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(true);
((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE)
.setTextColor(((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_NEGATIVE).getCurrentTextColor());
} else {
((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE).setEnabled(false);
((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_POSITIVE)
.setTextColor(getPartiallyTransparentColor(((AlertDialog) getDialog()).getButton(AlertDialog.BUTTON_NEGATIVE).getCurrentTextColor()));
}
}

private int getPartiallyTransparentColor(int color) {
return Color.argb(150, Color.red(color), Color.green(color), Color.blue(color));
}
}
}

0 comments on commit 73db551

Please sign in to comment.