Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2ef52d6 authored by Lucas Silva's avatar Lucas Silva
Browse files

Update dream settings logic to keep the customize button unselected.

Test: manually on device
Bug: 227717835
Fixed: 227717835
Change-Id: I4d796c3b7510baf07a670347fe4112a0b95d3036
parent 5ef52de6
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -105,11 +105,6 @@ public class DreamAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
            icon.setBounds(0, 0, iconSize, iconSize);
            mTitleView.setCompoundDrawablesRelative(icon, null, null, null);

            mCustomizeButton.setOnClickListener(v -> item.onCustomizeClicked());
            mCustomizeButton.setVisibility(
                    item.allowCustomization() && mEnabled ? View.VISIBLE : View.GONE);
            mCustomizeButton.setSelected(false);

            itemView.setOnClickListener(v -> {
                item.onItemClicked();
                if (mLastSelectedPos > -1 && mLastSelectedPos != position) {
@@ -127,6 +122,13 @@ public class DreamAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
                itemView.setClickable(true);
            }

            mCustomizeButton.setOnClickListener(v -> item.onCustomizeClicked());
            mCustomizeButton.setVisibility(
                    item.allowCustomization() && mEnabled ? View.VISIBLE : View.GONE);
            // This must be called AFTER itemView.setSelected above, in order to keep the
            // customize button in an unselected state.
            mCustomizeButton.setSelected(false);

            setEnabledStateOnViews(itemView, mEnabled);
        }