HandleViewpublic class HandleView extends android.widget.ImageView
Fields Summary |
---|
private static final int | ORIENTATION_HORIZONTAL | private Launcher | mLauncher | private int | mOrientation |
Constructors Summary |
---|
public HandleView(android.content.Context context)
super(context);
| public HandleView(android.content.Context context, android.util.AttributeSet attrs)
this(context, attrs, 0);
| public HandleView(android.content.Context context, android.util.AttributeSet attrs, int defStyle)
super(context, attrs, defStyle);
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.HandleView, defStyle, 0);
mOrientation = a.getInt(R.styleable.HandleView_direction, ORIENTATION_HORIZONTAL);
a.recycle();
|
Methods Summary |
---|
public android.view.View | focusSearch(int direction)
View newFocus = super.focusSearch(direction);
if (newFocus == null && mLauncher.isDrawerDown()) {
final Workspace workspace = mLauncher.getWorkspace();
workspace.dispatchUnhandledMove(null, direction);
return (mOrientation == ORIENTATION_HORIZONTAL && direction == FOCUS_DOWN) ?
this : workspace;
}
return newFocus;
| private static boolean | isDirectionKey(int keyCode)
return keyCode == KeyEvent.KEYCODE_DPAD_DOWN || keyCode == KeyEvent.KEYCODE_DPAD_LEFT ||
keyCode == KeyEvent.KEYCODE_DPAD_RIGHT || keyCode == KeyEvent.KEYCODE_DPAD_UP;
| public boolean | onKeyDown(int keyCode, android.view.KeyEvent event)
final boolean handled = super.onKeyDown(keyCode, event);
if (!handled && !mLauncher.isDrawerDown() && !isDirectionKey(keyCode)) {
return mLauncher.getApplicationsGrid().onKeyDown(keyCode, event);
}
return handled;
| public boolean | onKeyUp(int keyCode, android.view.KeyEvent event)
final boolean handled = super.onKeyUp(keyCode, event);
if (!handled && !mLauncher.isDrawerDown() && !isDirectionKey(keyCode)) {
return mLauncher.getApplicationsGrid().onKeyUp(keyCode, event);
}
return handled;
| void | setLauncher(Launcher launcher)
mLauncher = launcher;
|
|