本文整理汇总了Java中android.view.View.cancelLongPress方法的典型用法代码示例。如果您正苦于以下问题:Java View.cancelLongPress方法的具体用法?Java View.cancelLongPress怎么用?Java View.cancelLongPress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.cancelLongPress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cancelLongPress
import android.view.View; //导入方法依赖的package包/类
@Override
public void cancelLongPress() {
super.cancelLongPress();
// Cancel long press for all children
final int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
child.cancelLongPress();
}
}
示例2: requestDisallowInterceptTouchEvent
import android.view.View; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
if (disallowIntercept) {
// We need to make sure to cancel our long press if
// a scrollable widget takes over touch events
final View currentPage = getPageAt(mCurrentPage);
currentPage.cancelLongPress();
}
super.requestDisallowInterceptTouchEvent(disallowIntercept);
}
示例3: cancelCurrentPageLongPress
import android.view.View; //导入方法依赖的package包/类
protected void cancelCurrentPageLongPress() {
// Try canceling the long press. It could also have been scheduled
// by a distant descendant, so use the mAllowLongPress flag to block
// everything
final View currentPage = getPageAt(mCurrentPage);
if (currentPage != null) {
currentPage.cancelLongPress();
}
}
示例4: onKey
import android.view.View; //导入方法依赖的package包/类
public boolean onKey(View v, int keyCode, KeyEvent event) {
// guard against possible race conditions
if (mSearchable == null) {
return false;
}
if (DBG) {
Log.d(LOG_TAG, "mTextListener.onKey(" + keyCode + "," + event + "), selection: "
+ mQueryTextView.getListSelection());
}
// If a suggestion is selected, handle enter, search key, and action keys
// as presses on the selected suggestion
if (mQueryTextView.isPopupShowing()
&& mQueryTextView.getListSelection() != ListView.INVALID_POSITION) {
return onSuggestionsKey(v, keyCode, event);
}
// If there is text in the query box, handle enter, and action keys
// The search key is handled by the dialog's onKeyDown().
if (!mQueryTextView.isEmpty() && KeyEventCompat.hasNoModifiers(event)) {
if (event.getAction() == KeyEvent.ACTION_UP) {
if (keyCode == KeyEvent.KEYCODE_ENTER) {
v.cancelLongPress();
// Launch as a regular search.
launchQuerySearch(KeyEvent.KEYCODE_UNKNOWN, null, mQueryTextView.getText()
.toString());
return true;
}
}
if (event.getAction() == KeyEvent.ACTION_DOWN) {
// TODO SearchableInfo.ActionKeyInfo actionKey = mSearchable.findActionKey(keyCode);
// TODO if ((actionKey != null) && (actionKey.getQueryActionMsg() != null)) {
// TODO launchQuerySearch(keyCode, actionKey.getQueryActionMsg(), mQueryTextView
// TODO .getText().toString());
// TODO return true;
// TODO }
}
}
return false;
}