Search in sources :

Example 1 with MenuItemWrapper

use of com.actionbarsherlock.internal.view.menu.MenuItemWrapper in project AndroidTraining by mixi-inc.

the class ActionBarSherlockNative method dispatchOptionsItemSelected.

@Override
public boolean dispatchOptionsItemSelected(android.view.MenuItem item) {
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed());
    MenuItem wrapped;
    if (mMenu == null) {
        if (item.getItemId() != android.R.id.home) {
            throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId());
        }
        // Create a throw-away wrapper for now.
        wrapped = new MenuItemWrapper(item);
    } else {
        wrapped = mMenu.findItem(item);
    }
    final boolean result = callbackOptionsItemSelected(wrapped);
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result);
    return result;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) MenuItemWrapper(com.actionbarsherlock.internal.view.menu.MenuItemWrapper)

Example 2 with MenuItemWrapper

use of com.actionbarsherlock.internal.view.menu.MenuItemWrapper in project Ushahidi_Android by ushahidi.

the class ActionBarSherlockNative method dispatchOptionsItemSelected.

@Override
public boolean dispatchOptionsItemSelected(android.view.MenuItem item) {
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed());
    MenuItem wrapped;
    if (mMenu == null) {
        if (item.getItemId() != android.R.id.home) {
            throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId());
        }
        // Create a throw-away wrapper for now.
        wrapped = new MenuItemWrapper(item);
    } else {
        wrapped = mMenu.findItem(item);
    }
    final boolean result = callbackOptionsItemSelected(wrapped);
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result);
    return result;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) MenuItemWrapper(com.actionbarsherlock.internal.view.menu.MenuItemWrapper)

Example 3 with MenuItemWrapper

use of com.actionbarsherlock.internal.view.menu.MenuItemWrapper in project Libraries-for-Android-Developers by eoecn.

the class ActionBarSherlockNative method dispatchOptionsItemSelected.

@Override
public boolean dispatchOptionsItemSelected(android.view.MenuItem item) {
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed());
    MenuItem wrapped;
    if (mMenu == null) {
        if (item.getItemId() != android.R.id.home) {
            throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId());
        }
        // Create a throw-away wrapper for now.
        wrapped = new MenuItemWrapper(item);
    } else {
        wrapped = mMenu.findItem(item);
    }
    final boolean result = callbackOptionsItemSelected(wrapped);
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result);
    return result;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) MenuItemWrapper(com.actionbarsherlock.internal.view.menu.MenuItemWrapper)

Example 4 with MenuItemWrapper

use of com.actionbarsherlock.internal.view.menu.MenuItemWrapper in project ActionBarSherlock by JakeWharton.

the class ActionBarSherlockNative method dispatchOptionsItemSelected.

@Override
public boolean dispatchOptionsItemSelected(android.view.MenuItem item) {
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed());
    MenuItem wrapped;
    if (mMenu == null) {
        if (item.getItemId() != android.R.id.home) {
            throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId());
        }
        // Create a throw-away wrapper for now.
        wrapped = new MenuItemWrapper(item);
    } else {
        wrapped = mMenu.findItem(item);
    }
    final boolean result = callbackOptionsItemSelected(wrapped);
    if (ActionBarSherlock.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result);
    return result;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) MenuItemWrapper(com.actionbarsherlock.internal.view.menu.MenuItemWrapper)

Example 5 with MenuItemWrapper

use of com.actionbarsherlock.internal.view.menu.MenuItemWrapper in project cw-omnibus by commonsguy.

the class ActionBarSherlockNative method dispatchOptionsItemSelected.

@Override
public boolean dispatchOptionsItemSelected(android.view.MenuItem item) {
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] item: " + item.getTitleCondensed());
    MenuItem wrapped;
    if (mMenu == null) {
        if (item.getItemId() != android.R.id.home) {
            throw new IllegalStateException("Non-home action item clicked before onCreateOptionsMenu with ID " + item.getItemId());
        }
        // Create a throw-away wrapper for now.
        wrapped = new MenuItemWrapper(item);
    } else {
        wrapped = mMenu.findItem(item);
    }
    final boolean result = callbackOptionsItemSelected(wrapped);
    if (BuildConfig.DEBUG)
        Log.d(TAG, "[dispatchOptionsItemSelected] returning " + result);
    return result;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) MenuItemWrapper(com.actionbarsherlock.internal.view.menu.MenuItemWrapper)

Aggregations

MenuItemWrapper (com.actionbarsherlock.internal.view.menu.MenuItemWrapper)5 MenuItem (com.actionbarsherlock.view.MenuItem)5