Merge "Intercept the click from inline suggestion child view." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
82a087ddef
@@ -97,6 +97,9 @@ public abstract class InlineSuggestionRenderService extends Service {
|
|||||||
host.setView(suggestionRoot, lp);
|
host.setView(suggestionRoot, lp);
|
||||||
suggestionRoot.setOnClickListener((v) -> {
|
suggestionRoot.setOnClickListener((v) -> {
|
||||||
try {
|
try {
|
||||||
|
if (suggestionView.hasOnClickListeners()) {
|
||||||
|
suggestionView.callOnClick();
|
||||||
|
}
|
||||||
callback.onClick();
|
callback.onClick();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "RemoteException calling onClick()");
|
Log.w(TAG, "RemoteException calling onClick()");
|
||||||
@@ -105,6 +108,9 @@ public abstract class InlineSuggestionRenderService extends Service {
|
|||||||
|
|
||||||
suggestionRoot.setOnLongClickListener((v) -> {
|
suggestionRoot.setOnLongClickListener((v) -> {
|
||||||
try {
|
try {
|
||||||
|
if (suggestionView.hasOnLongClickListeners()) {
|
||||||
|
suggestionView.performLongClick();
|
||||||
|
}
|
||||||
callback.onLongClick();
|
callback.onLongClick();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
Log.w(TAG, "RemoteException calling onLongClick()");
|
Log.w(TAG, "RemoteException calling onLongClick()");
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ public class InlineSuggestionRoot extends FrameLayout {
|
|||||||
setFocusable(false);
|
setFocusable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
public boolean onTouchEvent(@NonNull MotionEvent event) {
|
public boolean onTouchEvent(@NonNull MotionEvent event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user