NullPointerException
when expanding an action item.NullPointerException
when the hardware menu key was pressed in an activity that is forcing the overflow menu.onCreate
if activity is finishing.false
when appropriate to avoid rendering artifacts.ShareActionProvider
widget for use as action items.null
on initial tab selection callback.Complete rewrite of the library to backport the Android 4.0 action bar.
SherlockActivity
and SherlockFragmentActivity
) which extend from the native activities.android-support-v4.jar
in your project separately.ab
- and am
-prefixed attributes in the theme.NullPointerException
in FragmentManager
can no longer occur when an attempt is being made to save to a Bundle
that has not yet been created.Library now uses the r6
version of the compatibility library for its base. Ice Cream Sandwich-specific implementations are currently disabled, however, but will be added in a future version of the library.
MenuCompat
, MenuItemCompat
, and ActivityCompat
have be added back in to ease transition to this library but all their methods and the classes themselves have been deprecated.
Rewritten menu and action item support from Ice Cream Sandwich.
Window.FEATURE_ACTION_ITEM_TEXT
flag. You should now use the showAsAction
attribute and/or the setShowAsAction(int)
method on each MenuItem
to control whether or not text is shownFix: List navigation no longer becomes unusable on certain device configurations.
Fix: SubMenu
's findItem(int)
method now properly returns the support version of MenuItem
.
Fix: Invisible sub-menu items are no longer shown on the pre-3.0 popup list.
makeFragmentName
method in FragmentPagerAdapter
has been changed to public
scope to allow for easier access to your fragments that it is managing.show()
or hide()
.SherlockPreferenceActivity
now provides full fragment and loader support.R.java
integer constants.r4
version of the compatibility library for its base. Ice Cream Sandwich-specific implementations are currently disabled, however, but will be added in a future version of the library.MenuItem
to maintain consistency.abHomeLayout
theme attribute is now honored.onPrepareOptionsMenu
is now properly dispatched upon menu invalidation.ADT 14 is now required. Maven 3 is required if building from the command line.
onClick
attributes will now check for an onClick
method that takes an android.support.v4.view.MenuItem
instance.onClick
method declared in the XML.showDialog
state when not being used as a popup.-1
when in tab navigation but no tab is selected. This brings the library in line with the post-3.0 behavior.IndexOutOfBoundsException
.getSelectedTab
and getTabAt
no longer throw NullPointerException
s on post-3.0 when no tab was selected or no tab existed at the specified position, respectively.findFragmentById
now properly returns fragments attached to android.R.id.content
when run on pre-3.0 devices.IllegalStateException
when being used as a regular fragment (i.e., not as a popup). See StackOverflow for more information.NullPointerException
when the target fragment no longer exists.ViewPager
that contributed items to the options menu were caught in a race condition causing inconsistent results when a new page was selected. This regression was introduced in version 3.2.2.FragmentMapActivity
due to how it was referencing resources from the main library.ViewPager
no longer receive context menu events.getMenuInflater()
.ViewPager
now determines whether or not an activity menu invalidation is required independently of whether or not fragments were created or destroyed. This should fix an edge case where an activity with a ViewPager
containing only two fragments would not get its menu properly invalidated.Menu
and MenuItem
classes causing an easy pitfall for ClassCastExceptions
.Added support for MapView
and the Google APIs through the use of FragmentMapActivity
. If you are using a map within a fragment you must ensure it is always attached to an activity which extends from this new base class.
Since supporting maps requires compiling against the Google APIs, this functionality is implemented in the form of a plugin which is to be used alongside the normal library. You can choose to add it as an additional library project or by including it as a .jar
. Maven users may simply include the additional dependency (artifactId: plugin-maps
).
Fix: Fragments adjacent to the currently selected fragment in a ViewPager
no longer contribute to the activity menu.
ActionBar.Tab
has been changed from an interface to an abstract class to mirror its native counterpart.
abs__
to avoid conflicts when including in your project.MenuItem.setVisible
now properly updates the associated action item and native menu item visible state.MenuItem
.MenuItem.getMenuInfo()
was throwing runtime exception. Will now just return null
.WebView
contained in a ViewPager
would not register.MenuItem.getSubMenu
now returns a support instance rather than a native instance.onAttach
and onInflate
incorrectly regressed to use Activity
instead of a FragmentActivity
in their method signatures.android.R.id.content
upon activity recreation.onPrepareOptionsMenu
not dispatched to fragments. This still will only occur if the activity method returns true (which is the default).Menu.findItem
not returning null
when the item was not found on Android 3.0+.Due to shortcomings in the Android theming system, a small change must be made in how this library handles themes. If you were using a custom style for actionBarStyle
you must now specify its attributes in the root of the theme and prefix them with ‘ab’.
You can see an example of this in the SherlockCustom
theme in samples/demos/res/values/styles.xml
.
r3
version of the compatibility library for its base.actionBarStyle
is no longer a valid theme attribute (see note above).samples/demos/
and merged in the old ‘featuredemo’.Window.FEATURE_ACTION_BAR_OVERLAY
is now honored on pre-3.0 devices.android:actionLayout
and android:actionViewClass
attributes.final
modifier on the native type, you must use setIndeterminateProgressBarVisibility(Boolean)
and pass Boolean.TRUE
or Boolean.FALSE
.MenuBuilder#removeItem(int)
and MenuBuilder#findItem(int)
throwing IndexOutOfBoundsException
s when the item was not found.MenuItem
instance for home.<item>
in android:title
and android:titleCondensed
.Window.FEATURE_ENABLE_ACTION_BAR_WATSON_TEXT
is now Window.FEATURE_ACTION_BAR_ITEM_TEXT
.Widget.Sherlock.Spinner.DropDown.ActionBar
and Widget.Sherlock.Light.Spinner.DropDown.ActionBar
styles are now Widget.Sherlock.Spinner
and Widget.Sherlock.Light.Spinner
, respectively.Widget.Sherlock.ActionBarView_TabXXX
styles are now Widget.Sherlock.ActionBar.TabXXX
.This version is a hotfix for incompatibilities introduced with the SDKs for 3.1 r2 and 3.2 r1. Due to unavoidable changes in the underlying SDK, the library must now be compiled against API level 13.
actionModeStyle
and actionModePopupWindowStyle
are no longer valid theme attributes.com.actionbarsherlock.internal
package which were not meant for public consumption. Despite being given public
scope in this new package, these classes should NOT be used under any circumstances as their API can be considered highly volatile and is subject to change often and without warning.onOptionsItemSelected()
not being called in fragments if the activity version returns false
.onCreateOptionsMenu()
not being called in fragments on Android 3.0+.requestWindowFeature
with Window.FEATURE_ENABLE_ACTION_BAR_WATSON_TEXT
.setCustomView()
no longer automatically enables the custom view on pre-3.0. You must call setDisplayShowCustomEnabled()
in order to display the view.The API has been rewritten to mimic that of the native action bar. As a result, usage now only requires changing a few imports to use the support versions of classes and calling getSupportActionBar()
. See the README for more info.
The rewrite necessitated tight interaction with the compatibility library to the point where its sources are now included. You are no longer required to have the standalone .jar
file.
Also included is a default custom action bar for use by default on pre-3.0 devices. This custom implementation is based off of Johan Nilsson's Android-ActionBar and the work that I have done on it.
More details are available at http://actionbarsherlock.com
No changes to library code.
samples/dependencies.py
script to automatically download the needed dependencies for the sample projects.WARNING: The Android Compatibility Library (v4) is now required.
ActionBarSherlock.Activity
, ActionBarSherlock.FragmentActivity
, and ActionBarSherlock.ListActivity
for extension by implementing activities, the latter of which is deprecated. This affords a much tighter integration and allows for the use of other new features listed below.layout(Fragment)
will use the fragment argument as the content to the activity.menu(int)
allows for the inflation of menu XMLs from a resource. For the non-native implementation, the XML can be inflated to a custom Menu which can then be applied appropriately to the third-party action bar. Sub-menus are also supported. Third-party action bar handlers should implement ActionBarSherlock.HasMenu
for this functionality. This feature requires that activities extend from one of the provided activity base classes.homeAsUp(boolean)
. This mimics the native method setDisplayHomeAsUpEnalbed
on the native action bar. Third-party action bar handlers should implement ActionBarSherlock.HasHomeAsUp
for this functionality.useLogo(boolean)
will trigger the action bar to hide the application icon/home button and title and show a larger logo representing the application. Third-party action bar handlers should implement ActionBarSherlock.HasLogo
for this functionality.listNavigation(SpinnerAdapter, OnNavigationListener)
. Tells the action bar to use drop-down style navigation with the specified list of items and callback listener. Third-party action bar handlers should implement ActionBarSherlock.HasListNavigation
for this functionality.com.jakewharton:android-actionbarsherlock:2.1.0
.Class.forName()
for detection of native action bar. This provides compatability all the way back to Android 1.5.Complete rewrite!
Initial release.