本文整理匯總了Java中android.support.v7.view.ActionMode.invalidate方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMode.invalidate方法的具體用法?Java ActionMode.invalidate怎麽用?Java ActionMode.invalidate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.view.ActionMode
的用法示例。
在下文中一共展示了ActionMode.invalidate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: notesLoaded
import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
private void notesLoaded(Cursor cursor) {
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, cursor);
/*
* Swapping instead of changing Cursor here, to keep the old one open.
* Loader should release the old Cursor - see note in
* {@link LoaderManager.LoaderCallbacks#onLoadFinished).
*/
mListAdapter.swapCursor(cursor);
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, "after swap: cursor/adapter count: " + cursor.getCount() + "/" + mListAdapter.getCount());
/* Display "No notes" text, unless notes or preface are displayed. */
if (mListAdapter.getCount() > 0 || isPrefaceDisplayed()) {
mNoNotesText.setVisibility(View.GONE);
} else {
mNoNotesText.setVisibility(View.VISIBLE);
}
if (mActionModeListener != null) {
mActionModeListener.updateActionModeForSelection(mSelection.getCount(), new MyActionMode());
ActionMode actionMode = mActionModeListener.getActionMode();
if (actionMode != null && mActionModeTag != null) {
actionMode.setTag("M"); // TODO: Ugh.
actionMode.invalidate();
mActionModeTag = null;
}
}
/* Scroll to note if note id argument is set. */
scrollToNoteIfSet();
}
示例2: onItemCheckedStateChanged
import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public void onItemCheckedStateChanged(@NonNull final ActionMode mode, final long itemId,
final boolean checked, final boolean fromUser) {
mode.invalidate();
mModalChoiceModeListener.onItemCheckedStateChanged(mode, itemId, checked, fromUser);
// If there are no items selected we no longer need the selection mode.
if (mFinishActionModeOnClearEnabled && getCheckedItemCount() == 0) {
mFinishFromUser = true;
mode.finish();
}
}