SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Downloaden Sie, um offline zu lesen
Mastering Material Motion
by Mike Wolfson
Droidcon NYC 2016
Download Demo App Now:
http://goo.gl/pq8VdA
1 @mikewolfson
Material Design
2014 - Material Design Guidelines
https://material.google.com
2016 - Motion Guidelines
https://material.google.com/motion
2 @mikewolfson
Material Design Principles
1. Material is the metaphor
2. Bold, graphic, intentional
3. Motion Provides Meaning
3 @mikewolfson
Motion Provides
Meaning
"Key Giveaway of a High Quality App"
"Makes Material, Material"
"Most often overlooked part of making an
App Great"
-- John Schlemmer Motion Lead at Google
4 @mikewolfson
Why do we need
Motion Guidelines?
• Describe works and what doesn't
• Pinpoint what feels "right"
• Avoid going overboard
5 @mikewolfson
Motion Principles
Material in motion has the following
characteristics:
• Responsive
• Natural
• Aware
• Intentional
6 @mikewolfson
Principle 1
Responsive
Motion respects and reinforces the user as
the prime mover.
• Touch Feedback
• Elevation
7 @mikewolfson
How to: Default Ripple
selectableItemBackground
<TextView
...
android:background="?attr/selectableItemBackground"
/>
Ripple without Border
?attr/selectableItemBackgroundBorderless
8 @mikewolfson
How to: Custom Ripple
API 21+ can use RippleDrawable
1. Selector - support older OS
resdrawablebg_foo.xml
2. Ripple
resdrawable-v21bg_foo.xml
3. Apply to View:
<TextView
...
android:background="@drawable/bg_selector"/>
9 @mikewolfson
Custom Ripple XML
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/colorAccent"> <!-- Ripple Color -->
<!-- Mask keeps Ripple within View bounds -->
<color android:color="@android:color/white"/>
<item android:id="@android:id/mask"/>
<!-- Default Background Omit for none-->
<item android:drawable="@color/grey_300"/>
</ripple>
10 @mikewolfson
Elevation: stateListAnimator
1. Create Folder
resanimator
2. Create StateListAnimator
resanimatorraise.xml
3. Apply to View
<TextView
...
`android:stateListAnimator="@animator/raise"`/>
https://blog.stylingandroid.com/statelistanimator/
11 @mikewolfson
StateListAnimator XML
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="translationZ"
android:valueTo="8dp"
android:valueType="floatType" />
</item>
<item>
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="translationZ"
android:valueTo="0dp"
android:valueType="floatType" />
</item>
</selector>
12 @mikewolfson
How to: Custom Ripple with Elevation
<TextView
...
android:background="@drawable/bg_selector"
android:stateListAnimator="@animator/raise"/>
13 @mikewolfson
Principle 1
Responsive
Demo
User generates energy in the form of ripple,
and the material raising to the touch
14 @mikewolfson
Principle 2
Natural
Inspired by Reality
Material depicts natural movement
inspired by forces in the real world.
• Duration
• Easing
15 @mikewolfson
Duration
Best Practices
• Keep it Fast (on all screens)
• Duration specific to screen size
• Natural Easing Curves
• Don't do it
16 @mikewolfson
Duration
Multiple screen sizes
Don't use single duration for all animations
• Tablet 130% 390ms
• Normal 100% 300ms
• Wearable 70% 210ms
17 @mikewolfson
Easing Curves
Motion Duration and Easing Guidelines
https://material.google.com/motion/duration-easing.html
Android Animation Interpolators
https://developer.android.com/reference/android/view/animation/
Interpolator.html
Chet Haase "Interpolator Playground"
https://github.com/google/android-ui-toolkit-demos/tree/master/
Animations/InterpolatorPlayground
18 @mikewolfson
Standard curve
Objects quickly accelerate and slowly
decelerate between on-screen locations.
Use FastOutSlowInInterpolator
19 @mikewolfson
Acceleration curve
(“Easing in”)
Objects leave the screen at full velocity.
They do not decelerate when off-screen.
Use FastOutLinearInInterpolator
20 @mikewolfson
Deceleration curve
(“Easing out”)
Objects enter the screen at full velocity
from off-screen and slowly decelerate to a
resting point.
Use LinearOutSlowInterpolator
21 @mikewolfson
Principle 2
Natural
Demo
22 @mikewolfson
Bad - Don't specify Interpolator
Default is Linear
exitBad.setOnClickListener(new View.OnClickListener() {
// BAD- no interpolator, will default to Linear
public void onClick(View view) {
Animation anim3 = AnimationUtils.loadAnimation(mActivity,
R.anim.slideup_in);
bigRedBall.startAnimation(anim3); }
});
23 @mikewolfson
Good - Use correct Interpolator
For exit animation
exitGood.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Animation anim1 = AnimationUtils.loadAnimation(mActivity, R.anim.slideup_in);
Interpolator interpFosi = AnimationUtils.loadInterpolator(mActivity,
android.R.interpolator.fast_out_slow_in);
anim1.setInterpolator(interpFosi);
bigRedBall.startAnimation(anim1); }
});
24 @mikewolfson
Good - Use correct Interpolator
For enter animation
enterGood.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Animation anim2 = AnimationUtils.loadAnimation(mActivity, R.anim.slidedown_out);
Interpolator interpFoli = AnimationUtils.loadInterpolator(mActivity,
android.R.interpolator.fast_out_linear_in);
anim2.setInterpolator(interpFoli);
bigRedBall.startAnimation(anim2); }
});
25 @mikewolfson
Principle 3
Aware
Material is aware of its surroundings,
including the user and other material
around it. It can be attracted to objects and
respond appropriately to user intent.
26 @mikewolfson
Automatic animation
Layout on right has following attribute:
<LinearLayout
...
android:animateLayoutChanges="true" >
27 @mikewolfson
RecyclerView
Use adapter methods
- notifyItemInserted(2)
- notifyItemRangeChanged(2, 6)
- notifyItemRemoved(2)
- https://developer.android.com/reference/android/support/v7/util/
DiffUtil.html
28 @mikewolfson
Principle 4
Intentional
Material in motion guides focus to the right
spot at the right time.
29 @mikewolfson
Intentional
Single Element
One item moves
30 @mikewolfson
Intentional
Two Elements
Good
Two items move together
31 @mikewolfson
Intentional
Too many elements
Bad
Two items move differently
32 @mikewolfson
Intentional
Too many elements
Really, Really Bad
Normal speed
33 @mikewolfson
Intentional
Too many elements
Demo - slowed down
33% of normal speed
34 @mikewolfson
How to: SharedElementTransition
1. Enable transitions in base styles.xml
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowContentTransitions">true</item>
...
</style>
35 @mikewolfson
How to: SharedElementTransition
2. Transition Attribute in Start and End layouts
//Activity #1
<ImageView
android:id="@+id/hero_img1"
...
android:transitionName="@string/trans_hero1" />
//Activity #2
<ImageView
android:id="@+id/hero_img1_lg"
...
android:transitionName="@string/trans_hero1" />
36 @mikewolfson
How to: SharedElementTransition
3. Call transition in Java
final ImageView heroImg1 = (ImageView) findViewById(R.id.hero_img1);
final String transHero = getResources().getString(R.string.trans_hero1);
heroImg1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(mActivity, IntentionalEndActivity.class);
ActivityOptionsCompat options = ActivityOptionsCompat.
makeSceneTransitionAnimation(mActivity, (View)heroImg1, transHero);
startActivity(intent, options.toBundle());
}
});
37 @mikewolfson
Review: Motion
Principles
Material in motion has the following
characteristics:
• Responsive
• Natural
• Aware
• Intentional
38 @mikewolfson
Thank You
Resources
http://android-developers.blogspot.com/2014/10/implementing-
material-design-in-your.html
http://www.mikewolfson.com
http://goo.gl/pq8VdA
https://github.com/mwolfson/MaterialMotionApp
39 @mikewolfson
Review
Style 1
Style 2
• Style 3
40 @mikewolfson

