Action Bar Sherlock
ActionBarSherlock class is a helper designed to facilitate the use of
the action bar design pattern across all versions of Android leveraging the
best APIs available.
The class will automatically use the native ActionBar implementation on Android 3.0 or later. For previous versions which do not include ActionBar, a custom action bar implementation can automatically be wrapped around the layout. Support for this goes all the way back to Android 1.5.
All interaction with these action bars is handled through the optional extension of static classes which should be implemented in each Activity as inner-classes.
Examples of third-party implementations can be found in the
of this repository.
There are three ways to leverage
ActionBarSherlock in your projects:
- Download the JAR file from the downloads page and add it to your
project's build path (commonly the
- If you're using the Eclipse Development Environment with the ADT plugin version 0.9.7 or greater you can include this as a library project. Create a new Android project in Eclipse using the repository folder as the existing source. Then, in your project properties, add the created project under the 'Libraries' section of the 'Android' category.
If you use maven to build you Android project, you can simply add a dependency for this project.
<dependency> <groupId>com.jakewharton</groupId> <artifactId>android-actionbarsherlock</artifactId> <version>2.1.0</version> </dependency>
Make sure you also include repository.jakewharton.com in the repositories section of your
There are a variety of ways to get started with
There is also a port of the Shakespeare fragments demo from the Android 3.0 API demos which has been converted to use this library for more of a real-world implementation. It depends on the Android-ActionBar library as well.
In order for these sample applications to properly work, the respective library that they depend on needs to be cloned in the same parent folder as this one.
This can be accomplished by executing one or both of the following commands in the parent directory.
git clone git://github.com/johannilsson/android-actionbar.git
git clone git://github.com/hameno/GreenDroid.git
You can also download pre-built .apks for each of these samples from the project download page for demonstration.
Due the use of third-party libraries, the samples have a minimum requirement of Android 1.6.
* NOTE: The GreenDroid implementation currently requires a fork of the official repository and NOT the official repository itself. This is because the current official GreenDroid library has API conflicts with Android 3.0. Until the changes implemented in the fork are merged upstream, this is the only way to achieve the GreenDroid implementation.
- Git repository located at github.com/JakeWharton/ActionBarSherlock.
- Javadoc site located at jakewharton.github.com/ActionBarSherlock.
- Jake Wharton - firstname.lastname@example.org
- smith324 via StackOverflow
Copyright 2011 Jake Wharton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.