Android Support Library 23.2

Support Vector Drawables and Animated Vector Drawables

VectorDrawable

AnimatedVectorDrawable

support-vector-drawable

animated-vector-drawable

vectorDrawables.useSupportLibrary = true

build.gradle

// Gradle Plugin 2.0+ android { defaultConfig { vectorDrawables.useSupportLibrary = true } }

// Gradle Plugin 1.5 android { defaultConfig { generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } }

ImageView

ImageButton

FloatingActionButton

android:src

<ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:srcCompat="@drawable/ic_add" />

setImageResource()

app:srcCompat

app:srcCompat

However, AppCompat does support loading vector drawables when they are referenced in another drawable container such as a StateListDrawable , InsetDrawable , LayerDrawable , LevelListDrawable , and RotateDrawable . By using this indirection, you can use vector drawables in cases such as TextView’s android:drawableLeft attribute, which wouldn’t normally be able to support vector drawables.

app:srcCompat

setImageResource()..

AppCompat DayNight theme

Theme.AppCompat.DayNight.

DayNight

DayNight.NoActionBar,

DayNight.DarkActionBar, DayNight.Dialog,

Light

Dark

UiModeManager.getNightMode()

AppCompatDelegate

AppCompatDelegate.setDefaultNightMode()

getDelegate()

setLocalNightMode()

Activity

Dialog.

AppCompatDelegate.MODE_NIGHT_AUTO,

MODE_NIGHT_NO

MODE_NIGHT_YES

DayNight

TextAppearance.AppCompat

android:textColorPrimary

night

Design Support Library: Bottom Sheets

BottomSheetBehavior

View

CoordinatorLayout

app:layout_behavior="android.support.design.widget.BottomSheetBehavior"

STATE_COLLAPSED: app:behavior_peekHeight attribute (defaults to 0)

attribute (defaults to 0) STATE_DRAGGING: the intermediate state while the user is directly dragging the bottom sheet up or down

the intermediate state while the user is directly dragging the bottom sheet up or down STATE_SETTLING: that brief time between when the View is released and settling into its final position

that brief time between when the View is released and settling into its final position STATE_EXPANDED: the fully expanded state of the bottom sheet, where either the whole bottom sheet is visible (if its height is less than the containing CoordinatorLayout ) or the entire CoordinatorLayout is filled

the fully expanded state of the bottom sheet, where either the whole bottom sheet is visible (if its height is less than the containing ) or the entire is filled STATE_HIDDEN: disabled by default (and enabled with the app:behavior_hideable attribute), enabling this allows users to swipe down on the bottom sheet to completely hide the bottom sheet

NestedScrollView

RecyclerView

ListView/ScrollView

// The View with the BottomSheetBehavior View bottomSheet = coordinatorLayout.findViewById(R.id.bottom_sheet); BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet); behavior.setBottomSheetCallback(new BottomSheetCallback() { @Override public void onStateChanged(@NonNull View bottomSheet, int newState) { // React to state change } @Override public void onSlide(@NonNull View bottomSheet, float slideOffset) { // React to dragging events } });

BottomSheetBehavior

BottomSheetDialog

BottomSheetDialogFragment

AppCompatDialog

AppCompatDialogFragment

Support v4: MediaBrowserServiceCompat

MediaSessionCompat

MediaBrowserServiceCompat

MediaBrowserCompat

RecyclerView

RecyclerView

LayoutManager

RecyclerView

WRAP_CONTENT

RecyclerView

LayoutManager

LayoutManagers

setAutoMeasureEnabled(true)

RecyclerView

RecyclerView

Custom Tabs

addToolbarItem()

(MAX_TOOLBAR_ITEMS)

setToolbarItem()

setSecondaryToolbarColor()

Leanback for Android TV

GuidedStepFragment

onCreateButtonActions()

setButtonActions()

GuidedActions

GuidedActions

descriptionEditable()

subActions()

GuidedDatePickerAction.

Available Now