Weitere ähnliche Inhalte

Ähnlich wie Mastering Material Motion

A computer vision based virtual mouse
A computer vision based virtual mouseA computer vision based virtual mouse
A computer vision based virtual mouseStudentRocks
 
Web Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellWeb Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellAnna Migas
 
Background Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard ofBackground Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard ofmoliver816
 
Siddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileSiddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileLviv Startup Club
 
Siddha Ganju, NVIDIA. Deep Learning for Mobile
Siddha Ganju, NVIDIA. Deep Learning for MobileSiddha Ganju, NVIDIA. Deep Learning for Mobile
Siddha Ganju, NVIDIA. Deep Learning for MobileIT Arena
 
The Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
The Wonderful-Amazing-Orientation-Motion-Sensormatic MachineThe Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
The Wonderful-Amazing-Orientation-Motion-Sensormatic MachineAndrew Fisher
 
SMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AISMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AIIRJET Journal
 
Animating the User Experience
Animating the User ExperienceAnimating the User Experience
Animating the User ExperienceRachel Nabors
 
Swift Paris - Dealing The Cards
Swift Paris - Dealing The CardsSwift Paris - Dealing The Cards
Swift Paris - Dealing The CardsZenly
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDevShuichi Tsutsumi
 
Direct manipulation is broken: O'Reilly Design Conference Jan 2016
Direct manipulation is broken: O'Reilly Design Conference Jan 2016Direct manipulation is broken: O'Reilly Design Conference Jan 2016
Direct manipulation is broken: O'Reilly Design Conference Jan 2016Claire Rowland
 
