Placeholder Image

Subtitles section Play video

  • MALE SPEAKER: AppCompat gives you

  • a consistent base for your Android

  • app built on the principles of material design.

  • But material design is a lot more

  • than adding a toolbar and some accent colors.

  • For everything else, there's a design library.

  • The design library provides many of the high-level components

  • you'll need to build a great app that feels

  • at home with material design.

  • So what do you get?

  • A text input layout for adding floating labels and errors

  • to edit text.

  • Floating action button for the primary action

  • in your interface.

  • SnackBars for quick feedback messages

  • with an optional action.

  • Material design compliant tabs and navigation

  • view for building your Navigation Drawer menu items.

  • Plus a lot of work, specifically around motion and scrolling.

  • All this back through API7.

  • Text Input Layer wraps and edits text, providing always visible

  • hint text, and a convenient way of showing error

  • text via the set error method.

  • Floating Action Buttons are ideal for that primary action

  • in your UI.

  • The design library's Floating Action Button

  • sports both a default size as well as a mini size,

  • useful for when the Floating Action Button needs

  • to match with other elements.

  • Snackbars are a new way to provide lightweight feedback

  • to your users.

  • Unlike toast messages, SnackBars are an interactive part

  • of your UI, allowing you to add an optional action

  • or allow the user to swipe to dismiss the SnackBar.

  • This makes SnackBars very useful around potentially destructive

  • operations.

  • A Click Undo Action can save a lot of headache,

  • while providing a far better experience than confirmation

  • dialogs.

  • Tabs have always been a common pattern on Android,

  • both as top level navigation for your app,

  • and for grouping content within your app.

  • The design library's tab layout supports fixed tabs

  • where each views width is split equally between tabs, suitable

  • if you only have a few important tabs,

  • as well supporting scrollable tabs where you

  • have a large number of tabs.

  • We've made it easy to attach your tab layout to a ViewPager,

  • keeping your tabs and pages content in sync.

  • Just make sure your pager adapter overrides

  • Get Page Title.

  • And then call Set Up With ViewPager

  • to tie everything together.

  • An alternative to using tabs as your top-level navigation

  • is the Navigation Drawer-- a slide out

  • pane which offers navigation between different parts

  • of your app.

  • Navigation View gives you a perfectly styled drawer.

  • You just provide the header, and then you

  • can add navigation items programmatically

  • or via a Menu Resource File.

  • The simplest drawer menus will have a group of checkable menu

  • items, using the checkable behavior

  • equals single attribute.

  • This ensures that the checked items will appear highlighted

  • in the Navigation View.

  • Support for subheaders using subviews is also available.

  • That takes care of a lot of the visuals of material design.

  • What about the motion side of material design?

  • Coordinator motion is critical to a great experience.

  • That's why the design library is introducing CoordinatorLayout.

  • CoordinatorLayout is a new layout

  • that allows children to declare a behavior, giving them

  • extra controls around touch events

  • and the ability to build dependencies between views.

  • A great example of this is when you use CoordinatorLayout

  • with the floating action button, and then show a Snackbar.

  • The default behavior for these components

  • allow the floating action button to automatically move up

  • as the Snackbar animates onto the screen,

  • ensuring that components don't overlap,

  • without you writing any code at all.

  • A major focus for CoordinatorLayout

  • in this initial release is around

  • enabling your appbar to react to your main content scrolling.

  • By wrapping your toolbar and other views, such as Tab

  • Layout, in an appbar layout, you'll

  • gain access to the special control flags,

  • allowing you to annotate each component as something that

  • scrolls off the screen, stays pinned

  • to the top of the screen, or even returns immediately,

  • when you downward scroll, making implementing a quick return

  • pattern just a few lines of XML.

  • No custom synchronized scrolling code needed.

  • You can take things even further by using a collapsing toolbar

  • layout.

  • This allows an extended hide toolbar

  • to grow and shrink its title text size as it collapses.

  • Pin elements to the top of the collapsing toolbar,

  • parallax images, and even add a full bleed scrim color

  • once it becomes collapsed.

  • Again, just a few lines of XML, and that's all you'll need.

  • Getting started with the design library is easy.

  • It's just a single dependency to add.

  • With AppCompat as the base, and the components provided

  • by the design library on top of it,

  • there's no better time to get started building great material

  • design apps.

  • We've only touched on the features in the design library.

  • You're can learn even more about the design library in the blog

  • post and on the developer site.

  • I'm looking forward to your great material design apps.

MALE SPEAKER: AppCompat gives you

Subtitles and vocabulary

Click the word to look it up Click the word to find further inforamtion about it