mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Allow right-click of taskbar icons to launch long-click menu.
Fix: 290459491 Test: TaplTestsTaskbar#testOpenMenuViaRightClick Flag: NONE. Change-Id: Ide85f62e5b08d5261f15871e85d3250cc66d0919
This commit is contained in:
@@ -29,6 +29,7 @@ import android.graphics.Canvas;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.InputDevice;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -408,6 +409,16 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
|
||||
public void setClickAndLongClickListenersForIcon(View icon) {
|
||||
icon.setOnClickListener(mIconClickListener);
|
||||
icon.setOnLongClickListener(mIconLongClickListener);
|
||||
// Add right-click support to btv icons.
|
||||
icon.setOnTouchListener((v, event) -> {
|
||||
if (event.isFromSource(InputDevice.SOURCE_MOUSE)
|
||||
&& (event.getButtonState() & MotionEvent.BUTTON_SECONDARY) != 0
|
||||
&& v instanceof BubbleTextView) {
|
||||
mActivityContext.showPopupMenuForIcon((BubbleTextView) v);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user