Innovative trends in robotics
Innovative trends in roboticsInnovative trends in robotics
Innovative trends in roboticsDesign World
 
UI Animations in Meteor
UI Animations in MeteorUI Animations in Meteor
UI Animations in MeteorNick Wientge
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technologyARUN S L
 
IRJET- Mouse on Finger Tips using ML and AI
IRJET- Mouse on Finger Tips using ML and AIIRJET- Mouse on Finger Tips using ML and AI
IRJET- Mouse on Finger Tips using ML and AIIRJET Journal
 

Ähnlich wie Mastering Material Motion (20)

A computer vision based virtual mouse
A computer vision based virtual mouseA computer vision based virtual mouse
A computer vision based virtual mouse
 
Animation
AnimationAnimation
Animation
 
Web Zurich - Make your animations perform well
Web Zurich - Make your animations perform wellWeb Zurich - Make your animations perform well
Web Zurich - Make your animations perform well
 
Background Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard ofBackground Fetch - the most powerful API you've never heard of
Background Fetch - the most powerful API you've never heard of
 
Siddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobileSiddha Ganju. Deep learning on mobile
Siddha Ganju. Deep learning on mobile
 
Siddha Ganju, NVIDIA. Deep Learning for Mobile
Siddha Ganju, NVIDIA. Deep Learning for MobileSiddha Ganju, NVIDIA. Deep Learning for Mobile
Siddha Ganju, NVIDIA. Deep Learning for Mobile
 
The Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
The Wonderful-Amazing-Orientation-Motion-Sensormatic MachineThe Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
The Wonderful-Amazing-Orientation-Motion-Sensormatic Machine
 
SMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AISMART MEDIA PLAYER USING AI
SMART MEDIA PLAYER USING AI
 
Unit vi
Unit viUnit vi
Unit vi
 
Animating the User Experience
Animating the User ExperienceAnimating the User Experience
Animating the User Experience
 
Swift Paris - Dealing The Cards
Swift Paris - Dealing The CardsSwift Paris - Dealing The Cards
Swift Paris - Dealing The Cards
 
