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

Commit 5547632c authored by Feng Cao's avatar Feng Cao
Browse files

Intercept the click from inline suggestion child view.

* so that the parent view's onClick, onLongClick listeners
  as well as scrolling still works
* explicitly invoke child view's onClick and onLongClick
  listeners from the parent view's listeners

Test: manual verification
Bug: 150321630

Change-Id: Ie9e9b5a17fa15b502c51a2fbb6af2c09a77d567f
parent 323255dd
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,9 @@ public abstract class InlineSuggestionRenderService extends Service {
            host.setView(suggestionRoot, lp);
            suggestionRoot.setOnClickListener((v) -> {
                try {
                    if (suggestionView.hasOnClickListeners()) {
                        suggestionView.callOnClick();
                    }
                    callback.onClick();
                } catch (RemoteException e) {
                    Log.w(TAG, "RemoteException calling onClick()");
@@ -105,6 +108,9 @@ public abstract class InlineSuggestionRenderService extends Service {

            suggestionRoot.setOnLongClickListener((v) -> {
                try {
                    if (suggestionView.hasOnLongClickListeners()) {
                        suggestionView.performLongClick();
                    }
                    callback.onLongClick();
                } catch (RemoteException e) {
                    Log.w(TAG, "RemoteException calling onLongClick()");
+5 −0
Original line number Diff line number Diff line
@@ -51,6 +51,11 @@ public class InlineSuggestionRoot extends FrameLayout {
        setFocusable(false);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        return true;
    }

    @Override
    @SuppressLint("ClickableViewAccessibility")
    public boolean onTouchEvent(@NonNull MotionEvent event) {