import androidx.annotation.NonNull;
public class HueRingDialog extends Dialog {
+ private final int currentHue;
private int initialHue;
private HueRing hueRing;
private HueSelectedListener listener;
- public HueRingDialog(@NonNull Context context, int initialHue) {
+ public HueRingDialog(@NonNull Context context, int initialHue, int currentHue) {
super(context);
this.initialHue = initialHue;
+ this.currentHue = currentHue;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.hue_dialog);
hueRing = findViewById(R.id.ring);
hueRing.setInitialHue(initialHue);
- hueRing.setHue(initialHue);
+ hueRing.setHue(currentHue);
findViewById(R.id.btn_ok).setOnClickListener(v -> {
if (listener != null) listener.onHueSelected(hueRing.getHueDegrees());
huePickerView.setTag(profileThemeId);
huePickerView.setOnClickListener(v -> {
HueRingDialog d = new HueRingDialog(
- Objects.requireNonNull(ProfileDetailFragment.this.getContext()), hue);
+ Objects.requireNonNull(ProfileDetailFragment.this.getContext()),
+ profileThemeId, (Integer) v.getTag());
d.show();
d.setColorSelectedListener(this);
});