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

Commit dc44eb1f authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Update dream settings logic to keep the customize button unselected." into tm-dev

parents 8f463f5c e2ef52d6
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);
        }