Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Design Library

Design Library

Slides of my presentation at the GDG Montreal Pos Google I/O Event about Design Library.

More Decks by Marcos Paulo Souza Damasceno

Other Decks in Programming

Transcript

  1. Why a design library? "Design is all about finding solutions

    within constraints; if there were no constraints, it's not design - it's art." Matias Duarte Design God @Google
  2. Bring Material Design to Pre-Lollipop devices. Reference implementation of Material

    design. Encourage the adoption of Material. Simplify the implementation of motion coordination. Why a design library?
  3. Floating Action Button 56dp - Normal Size 40dp - Mini

    Size Customizable fabSize backgroundTint borderWidth rippleColor
  4. EditText Floating Labels When an EditText has focus, the assigned

    hint will ‘float’ above the view to the top-left hand side
  5. Navigation View Simpler and easier way to implement Navigation Drawer

    Customizable itemBackground itemIconTint itemTextColor OnNavigationItemSelectedListener
  6. TabLayout Provides a scrollable tab bar component for use in

    applications Attributes tabMode tabGravity setText setIcon
  7. TabLayout Provides a scrollable tab bar component for use in

    applications Attributes tabMode tabGravity setText setIcon Listeners OnTabSelectedListener TabLayoutOnPageChangeListener
  8. CoordinatorLayout The CoordinatorLayout builds on-top of the motion effects already

    provided by adding the ability to transition views based on the motion of others. Floating Action Button
  9. CoordinatorLayout App Bar Let us adapt our layouts based on

    different scroll events that may take place.
  10. CoordinatorLayout Understanding Behavior CoordinatorLayout is important cause it looks for

    Views that have a behavior. You can set a behavior using app:layout_behavior or by using the annotation @DefaultBehavior in a Custom View
  11. CoordinatorLayout Behavior methods public boolean layoutDependsOn(CoordinatorLayout parent, View child, View

    dependency) public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) Verifies if it should dispatch the DependentViewChanged Called every time there is a change on the dependency
  12. CoordinatorLayout Behavior methods - child View that will change based

    on another view. - dependency View that will trigger the behavior, it can be a NestedView, RecyclerView, ViewPager and some others.
  13. CoordinatorLayout Floating Action Button Behavior The translate animation of the

    FAB when a snack bar appears and the shrink animation inside a AppBar when it collapses are part of FloatingActionButton Behavior
  14. CoordinatorLayout Creating a custom Behavior What if we want our

    FAB to hide when we scroll down and appear when we scroll up?
  15. CoordinatorLayout Advantage over implementing it on a ScrollListener The code

    is unaware of who is scrolling. It can be a defaultBehavior for your app. Meaning every time you have a FAB inside a CoordinatorLayout, it will automatically hide. Cleaner code. Can be used for any view, not only for a FAB.
  16. Android Design Library It’s time for Developers start caring more

    about UI and Design! https://plus.google.com/+IanLake/posts/haQL1mnTzaw tps://medium.com/ribot-labs/exploring-the-new-android-design-support-library-b7cda56d2c32 References: