本文整理汇总了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();
}
}