FileDocCategorySizeDatePackage
ActionBarActivityDelegate.javaAPI DocAndroid 5.1 API11320Thu Mar 12 22:22:56 GMT 2015android.support.v7.app

ActionBarActivityDelegate

public abstract class ActionBarActivityDelegate extends Object

Fields Summary
static final String
METADATA_UI_OPTIONS
private static final String
TAG
final ActionBarActivity
mActivity
private ActionBar
mActionBar
private android.view.MenuInflater
mMenuInflater
boolean
mHasActionBar
boolean
mOverlayActionBar
boolean
mOverlayActionMode
boolean
mIsFloating
final android.support.v7.internal.app.WindowCallback
mDefaultWindowCallback
private android.support.v7.internal.app.WindowCallback
mWindowCallback
private boolean
mIsDestroyed
Constructors Summary
ActionBarActivityDelegate(ActionBarActivity activity)


      
        mActivity = activity;
        mWindowCallback = mDefaultWindowCallback;
    
Methods Summary
abstract voidaddContentView(android.view.View v, ViewGroup.LayoutParams lp)

static android.support.v7.app.ActionBarActivityDelegatecreateDelegate(ActionBarActivity activity)


        
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            return new ActionBarActivityDelegateHC(activity);
        } else {
            return new ActionBarActivityDelegateBase(activity);
        }
    
abstract ActionBarcreateSupportActionBar()

abstract android.view.ViewcreateView(java.lang.String name, android.content.Context context, android.util.AttributeSet attrs)

final voiddestroy()

        mIsDestroyed = true;
    
abstract booleandispatchKeyEvent(android.view.KeyEvent event)

protected final android.content.ContextgetActionBarThemedContext()

        Context context = null;

        // If we have an action bar, let it return a themed context
        ActionBar ab = getSupportActionBar();
        if (ab != null) {
            context = ab.getThemedContext();
        }

        if (context == null) {
            context = mActivity;
        }
        return context;
    
final ActionBarDrawerToggle.DelegategetDrawerToggleDelegate()

        return new ActionBarDrawableToggleImpl();
    
abstract intgetHomeAsUpIndicatorAttrId()

android.view.MenuInflatergetMenuInflater()

        if (mMenuInflater == null) {
            mMenuInflater = new SupportMenuInflater(getActionBarThemedContext());
        }
        return mMenuInflater;
    
final ActionBargetSupportActionBar()

        // The Action Bar should be lazily created as hasActionBar
        // could change after onCreate
        if (mHasActionBar) {
            if (mActionBar == null) {
                mActionBar = createSupportActionBar();
            }
        }
        return mActionBar;
    
final java.lang.StringgetUiOptionsFromMetadata()

        try {
            PackageManager pm = mActivity.getPackageManager();
            ActivityInfo info = pm.getActivityInfo(mActivity.getComponentName(),
                    PackageManager.GET_META_DATA);

            String uiOptions = null;
            if (info.metaData != null) {
                uiOptions = info.metaData.getString(METADATA_UI_OPTIONS);
            }
            return uiOptions;
        } catch (PackageManager.NameNotFoundException e) {
            Log.e(TAG, "getUiOptionsFromMetadata: Activity '" + mActivity.getClass()
                    .getSimpleName() + "' not in manifest");
            return null;
        }
    
final android.support.v7.app.ActionBarDrawerToggle.DelegategetV7DrawerToggleDelegate()

        return new ActionBarDrawableToggleImpl();
    
final android.support.v7.internal.app.WindowCallbackgetWindowCallback()

        return mWindowCallback;
    
final booleanisDestroyed()

        return mIsDestroyed;
    
abstract booleanonBackPressed()

abstract voidonConfigurationChanged(android.content.res.Configuration newConfig)

abstract voidonContentChanged()

voidonCreate(android.os.Bundle savedInstanceState)

        TypedArray a = mActivity.obtainStyledAttributes(R.styleable.Theme);

        if (!a.hasValue(R.styleable.Theme_windowActionBar)) {
            a.recycle();
            throw new IllegalStateException(
                    "You need to use a Theme.AppCompat theme (or descendant) with this activity.");
        }

        if (a.getBoolean(R.styleable.Theme_windowActionBar, false)) {
            mHasActionBar = true;
        }
        if (a.getBoolean(R.styleable.Theme_windowActionBarOverlay, false)) {
            mOverlayActionBar = true;
        }
        if (a.getBoolean(R.styleable.Theme_windowActionModeOverlay, false)) {
            mOverlayActionMode = true;
        }
        mIsFloating = a.getBoolean(R.styleable.Theme_android_windowIsFloating, false);
        a.recycle();
    
abstract booleanonCreatePanelMenu(int featureId, android.view.Menu menu)

abstract booleanonKeyShortcut(int keyCode, android.view.KeyEvent event)

abstract booleanonMenuOpened(int featureId, android.view.Menu menu)

abstract voidonPanelClosed(int featureId, android.view.Menu menu)

abstract voidonPostCreate(android.os.Bundle savedInstanceState)

abstract voidonPostResume()

booleanonPrepareOptionsPanel(android.view.View view, android.view.Menu menu)

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
            // Call straight through to onPrepareOptionsMenu, bypassing super.onPreparePanel().
            // This is because Activity.onPreparePanel() on <v4.1 calls menu.hasVisibleItems(),
            // which interferes with the initially invisible items.
            return mActivity.onPrepareOptionsMenu(menu);
        }
        return mActivity.superOnPrepareOptionsPanel(view, menu);
    
abstract booleanonPreparePanel(int featureId, android.view.View view, android.view.Menu menu)

abstract voidonStop()

abstract voidonTitleChanged(java.lang.CharSequence title)

final ActionBarpeekSupportActionBar()

        return mActionBar;
    
abstract voidsetContentView(android.view.View v)

abstract voidsetContentView(int resId)

abstract voidsetContentView(android.view.View v, ViewGroup.LayoutParams lp)

protected final voidsetSupportActionBar(ActionBar actionBar)

        mActionBar = actionBar;
    
abstract voidsetSupportActionBar(android.support.v7.widget.Toolbar toolbar)

abstract voidsetSupportProgress(int progress)

abstract voidsetSupportProgressBarIndeterminate(boolean indeterminate)

abstract voidsetSupportProgressBarIndeterminateVisibility(boolean visible)

abstract voidsetSupportProgressBarVisibility(boolean visible)

final voidsetWindowCallback(android.support.v7.internal.app.WindowCallback callback)

        if (callback == null) {
            throw new IllegalArgumentException("callback can not be null");
        }
        mWindowCallback = callback;
    
abstract android.support.v7.view.ActionModestartSupportActionMode(ActionMode.Callback callback)

abstract android.support.v7.view.ActionModestartSupportActionModeFromWindow(ActionMode.Callback callback)

abstract voidsupportInvalidateOptionsMenu()

abstract booleansupportRequestWindowFeature(int featureId)