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


Java ActionBarSherlock類代碼示例

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


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

示例1: requestFeature

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public boolean requestFeature(int featureId) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[requestFeature] featureId: " + featureId);

    if (mContentParent != null) {
        throw new AndroidRuntimeException("requestFeature() must be called before adding content");
    }

    switch (featureId) {
        case Window.FEATURE_ACTION_BAR:
        case Window.FEATURE_ACTION_BAR_OVERLAY:
        case Window.FEATURE_ACTION_MODE_OVERLAY:
        case Window.FEATURE_INDETERMINATE_PROGRESS:
        case Window.FEATURE_NO_TITLE:
        case Window.FEATURE_PROGRESS:
            mFeatures |= (1 << featureId);
            return true;

        default:
            return false;
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:ActionBarSherlockCompat.java

示例2: setContentView

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void setContentView(int layoutResId) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId);

    if (mContentParent == null) {
        installDecor();
    } else {
        mContentParent.removeAllViews();
    }
    mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);

    Window.Callback callback = mActivity.getWindow().getCallback();
    if (callback != null) {
        callback.onContentChanged();
    }

    initActionBar();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:19,代碼來源:ActionBarSherlockCompat.java

示例3: startActionMode

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的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

示例4: onMenuItemSelected

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);

    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        if (onOptionsItemSelected(item)) {
            return true;
        }

        if (mFragments.mAdded != null) {
            for (int i = 0; i < mFragments.mAdded.size(); i++) {
                Fragment f = mFragments.mAdded.get(i);
                if (f != null && !f.mHidden && f.mHasMenu && f.mMenuVisible && f instanceof OnOptionsItemSelectedListener) {
                    if (((OnOptionsItemSelectedListener)f).onOptionsItemSelected(item)) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:23,代碼來源:Watson.java

示例5: dispatchInvalidateOptionsMenu

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void dispatchInvalidateOptionsMenu() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchInvalidateOptionsMenu]");

    Bundle savedActionViewStates = null;
    if (mMenu != null) {
        savedActionViewStates = new Bundle();
        mMenu.saveActionViewStates(savedActionViewStates);
        if (savedActionViewStates.size() > 0) {
            mMenuFrozenActionViewState = savedActionViewStates;
        }
        // This will be started again when the panel is prepared.
        mMenu.stopDispatchingItemsChanged();
        mMenu.clear();
    }
    mMenuRefreshContent = true;

    // Prepare the options panel if we have an action bar
    if (wActionBar != null) {
        mMenuIsPrepared = false;
        preparePanel();
    }
}
 
開發者ID:Aptoide,項目名稱:aptoide-backup-apps,代碼行數:24,代碼來源:ActionBarSherlockCompat.java

示例6: setContentView

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void setContentView(int layoutResId) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[setContentView] layoutResId: " + layoutResId);

    if (mContentParent == null) {
        installDecor();
    } else {
        mContentParent.removeAllViews();
    }
    mActivity.getLayoutInflater().inflate(layoutResId, mContentParent);

    android.view.Window.Callback callback = mActivity.getWindow().getCallback();
    if (callback != null) {
        callback.onContentChanged();
    }

    initActionBar();
}
 
開發者ID:zhangxiaomenglin,項目名稱:PalmCampus,代碼行數:19,代碼來源:ActionBarSherlockCompat.java

示例7: onCreatePanelMenu

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public final boolean onCreatePanelMenu(int featureId, android.view.Menu menu) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] featureId: " + featureId + ", menu: " + menu);

    if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeCreate) {
        mIgnoreNativeCreate = true;
        boolean result = getSherlock().dispatchCreateOptionsMenu(menu);
        mIgnoreNativeCreate = false;

        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onCreatePanelMenu] returning " + result);
        return result;
    }
    return super.onCreatePanelMenu(featureId, menu);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:SherlockFragmentActivity.java

示例8: onPreparePanel

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public final boolean onPreparePanel(int featureId, View view, android.view.Menu menu) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + ", menu: " + menu);

    if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativePrepare) {
        mIgnoreNativePrepare = true;
        boolean result = getSherlock().dispatchPrepareOptionsMenu(menu);
        mIgnoreNativePrepare = false;

        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
        return result;
    }
    return super.onPreparePanel(featureId, view, menu);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:SherlockFragmentActivity.java

示例9: onMenuItemSelected

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public final boolean onMenuItemSelected(int featureId, android.view.MenuItem item) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item.getTitle());

    if (featureId == Window.FEATURE_OPTIONS_PANEL && !mIgnoreNativeSelected) {
        mIgnoreNativeSelected = true;
        boolean result = getSherlock().dispatchOptionsItemSelected(item);
        mIgnoreNativeSelected = false;

        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onMenuItemSelected] returning " + result);
        return result;
    }
    return super.onMenuItemSelected(featureId, item);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:15,代碼來源:SherlockFragmentActivity.java

示例10: getActionBar

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public ActionBar getActionBar() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getActionBar]");

    initActionBar();
    return aActionBar;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:ActionBarSherlockCompat.java

示例11: dispatchConfigurationChanged

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void dispatchConfigurationChanged(Configuration newConfig) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchConfigurationChanged] newConfig: " + newConfig);

    if (aActionBar != null) {
        aActionBar.onConfigurationChanged(newConfig);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:ActionBarSherlockCompat.java

示例12: dispatchPostResume

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void dispatchPostResume() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPostResume]");

    if (aActionBar != null) {
        aActionBar.setShowHideAnimationEnabled(true);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:ActionBarSherlockCompat.java

示例13: dispatchPause

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void dispatchPause() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPause]");

    if (wActionBar != null && wActionBar.isOverflowMenuShowing()) {
        wActionBar.hideOverflowMenu();
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:ActionBarSherlockCompat.java

示例14: dispatchStop

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public void dispatchStop() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchStop]");

    if (aActionBar != null) {
        aActionBar.setShowHideAnimationEnabled(false);
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:ActionBarSherlockCompat.java

示例15: dispatchOpenOptionsMenu

import com.actionbarsherlock.ActionBarSherlock; //導入依賴的package包/類
@Override
public boolean dispatchOpenOptionsMenu() {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchOpenOptionsMenu]");

    if (!isReservingOverflow()) {
        return false;
    }

    return wActionBar.showOverflowMenu();
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:11,代碼來源:ActionBarSherlockCompat.java


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