Example project for ActionBar Compat and Menu Drawer tested on API level 7 (Android 2.1)
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.settings
libs
res
src
.classpath
.project
AndroidManifest.xml
README.md
project.properties

README.md

menu-drawer-compat-example

Example project for ActionBar Compat and Menu Drawer tested on API level 7 (Android 2.1)

This is an eclipse ADT project. If you're looking for something similar on Android Studio you can either try importing this project or check out the fragment based navigation example at https://github.com/AndroidExamples/fragment-navigation instead. That project was created in AS and will be extended to have the action bar compat navigation drawer included.

This project was never intended to be a complete app. Instead I wanted to convert the AcitonBar example project from Android towards an ActionBar Compat project.

Screenshot

Visit this link.

Changes required from demo app

I started from the sample menu drawer app from the official Navigation Drawer Documentation. That sample project requires API level 14 though. The following is a quick overview of what I had to change to get this working with everything from API level 11 and up.

  • update theme
  • add compat libraries
  • extend ActionBarActivity
  • change imports
  • clean up layout drawer

update theme

In your manifest update the application tag to include the following compat theme.

Add compat libraries

Support lib libraries

  • and android-support-v7-appcompat.jar to libs folder
  • replace android-support-v4.jar in libs folder

You'll have to set up the required android support libraries to get this sample working. The project file (eclipse) contains a local reference to my system set up. Fix that first. The jars are included on this project in the libs folder.

Compat Project setup

  • add android-support-v7-appcompat as a library project

The compat library project isn't included here. You can find it in your SDK folder. First import that as an Android project (eclipse File menu > import > android > existing android project) from:

SDK_PATH/extras/android/support/v7/appcompat

Now you can add this android project as a dependency on your project.

Update imports

Only for existing projects. In your source files replace the imports to match all support packages.

TODO

Some open points listed here

More info