The Android Support Library package is a set of code libraries that provide backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs. Each Support Library is backward-compatible to a specific Android API level. This design means that your applications can use the libraries' features and still be compatible with devices running Android 1.6 (API level 4) and up.
This guide provides information about what features are enabled by the Support Libraries, how to use them in your development environment and information about library releases.
Overview
Including the Support Libraries in your Android project is considered a best practice for application developers, depending on the range of platform versions your app is targeting and the APIs that it uses. Using the features the libraries provide can help you improve the look of your application, increase performance and broaden the reach of your application to more users. If you use the Android code template tools, you will notice that all the Android application templates include one or more of the Support Libraries by default.
The Support Libraries each target a base Android API level and each provides a different set
of features. In order to effectively use the libraries, it is important to consider what features
you want to support and understand what features are supported by each library at what Android
API level. To get started, review the
Support Library Features guide.
After that, go to the
Support Library Setup topic to
learn how to incorporate the Support Libraries into your application. For more details
about Support Library APIs, see the android.support
packages in the API reference.
Revisions
This section provides details about the Support Library package releases.
Android Support Library, revision 22.2.0 (May 2015)
- Added Design Support library:
-
- Added
TextInputLayout
for showingEditText
hint and error text as floating labels. - Added
FloatingActionButton
for implementing a primary action on your interface as a floating action button, supporting either default or mini sizes. - Added
Snackbar
for providing lightweight feedback with an optional action in an animated snackbar. - Added
TabLayout
for implementing fixed and scrollable tabs as well as easy integration withViewPager
. - Added
NavigationView
for implementing navigation drawer contents, including the ability to inflate menu items via a Menu Resource. - Added
CoordinatorLayout
, a general purpose layout, used for building dependencies between sibling views and allowing easy scrolling reactions between components viaCoordinatorLayout.Behavior
. Many of the Design Library components rely on being a child of aCoordinatorLayout
. - Added
AppBarLayout
, a container for aToolbar
and other views (such asTabLayout
) for reacting to scrolling events by scrolling off the screen, becoming visible in reaction to a downward scroll, or collapsing/uncollapsing before scrolling off/onto the screen. - Added
CollapsingToolbarLayout
for controlling how aToolbar
collapses. A toolbar may collapse by: pinning components to the top of the screen while it collapses, introducing parallax scrolling of components such as anImageView
, or adding a content scrim color when the view is partially collapsed.
- Added
- Changes for v4 support library:
-
- Added the
getContentChangeTypes()
andsetContentChangeTypes()
methods and related change type fields to theAccessibilityEventCompat
class for accessibility event handling. - Added the
getActiveQueueItemId()
,getCustomActions()
, andgetExtras()
methods with related state fields to thePlaybackStateCompat
class for getting custom actions from the queue. - Added the
addCustomAction()
,setActiveQueueItemId()
, andsetExtras()
methods to thePlaybackStateCompat.Builder
class for adding adding custom actions to a playback state. - Added the
fromCustomAction()
andgetCustomAction()
methods to thePlaybackStateCompat.CustomAction
class for getting custom actions from the queue. - Added the
isAttachedToWindow()
,offsetLeftAndRight()
, andoffsetTopAndBottom()
methods to theViewCompat
class for working with views. - Added the
addOnPageChangeListener()
,clearOnPageChangeListeners()
, andremoveOnPageChangeListener()
methods to theViewPager
class for responding to page changes.Deprecated the
setOnPageChangeListener()
method. - Added the
notifySubtreeAccessibilityStateChanged()
method to theViewParentCompat
class for notifying a view parent that the accessibility state of one of its descendants has changed. - Added the
translationZ()
,translationZBy()
,z()
, andzBy()
methods to theViewPropertyAnimatorCompat
class for adding animation.
- Added the
- Changes for v7 appcompat library:
-
- Added the
onWindowStartingSupportActionMode()
method to theAppCompatActivity
,AppCompatCallback
, andAppCompatDialog
classes for handling action modes started from the current window. - Added the
isHandleNativeActionModesEnabled()
andsetHandleNativeActionModesEnabled()
methods to theAppCompatDelegate
class for handling native action modes.
- Added the
Android Support Library, revision 22.1.0 (April 2015)
- Changes for annotations library:
-
- Added the Annotations library to provide support for enhanced code inspections. Annotations are added as metadata tags that you attach to variables, parameters, and return values to inspect method return values, passed parameters, and local variables and fields.
- Changes for v4 support library:
-
- Added the
ColorUtils
class to provide a set of color-related utility methods. - Added the
unwrap()
andwrap()
methods to theDrawableCompat
class , allowing you to usesetTint()
,setTintList()
, andsetTintMode()
on all API level 4 or higher devices. - Added the
TraceCompat
class to write trace events to the system trace buffer, which can then be collected and visualized using the Systrace tool. - Added the
CircularIntArray
class to create circular integer array data structures. - Added the
clear()
,removeFromStart()
, andremoveFromEnd()
methods to theCircularArray
class. Also, changed the existing methods in this class to be non-final. - Added the
InputDeviceCompat
as a helper class to access data in theInputDeviceCompat
class. - Added the
LayoutInflaterCompat
class as a helper class to access data in theLayoutInflaterCompat
class and added theLayoutInflaterFactory
interface. - Added classes, methods, and interfaces to support nested scrolling.
- Added the
NestedScrollingChildHelper
andNestedScrollingParentHelper
helper classes for implementing nested scrolling parent and child views. - Added the
NestedScrollingChild
interface to be implemented byView
subclasses. - Added the
NestedScrollingParent
andScrollingView
interfaces to support scrolling operations and provide scroll related APIs. - Added the
getNestedScrollAxes()
method to theViewGroupCompat
class. - Added methods to the
ViewParentCompat
class to support nested scrolling. - Added the
NestedScrollView
class to support nested scrolling parent and child on both new and old versions of Android.
- Added the
- Added methods and constants to the
MotionEventCompat
class for getting axis values and event source. - Updated the
AccessibilityNodeInfoCompat
class to add methods for errors, content invalidation and labels. - Added the following interpolation classes for animation:
FastOutLinearInInterpolator
,FastOutSlowInInterpolator
,LinearOutSlowInInterpolator
,LinearOutSlowInInterpolator
, andPathInterpolatorCompat
. - Added the
Space
class to create gaps between components in general purpose layouts. This class is deprecated in the gridlayout library. - Added the
TextViewCompat
class for accessing features in aTextView
. - Added a displacement parameter to the
onPull()
method in theEdgeEffectCompat
class.
- Added the
- Changes for v7 appcompat library:
-
- Added tint support to appcompat widgets, including
AppCompatAutoCompleteTextView
,AppCompatButton
,AppCompatCheckBox
,AppCompatCheckedTextView
,AppCompatEditText
,AppCompatMultiAutoCompleteTextView
,AppCompatRadioButton
,AppCompatRatingBar
,AppCompatSpinner
, andAppCompatTextView
. - Updated the
AppCompatActivity
as the base class for activities that use the support library action bar features. This class replaces the deprecatedActionBarActivity
. - Added the
AppCompatCallback
interface to be implemented for AppCompat to be able to perform callbacks. - Added the
AppCompatDelegate
abstract class as a delegate you can use to extend AppCompat's support to any activity. - Added the
AppCompatDialog
class as the base class for AppCompat themed dialogs. - Added the spinner style
AlertDialog
andAlertDialog.Builder
classes to provide an AppCompat themedAlertDialog
. - Added the
Palette.Builder
class for generatingPalette
instances.- Added the
from(Bitmap)
method to thePalette
class to start generating a Palette with the returnedPalette.Builder
instance. - Deprecated the
generate()
andgenerateAsync()
methods.
- Added the
- Added the
getAbsoluteAlignment()
method to theGridLayout.Spec
class. - Deprecated use of
app:theme
for stylingToolbar
. You can now useandroid:theme
for toolbars on all API level 7 and higher devices andandroid:theme
support for all widgets on API level 11 and higher devices.
- Added tint support to appcompat widgets, including
- Changes for v17 leanback library:
-
- Added
GuidedStepFragment
,GuidanceStylist
andGuidedActionsStylist
to support creating multi-step decision flows.
- Added
- Changes for v7 recyclerview library:
-
- Added
SortedList
classes to display items in a list order and provide notification of changes to the list. - Added the
SortedListAdapterCallback
class that can bind a sorted list to aRecyclerView.Adapter
class.
- Added
- Changes for v8 renderscript library:
-
- Added the
ScriptIntrinsicHistogram
class for use as a histogram filter. - Added the
ScriptIntrinsicResize
class for performing a resize of a 2D allocation.
- Added the
Android Support Library, revision 22 (March 2015)
- Changes for v4 support library:
-
- Updated the
getDrawable()
method to return a drawable object for a specified specific resource ID, screen density, and theme. - Added the
setImportantForAccessibility()
method so you can indicate if a view should trigger accessibility events. - Added the
getStatusBarBackgroundDrawable()
method so you can get the status bar background drawable. - Added methods to the
NotificationCompat.CarExtender.UnreadConversation
class so Android Auto messaging apps can retrieve additional notification data. - Added the
getProgressCircleDiameter()
method to return the diameter of a circle layout. - Changed the default
DrawerLayout
status bar color tocolorPrimaryDark
.
- Updated the
- Changes for v7 appcompat library:
-
- Added the spinner style
Base_Widget_AppCompat_Spinner_Underlined
. - Added tinted widgets styles with
Widget_AppCompat_AutoCompleteTextView
,MultiAutoCompleteTextView
,TextAppearance_AppCompat_Button
, andBase_Widget_AppCompat_RatingBar
.
- Added the spinner style
- Changes for v17 leanback library:
-
- Added the
getRecycledPoolSize()
andsetRecycledPoolSize()
methods to allow customized recycled pool sizes. - Added the
WRAP_CONTENT
attribute to the layout width setting to support wrapped content for title icons. - Defined
R.transition
in XML to improve transition updates. - Enabled support for right to left layouts.
- Added the play and pause media key events support to the
PlaybackOverlayFragment
class. - Added enter and return transitions to the
BrowseFragment
class and theDetailsFragment
class. - Added the
replace()
method to replace items in an object’s adapter array.
- Added the
- Changes for v7 mediarouter library:
-
- Updated Google Cast icons to use the material design style.
- Updated all the icons used in the
MediaRouter
dialogs to use the material design style.
- Changes for v7 recyclerview library:
-
- Added the
getlayoutPosition()
andgetadapterPosition()
methods to theRecyclerView
class. - Deprecated the
classgetChildPosition()
andfindViewHolderForPosition()
methods in theRecyclerView
class. - Deprecated the
getPosition()
method in theRecyclerView.ViewHolder
class. - Deprecated the
getViewPosition()
method in theRecyclerView.LayoutParams
class.
- Added the
Android Support Library, revision 21.0.3 (December 2014)
- Changes for v4 support library:
-
- Added several
NotificationCompat.WearableExtender
methods to improve the display of barcodes in notifications on wearable devices.
- Added several
Android Support Library, revision 21.0.2 (November 2014)
- Changes for v4 support library:
-
- Added
NotificationCompat.CarExtender
class to support Android Auto extensions to notifications.
- Added
- Changes for v7 appcompat library:
-
- Added the
PopupMenu
constructor to support new popup menus. - Added support for a Collapse icon description in the
Toolbar
class. - Updated the
SearchView
widget to support displaying thecommitIcon
. - Removed the
buttonGravity
attribute from theToolbar
class.
- Added the
- Changes for v7 cardview library:
-
- Added
setCardBackgroundColor(int)
API to support changing the background color of theCardView
. - Changed the
CardView
to more accurately report its opacity value asTRANSLUCENT
.
- Added
- Changes for v7 recyclerview library:
-
- Added
TOUCH_SLOP_DEFAULT
andTOUCH_SLOP_PAGING
constants to theRecyclerView
class to support touch slop configurations for paging.
- Added
- Changes for v17 leanback library:
-
- Added support to generate v4 code fragments.
- Changed the secondary text color on
CardView
.
Android Support Library, revision 21.0.1 (November 2014)
- Added multidex support library to support multiple Dalvik Executable (DEX) files for multi-dex file support prior to Android 5.0.
Android Support Library, revision 21 (October 2014)
- Changes for v4 support library:
-
- Added support for
Fragment
transitions for devices running Android 5.0 (API level 21). Be aware that transitions have no effect on devices running Android 4.4 and lower. - Added
DocumentFile
to ease the transition fromFile
while working with document trees. However, this class demands more processing overhead compared to the platform'sDocumentsContract
API added in Android 4.4 (API level 19). So you should switch to usingDocumentsContract
when running on Android 4.4 and higher.
- Added support for
- Changes for v7 appcompat library:
-
- Added support for material design user interfaces.
- Added
Toolbar
, which generalizes the functionality ofActionBar
for use within app layouts. - Updated
ActionBarDrawerToggle
, which contains the menu-to-arrow animation - Updated common user interface widgets to allow tinting via theme attributes when running on pre-Android 5.0 devices
- Added
SwitchCompat
, a backport of theSwitch
widget that was added in Android 4.0 (API level 14).
- New v7 cardview library:
-
- Added the
CardView
widget, which provides a material design-compatible implementation for displaying data items.
- Added the
- New v7 recyclerview library:
-
- Added the
RecyclerView
widget, which provides a flexible list view for providing a limited window into a large data set.
- Added the
- New v7 palette library:
-
- Added
Palette
class, which lets you extract prominent colors from an image.
- Added
- New v17 leanback library:
-
- Added support for building TV user interfaces, including
BrowseFragment
,DetailsFragment
, andPlaybackOverlayFragment
. For more information about using these user interface widgets, see Building TV Playback Apps.
- Added support for building TV user interfaces, including
Android Support Library, revision 20 (July 2014)
- Changes for v4 support library:
-
- Added extended notification support for Android Wear in
NotificationCompat.WearableExtender
, which allows you to specify wearable-specific features in your notifications. - Added
NotificationCompat.Action.WearableExtender
, which allows actions to be added on wearable notifications. - Added
NotificationManagerCompat
, which allows you to issue notifications that properly support wearable features. - Added
RemoteInput
, which allows a handheld device to receive voice input from a notification that appears on a wearable device. - Improved the handling of touch feedback in
SwipeRefreshLayout
.
- Added extended notification support for Android Wear in
Android Support Library, revision 19.1.0 (March 2014)
- Changes for v4 support library:
-
- Added the
SwipeRefreshLayout
class, which enables users to refresh the contents of a view with a vertical swipe gesture. - Fixed accessibility issues with navigation drawers.
- Added the
- Changes for v7 appcompat library:
-
- Fixed background issues with the action bar.
Android Support Library, revision 19.0.1 (December 2013)
- Changes for v4 support library:
-
- Improved
PrintHelper
by adding asynchronous handling of printing. - Fixed the
DrawerLayout
class approximation of theaddChildrenForAccessibility()
method. - Fixed slide drawable mirroring in
ActionBarDrawerToggle
. - Fixed off-by-one issue when removing an item from a collection iterator.
- Improved
- Changes for v7 mediarouter library:
-
- Improved route identification by using full component name in the
MediaRouteProvider.ProviderMetadata
. - Updated
MediaRouteChooserDialog
to hide disabled routes.
- Improved route identification by using full component name in the
- Changes for v8 renderscript library
-
- Added error propagation for the RenderScript thunking layer.
Android Support Library, revision 19 (October 2013)
- Changes for v4 support library:
-
- Added support for external Storage APIs with the
getObbDirs()
,getExternalFilesDirs()
,getExternalCacheDirs()
, andgetStorageState()
. These helper methods always return a single file object on devices running Android 4.3 (API level 18) and earlier. When running on Android 4.4 (API level 19) and higher, these methods may return more than one file object. - Added
PrintHelper
class that works with the Print APIs to print images with a minimum of code. - Added drag-to-open user interface support for pop-up menus. For more information, see
PopupMenuCompat
andListPopupWindowCompat
. - Improved accessibility support with the addition of a
findFocus()
method inAccessibilityNodeProviderCompat
and thegetLiveRegion()
method inAccessibilityNodeInfoCompat
. - Added helper class
ScaleGestureDetectorCompat
for accessing new scaling gesture methods. - Fixed problem with
ActionBarDrawerToggle
in right-to-left language displays. - Modified
AutoScrollHelper
option to consume touch events or allow them to be passed through to other views.
- Added support for external Storage APIs with the
- Changes for v7 mediarouter library:
-
- Added support for media playback queuing, setting HTTP header values and media playback duration.
- Added explicit start, get, and end session actions for explicitly managing media playback sessions with media router.
Android Support Library, revision 18 (July 2013)
- Changes for v4 support library:
-
- User interface
- Added
BidiFormatter
for handling text strings that combine right to left and left to right-formatted text. - Modified
ViewPager
to better handle cases where the pager has a measured width of zero in the initial layout processing. - Modified
DrawerLayout
andSlidingPaneLayout
to not throw exceptions for measurement while the project code is being edited.
- Added
- Accessibility
- Added
ExploreByTouchHelper
to simplify the implementation of accessibility for custom views. - Fixed a problem with
ViewPager
incorrectly populatingTYPE_VIEW_SCROLLED
accessibility events. - Fixed a null pointer exception in
ViewPager
when populating an accessibility event. - Simplified
AccessibilityNodeInfoCompat
by changingCharSequence
inputs toString
objects. - Deprecated an
AccessibilityRecordCompat
constructor that used anObject
as input.
- Added
- Media
- Added
TransportMediator
helper class to manage media transport control, such as play, pause, skip and other media actions. - Added
DisplayManagerCompat
for managing display output to one or more device displays.
- Added
- Other changes
- Added
WakefulBroadcastReceiver
helper class for implementing a common pattern of detecting a device wakeup event and passing work off to aService
while ensuring that the device does not go back to sleep before the handoff is complete. - Added two new APIs,
commitContentChanged()
androllbackContentChanged()
, toAsyncTaskLoader
to help deal with background updates for data changes that are subsequently canceled.
- Added
- User interface
- New v7 appcompat library:
-
- Added
ActionBar
to allow implementation of the action bar user interface design pattern back to Android 2.1 (API level 7) and higher. Use of this class requires that you implement your activity by extending the newActionBarActivity
class.
- Added
- New v7 mediarouter library:
-
Added a new mediarouter library that provides support for the Google Cast developer preview. The v7 mediarouter library APIs provide a means of controlling the routing of media channels and streams from the current device to external screens, speakers, and other destination devices, with compatibility back to Android 2.1 (API level 7). See V7 mediarouter library for more information.
The v7 mediarouter library APIs introduced in Support Library r18 are subject to change in later revisions of the Support Library. At this time, we recommend using the library only in connection with the Google Cast developer preview.
Android Support Library, revision 13 (May 2013)
- Changes for v4 support library:
-
- Added
DrawerLayout
for creating a Navigation Drawer that can be pulled in from the edge of a window. - Added
SlidingPaneLayout
widget for creating linked summary and detail views that appropriately adapt to various screen sizes. - Added
ActionBarDrawerToggle
as a way to tie together the functions ofDrawerLayout
andActionBar
. - Added
ViewDragHelper
as a new common component for dragging views within a parent view. - Added
ScrollerCompat
to provideScroller
andOverScroller
compatibility support. - Added
FileProvider
to allow sharing of private files between applications. - Updated
ViewPager
to throw an exception if the associatedPagerAdapter
class is modified without a call tonotifyDataSetChanged()
. - Fixed an issue with
ViewPager
children drawing sort order. - Fixed
GestureDetectorCompat
to dispatch missingonSingleTapConfirmed(MotionEvent)
calls between tap timeout and long press events.
- Added
- New v7 gridlayout library:
-
- Added
GridLayout
to provide support for theGridLayout
layout object. - Added
Space
which can be used to create blank areas within aGridLayout
layout object.
- Added
Android Support Library, revision 12 (February 2013)
- Changes for v4 support library:
-
- Improved interaction behavior for
ViewPager
. - Fixed a bug that could cause
ViewPager
to select the wrong page. - Fixed use of
removeView()
method during layout forViewPager
. - Fixed issue with
SearchViewCompat
where using the back button to dismiss does not clear the search text. This fix only applies to host API levels 14 and higher.
- Improved interaction behavior for
Android Support Library, revision 11 (November 2012)
- Changes for v4 support library:
-
- User Interface
- Added support for nested
Fragment
classes. - Added improvements to
FragmentManager
debugging. - Fixed problem in
FragmentTabHost
where fragment and tab interaction could result in aListView
state loss. - Fixed issue with user-visible hint in
FragmentStatePagerAdapter
. - Added
PageTransformer
interface toViewPager
to allow applications to supply a custom transition behavior for scrolling. - Added new features and fixes to
TaskStackBuilder
from current release. - Fixed
PagerTitleStrip
to correctly track thePagerAdapter
currently in use. - Fixed display flickering, positioning, and text clipping problems with
PagerTitleStrip
. - Fixed
PagerTabStrip
to properly respect padding when drawing an underline.
- Added support for nested
- Accessibility
- Added support for new accessibility gesture and touch event types in
AccessibilityEventCompat
. - Added support for new accessibility APIs in
ViewCompat
. - Added support for
performAccessibilityAction()
method toViewCompat
.
- Added support for new accessibility gesture and touch event types in
- Added support for gestures with
GestureDetectorCompat
. - Added support for performing atomic operations on files using a new
AtomicFile
class. - Added support for the full set of
make
methods inIntentCompat
. - Added
trimToSize()
method inLruCache
utility class. - Updated
ConnectivityManagerCompat
to get NetworkInfo from aCONNECTIVITY_ACTION
broadcast.
- User Interface
Android Support Library, revision 10 (August 2012)
- Changes for v4 support library:
-
- Added support for notification features introduced in Android 4.1 (API level 16) with
additions to
NotificationCompat
.
- Added support for notification features introduced in Android 4.1 (API level 16) with
additions to
Android Support Library, revision 9 (June 2012)
- Changes for v4 support library:
-
- User Interface Support
- Added
PagerTabStrip
support, providing enhanced functionality beyondPagerTitleStrip
. - Fixed various bugs for
PagerTitleStrip
andPagerTabStrip
, includingsetAllCaps
option, title alignment, appearance improvements, minimum width constraints and touch navigation issues. - Added support for
ViewPager
page gutters, which helps theViewPager
class provide paging support for content with a large horizontal scroll range, such as a map. - Fixed numerous bugs for
ViewPager
, including size and data set change problems, page positioning, user interaction, scroll tracking and keyboard navigation problems. - Fixed many bugs for
Fragment
, including proper handling ofonActivityResult()
when the target fragment no longer exists, dispatching selection events to invisible fragments, improvedFragmentTransaction.replace()
behavior and added better state handling for fragments being moved out of view. - Added support for the
postOnAnimation()
method inViewCompat
. - Updated
NavUtils
to use Android 4.1 (API level 16) Up navigation functionality when available.
- Added
- Accessibility
- Updated accessibility support classes, including
AccessibilityNodeInfoCompat
, to follow fixes made in Android 4.1 (API level 16). - Added support for accessibility scroll actions in
ViewPager
.
- Updated accessibility support classes, including
- General improvements
- Updated
TaskStackBuilder
to reflect API changes in Android 4.1 (API level 16). - Enhanced
TaskStackBuilder
to allow it to be used from a Service. - Added support for
EXTRA_HTML_TEXT
toShareCompat
. - Updated
NotificationCompat.Builder
to support thesetNumber()
method. - Added support in
ConnectivityManagerCompat
for theisActiveNetworkMetered()
method.
- Updated
- User Interface Support
Android Support Library, revision 8 (April 2012)
- Changes for v4 support library:
-
- Fixed intent flags for
PendingIntent
objects generated byTaskStackBuilder
. - Removed unused attributes from the gridlayout library projects to make sure the library can be built with API level 7 and higher.
- Added
.classpath
and.project
files for the gridlayout library project.
- Fixed intent flags for
Android Support Library, revision 7 (March 2012)
- Changes for v4 support library:
-
- Added
ShareCompat
, which provides helper classes for sending and receiving content for social sharing applications, including new metadata for attributing shared data to the source app. This class also provides compatible integration with the newShareActionProvider
in Android 4.0. - Added
NavUtils
andTaskStackBuilder
to provide support for implementing the Android Design guidelines for navigation. These additions include a way to implement the action bar's Up button across versions. For an example implementation of this pattern, see the AppNavigation sample in (<sdk>/samples/<platform>/AppNavigation
). - Added
NotificationCompat.Builder
to provide a compatibility implementation of Android 3.0'sNotification.Builder
helper class for creating standardized system notifications.
- Added
Android Support Library, revision 6 (December 2011)
Note: Reference for support library APIs are now available with
the framework references, for example: android.support.v4.app
.
- Changes for v4 support library:
-
- Changes to ViewPager:
- Added extra decorative view support for
ViewPager
. Decorative views may be supplied as child views of a pager in XML layout. - Added
PagerAdapter.getPageTitle()
to supply title strings for pages, which defaults to no title for each page. - Added
PagerTitleStrip
, a non-interactive title strip, that can be added as a child of ViewPager. Developers can supply text appearance and color, as well as layout sizing and gravity information. - Updated
PagerAdapter
methods to take ViewGroup objects, rather than View to avoid class casting in adapter implementations. - Updated
ViewPager
to use Launcher-style fling behavior. - Bug fixes for user interface interaction and test automation.
- Added extra decorative view support for
- Support for Fragments:
- Changed
setStartDeferred()
method tosetUserVisibleHint(boolean)
. - Added deferred start for off-screen pages to improve performance.
- Changed
- Support for Accessiblity APIs:
- Updated
AccessibilityDelegateCompat
methods to return empty lists instead of null. - Added new APIs needed by the v4 samples.
- Updated
- Changes to ViewPager:
Android Support Library, revision 5 (December 2011)
- Changes for v4 support library:
-
- Support for Accessiblity APIs:
- Added
AccessibilityDelegateCompat
to supportView.AccessibilityDelegate
. - Added
AccessibilityEventCompat
to supportAccessibilityEvent
. - Added
AccessibilityManagerCompat
to supportAccessibilityManager
. - Added
AccessibilityNodeInfoCompat
to supportAccessibilityNodeInfo
. - Added
AccessibilityRecordCompat
to supportAccessibilityRecord
. - Added
AccessibilityServiceInfoCompat
to supportAccessibilityServiceInfo
. - Added
ViewGroupCompat
to support accessibility features inViewGroup
. - Modified
ViewCompat
to support accessibility features inView
.
- Added
- Changes to ViewPager:
- Added support for margins between pages.
An optional
Drawable
can be provided to fill the margins. - Added support for
EdgeEffect
. - Added support for keyboard navigation
- Added support to control how many pages are kept to either side of the current page.
- Improved touch physics.
- Bug fixes for user interface behavior.
- Added support for margins between pages.
An optional
- Support for Accessiblity APIs:
Android Support Library, revision 4 (October 2011)
- Changes for v4 support library:
-
- Added
EdgeEffectCompat
to supportEdgeEffect
. - Added
LocalBroadcastManager
to allow applications to easily register for and receive intents within a single application without broadcasting them globally. - Added support in
ViewCompat
to check for and set overscroll modes forView
s on Android 2.3 and later. - Changes to Fragment APIs:
- Added new APIs to control the visibility of new menus.
- Added custom animation APIs.
- Added APIs in
FragmentActivity
to retain custom, non-configuration instance data. - Various bug fixes.
- Fixed a
Loader
bug that caused issues in cancelingAsyncTask
s when running on Froyo and older versions of the platform. The support code now uses its own version ofAsyncTask
to keep the same behavior on all platform versions.
- Added
Android Support Library, revision 3 (July 2011)
- Changes for v4 support library:
-
- Adds support for
Fragment.SavedState
- Adds
MotionEventCompat
to support newerMotionEvent
APIs - Adds
VelocityTrackerCompat
to support a newerVelocityTracker
APIs - Adds
ViewConfigurationCompat
to support a newerViewConfiguration
APIs - All new APIs (available only in the support library) that allow you to create UIs
with horizontal paging, allowing users to swipe left and right between content views. Classes to
support this include:
ViewPager
: AViewGroup
that manages the layout for the child views, which the user can swipe between.PagerAdapter
: An adapter that populates theViewPager
with the views that represent each page.FragmentPagerAdapter
: An extension ofPagerAdapter
for flipping between fragments.FragmentStatePagerAdapter
: An extension ofPagerAdapter
for flipping between fragments that uses the library's support forFragment.SavedState
.
- Adds support for
- New v13 support library:
-
- Includes the
FragmentPagerAdapter
andFragmentStatePagerAdapter
to support the horizontal paging.These are exactly the same as the APIs added to the v4 support library, but rely on other platform components in Android 3.2. Use this library instead of v4 if you're developing for Android 3.2 and higher (all other APIs in the v4 library are already available with API level 13).
- Includes the
Android Support Library, revision 2 (May 2011)
- Changes for v4 library:
-
- Support for fragment animations
- Fix
Fragment.onActivityResult()
bug
Android Support Library, revision 1 (March 2011)
Initial release with the v4 library.