Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Material Design in Android
Search
Esteban Dorado Roldan
May 12, 2015
Programming
0
220
Material Design in Android
Seminary "Material Design in Android" in University of Granada.
Esteban Dorado Roldan
May 12, 2015
Tweet
Share
More Decks by Esteban Dorado Roldan
See All by Esteban Dorado Roldan
Codemotion Spain Meetup -Microservices: gRPC vs Rest
mresti
0
230
PyConES2018: Python & gRPC, el conquistador de microservicios
mresti
0
420
Microservices: grpc vs rest
mresti
0
520
T3chFest 2018: Crea una API REST con Go
mresti
0
93
Build REST API with Golang
mresti
0
140
Firebase aventures - cloud based real time database
mresti
0
58
Material Design in Android
mresti
0
100
Android Wear
mresti
0
140
Android Wear
mresti
0
52
Other Decks in Programming
See All in Programming
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
110
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.9k
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
770
Amazon Qを使ってIaCを触ろう!
maruto
0
390
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
5
1.1k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
510
役立つログに取り組もう
irof
28
9.5k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
530
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
570
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.4k
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
280
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.1k
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
How GitHub (no longer) Works
holman
310
140k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
We Have a Design System, Now What?
morganepeng
50
7.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Transcript
Material Design In Android @Mr_Esti @Mr_Esti
Material Design implementing & compatibilizing - Concepts - Animations -
Style - Layout - Components - Patterns - Compatibility
None
Concepts Material is the metaphor
Print-like design
None
Constrained depth
None
<android.support.v7.widget.Toolbar android:layout_height="wrap_content" android:layout_width="match_parent" android:background="?android:colorPrimary" android:minHeight="?attr/actionBarSize" android:elevation="5dp" /> <android.support.v7.widget.CardView android:layout_width="100dp" android:layout_height=“96dp"
android:layout_gravity="center" android:stateListAnimator="@drawable/translation_selector" android:clickable=“true" android:elevation="2dp" card_view:cardCornerRadius="4dp" />
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <set> <objectAnimator android:propertyName="translationZ" android:duration="@android:integer/config_shortAnimTime" android:valueTo="10dp" android:valueType="floatType"/>
</set> </item> <item android:state_pressed="false"> <set> <objectAnimator android:propertyName="translationZ" android:duration="@android:integer/config_shortAnimTime" android:valueTo="2dp" android:valueType="floatType"/> </set> </item> </selector>
None
None
Concepts Motion provides meaning
// After transition mFab.animate() .scaleX(1).scaleY(1) .start(); // After fab mToolbar.animate()
.scaleX(0).scaleY(1) .start(); // After toolbar mContent.animate() .scaleX(0).scaleY(1) .start();
None
// Slide awesomeTransition = new Slide (Gravity.BOTTOM); // Fade awesomeTransition
= new Fade (); Explode awesomeTransition = new Explode(); awesomeTransition.excludeTarget(android.R.id.navigationBarBackground, true); awesomeTransition.excludeTarget(android.R.id.statusBarBackground, true); awesomeTransition.excludeTarget(R.id.activity_transition_header, true); getWindow().setExitTransition(awesomeTransition); Slide Explode Fade
public void onFabPressed(View view) { Intent i = new Intent
(TransitionFirstActivity.this, TransitionSecondActivity.class); ActivityOptions transitionActivityOptions = ActivityOptions .makeSceneTransitionAnimation(mContext, Pair.create(mFabButton, "fab"), Pair.create(mHeader, "holder1")); startActivity(i, transitionActivityOptions.toBundle()); } <View ... android:transitionName="holder1" /> <Button ... android:transitionName=“fab" />
Concepts Bold, graphic, intentional
<style name=“AwesomeTheme" parent=“AppTheme"> <item name=“android:colorPrimary”>@color/my_primary</item> <item name=“android:colorAccent">@color/my_accent</item> </style> <style name=“AwesomeTheme"
parent=“AppTheme"> <item name=“colorPrimary”>@color/my_primary</item> <item name=“colorAccent">@color/my_accent</item> </style>
None
public class MovieDetailActivity extends Activity implements Palette.PaletteAsyncListener { ... @Override
public void onGenerated(Palette palette) { if (palette != null) { Palette.Swatch vibrantSwatch = palette .getVibrantSwatch(); Palette.Swatch darkVibrantSwatch = palette .getDarkVibrantSwatch(); Palette.Swatch lightSwatch = palette .getLightVibrantSwatch(); if (lightSwatch != null) { // awesome palette code } } } }
None
None
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { getWindow().setStatusBarColor(mAwesomeStatusColor); getWindow().setNavigationBarColor(mAwesomeNavColor); }
None
https://github.com/saulmm/Android-Material-Examples
https://github.com/saulmm/Curved-Fab-Reveal-Example
Practice on Paper
Further reading Support Libraries v22.1.0 https://chris.banes.me/2015/04/22/support-libraries-v22-1-0/ Material Design Guidelines http://www.google.com/design/spec/material-design/introduction.html
From Holo to Material http://novoda.com/blog/from-holo-to-material Paper prototyping https://www.youtube.com/watch?v=07xPF7L6klY From Material Design to Android Wear https://speakerdeck.com/saulmm/from-material-design-to-android-wear
None
Material Design
Holo App
RecyclerView API Documentation: “A Flexible view for providing a limited
window into a large data set”
RecyclerView API Recycler API: • Adapter • ViewHolder • Layaout
Manayer • Item Decoration • Item Animation
Adapter Recycler API: • Defines what gets displayed and how
one item is displayed • No default implementations • ViewHolder pattern
Adapter code
ViewHolder code
LayoutManager • Defines: The placement of items • One predefined
layoutmanager: LinearLayoutManager
Item Decorations • Defines how items are separated from each
other • No default implementation • Called once per onDraw()
Animations The ItemAnimator class: Defines the animations for addition, removal
or the moving of items
Examples: Animations
https://github.com/mresti/Materialize-Android-App/
Further reading A First Glance at Android’s RecyclerView http://www.grokkingandroid.com/first-glance-androids-recyclerview/ RecyclerView-Demo
https://github.com/saulmm/RecyclerView-demo
None