本文整理汇总了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;
}
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例10: getActionBar
import com.actionbarsherlock.ActionBarSherlock; //导入依赖的package包/类
@Override
public ActionBar getActionBar() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[getActionBar]");
initActionBar();
return aActionBar;
}
示例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);
}
}
示例12: dispatchPostResume
import com.actionbarsherlock.ActionBarSherlock; //导入依赖的package包/类
@Override
public void dispatchPostResume() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPostResume]");
if (aActionBar != null) {
aActionBar.setShowHideAnimationEnabled(true);
}
}
示例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();
}
}
示例14: dispatchStop
import com.actionbarsherlock.ActionBarSherlock; //导入依赖的package包/类
@Override
public void dispatchStop() {
if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchStop]");
if (aActionBar != null) {
aActionBar.setShowHideAnimationEnabled(false);
}
}
示例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();
}