Skip to content Skip to sidebar Skip to footer

Actionbar Like Evernote - Up Button And Tabs In One Row On Top With Menu Actions At Bottom

I have app which has actionbar containing 1) up button which opens side bar menu for navigation just like google plus 2) 2 action menu buttons 3) 2 tabs implemented via view pag

Solution 1:

//enabling embedded tabs

//pre-ICSif (actionBarSherlock instanceof ActionBarImpl) {
    enableEmbeddedTabs(actionBarSherlock);

//ICS and forward
} elseif (actionBarSherlock instanceof ActionBarWrapper) {
    try {
        Field actionBarField = actionBarSherlock.getClass().getDeclaredField("mActionBar");
        actionBarField.setAccessible(true);
        enableEmbeddedTabs(actionBarField.get(actionBarSherlock));
    } catch (Exception e) {
        Log.e(TAG, "Error enabling embedded tabs", e);
    }
}

//helper methodprivatevoid enableEmbeddedTabs(Object actionBar) {
    try {
        Method setHasEmbeddedTabsMethod = actionBar.getClass().getDeclaredMethod("setHasEmbeddedTabs", boolean.class);
        setHasEmbeddedTabsMethod.setAccessible(true);
        setHasEmbeddedTabsMethod.invoke(actionBar, true);
    } catch (Exception e) {
        Log.e(TAG, "Error marking actionbar embedded", e);
    }
}

for further reference - https://groups.google.com/forum/#!topic/actionbarsherlock/hmmB1JqDeCk

Post a Comment for "Actionbar Like Evernote - Up Button And Tabs In One Row On Top With Menu Actions At Bottom"