当前位置: 首页>>代码示例>>Java>>正文


Java KeyEvent.isTracking方法代码示例

本文整理汇总了Java中android.view.KeyEvent.isTracking方法的典型用法代码示例。如果您正苦于以下问题:Java KeyEvent.isTracking方法的具体用法?Java KeyEvent.isTracking怎么用?Java KeyEvent.isTracking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.KeyEvent的用法示例。


在下文中一共展示了KeyEvent.isTracking方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onKeyPreIme

import android.view.KeyEvent; //导入方法依赖的package包/类
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
    if (keyCode == 4) {
        DispatcherState state;
        if (event.getAction() == 0 && event.getRepeatCount() == 0) {
            state = getKeyDispatcherState();
            if (state == null) {
                return true;
            }
            state.startTracking(event, this);
            return true;
        } else if (event.getAction() == 1) {
            state = getKeyDispatcherState();
            if (state != null) {
                state.handleUpEvent(event);
            }
            if (event.isTracking() && !event.isCanceled()) {
                this.mSearchView.clearFocus();
                this.mSearchView.setImeVisibility(false);
                return true;
            }
        }
    }
    return super.onKeyPreIme(keyCode, event);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:25,代码来源:SearchView.java

示例2: onKey

import android.view.KeyEvent; //导入方法依赖的package包/类
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
    if (mPopup == null || mPopup.getListView() == null) return false;

    if (event.getKeyCode() == KeyEvent.KEYCODE_MENU) {
        if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
            event.startTracking();
            v.getKeyDispatcherState().startTracking(event, this);
            return true;
        } else if (event.getAction() == KeyEvent.ACTION_UP) {
            v.getKeyDispatcherState().handleUpEvent(event);
            if (event.isTracking() && !event.isCanceled()) {
                dismiss();
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:AppMenu.java

示例3: onKey

import android.view.KeyEvent; //导入方法依赖的package包/类
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK) {
        if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
            // Tell the framework to start tracking this event.
            getKeyDispatcherState().startTracking(event, this);
            return true;
        } else if (event.getAction() == KeyEvent.ACTION_UP) {
            getKeyDispatcherState().handleUpEvent(event);
            if (event.isTracking() && !event.isCanceled()) {
                mFindToolbar.deactivate();
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:18,代码来源:FindToolbar.java

示例4: onKeyUp

import android.view.KeyEvent; //导入方法依赖的package包/类
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (event.isTracking()) {
        if (!mChildrenFocused && keyCode == KeyEvent.KEYCODE_ENTER) {
            mChildrenFocused = true;
            ArrayList<View> focusableChildren = getFocusables(FOCUS_FORWARD);
            focusableChildren.remove(this);
            int childrenCount = focusableChildren.size();
            switch (childrenCount) {
                case 0:
                    mChildrenFocused = false;
                    break;
                case 1: {
                    if (getTag() instanceof ItemInfo) {
                        ItemInfo item = (ItemInfo) getTag();
                        if (item.spanX == 1 && item.spanY == 1) {
                            focusableChildren.get(0).performClick();
                            mChildrenFocused = false;
                            return true;
                        }
                    }
                    // continue;
                }
                default:
                    focusableChildren.get(0).requestFocus();
                    return true;
            }
        }
    }
    return super.onKeyUp(keyCode, event);
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:32,代码来源:LauncherAppWidgetHostView.java

示例5: onKeyUp

import android.view.KeyEvent; //导入方法依赖的package包/类
public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (keyCode != 4 || !event.isTracking() || event.isCanceled()) {
        return super.onKeyUp(keyCode, event);
    }
    if (this.mLiveFragment.onBackPressed() && event.getRepeatCount() == 0) {
        return true;
    }
    if (!LetvUtils.isNoRetainPopupPcode() && mExitRetainController.showExitRetainPopupwindow(getWindow().getDecorView().getRootView())) {
        return true;
    }
    handleTwiceBackExit();
    return true;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:MainActivity.java

示例6: onKeyUp

import android.view.KeyEvent; //导入方法依赖的package包/类
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking() && !event.isCanceled()) {
        if (getScale() > 1.0f) {
            // If we're zoomed in, pressing Back jumps out to show the
            // entire image, otherwise Back returns the user to the gallery
            zoomTo(1.0f);
            return true;
        }
    }
    return super.onKeyUp(keyCode, event);
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:13,代码来源:ImageViewTouchBase.java

示例7: isTracking

import android.view.KeyEvent; //导入方法依赖的package包/类
public static boolean isTracking(KeyEvent event) {
    return event.isTracking();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:4,代码来源:KeyEventCompatEclair.java

示例8: onKeyUp

import android.view.KeyEvent; //导入方法依赖的package包/类
/**
 * Called when a key was released and not handled by any of the views
 * inside of the activity. So, for example, key presses while the cursor
 * is inside a TextView will not trigger the event (unless it is a navigation
 * to another object) because TextView handles its own key presses.
 *
 * <p>The default implementation handles KEYCODE_BACK to stop the activity
 * and go back.
 *
 * @return Return <code>true</code> to prevent this event from being propagated
 * further, or <code>false</code> to indicate that you have not handled
 * this event and it should continue to be propagated.
 * @see #onKeyDown
 * @see KeyEvent
 */
public boolean onKeyUp(int keyCode, KeyEvent event) {
    if (getApplicationInfo().targetSdkVersion
            >= Build.VERSION_CODES.ECLAIR) {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.isTracking()
                && !event.isCanceled()) {
            onBackPressed();
            return true;
        }
    }
    return false;
}
 
开发者ID:JessYanCoding,项目名称:ProgressManager,代码行数:27,代码来源:a.java


注:本文中的android.view.KeyEvent.isTracking方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。