当前位置: 首页>>代码示例>>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;未经允许,请勿转载。