Пример #1
0
 @Override
 public boolean onLongClick(final View view) {
   if (mActionMode == null) {
     mActionMode = mActivity.startSupportActionMode(this);
   }
   toggleViewActivatedState(view);
   return true;
 }
Пример #2
0
 public void addViewToActionMode(final View view) {
   if (mActionMode == null) {
     mActionMode = mActivity.startSupportActionMode(this);
   }
   final int position = mRecyclerView.getChildPosition(view);
   if (!mActivatedPositions.contains(position)) {
     toggleViewActivatedState(view);
   }
 }
Пример #3
0
  public void restoreInstanceState(final Bundle bundle) {
    if (bundle == null) {
      return;
    }
    final List<Integer> items = bundle.getIntegerArrayList(ACTIVATED_POSITIONS);
    if (Utils.isCollectionEmpty(items)) {
      return;
    }

    mActivatedPositions.addAll(items);
    mActionMode = mActivity.startSupportActionMode(this);
    notifyActivatedItemsChanged();
  }