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