本文整理汇总了Java中android.support.v7.view.ActionMode.Callback方法的典型用法代码示例。如果您正苦于以下问题:Java ActionMode.Callback方法的具体用法?Java ActionMode.Callback怎么用?Java ActionMode.Callback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.view.ActionMode
的用法示例。
在下文中一共展示了ActionMode.Callback方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateActionModeForSelection
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public void updateActionModeForSelection(int selectedCount, ActionMode.Callback actionMode) {
if (BuildConfig.LOG_DEBUG) LogUtils.d(TAG, selectedCount, actionMode);
if (mActionMode != null) { /* Action menu is already activated. */
/* Finish action mode if there are no more selected items. */
if (selectedCount == 0) {
mActionMode.finish();
} else {
mActionMode.invalidate();
}
} else { /* No action menu activated - started it. */
if (selectedCount > 0) {
/* Start new action mode. */
mActionMode = startSupportActionMode(actionMode);
}
}
}
示例2: startActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Nullable
@Override
public ActionMode startActionMode(@NonNull final ActionMode.Callback callback) {
final FragmentActivity activity = mFragment.getActivity();
if (activity instanceof AppCompatActivity) {
final AppCompatActivity appCompatActivity = (AppCompatActivity) activity;
return appCompatActivity.startSupportActionMode(callback);
} else {
throw new IllegalStateException("Your activity should extend AppCompatActivity.");
}
}
示例3: startSupportActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
public ActionMode startSupportActionMode(ActionMode.Callback callback) {
if (callback == null) {
throw new IllegalArgumentException("ActionMode callback can not be null.");
}
if (this.mActionMode != null) {
this.mActionMode.finish();
}
ActionMode.Callback wrappedCallback = new ActionModeCallbackWrapperV7(callback);
ActionBar ab = getSupportActionBar();
if (ab != null) {
this.mActionMode = ab.startActionMode(wrappedCallback);
if (!(this.mActionMode == null || this.mAppCompatCallback == null)) {
this.mAppCompatCallback.onSupportActionModeStarted(this.mActionMode);
}
}
if (this.mActionMode == null) {
this.mActionMode = startSupportActionModeFromWindow(wrappedCallback);
}
return this.mActionMode;
}
示例4: ActionModeHelper
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
public ActionModeHelper(FastAdapter fastAdapter, int cabMenu, ActionMode.Callback callback) {
this.mFastAdapter = fastAdapter;
this.mCabMenu = cabMenu;
this.mCallback = callback;
this.mInternalCallback = new ActionBarCallBack();
}
示例5: getNewActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
abstract public ActionMode.Callback getNewActionMode();
示例6: getNewActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public ActionMode.Callback getNewActionMode() {
return new MyActionMode();
}
示例7: startMultiChoice
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
protected ActionMode startMultiChoice(ActionMode.Callback callback) {
return startSupportActionMode(callback);
}
示例8: startActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
return ((AppCompatActivity)getActivity()).startSupportActionMode(callback);
}
示例9: ActionModeCallbackWrapperV7
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
public ActionModeCallbackWrapperV7(ActionMode.Callback wrapped) {
this.mWrapped = wrapped;
}
示例10: ActionModeHelper
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
/**
* Constructor with internal callback + custom callback.
*
* @param adapter the FlexibleAdapter instance
* @param cabMenu the menu resourceId
* @param callback the custom {@link android.support.v7.view.ActionMode.Callback}
* @see #ActionModeHelper(FlexibleAdapter, int)
* @since 5.0.0-b6
*/
public ActionModeHelper(@NonNull FlexibleAdapter adapter, @MenuRes int cabMenu,
@NonNull ActionMode.Callback callback) {
this(adapter, cabMenu);
this.mCallback = callback;
}
示例11: getNewActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
public abstract ActionMode.Callback getNewActionMode();
示例12: updateActionModeForSelection
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
void updateActionModeForSelection(int selectedCount, ActionMode.Callback actionMode);
示例13: startActionMode
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
ActionMode startActionMode(ActionMode.Callback callback);
示例14: startSupportActionModeFromWindow
import android.support.v7.view.ActionMode; //导入方法依赖的package包/类
abstract ActionMode startSupportActionModeFromWindow(ActionMode.Callback callback);