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

Commit 13955931 authored by Kshitij's avatar Kshitij
Browse files

Merge branch '2836os-u-twopanepicker' into 'v1-u'

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

See merge request e/os/BlissLauncher3!82
parents 8c93c865 979b4bd5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
    }

    @Override
    public final void onClick(View v) {
    public void onClick(View v) {
        if (v instanceof WidgetCell) {
            mActivityContext.getItemOnClickListener().onClick(v);
        } else if (v.getParent() instanceof WidgetCell wc) {
+20 −6
Original line number Diff line number Diff line
@@ -976,6 +976,24 @@ public class WidgetsFullSheet extends BaseWidgetSheet
        mAdapters.get(AdapterHolder.PRIMARY).mWidgetsRecyclerView.scrollToTop();
    }

    @Override
    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;
@@ -996,12 +1014,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,
                    isTwoPane());
            mWidgetsListAdapter.setHasStableIds(true);
            switch (mAdapterType) {