Deep Learning on iOS #360iDev
Deep Learning on iOS #360iDevDeep Learning on iOS #360iDev
Deep Learning on iOS #360iDev
 
Direct manipulation is broken: O'Reilly Design Conference Jan 2016
Direct manipulation is broken: O'Reilly Design Conference Jan 2016Direct manipulation is broken: O'Reilly Design Conference Jan 2016
Direct manipulation is broken: O'Reilly Design Conference Jan 2016
 
Innovative trends in robotics
Innovative trends in roboticsInnovative trends in robotics
Innovative trends in robotics
 
HMotion: An Algorithm for Human Motion Detection
HMotion: An Algorithm for Human Motion DetectionHMotion: An Algorithm for Human Motion Detection
HMotion: An Algorithm for Human Motion Detection
 
UI Animations in Meteor
UI Animations in MeteorUI Animations in Meteor
UI Animations in Meteor
 
Motion capture technology
Motion capture technologyMotion capture technology
Motion capture technology
 
Robot arm ppt
Robot arm pptRobot arm ppt
Robot arm ppt
 
Performence #2 gpu
Performence #2  gpuPerformence #2  gpu
Performence #2 gpu
 
IRJET- Mouse on Finger Tips using ML and AI
IRJET- Mouse on Finger Tips using ML and AIIRJET- Mouse on Finger Tips using ML and AI
IRJET- Mouse on Finger Tips using ML and AI
 

Mehr von Mike Wolfson

Effective Remote Teamwork
Effective Remote TeamworkEffective Remote Teamwork
Effective Remote TeamworkMike Wolfson
 
The Haggadah Story For Young Children
The Haggadah Story For Young ChildrenThe Haggadah Story For Young Children
The Haggadah Story For Young ChildrenMike Wolfson
 
Move Into Motion Layout
Move Into Motion LayoutMove Into Motion Layout
Move Into Motion LayoutMike Wolfson
 
Handling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSHandling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSMike Wolfson
 
Human + Machine Learning : Oredev Human Centered Machine Learning
Human + Machine Learning : Oredev Human Centered Machine LearningHuman + Machine Learning : Oredev Human Centered Machine Learning
Human + Machine Learning : Oredev Human Centered Machine LearningMike Wolfson
 
Handling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSHandling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSMike Wolfson
 
Human + Machine Learning
Human + Machine LearningHuman + Machine Learning
Human + Machine LearningMike Wolfson
 
Effective Remote Teamwork DevFest Minnesota 2018
Effective Remote Teamwork DevFest Minnesota 2018Effective Remote Teamwork DevFest Minnesota 2018
Effective Remote Teamwork DevFest Minnesota 2018Mike Wolfson
 
Introduction To Android - Long
Introduction To Android - LongIntroduction To Android - Long
Introduction To Android - LongMike Wolfson
 
Material Design basics for Android and the Web
Material Design basics for Android and the WebMaterial Design basics for Android and the Web
Material Design basics for Android and the WebMike Wolfson
 
Android Developer Tools Essentials - Oscon 14
Android Developer Tools Essentials - Oscon 14Android Developer Tools Essentials - Oscon 14
Android Developer Tools Essentials - Oscon 14Mike Wolfson
 
Android Developer Tools Essentials
Android Developer Tools EssentialsAndroid Developer Tools Essentials
Android Developer Tools EssentialsMike Wolfson
 
AnDevCon IV - Android Bootcamp
AnDevCon IV - Android BootcampAnDevCon IV - Android Bootcamp
AnDevCon IV - Android BootcampMike Wolfson
 
AnDevCon IV - Advanced Android Developer Tools
AnDevCon IV - Advanced Android Developer ToolsAnDevCon IV - Advanced Android Developer Tools
AnDevCon IV - Advanced Android Developer ToolsMike Wolfson
 
