Example usage for android.view Window FEATURE_OPTIONS_PANEL

List of usage examples for android.view Window FEATURE_OPTIONS_PANEL

Introduction

In this page you can find the example usage for android.view Window FEATURE_OPTIONS_PANEL.

Prototype

int FEATURE_OPTIONS_PANEL

To view the source code for android.view Window FEATURE_OPTIONS_PANEL.

Click Source Link

Document

Flag for the "options panel" feature.

Usage

From source file:android.support.v7.app.ActionBarActivityDelegateBase.java

@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        item = MenuWrapperFactory.createMenuItemWrapper(item);
    }/*from   ww  w .ja v a  2  s .co  m*/
    return mActivity.superOnMenuItemSelected(featureId, item);
}

From source file:android.support.v7.app.ActionBarActivityDelegateBase.java

@Override
public boolean onMenuItemSelected(MenuBuilder menu, MenuItem item) {
    return mActivity.onMenuItemSelected(Window.FEATURE_OPTIONS_PANEL, item);
}

From source file:fm.smart.r1.activity.ItemActivity.java

public void closeMenu() {
    this.getWindow().closePanel(Window.FEATURE_OPTIONS_PANEL);
}

From source file:android.support.v7.app.ToolbarActionBar.java

void populateOptionsMenu() {
    final Menu menu = getMenu();
    final MenuBuilder mb = menu instanceof MenuBuilder ? (MenuBuilder) menu : null;
    if (mb != null) {
        mb.stopDispatchingItemsChanged();
    }/*  www.java  2s .  c  o m*/
    try {
        menu.clear();
        if (!mWindowCallback.onCreatePanelMenu(Window.FEATURE_OPTIONS_PANEL, menu)
                || !mWindowCallback.onPreparePanel(Window.FEATURE_OPTIONS_PANEL, null, menu)) {
            menu.clear();
        }
    } finally {
        if (mb != null) {
            mb.startDispatchingItemsChanged();
        }
    }
}

From source file:com.chuhan.privatecalc.fragment.os.FragmentActivity.java

/**
 * Dispatch context and options menu to fragments.
 *///ww w .  j  a va 2  s  . c  o  m
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (super.onMenuItemSelected(featureId, item)) {
        return true;
    }

    switch (featureId) {
    case Window.FEATURE_OPTIONS_PANEL:
        return mFragments.dispatchOptionsItemSelected(item);

    case Window.FEATURE_CONTEXT_MENU:
        return mFragments.dispatchContextItemSelected(item);

    default:
        return false;
    }
}

From source file:com.chuhan.privatecalc.fragment.os.FragmentActivity.java

/**
 * Call onOptionsMenuClosed() on fragments.
 *//*ww  w.  jav a 2s  . c  om*/
@Override
public void onPanelClosed(int featureId, Menu menu) {
    switch (featureId) {
    case Window.FEATURE_OPTIONS_PANEL:
        mFragments.dispatchOptionsMenuClosed(menu);
        break;
    }
    super.onPanelClosed(featureId, menu);
}

From source file:com.actionbarsherlock.internal.ActionBarSherlockCompat.java

@Override
public boolean dispatchMenuOpened(int featureId, android.view.Menu menu) {
    if (DEBUG)/*from   www  . ja  v a  2 s .  com*/
        Log.d(TAG, "[dispatchMenuOpened] featureId: " + featureId + ", menu: " + menu);

    if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) {
        if (aActionBar != null) {
            aActionBar.dispatchMenuVisibilityChanged(true);
        }
        return true;
    }

    return false;
}

From source file:com.actionbarsherlock.internal.ActionBarSherlockCompat.java

@Override
public void dispatchPanelClosed(int featureId, android.view.Menu menu) {
    if (DEBUG)//ww  w. j a v  a  2s. com
        Log.d(TAG, "[dispatchPanelClosed] featureId: " + featureId + ", menu: " + menu);

    if (featureId == Window.FEATURE_ACTION_BAR || featureId == Window.FEATURE_OPTIONS_PANEL) {
        if (aActionBar != null) {
            aActionBar.dispatchMenuVisibilityChanged(false);
        }
    }
}

From source file:com.chuhan.privatecalc.fragment.os.FragmentActivity.java

/**
 * Dispatch onPrepareOptionsMenu() to fragments.
 *///ww w.  jav a  2s .  co  m
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL && menu != null) {
        if (mOptionsMenuInvalidated) {
            mOptionsMenuInvalidated = false;
            menu.clear();
            onCreatePanelMenu(featureId, menu);
        }
        boolean goforit = super.onPreparePanel(featureId, view, menu);
        goforit |= mFragments.dispatchPrepareOptionsMenu(menu);
        return goforit && menu.hasVisibleItems();
    }
    return super.onPreparePanel(featureId, view, menu);
}

From source file:com.tencent.tws.assistant.support.v4.app.TwsFragmentActivity.java

/**
 * Dispatch onPrepareOptionsMenu() to fragments.
 *///from   w  w  w  .jav  a  2 s  . c om
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL && menu != null) {
        if (mOptionsMenuInvalidated) {
            mOptionsMenuInvalidated = false;
            menu.clear();
            onCreatePanelMenu(featureId, menu);
        }
        boolean goforit = onPrepareOptionsPanel(view, menu);
        goforit |= mFragments.dispatchPrepareOptionsMenu(menu);
        return goforit;
    }
    return super.onPreparePanel(featureId, view, menu);
}