本文整理匯總了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;
}