當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionMode.finish方法代碼示例

本文整理匯總了Java中android.support.v7.view.ActionMode.finish方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMode.finish方法的具體用法?Java ActionMode.finish怎麽用?Java ActionMode.finish使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v7.view.ActionMode的用法示例。


在下文中一共展示了ActionMode.finish方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    boolean consumed = false;
    if (mCallback != null) {
        consumed = mCallback.onActionItemClicked(mode, item);
    }

    if (!consumed) {
        if (mSupportSubItems) {
            SubItemUtil.deleteSelected(mFastAdapter, true, false);
        }
        else {
            mFastAdapter.deleteAllSelectedItems();
        }
        //finish the actionMode
        mode.finish();
    }
    return consumed;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:20,代碼來源:ActionModeHelper.java

示例2: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    ChatFragment fragment = fragmentWeakReference.get();
    if (Objects.isNull(fragment)) {
        return true;
    }

    switch (item.getItemId()) {
        case R.id.delete:
            fragment.getPresenter().fireActionModeDeleteClick();
            break;
        case R.id.copy:
            fragment.getPresenter().fireActionModeCopyClick();
            break;
        case R.id.forward:
            fragment.getPresenter().fireForwardClick();
            break;
    }

    mode.finish();
    return true;
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:23,代碼來源:ChatFragment.java

示例3: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    switch (item.getItemId()) {
        case R.id.delete:
            getPresenter().fireActionModeDeleteClick();
            break;
        case R.id.copy:
            getPresenter().fireActionModeCopyClick();
            break;
        case R.id.forward:
            getPresenter().fireForwardClick();
            break;
    }

    mode.finish();
    return true;
}
 
開發者ID:PhoenixDevTeam,項目名稱:Phoenix-for-VK,代碼行數:18,代碼來源:MessagesLookFragment.java

示例4: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@CallSuper
@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem item) {
	boolean consumed = false;
	if (mCallback != null) {
		consumed = mCallback.onActionItemClicked(actionMode, item);
	}
	if (!consumed) {
		// Finish the actionMode
		actionMode.finish();
	}
	return consumed;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:14,代碼來源:ActionModeHelper.java

示例5: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    mUndoHelper.remove(findViewById(android.R.id.content), "Item removed", "Undo", Snackbar.LENGTH_LONG, mFastAdapter.getSelections());
    //as we no longer have a selection so the actionMode can be finished
    mode.finish();
    //we consume the event
    return true;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:MultiselectSampleActivity.java

示例6: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {

    // delete the selected items with the SubItemUtil to correctly handle sub items
    // this will even delete empty headers if you want to
    List<IItem> deleted = SubItemUtil.deleteSelected(fastItemAdapter, true, true);
    //as we no longer have a selection so the actionMode can be finished
    mode.finish();
    //we consume the event
    return true;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:ExpandableMultiselectDeleteSampleActivity.java

示例7: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    List<FileItem> selectedItems = mAdapter.getSelectedItems();;
    if(item.getItemId()==R.id.action_properties) {
        if (io != null)
            io.getProperties(selectedItems);
        mode.finish();
    }
    else if(item.getItemId()==R.id.action_share) {
        if (io != null)
            io.shareMultipleFiles(selectedItems);
        mode.finish();//Finish action mode
    }
    else if(item.getItemId()==R.id.action_rename) {
        if (selectedItems.size() != 1) {
            UIUtils.ShowToast("Please select a single item", mActivity);
            return false;
        }
        if (!selectedItems.get(0).getFile().canWrite()) {
            UIUtils.ShowToast("No write permission available", mActivity);
            return false;
        }
        io.renameFile(selectedItems.get(0));
        mode.finish();//Finish action mode
    }
    else if(item.getItemId()==R.id.action_selectall) {
        mAdapter.selectAll();
    }
    return false;
}
 
開發者ID:adityak368,項目名稱:Android-FileBrowser-FilePicker,代碼行數:31,代碼來源:ToolbarActionMode.java

示例8: 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();
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:13,代碼來源:SingleModalChoiceMode.java

示例9: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
  if (item.getItemId() == R.id.action_analyze) {
    presenter.onAnalyzeSelectedAppsClicked();
    mode.finish();
    return true;
  }
  return false;
}
 
開發者ID:philipphager,項目名稱:disclosure-android-app,代碼行數:9,代碼來源:AppManagerFragment.java

示例10: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(final ActionMode mode,
                                   MenuItem item) {
    if (isAdded() && getView() != null) {
        if (item.getTitle().toString().equals(mContext.getString(R.string.favorite))) {

        } else {
            mode.finish();
        }
    }
    return true;
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:13,代碼來源:OfflineHistoryMaterialFragment.java

示例11: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    switch (item.getItemId()) {
        case R.id.action_copy:
            copySelectedMessages();
            mode.finish();
            return true;
        default:
            return false;
    }
}
 
開發者ID:MCMrARM,項目名稱:revolution-irc,代碼行數:12,代碼來源:ChatMessagesFragment.java

示例12: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
    switch (menuItem.getItemId()) {
        case R.id.action_delete:
            mStartBtn.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS,
                    HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
            deleteTimeControls();
            actionMode.finish(); // Action picked, so close the CAB
            return true;
        default:
            return false;
    }
}
 
開發者ID:ChessCom,項目名稱:android-chessclock,代碼行數:14,代碼來源:SettingsFragment.java

示例13: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    switch (item.getItemId()) {
        case R.id.editMenuItem:
            openEditCommentDialog(selectedComment);
            mode.finish(); // Action picked, so close the CAB
            return true;
        case R.id.deleteMenuItem:
            removeComment(selectedComment.getId(), mode, position);
            return true;
        default:
            return false;
    }
}
 
開發者ID:rozdoum,項目名稱:social-app-android,代碼行數:15,代碼來源:PostDetailsActivity.java

示例14: onActionItemClicked

import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
@Override
public boolean onActionItemClicked(final ActionMode mode,
                                   MenuItem item) {
    if (isAdded() && getView() != null) {
        if (item.getTitle().toString().equals(mContext.getString(R.string.favorite))) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            builder.setTitle("Change Favorite Tag");
            ListView lv = new ListView(getActivity());
            FavoriteListAdapter lAdapter = new FavoriteListAdapter(mContext);
            lAdapter.add(new FavoriteTag(-1, "Remove", -1));
            final FavoriteListAdapter adapter = lAdapter;
            lv.setAdapter(lAdapter);
            builder.setView(lv);
            builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.cancel();
                }
            });
            final AlertDialog alert = builder.create();
            lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {

                @TargetApi(Build.VERSION_CODES.HONEYCOMB)
                @Override
                public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
                    alert.dismiss();
                    List<FavoriteTag> lList = MAVApplication.getInstance().getRepository().getFavoriteTags();

                    if (mAdapter != null) {
                        Anime lAnime = null;
                        for (int i : mAdapter.getSelectedItems()) {
                            lAnime = mAdapter.getItem(i);
                            if (arg2 < lList.size()) {
                                MAVApplication.getInstance().getRepository().insertFavorite(lAnime.getUrl(), adapter.getItem(arg2).getTagId());
                                lAnime.setTagId(adapter.getItem(arg2).getTagId());
                            } else {
                                MAVApplication.getInstance().getRepository().deleteFavorite(lAnime.getUrl());
                                lAnime.setTagId(-1);
                            }
                        }
                        mAdapter.notifyDataSetChanged();
                    }
                    mode.finish();
                }
            });
            alert.show();
        } else {
            mode.finish();
        }
    }
    return true;
}
 
開發者ID:SalmanTKhan,項目名稱:MyAnimeViewer,代碼行數:53,代碼來源:AnimeCardGridFragment.java


注:本文中的android.support.v7.view.ActionMode.finish方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。