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

Verified Commit 91b28a78 authored by Kshitij's avatar Kshitij Committed by Saalim Quadri
Browse files

fix: Update click receivers for two-pane widget picker as well

parent e93a2d45
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -142,7 +142,7 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
    }

    @Override
    public final void onClick(View v) {
    public void onClick(View v) {
        WidgetCell wc;
        if (v instanceof WidgetCell view) {
            wc = view;
+19 −6
Original line number Diff line number Diff line
@@ -1095,6 +1095,23 @@ public class WidgetsFullSheet extends BaseWidgetSheet
        return findViewById(R.id.primary_widgets_list_view);
    }

    public void onClick(View v) {
        if (isEditMode) {
            WidgetFragment.onWidgetClick(mActivityContext, v, close -> {
                handleClose(false);
                return null;
            });
        } else {
            super.onClick(v);
        }
    }

    @Override
    public boolean onLongClick(View v) {
        if (isEditMode) return false;
        return super.onLongClick(v);
    }

    /** A holder class for holding adapters & their corresponding recycler view. */
    final class AdapterHolder {
        static final int PRIMARY = 0;
@@ -1115,12 +1132,8 @@ public class WidgetsFullSheet extends BaseWidgetSheet
                    context,
                    LayoutInflater.from(context),
                    this::getEmptySpaceHeight,
                    /* iconClickListener= */ !isEditMode ? WidgetsFullSheet.this :
                    v -> WidgetFragment.onWidgetClick(context, v, close -> {
                        handleClose(false);
                        return null;
                    }),
                    /* iconLongClickListener= */ !isEditMode ? WidgetsFullSheet.this : null,
                    WidgetsFullSheet.this,
                    WidgetsFullSheet.this,
                    /* expandButtonClickListener= */ WidgetsFullSheet.this,
                    isTwoPane());
            mWidgetsListAdapter.setHasStableIds(true);