mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Removing unused keyboard handling code" into sc-dev
This commit is contained in:
@@ -26,7 +26,6 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
|
||||
import com.android.launcher3.dragndrop.DragLayer;
|
||||
import com.android.launcher3.util.FocusLogic;
|
||||
import com.android.launcher3.util.MainThreadInitializedObject;
|
||||
import com.android.launcher3.widget.LauncherAppWidgetHostView;
|
||||
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
|
||||
@@ -544,7 +543,7 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
|
||||
@Override
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
// Clear the frame and give focus to the widget host view when a directional key is pressed.
|
||||
if (FocusLogic.shouldConsume(keyCode)) {
|
||||
if (shouldConsume(keyCode)) {
|
||||
close(false);
|
||||
mWidgetView.requestFocus();
|
||||
return true;
|
||||
@@ -667,4 +666,14 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
|
||||
return moveEnd ? out.size() - size() : size() - out.size();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true only if this utility class handles the key code.
|
||||
*/
|
||||
public static boolean shouldConsume(int keyCode) {
|
||||
return (keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT
|
||||
|| keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN
|
||||
|| keyCode == KeyEvent.KEYCODE_MOVE_HOME || keyCode == KeyEvent.KEYCODE_MOVE_END
|
||||
|| keyCode == KeyEvent.KEYCODE_PAGE_UP || keyCode == KeyEvent.KEYCODE_PAGE_DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user