Androider
Androider

Reputation: 255

Is there any way use new DrawerLayout with ActionBarSharlock?

I am wondering if there any way to use new DrawerLayout from support library with ActionBarSherlock? I found workaround for ICS+ but what i need is support for android 2.2+ The problem is that ABS hold reference for original android.view.MenuItem only when ICS+ but for older version there is inner implementation that not hold reference for original one.

Upvotes: 9

Views: 4708

Answers (2)

SeanSWatkins
SeanSWatkins

Reputation: 413

There is a project on GitHub that works perfectly

SherlockNavigationDrawer

Hope this helps

Upvotes: 6

Enrique Diaz
Enrique Diaz

Reputation: 573

If you are looking a way to open and close the DrawerLayout when user touch Icon from ActionBar, you can use this:

switch (item.getItemId()) {
    case android.R.id.home:
        if (mDrawerLayout.isDrawerOpen(mDrawerList)) {
            mDrawerLayout.closeDrawer(mDrawerList);
        } else {
            mDrawerLayout.openDrawer(mDrawerList);
        }
        return true;

    }
    return true;
}

Upvotes: 22

Related Questions