一、Android Support Library, revision 22.2.0
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 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
onWindowStartingSupportActionMode()
method to theAppCompatActivity
,AppCompatCallback
, andAppCompatDialog
classes for handling action modes started from the current window.
isHandleNativeActionModesEnabled()
and
setHandleNativeActionModesEnabled()
methods to the
AppCompatDelegate
class for handling native action modes.
二、
Android Support Library, revision 22.1.0
-
- 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.
Changes for
v7 appcompat library:
- Added the
-
- 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.
Changes for
v17 leanback library:
- Added tint support to appcompat widgets, including
-
- Added
GuidedStepFragment
,GuidanceStylist
andGuidedActionsStylist
to support creating multi-step decision flows.
Changes for
v7 recyclerview library:
- Added
-
- 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.
Changes for
v8 renderscript library:
- Added
-
- Added the
ScriptIntrinsicHistogram
class for use as a histogram filter. - Added the
ScriptIntrinsicResize
class for performing a resize of a 2D allocation.
- Added the
-
Changes for
annotations library:
-
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
.
Changes for v7 appcompat library:
- Updated the
-
- 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
.
Changes for v17 leanback library:
- Added the spinner style
-
- 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.
Changes for v7 mediarouter library:
- Added the
-
- 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
-