Slide 1

Slide 1 text

Paris, 04 Mai 2015 Material Design Developper Edition

Slide 2

Slide 2 text

2015 • Material design Material Design (dev)

Slide 3

Slide 3 text

Material Design (dev) 2015 • Material design Metaphor: paper and ink Vivid colors Animations and transitions Shadows Ripples

Slide 4

Slide 4 text

Material Design (dev) 2015 • In action: Gmail

Slide 5

Slide 5 text

2015 • Guidelines Material Design (dev) www.google.com/design/spec/material-design/

Slide 6

Slide 6 text

2015 • Keylines Material Design (dev)

Slide 7

Slide 7 text

2015 • build.gradle Material Design (dev) compile ‘com.android.support:appcompat-v7:22.1.0' compile ‘com.android.support:cardview-v7:21.0.0’ compile ‘com.android.support:palette-v7:21.0.0’ compile ‘com.android.support:recyclerview-v7:21.0.0’

Slide 8

Slide 8 text

2015 • styles.xml Material Design (dev) <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> Alternatives : Theme.AppCompat Theme.AppCompat.Light

Slide 9

Slide 9 text

2015 • styles.xml Material Design (dev) colorPrimary. The primary branding color for the app; used as the action bar background, recents task title and in edge effects. colorAccent. Vibrant complement to the primary branding color. Applied to framework controls such as EditText and Switch. colorPrimaryDark. Darker variant of the primary branding color; applied to the status bar.

Slide 10

Slide 10 text

2015 • styles.xml Material Design (dev) Further attributes give fine grained control over colorizing controls, see: • colorControlNormal, • colorControlActivated, • colorControlHighlight, • colorButtonNormal, • colorSwitchThumbNormal, • colorEdgeEffect, • statusBarColor • and navigationBarColor.

Slide 11

Slide 11 text

2015 • Accent Color Material Design (dev)

Slide 12

Slide 12 text

2015 • Accent Color : Careful ! Material Design (dev) Why is my EditText (or other widget listed above) not being tinted correctly on my pre-Lollipop device? The widget tinting in AppCompat works by intercepting any layout inflation and inserting a special tint-aware version of the widget in its place. For most people this will work fine, but I can think of a few scenarios where this won’t work, including: • You have your own custom version of the widget (i.e. you’ve extended EditText) • You are creating the EditText without a LayoutInflater (i.e., calling new EditText()). The special tint-aware widgets are currently hidden as they’re an unfinished implementation detail. This may change in the future.

Slide 13

Slide 13 text

2015 • Activities Material Design (dev) No action bar in Theme.AppCompat (vs Theme.Holo) Need to : • inherit from AppCompatActivity • or add a ToolBar in the activity layout

Slide 14

Slide 14 text

2015 • ToolBar Material Design (dev) Action bar fully customisable : position, size, content…

Slide 15

Slide 15 text

2015 • ToolBar Material Design (dev)

Slide 16

Slide 16 text

ToolBar : default metrics Material Design (dev)

Slide 17

Slide 17 text

2015 • Action Bar : Careful ! Material Design (dev) getActionBar() -> getSupportActionBar() (only if inheriting from AppCompatActivity or setSupportActionBar(toolBar) has been called) public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.search, menu); SearchView searchView; - searchView = (SearchView) menu.findItem(R.id.search).getActionView(); + searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.search));

Slide 18

Slide 18 text

2015 • Action Bar : Careful ! Material Design (dev) - + + app:showAsAction="always" + app:actionViewClass="android.widget.SearchView"/>

Slide 19

Slide 19 text

2015 • Text fields Material Design (dev) https://gist.github.com/ dmytrodanylyk/ d0c0f93c305e6879ec12

Slide 20

Slide 20 text

2015 • Text Material Design (dev) @style/TextAppearance.AppCompat.Title @style/TextAppearance.AppCompat.Body1

Slide 21

Slide 21 text

2015 • Dialogs : AppCompatDialog Material Design (dev)

Slide 22

Slide 22 text

2015 • Navigation Drawer Material Design (dev) https://github.com/ mikepenz/MaterialDrawer

Slide 23

Slide 23 text

2015 • Bottom sheets Material Design (dev) https://github.com/ soarcn/BottomSheet

Slide 24

Slide 24 text

2015 • Snack bars Material Design (dev) https://github.com/ nispok/snackbar

Slide 25

Slide 25 text

2015 • Chips Material Design (dev) https://github.com/ klinker41/android-chips

Slide 26

Slide 26 text

2015 • Everything else Material Design (dev) https://github.com/ rey5137/Material

Slide 27

Slide 27 text

2015 • Icons Material Design (dev) https://github.com/google/material-design-icons

Slide 28

Slide 28 text

2015 • Elevation Material Design (dev) ViewCompat.setElevation(view, 8dp) CardView + card_view:cardElevation PNG

Slide 29

Slide 29 text

2015 • Animations Material Design (dev)              <item  name="android:windowContentTransitions">true</item>          <item  name="android:windowAllowEnterTransitionOverlap">true</item>          <item  name="android:windowAllowReturnTransitionOverlap">true</item>          <item  name="android:windowSharedElementEnterTransition">@android:transition/move</item>          <item  name="android:windowSharedElementExitTransition">@android:transition/move</item>     values-v21/themes.xml ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
 activity,
 transitionView,
 DetailActivity.EXTRA_IMAGE);
 ActivityCompat.startActivity(
 activity,
 new Intent(activity, DetailActivity.class),
 options.toBundle());

Slide 30

Slide 30 text

Paris, 04 Mai 2015 Applidium 20 rue Sainte-Croix de la Bretonnerie 75004 Paris www.applidium.com Questions ?