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


Java ActionMode類代碼示例

本文整理匯總了Java中com.actionbarsherlock.view.ActionMode的典型用法代碼示例。如果您正苦於以下問題:Java ActionMode類的具體用法?Java ActionMode怎麽用?Java ActionMode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: startActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
public ActionMode startActionMode(ActionMode.Callback callback) {
    boolean wasHidden = false;
    if (mActionMode != null) {
        wasHidden = mWasHiddenBeforeMode;
        mActionMode.finish();
    }

    mContextView.killMode();
    ActionModeImpl mode = new ActionModeImpl(callback);
    if (mode.dispatchOnCreate()) {
        mWasHiddenBeforeMode = !isShowing() || wasHidden;
        mode.invalidate();
        mContextView.initForMode(mode);
        animateToMode(true);
        if (mSplitView != null && mContextDisplayMode == CONTEXT_DISPLAY_SPLIT) {
            // TODO animate this
            mSplitView.setVisibility(View.VISIBLE);
        }
        mContextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        mActionMode = mode;
        return mode;
    }
    return null;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:25,代碼來源:ActionBarImpl.java

示例2: startActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public ActionMode startActionMode(ActionMode.Callback callback) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);

    if (mActionMode != null) {
        mActionMode.finish();
    }
    ActionModeCallbackWrapper wrapped = null;
    if (callback != null) {
        wrapped = new ActionModeCallbackWrapper(callback);
    }

    //Calling this will trigger the callback wrapper's onCreate which
    //is where we will set the new instance to mActionMode since we need
    //to pass it through to the sherlock callbacks and the call below
    //will not have returned yet to store its value.
    if (mActivity.startActionMode(wrapped) == null) {
        mActionMode = null;
    }
    if (mActivity instanceof OnActionModeStartedListener && mActionMode != null) {
        ((OnActionModeStartedListener)mActivity).onActionModeStarted(mActionMode);
    }

    return mActionMode;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:ActionBarSherlockNative.java

示例3: startActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public ActionMode startActionMode(com.actionbarsherlock.view.ActionMode.Callback callback) {
    if (BuildConfig.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);

    if (mActionMode != null) {
        mActionMode.finish();
    }
    ActionModeCallbackWrapper wrapped = null;
    if (callback != null) {
        wrapped = new ActionModeCallbackWrapper(callback);
    }

    //Calling this will trigger the callback wrapper's onCreate which
    //is where we will set the new instance to mActionMode since we need
    //to pass it through to the sherlock callbacks and the call below
    //will not have returned yet to store its value.
    if (mActivity.startActionMode(wrapped) == null) {
        mActionMode = null;
    }
    if (mActivity instanceof OnActionModeStartedListener && mActionMode != null) {
        ((OnActionModeStartedListener) mActivity).onActionModeStarted(mActionMode);
    }

    return mActionMode;
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:26,代碼來源:ActionBarSherlockNative.java

示例4: startActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public ActionMode startActionMode(com.actionbarsherlock.view.ActionMode.Callback callback) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[startActionMode] callback: " + callback);

    if (mActionMode != null) {
        mActionMode.finish();
    }
    ActionModeCallbackWrapper wrapped = null;
    if (callback != null) {
        wrapped = new ActionModeCallbackWrapper(callback);
    }

    //Calling this will trigger the callback wrapper's onCreate which
    //is where we will set the new instance to mActionMode since we need
    //to pass it through to the sherlock callbacks and the call below
    //will not have returned yet to store its value.
    if (mActivity.startActionMode(wrapped) == null) {
        mActionMode = null;
    }
    if (mActivity instanceof OnActionModeStartedListener && mActionMode != null) {
        ((OnActionModeStartedListener)mActivity).onActionModeStarted(mActionMode);
    }

    return mActionMode;
}
 
開發者ID:zhangxiaomenglin,項目名稱:PalmCampus,代碼行數:26,代碼來源:ActionBarSherlockNative.java

示例5: onPrepareActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
    Log.d(THIS_FILE, "onPrepareActionMode");
    ListView lv = getListView();
    int nbrCheckedItem = 0;

    for (int i = 0; i < lv.getCount(); i++) {
        if (lv.isItemChecked(i)) {
            nbrCheckedItem++;
        }
    }
    menu.findItem(R.id.delete).setVisible(nbrCheckedItem > 0);
    menu.findItem(R.id.dialpad).setVisible(nbrCheckedItem == 1);
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:CallLogListFragment.java

示例6: onActionItemClicked

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
    int itemId = item.getItemId();
    if(itemId == R.id.delete) {
        actionModeDelete();
        return true;
    }else if(itemId == R.id.invert_selection) {
        actionModeInvertSelection();
        return true;
    }else if(itemId == R.id.dialpad) {
        actionModeDialpad();
        return true;
    }
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:16,代碼來源:CallLogListFragment.java

示例7: onDestroyActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public void onDestroyActionMode(ActionMode mode) {
    Log.d(THIS_FILE, "onDestroyActionMode");

    ListView lv = getListView();
    // Uncheck all
    int count = lv.getAdapter().getCount();
    for (int i = 0; i < count; i++) {
        lv.setItemChecked(i, false);
    }
    mMode = null;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:13,代碼來源:CallLogListFragment.java

示例8: onDestroyActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
public void onDestroyActionMode(ActionMode mode) {
    mWrapped.onDestroyActionMode(mode);
    if (mActionModeView != null) {
        mActionModeView.setVisibility(View.GONE);
        mActionModeView.removeAllViews();
    }
    if (mActivity instanceof OnActionModeFinishedListener) {
        ((OnActionModeFinishedListener)mActivity).onActionModeFinished(mActionMode);
    }
    mActionMode = null;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:12,代碼來源:ActionBarSherlockCompat.java

示例9: onCreateActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public boolean onCreateActionMode(android.view.ActionMode mode, android.view.Menu menu) {
    //See ActionBarSherlockNative#startActionMode
    mActionMode = new ActionModeWrapper(mode);

    return mCallback.onCreateActionMode(mActionMode, mActionMode.getMenu());
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:ActionBarSherlockNative.java

示例10: onDestroyActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public void onDestroyActionMode(android.view.ActionMode mode) {
    mCallback.onDestroyActionMode(mActionMode);
    if (mActivity instanceof OnActionModeFinishedListener) {
        ((OnActionModeFinishedListener)mActivity).onActionModeFinished(mActionMode);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:ActionBarSherlockNative.java

示例11: StandaloneActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
public StandaloneActionMode(Context context, ActionBarContextView view,
                            ActionMode.Callback callback, boolean isFocusable) {
    mContext = context;
    mContextView = view;
    mCallback = callback;

    mMenu = new MenuBuilder(context).setDefaultShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
    mMenu.setCallback(this);
    mFocusable = isFocusable;
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:11,代碼來源:StandaloneActionMode.java

示例12: onDestroyActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
public void onDestroyActionMode(ActionMode mode) {
    mWrapped.onDestroyActionMode(mode);
    if (mActionModeView != null) {
        mActionModeView.setVisibility(View.GONE);
        mActionModeView.removeAllViews();
    }
    if (mActivity instanceof OnActionModeFinishedListener) {
        ((OnActionModeFinishedListener) mActivity).onActionModeFinished(mActionMode);
    }
    mActionMode = null;
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:12,代碼來源:ActionBarSherlockCompat.java

示例13: onDestroyActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public void onDestroyActionMode(android.view.ActionMode mode) {
    mCallback.onDestroyActionMode(mActionMode);
    if (mActivity instanceof OnActionModeFinishedListener) {
        ((OnActionModeFinishedListener) mActivity).onActionModeFinished(mActionMode);
    }
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:8,代碼來源:ActionBarSherlockNative.java

示例14: onCreateActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    MenuInflater inflater = mode.getMenuInflater();
    mode.setTitle("Download");
    inflater.inflate(R.menu.download, menu);
    return true;  //To change body of implemented methods use File | Settings | File Templates.
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:8,代碼來源:BackedUpCursorAdapter.java

示例15: startActionMode

import com.actionbarsherlock.view.ActionMode; //導入依賴的package包/類
private void startActionMode() {
    try {
        Activity activity = (Activity) adapterView.getContext();
        Method method = activity.getClass().getMethod("startActionMode", ActionMode.Callback.class);
        actionMode = (ActionMode) method.invoke(activity, owner);
    } catch (Exception e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:11,代碼來源:MultiChoiceAdapterHelper.java


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