AnDevCon IV - Intro to Android Developer Tools
AnDevCon IV - Intro to Android Developer ToolsAnDevCon IV - Intro to Android Developer Tools
AnDevCon IV - Intro to Android Developer ToolsMike Wolfson
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java DevelopersMike Wolfson
 
Intro to Android for the iOS Fan
Intro to Android for the iOS FanIntro to Android for the iOS Fan
Intro to Android for the iOS FanMike Wolfson
 
Mobile tech is saving the world
Mobile tech is saving the worldMobile tech is saving the world
Mobile tech is saving the worldMike Wolfson
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools OverviewMike Wolfson
 

Mehr von Mike Wolfson (20)

Effective Remote Teamwork
Effective Remote TeamworkEffective Remote Teamwork
Effective Remote Teamwork
 
The Haggadah Story For Young Children
The Haggadah Story For Young ChildrenThe Haggadah Story For Young Children
The Haggadah Story For Young Children
 
Move Into Motion Layout
Move Into Motion LayoutMove Into Motion Layout
Move Into Motion Layout
 
Handling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSHandling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOS
 
Human + Machine Learning : Oredev Human Centered Machine Learning
Human + Machine Learning : Oredev Human Centered Machine LearningHuman + Machine Learning : Oredev Human Centered Machine Learning
Human + Machine Learning : Oredev Human Centered Machine Learning
 
Handling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOSHandling Dark Mode on Android and iOS
Handling Dark Mode on Android and iOS
 
Human + Machine Learning
Human + Machine LearningHuman + Machine Learning
Human + Machine Learning
 
Effective Remote Teamwork DevFest Minnesota 2018
Effective Remote Teamwork DevFest Minnesota 2018Effective Remote Teamwork DevFest Minnesota 2018
Effective Remote Teamwork DevFest Minnesota 2018
 
Introduction To Android - Long
Introduction To Android - LongIntroduction To Android - Long
Introduction To Android - Long
 
Material Design basics for Android and the Web
Material Design basics for Android and the WebMaterial Design basics for Android and the Web
Material Design basics for Android and the Web
 
Android Developer Tools Essentials - Oscon 14
Android Developer Tools Essentials - Oscon 14Android Developer Tools Essentials - Oscon 14
Android Developer Tools Essentials - Oscon 14
 
Android Developer Tools Essentials
Android Developer Tools EssentialsAndroid Developer Tools Essentials
Android Developer Tools Essentials
 
AnDevCon IV - Android Bootcamp
AnDevCon IV - Android BootcampAnDevCon IV - Android Bootcamp
AnDevCon IV - Android Bootcamp
 
AnDevCon IV - Advanced Android Developer Tools
AnDevCon IV - Advanced Android Developer ToolsAnDevCon IV - Advanced Android Developer Tools
AnDevCon IV - Advanced Android Developer Tools
 
AnDevCon IV - Intro to Android Developer Tools
AnDevCon IV - Intro to Android Developer ToolsAnDevCon IV - Intro to Android Developer Tools
AnDevCon IV - Intro to Android Developer Tools
 
Phxmobilefest
PhxmobilefestPhxmobilefest
Phxmobilefest
 
Android For Java Developers
Android For Java DevelopersAndroid For Java Developers
Android For Java Developers
 
Intro to Android for the iOS Fan
Intro to Android for the iOS FanIntro to Android for the iOS Fan
Intro to Android for the iOS Fan
 
Mobile tech is saving the world
Mobile tech is saving the worldMobile tech is saving the world
Mobile tech is saving the world
 
Android Development Tools Overview
Android Development Tools OverviewAndroid Development Tools Overview
Android Development Tools Overview
 

Kürzlich hochgeladen

Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 

Kürzlich hochgeladen (9)

Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 

