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