Java Code Examples for android.view.Window#FEATURE_OPTIONS_PANEL

The following examples show how to use android.view.Window#FEATURE_OPTIONS_PANEL . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FragmentActivity.java    From android-recipes-app with Apache License 2.0 6 votes vote down vote up
/**
 * Dispatch context and options menu to fragments.
 */
@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;
    }
}
 
Example 2
Source File: _ActionBarSherlockTrojanHorse.java    From android-apps with MIT License 6 votes vote down vote up
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (DEBUG) Log.d(TAG, "[onMenuItemSelected] featureId: " + featureId + ", item: " + item);

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

        if (mFragments.mActive != 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;
}
 
Example 3
Source File: SherlockListActivity.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onOptionsItemSelected(item);
    }
    return false;
}
 
Example 4
Source File: SherlockFragmentActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 5
Source File: SherlockListActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example 6
Source File: SherlockActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onPrepareOptionsMenu(menu);
    }
    return false;
}
 
Example 7
Source File: FragmentActivity.java    From guideshow with MIT License 5 votes vote down vote up
/**
 * Dispatch onPrepareOptionsMenu() to fragments.
 */
@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);
}
 
Example 8
Source File: SherlockFragmentActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@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);
}
 
Example 9
Source File: SherlockExpandableListActivity.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example 10
Source File: FragmentActivity.java    From V.FlyoutTest with MIT License 5 votes vote down vote up
/**
 * Call onOptionsMenuClosed() on fragments.
 */
@Override
public void onPanelClosed(int featureId, Menu menu) {
    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            mFragments.dispatchOptionsMenuClosed(menu);
            break;
    }
    super.onPanelClosed(featureId, menu);
}
 
Example 11
Source File: _ActionBarSherlockTrojanHorse.java    From android-apps with MIT License 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);

    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        boolean result = onPrepareOptionsMenu(menu);
        if (DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);

        boolean show = false;
        if (mFragments.mActive != 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 OnPrepareOptionsMenuListener) {
                    show = true;
                    ((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu);
                }
            }
        }

        if (DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
        result |= show;

        result &= menu.hasVisibleItems();
        if (DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
        return result;
    }
    return false;
}
 
Example 12
Source File: SherlockPreferenceActivity.java    From zen4android with MIT License 5 votes vote down vote up
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onOptionsItemSelected(item);
    }
    return false;
}
 
Example 13
Source File: SherlockExpandableListActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example 14
Source File: FragmentActivity.java    From CodenameOne with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Call onOptionsMenuClosed() on fragments.
 */
@Override
public void onPanelClosed(int featureId, Menu menu) {
    switch (featureId) {
        case Window.FEATURE_OPTIONS_PANEL:
            mFragments.dispatchOptionsMenuClosed(menu);
            break;
    }
    super.onPanelClosed(featureId, menu);
}
 
Example 15
Source File: Watson.java    From Libraries-for-Android-Developers with MIT License 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] featureId: " + featureId + ", view: " + view + " menu: " + menu);

    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        boolean result = onPrepareOptionsMenu(menu);
        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] activity prepare result: " + result);

        boolean show = false;
        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 OnPrepareOptionsMenuListener) {
                    show = true;
                    ((OnPrepareOptionsMenuListener)f).onPrepareOptionsMenu(menu);
                }
            }
        }

        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] fragments prepare result: " + show);
        result |= show;

        result &= menu.hasVisibleItems();
        if (ActionBarSherlock.DEBUG) Log.d(TAG, "[onPreparePanel] returning " + result);
        return result;
    }
    return false;
}
 
Example 16
Source File: SherlockListActivity.java    From android-apps with MIT License 5 votes vote down vote up
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onOptionsItemSelected(item);
    }
    return false;
}
 
Example 17
Source File: SherlockFragmentActivity.java    From zen4android with MIT License 5 votes vote down vote up
@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);
}
 
Example 18
Source File: SherlockPreferenceActivity.java    From CSipSimple with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean onCreatePanelMenu(int featureId, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onCreateOptionsMenu(menu);
    }
    return false;
}
 
Example 19
Source File: SherlockPreferenceActivity.java    From zhangshangwuda with Apache License 2.0 5 votes vote down vote up
@Override
public boolean onPreparePanel(int featureId, View view, Menu menu) {
    if (featureId == Window.FEATURE_OPTIONS_PANEL) {
        return onPrepareOptionsMenu(menu);
    }
    return false;
}
 
Example 20
Source File: FragmentActivity.java    From V.FlyoutTest with MIT License 4 votes vote down vote up
/**
 * @hide
 */
protected boolean onPrepareOptionsPanel(View view, Menu menu) {
    return super.onPreparePanel(Window.FEATURE_OPTIONS_PANEL, view, menu);
}