Mastering Material Motion

  • 1. Mastering Material Motion by Mike Wolfson Droidcon NYC 2016 Download Demo App Now: http://goo.gl/pq8VdA 1 @mikewolfson
  • 2. Material Design 2014 - Material Design Guidelines https://material.google.com 2016 - Motion Guidelines https://material.google.com/motion 2 @mikewolfson
  • 3. Material Design Principles 1. Material is the metaphor 2. Bold, graphic, intentional 3. Motion Provides Meaning 3 @mikewolfson
  • 4. Motion Provides Meaning "Key Giveaway of a High Quality App" "Makes Material, Material" "Most often overlooked part of making an App Great" -- John Schlemmer Motion Lead at Google 4 @mikewolfson
  • 5. Why do we need Motion Guidelines? • Describe works and what doesn't • Pinpoint what feels "right" • Avoid going overboard 5 @mikewolfson
  • 6. Motion Principles Material in motion has the following characteristics: • Responsive • Natural • Aware • Intentional 6 @mikewolfson
  • 7. Principle 1 Responsive Motion respects and reinforces the user as the prime mover. • Touch Feedback • Elevation 7 @mikewolfson
  • 8. How to: Default Ripple selectableItemBackground <TextView ... android:background="?attr/selectableItemBackground" /> Ripple without Border ?attr/selectableItemBackgroundBorderless 8 @mikewolfson
  • 9. How to: Custom Ripple API 21+ can use RippleDrawable 1. Selector - support older OS resdrawablebg_foo.xml 2. Ripple resdrawable-v21bg_foo.xml 3. Apply to View: <TextView ... android:background="@drawable/bg_selector"/> 9 @mikewolfson
  • 10. Custom Ripple XML <?xml version="1.0" encoding="utf-8"?> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@color/colorAccent"> <!-- Ripple Color --> <!-- Mask keeps Ripple within View bounds --> <color android:color="@android:color/white"/> <item android:id="@android:id/mask"/> <!-- Default Background Omit for none--> <item android:drawable="@color/grey_300"/> </ripple> 10 @mikewolfson
  • 11. Elevation: stateListAnimator 1. Create Folder resanimator 2. Create StateListAnimator resanimatorraise.xml 3. Apply to View <TextView ... `android:stateListAnimator="@animator/raise"`/> https://blog.stylingandroid.com/statelistanimator/ 11 @mikewolfson
  • 12. StateListAnimator XML <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="true" android:state_pressed="true"> <objectAnimator android:duration="@android:integer/config_shortAnimTime" android:propertyName="translationZ" android:valueTo="8dp" android:valueType="floatType" /> </item> <item> <objectAnimator android:duration="@android:integer/config_shortAnimTime" android:propertyName="translationZ" android:valueTo="0dp" android:valueType="floatType" /> </item> </selector> 12 @mikewolfson
  • 13. How to: Custom Ripple with Elevation <TextView ... android:background="@drawable/bg_selector" android:stateListAnimator="@animator/raise"/> 13 @mikewolfson
  • 14. Principle 1 Responsive Demo User generates energy in the form of ripple, and the material raising to the touch 14 @mikewolfson
  • 15. Principle 2 Natural Inspired by Reality Material depicts natural movement inspired by forces in the real world. • Duration • Easing 15 @mikewolfson
  • 16. Duration Best Practices • Keep it Fast (on all screens) • Duration specific to screen size • Natural Easing Curves • Don't do it 16 @mikewolfson
  • 17. Duration Multiple screen sizes Don't use single duration for all animations • Tablet 130% 390ms • Normal 100% 300ms • Wearable 70% 210ms 17 @mikewolfson
  • 18. Easing Curves Motion Duration and Easing Guidelines https://material.google.com/motion/duration-easing.html Android Animation Interpolators https://developer.android.com/reference/android/view/animation/ Interpolator.html Chet Haase "Interpolator Playground" https://github.com/google/android-ui-toolkit-demos/tree/master/ Animations/InterpolatorPlayground 18 @mikewolfson
  • 19. Standard curve Objects quickly accelerate and slowly decelerate between on-screen locations. Use FastOutSlowInInterpolator 19 @mikewolfson
  • 20. Acceleration curve (“Easing in”) Objects leave the screen at full velocity. They do not decelerate when off-screen. Use FastOutLinearInInterpolator 20 @mikewolfson
  • 21. Deceleration curve (“Easing out”) Objects enter the screen at full velocity from off-screen and slowly decelerate to a resting point. Use LinearOutSlowInterpolator 21 @mikewolfson
  • 23. Bad - Don't specify Interpolator Default is Linear exitBad.setOnClickListener(new View.OnClickListener() { // BAD- no interpolator, will default to Linear public void onClick(View view) { Animation anim3 = AnimationUtils.loadAnimation(mActivity, R.anim.slideup_in); bigRedBall.startAnimation(anim3); } }); 23 @mikewolfson
  • 24. Good - Use correct Interpolator For exit animation exitGood.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Animation anim1 = AnimationUtils.loadAnimation(mActivity, R.anim.slideup_in); Interpolator interpFosi = AnimationUtils.loadInterpolator(mActivity, android.R.interpolator.fast_out_slow_in); anim1.setInterpolator(interpFosi); bigRedBall.startAnimation(anim1); } }); 24 @mikewolfson
  • 25. Good - Use correct Interpolator For enter animation enterGood.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { Animation anim2 = AnimationUtils.loadAnimation(mActivity, R.anim.slidedown_out); Interpolator interpFoli = AnimationUtils.loadInterpolator(mActivity, android.R.interpolator.fast_out_linear_in); anim2.setInterpolator(interpFoli); bigRedBall.startAnimation(anim2); } }); 25 @mikewolfson
  • 26. Principle 3 Aware Material is aware of its surroundings, including the user and other material around it. It can be attracted to objects and respond appropriately to user intent. 26 @mikewolfson
  • 27. Automatic animation Layout on right has following attribute: <LinearLayout ... android:animateLayoutChanges="true" > 27 @mikewolfson
  • 28. RecyclerView Use adapter methods - notifyItemInserted(2) - notifyItemRangeChanged(2, 6) - notifyItemRemoved(2) - https://developer.android.com/reference/android/support/v7/util/ DiffUtil.html 28 @mikewolfson
  • 29. Principle 4 Intentional Material in motion guides focus to the right spot at the right time. 29 @mikewolfson
  • 30. Intentional Single Element One item moves 30 @mikewolfson
  • 31. Intentional Two Elements Good Two items move together 31 @mikewolfson
  • 32. Intentional Too many elements Bad Two items move differently 32 @mikewolfson
  • 33. Intentional Too many elements Really, Really Bad Normal speed 33 @mikewolfson
  • 34. Intentional Too many elements Demo - slowed down 33% of normal speed 34 @mikewolfson
  • 35. How to: SharedElementTransition 1. Enable transitions in base styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="android:windowContentTransitions">true</item> ... </style> 35 @mikewolfson
  • 36. How to: SharedElementTransition 2. Transition Attribute in Start and End layouts //Activity #1 <ImageView android:id="@+id/hero_img1" ... android:transitionName="@string/trans_hero1" /> //Activity #2 <ImageView android:id="@+id/hero_img1_lg" ... android:transitionName="@string/trans_hero1" /> 36 @mikewolfson
  • 37. How to: SharedElementTransition 3. Call transition in Java final ImageView heroImg1 = (ImageView) findViewById(R.id.hero_img1); final String transHero = getResources().getString(R.string.trans_hero1); heroImg1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(mActivity, IntentionalEndActivity.class); ActivityOptionsCompat options = ActivityOptionsCompat. makeSceneTransitionAnimation(mActivity, (View)heroImg1, transHero); startActivity(intent, options.toBundle()); } }); 37 @mikewolfson
  • 38. Review: Motion Principles Material in motion has the following characteristics: • Responsive • Natural • Aware • Intentional 38 @mikewolfson
  • 40. Review Style 1 Style 2 • Style 3 40 @mikewolfson