SlideShare a Scribd company logo
Material Design 
Backwards Compatibility
2 
About Me 
• Mobile Development 
• Android 
• iOS 
• REST-Api Design 
• Cloud Infrastructure 
+Angelo Rüggeberg 
@s3xy4ngyc 
http://s3xy4ngyc.github.io
Sample app 
• Source Available at 
Github: 
https://github.com/ 
s3xy4ngyc/Android-L-Samples 
• Available at Google Play: 
https://play.google.com/ 
store/apps/details? 
id=s3xy.de.lsamples 
3
4
Distribution 
5
Distribution 
6
Distribution 
• Devices having Android 5.0 officially: 
• Nexus 5 
• Nexus 7 
• Nexus 9 
• LG G3 
6
Distribution 
7
Distribution 
7
Dependencies 
8
9
9 
dependencies { 
compile 'com.android.support:support-v4:21.0.2' 
compile 'com.android.support:appcompat-v7:21.0.2' 
compile 'com.android.support:cardview-v7:21.0.2' 
compile 'com.android.support:recyclerview-v7:21.0.2' 
compile 'com.android.support:gridlayout-v7:21.0.2' 
compile 'com.android.support:mediarouter-v7:21.0.2' 
compile 'com.android.support:palette-v7:21.0.2' 
compile 'com.android.support:support-v13:21.0.2' 
compile 'com.android.support:leanback-v17:21.0.2' 
compile 'com.android.support:support-annotations:21.0.2' 
}
9 
dependencies { 
compile 'com.android.support:support-v4:21.0.2' 
compile 'com.android.support:appcompat-v7:21.0.2' 
compile 'com.android.support:cardview-v7:21.0.2' 
compile 'com.android.support:recyclerview-v7:21.0.2' 
compile 'com.android.support:gridlayout-v7:21.0.2' 
compile 'com.android.support:mediarouter-v7:21.0.2' 
compile 'com.android.support:palette-v7:21.0.2' 
compile 'com.android.support:support-v13:21.0.2' 
compile 'com.android.support:leanback-v17:21.0.2' 
compile 'com.android.support:support-annotations:21.0.2' 
} 
‚//material Theme, ActionBar, etc.
9 
dependencies { 
compile 'com.android.support:support-v4:21.0.2' 
compile 'com.android.support:appcompat-v7:21.0.2' 
compile 'com.android.support:cardview-v7:21.0.2' 
compile 'com.android.support:recyclerview-v7:21.0.2' 
compile 'com.android.support:gridlayout-v7:21.0.2' 
compile 'com.android.support:mediarouter-v7:21.0.2' 
compile 'com.android.support:palette-v7:21.0.2' 
compile 'com.android.support:support-v13:21.0.2' 
compile 'com.android.support:leanback-v17:21.0.2' 
compile 'com.android.support:support-annotations:21.0.2' 
} 
‚//material Theme, ActionBar, etc. 
‚//New Components for Pre 5.0
Apply Material 
Theme 
10
11
11 
android: 
Theme.Material
11 
android: 
Theme.Material 
android: 
Theme.Material.Light
Theme.AppCompat Theme.AppCompat.Light 
11 
android: 
Theme.Material 
android: 
Theme.Material.Light
Apply Material Theme 
12
Apply Material Theme 
• Custom Style Extending Appcompat Style 
12
Apply Material Theme 
• Custom Style Extending Appcompat Style 
• Things to note: 
12
Apply Material Theme 
• Custom Style Extending Appcompat Style 
• Things to note: 
• No more @android duplicates 
12
Apply Material Theme 
• Custom Style Extending Appcompat Style 
• Things to note: 
• No more @android duplicates 
• No more v14+ Style Folder 
12
13
13
13
13
13
13
13
Apply Material Theme 
14
Apply Material Theme 
• Ui Elements that Get Material Design: 
• EditText 
• Spinner 
• CheckBox 
• RadioButton 
• Switch 
• CheckedTextView 
14
Apply Material Theme 
• Ui Elements that Get Material Design: 
• EditText 
• Spinner 
• CheckBox 
• RadioButton 
• Switch 
• CheckedTextView 
• All Other UI Elements do not get Styled 
and Need Custom Styling/Views 
14
Action Bar Drawer 
Toggle 
15
16 
Action Bar Drawer Toggle
16 
Action Bar Drawer Toggle
Action Bar Drawer Toggle 
17
Action Bar Drawer Toggle 
• import 
android.support.v7.app.ActionBarDrawerT 
oggle 
• Extend from ActionBarActivity 
• Init DrawerToggle with Drawer Layout 
• Assign DrawerToggle to DrawerLayout 
17
18
18 
DrawerLayout mDrawerLayout; 
ActionBarDrawerToggle drawerToggle; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_my); 
drawerToggle = new ActionBarDrawerToggle(this, 
mDrawerLayout, 
R.string.app_name, 
R.string.app_name) { 
}; 
mDrawerLayout.setDrawerListener(drawerToggle); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 
}
18 
DrawerLayout mDrawerLayout; 
ActionBarDrawerToggle drawerToggle; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_my); 
drawerToggle = new ActionBarDrawerToggle(this, 
mDrawerLayout, 
R.string.app_name, 
R.string.app_name) { 
}; 
mDrawerLayout.setDrawerListener(drawerToggle); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 
}
18 
DrawerLayout mDrawerLayout; 
ActionBarDrawerToggle drawerToggle; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_my); 
drawerToggle = new ActionBarDrawerToggle(this, 
mDrawerLayout, 
R.string.app_name, 
R.string.app_name) { 
}; 
mDrawerLayout.setDrawerListener(drawerToggle); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 
}
18 
DrawerLayout mDrawerLayout; 
ActionBarDrawerToggle drawerToggle; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_my); 
drawerToggle = new ActionBarDrawerToggle(this, 
mDrawerLayout, 
R.string.app_name, 
R.string.app_name) { 
}; 
mDrawerLayout.setDrawerListener(drawerToggle); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 
}
18 
DrawerLayout mDrawerLayout; 
ActionBarDrawerToggle drawerToggle; 
@Override 
protected void onCreate(Bundle savedInstanceState) { 
super.onCreate(savedInstanceState); 
setContentView(R.layout.activity_my); 
drawerToggle = new ActionBarDrawerToggle(this, 
mDrawerLayout, 
R.string.app_name, 
R.string.app_name) { 
}; 
mDrawerLayout.setDrawerListener(drawerToggle); 
getSupportActionBar().setDisplayHomeAsUpEnabled(true); 
getSupportActionBar().setHomeButtonEnabled(true); 
}
Card View 
19
Card View 
20
Card View 
• Support for rounded Corners 
• Elevation Shadows 
20
Card View 
• Support for rounded Corners 
• Elevation Shadows 
• Limitations: 
• On Pre-L no Clipping for Children with 
Round Corners 
• On Pre-L Adds Padding to Draw 
Shadows 
20
21
22
22 
<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.CardView 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/cardView" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:layout_margin="5dp" 
android:background="?android:selectableItemBackground" 
app:cardCornerRadius="2dp" 
app:cardElevation="5dp" 
app:cardPreventCornerOverlap="true" 
app:cardUseCompatPadding="true"> 
<!-- Place Your Textviews etc. in here --> 
<LinearLayout...> 
</android.support.v7.widget.CardView>
Recycler View 
23
Recycler View 
24
Recycler View 
• „Replacement“ for ListView 
• Implements the ViewHolderPattern 
• Improved Recycling 
• LayoutManager 
• Vertical List View 
• Horizontal List View 
• Staggered Grid View 
24
25
25 
Layout:
25 
Layout:
25 
Layout: 
Code:
25 
Layout: 
Code:
26
27 
Recycler View - Adapter
27 
Recycler View - Adapter 
Old Adapter: 
class MenuAdapterOld extends ArrayAdapter<String> {
27 
Recycler View - Adapter 
Old Adapter: 
class MenuAdapterOld extends ArrayAdapter<String> { 
New Adapter: 
import android.support.v7.widget.RecyclerView; 
public class MenuAdapter extends RecyclerView.Adapter<MenuAdapter.ViewHolder> {
28 
Recycler View - Adapter
28 
private ArrayList<String> mDataset; 
private OnItemClickListener mListener; 
public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { 
mDataset = myDataset; 
mListener = listener; 
} 
Recycler View - Adapter
29 
Recycler View - Adapter
29 
private ArrayList<String> mDataset; 
private OnItemClickListener mListener; 
public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { 
mDataset = myDataset; 
mListener = listener; 
} 
Recycler View - Adapter
29 
private ArrayList<String> mDataset; 
private OnItemClickListener mListener; 
public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { 
mDataset = myDataset; 
mListener = listener; 
} 
Recycler View - Adapter
29 
private ArrayList<String> mDataset; 
private OnItemClickListener mListener; 
public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { 
mDataset = myDataset; 
mListener = listener; 
} 
Recycler View - Adapter 
@Override 
public int getItemCount() { 
return mDataset.size(); 
}
30 
Recycler View - Adapter
30 
public static class ViewHolder extends RecyclerView.ViewHolder { 
ImageView mPhoto; 
TextView mPhotoTitle; 
CardView mCardView; 
public ViewHolder(View itemView) { 
super(itemView); 
mPhoto = (ImageView) itemView.findViewById(R.id.photo); 
mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); 
mCardView = (CardView) itemView.findViewById(R.id.cardView); 
} 
} 
Recycler View - Adapter
30 
public static class ViewHolder extends RecyclerView.ViewHolder { 
ImageView mPhoto; 
TextView mPhotoTitle; 
CardView mCardView; 
public ViewHolder(View itemView) { 
super(itemView); 
mPhoto = (ImageView) itemView.findViewById(R.id.photo); 
mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); 
mCardView = (CardView) itemView.findViewById(R.id.cardView); 
} 
} 
Recycler View - Adapter
30 
public static class ViewHolder extends RecyclerView.ViewHolder { 
ImageView mPhoto; 
TextView mPhotoTitle; 
CardView mCardView; 
public ViewHolder(View itemView) { 
super(itemView); 
mPhoto = (ImageView) itemView.findViewById(R.id.photo); 
mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); 
mCardView = (CardView) itemView.findViewById(R.id.cardView); 
} 
} 
Recycler View - Adapter
30 
public static class ViewHolder extends RecyclerView.ViewHolder { 
ImageView mPhoto; 
TextView mPhotoTitle; 
CardView mCardView; 
public ViewHolder(View itemView) { 
super(itemView); 
mPhoto = (ImageView) itemView.findViewById(R.id.photo); 
mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); 
mCardView = (CardView) itemView.findViewById(R.id.cardView); 
} 
} 
Recycler View - Adapter
30 
public static class ViewHolder extends RecyclerView.ViewHolder { 
ImageView mPhoto; 
TextView mPhotoTitle; 
CardView mCardView; 
public ViewHolder(View itemView) { 
super(itemView); 
mPhoto = (ImageView) itemView.findViewById(R.id.photo); 
mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); 
mCardView = (CardView) itemView.findViewById(R.id.cardView); 
} 
} 
Recycler View - Adapter
31 
Recycler View - Adapter
31 
@Override 
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 
View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, 
false); 
return new ViewHolder(v); 
} 
@Override 
public void onBindViewHolder(final ViewHolder viewHolder, final int i) { 
Photo p = photos.get(i); 
mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. 
drawable.stat_notify_sync).into(viewHolder.mPhoto); 
viewHolder.mPhotoTitle.setText(p.getId()); 
if (viewHolder.mPhotographerTitle != null) { 
viewHolder.mPhotographerTitle.setText(p.getTitle()); 
} 
viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { 
@Override 
public void onClick(View v) { 
mListener.onClick(viewHolder.mPhoto, i); 
} 
}); 
} 
Recycler View - Adapter
31 
@Override 
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 
View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, 
false); 
return new ViewHolder(v); 
} 
@Override 
public void onBindViewHolder(final ViewHolder viewHolder, final int i) { 
Photo p = photos.get(i); 
mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. 
drawable.stat_notify_sync).into(viewHolder.mPhoto); 
viewHolder.mPhotoTitle.setText(p.getId()); 
if (viewHolder.mPhotographerTitle != null) { 
viewHolder.mPhotographerTitle.setText(p.getTitle()); 
} 
viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { 
@Override 
public void onClick(View v) { 
mListener.onClick(viewHolder.mPhoto, i); 
} 
}); 
} 
Recycler View - Adapter
31 
@Override 
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 
View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, 
false); 
return new ViewHolder(v); 
} 
@Override 
public void onBindViewHolder(final ViewHolder viewHolder, final int i) { 
Photo p = photos.get(i); 
mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. 
drawable.stat_notify_sync).into(viewHolder.mPhoto); 
viewHolder.mPhotoTitle.setText(p.getId()); 
if (viewHolder.mPhotographerTitle != null) { 
viewHolder.mPhotographerTitle.setText(p.getTitle()); 
} 
viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { 
@Override 
public void onClick(View v) { 
mListener.onClick(viewHolder.mPhoto, i); 
} 
}); 
} 
Recycler View - Adapter
31 
@Override 
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 
View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, 
false); 
return new ViewHolder(v); 
} 
@Override 
public void onBindViewHolder(final ViewHolder viewHolder, final int i) { 
Photo p = photos.get(i); 
mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. 
drawable.stat_notify_sync).into(viewHolder.mPhoto); 
viewHolder.mPhotoTitle.setText(p.getId()); 
if (viewHolder.mPhotographerTitle != null) { 
viewHolder.mPhotographerTitle.setText(p.getTitle()); 
} 
viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { 
@Override 
public void onClick(View v) { 
mListener.onClick(viewHolder.mPhoto, i); 
} 
}); 
} 
Recycler View - Adapter
31 
@Override 
public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { 
View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, 
false); 
return new ViewHolder(v); 
} 
@Override 
public void onBindViewHolder(final ViewHolder viewHolder, final int i) { 
Photo p = photos.get(i); 
mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. 
drawable.stat_notify_sync).into(viewHolder.mPhoto); 
viewHolder.mPhotoTitle.setText(p.getId()); 
if (viewHolder.mPhotographerTitle != null) { 
viewHolder.mPhotographerTitle.setText(p.getTitle()); 
} 
viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { 
@Override 
public void onClick(View v) { 
mListener.onClick(viewHolder.mPhoto, i); 
} 
}); 
} 
Recycler View - Adapter
32
32 
• Linear Layout 
Manager
32 
• Linear Layout 
Manager 
• Supports Smooth 
Scrolling
32 
• Linear Layout 
Manager 
• Supports Smooth 
Scrolling
33
33 
• Linear Layout 
Manager
33 
• Linear Layout 
Manager 
• Orientation 
Horizontal
33 
• Linear Layout 
Manager 
• Orientation 
Horizontal
34
34 
• Staggered Grid Layout 
Manager
34 
• Staggered Grid Layout 
Manager 
• Grid Size can be 
defined
34 
• Staggered Grid Layout 
Manager 
• Grid Size can be 
defined 
• Supports Vertical and 
Horizontal Scrolling
34 
• Staggered Grid Layout 
Manager 
• Grid Size can be 
defined 
• Supports Vertical and 
Horizontal Scrolling
Toolbar 
35
Toolbar 
37
Toolbar 
• ActionBar == Toolbar 
• Toolbar is a ViewGroup 
• Styleable 
• Positionable 
37
38 
Layout: 
Code:
39 
Standalone Widget:
Limitations 
40
Limitations 
41
Limitations 
• Activity Transitions are Possible, BUT 
won’t be applied on PRE 5.0 Devices 
• Many „New“ Ui Elements are not available 
in the API, thus require separate 
Implementation/Style. 
41
Limitations 
42
Limitations 
• Elements not Included: 
• Fancy Material Progressbars 
• Buttons 
• Flat 
• Raised 
• Round / Floating 
• Sliders 
• Snackbars 
42
Limitations 
43
Limitations 
• Things not Supported on Pre 5.0: 
• Activity transitions 
• Touch feedback 
• Reveal animations 
• Path-based animations 
• Vector drawables 
• Drawable tinting 
43
44 
Useful Links
Useful Links 
• Official Documentation: 
http://developer.android.com/tools/ 
support-library/index.html 
• Index for Open Source Libraries: 
https://android-arsenal.com/ 
• e.G. Missing Ui Elements 
45
Questions? 
AngeloRüggeberg 
twitter.com/ 
s3xy4ngyc 
google.com/+ 
s3xy4ngyc 
.github.io 
github.com/ 
s3xy4ngyc

More Related Content

What's hot

Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
MingHo Chang
 
Solid angular
Solid angularSolid angular
Solid angular
Nir Kaufman
 
ButterKnife
ButterKnifeButterKnife
ButterKnife
Himanshu Dudhat
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation Drawer
Agus Haryanto
 
Understanding angular meteor
Understanding angular meteorUnderstanding angular meteor
Understanding angular meteor
Entrepreneur / Startup
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
Pavel Lahoda
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon Berlin
 
Sword fighting with Dagger GDG-NYC Jan 2016
 Sword fighting with Dagger GDG-NYC Jan 2016 Sword fighting with Dagger GDG-NYC Jan 2016
Sword fighting with Dagger GDG-NYC Jan 2016
Mike Nakhimovich
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
Paul Trebilcox-Ruiz
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
Prof. Erwin Globio
 
RxBinding-kotlin
RxBinding-kotlinRxBinding-kotlin
RxBinding-kotlin
Satoru Fujiwara
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)
Katsumi Kishikawa
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
Alfredo Morresi
 
Capture image on eye blink
Capture image on eye blinkCapture image on eye blink
Capture image on eye blink
InnovationM
 
Building Robust jQuery Plugins
Building Robust jQuery PluginsBuilding Robust jQuery Plugins
Building Robust jQuery Plugins
Jörn Zaefferer
 
Fun with RecyclerView
Fun with RecyclerViewFun with RecyclerView
Fun with RecyclerView
GlobalLogic Ukraine
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
Vivek Bhusal
 
3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS
Rodrigo Borges
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说Ting Lv
 

What's hot (20)

Action bar
Action barAction bar
Action bar
 
Android - Intents and Broadcast Receivers
Android - Intents and Broadcast ReceiversAndroid - Intents and Broadcast Receivers
Android - Intents and Broadcast Receivers
 
Solid angular
Solid angularSolid angular
Solid angular
 
ButterKnife
ButterKnifeButterKnife
ButterKnife
 
Android Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation DrawerAndroid Sliding Menu dengan Navigation Drawer
Android Sliding Menu dengan Navigation Drawer
 
Understanding angular meteor
Understanding angular meteorUnderstanding angular meteor
Understanding angular meteor
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
 
Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
 
Sword fighting with Dagger GDG-NYC Jan 2016
 Sword fighting with Dagger GDG-NYC Jan 2016 Sword fighting with Dagger GDG-NYC Jan 2016
Sword fighting with Dagger GDG-NYC Jan 2016
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
 
Action Bar in Android
Action Bar in AndroidAction Bar in Android
Action Bar in Android
 
RxBinding-kotlin
RxBinding-kotlinRxBinding-kotlin
RxBinding-kotlin
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Capture image on eye blink
Capture image on eye blinkCapture image on eye blink
Capture image on eye blink
 
Building Robust jQuery Plugins
Building Robust jQuery PluginsBuilding Robust jQuery Plugins
Building Robust jQuery Plugins
 
Fun with RecyclerView
Fun with RecyclerViewFun with RecyclerView
Fun with RecyclerView
 
Android training day 4
Android training day 4Android training day 4
Android training day 4
 
3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS3D Touch: Preparando sua app para o futuro do iOS
3D Touch: Preparando sua app para o futuro do iOS
 
前端MVC 豆瓣说
前端MVC 豆瓣说前端MVC 豆瓣说
前端MVC 豆瓣说
 

Viewers also liked

Deep Dive Into Android Design Support Library And AppCompat
Deep Dive Into Android Design Support Library And AppCompatDeep Dive Into Android Design Support Library And AppCompat
Deep Dive Into Android Design Support Library And AppCompat
Fernando Cesar da Silva
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
Deepu S Nath
 
Material design
Material designMaterial design
Material design
Ciklum Ukraine
 
Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]
Angelo Rüggeberg
 
Implementacja Material Design na Android Lollipop i starszych - MTC 2015
Implementacja Material Design na Android Lollipop i starszych - MTC 2015Implementacja Material Design na Android Lollipop i starszych - MTC 2015
Implementacja Material Design na Android Lollipop i starszych - MTC 2015
Sylwester Madej
 
Android Lollipop and Material Design
Android Lollipop and Material DesignAndroid Lollipop and Material Design
Android Lollipop and Material Design
James Montemagno
 
Material for old school
Material for old schoolMaterial for old school
Material for old school
Jorge Barroso
 

Viewers also liked (7)

Deep Dive Into Android Design Support Library And AppCompat
Deep Dive Into Android Design Support Library And AppCompatDeep Dive Into Android Design Support Library And AppCompat
Deep Dive Into Android Design Support Library And AppCompat
 
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
What’s new for Android Developers in 2015 - Material Design, Android Studio, ...
 
Material design
Material designMaterial design
Material design
 
Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]Hacking Android [MUC:SEC 20.05.2015]
Hacking Android [MUC:SEC 20.05.2015]
 
Implementacja Material Design na Android Lollipop i starszych - MTC 2015
Implementacja Material Design na Android Lollipop i starszych - MTC 2015Implementacja Material Design na Android Lollipop i starszych - MTC 2015
Implementacja Material Design na Android Lollipop i starszych - MTC 2015
 
Android Lollipop and Material Design
Android Lollipop and Material DesignAndroid Lollipop and Material Design
Android Lollipop and Material Design
 
Material for old school
Material for old schoolMaterial for old school
Material for old school
 

Similar to Material Design and Backwards Compatibility

Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
cbeyls
 
Android UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and TechniquesAndroid UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and Techniques
Edgar Gonzalez
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and Techniques
Marakana Inc.
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design Patterns
Godfrey Nolan
 
Android TV: Building apps with Google’s Leanback Library
Android TV: Building apps with  Google’s Leanback LibraryAndroid TV: Building apps with  Google’s Leanback Library
Android TV: Building apps with Google’s Leanback Library
Joe Birch
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
Michael Galpin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the Lollipop
Sonja Kesic
 
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
Fons Sonnemans
 
Modern android development
Modern android developmentModern android development
Modern android development
Khiem-Kim Ho Xuan
 
Volley lab btc_bbit
Volley lab btc_bbitVolley lab btc_bbit
Volley lab btc_bbit
CarWash1
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
Yasin Yildirim
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
Hassan Abid
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
Pratama Nur Wijaya
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
Egerton University
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
ImranS18
 
Groovygrailsnetbeans 12517452668498-phpapp03
Groovygrailsnetbeans 12517452668498-phpapp03Groovygrailsnetbeans 12517452668498-phpapp03
Groovygrailsnetbeans 12517452668498-phpapp03Kevin Juma
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
Jose Manuel Pereira Garcia
 

Similar to Material Design and Backwards Compatibility (20)

Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
 
Android UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and TechniquesAndroid UI Development: Tips, Tricks, and Techniques
Android UI Development: Tips, Tricks, and Techniques
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and Techniques
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design Patterns
 
Android TV: Building apps with Google’s Leanback Library
Android TV: Building apps with  Google’s Leanback LibraryAndroid TV: Building apps with  Google’s Leanback Library
Android TV: Building apps with Google’s Leanback Library
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android Infrastructure
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the Lollipop
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
TechDays 2016 - Developing websites using asp.net core mvc6 and entity framew...
 
Modern android development
Modern android developmentModern android development
Modern android development
 
Volley lab btc_bbit
Volley lab btc_bbitVolley lab btc_bbit
Volley lab btc_bbit
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material Design
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Recyclerview in action
Recyclerview in action Recyclerview in action
Recyclerview in action
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
 
Groovygrailsnetbeans 12517452668498-phpapp03
Groovygrailsnetbeans 12517452668498-phpapp03Groovygrailsnetbeans 12517452668498-phpapp03
Groovygrailsnetbeans 12517452668498-phpapp03
 
From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)From Legacy to Hexagonal (An Unexpected Android Journey)
From Legacy to Hexagonal (An Unexpected Android Journey)
 

Recently uploaded

Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Orkestra
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
OWASP Beja
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
OECD Directorate for Financial and Enterprise Affairs
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Sebastiano Panichella
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
khadija278284
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
faizulhassanfaiz1670
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Matjaž Lipuš
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
Access Innovations, Inc.
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
eCommerce Institute
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
IP ServerOne
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
Howard Spence
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Access Innovations, Inc.
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
Vladimir Samoylov
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
Faculty of Medicine And Health Sciences
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
Sebastiano Panichella
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Sebastiano Panichella
 

Recently uploaded (16)

Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
Sharpen existing tools or get a new toolbox? Contemporary cluster initiatives...
 
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
0x01 - Newton's Third Law:  Static vs. Dynamic Abusers0x01 - Newton's Third Law:  Static vs. Dynamic Abusers
0x01 - Newton's Third Law: Static vs. Dynamic Abusers
 
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
Competition and Regulation in Professional Services – KLEINER – June 2024 OEC...
 
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...Doctoral Symposium at the 17th IEEE International Conference on Software Test...
Doctoral Symposium at the 17th IEEE International Conference on Software Test...
 
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdfBonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
Bonzo subscription_hjjjjjjjj5hhhhhhh_2024.pdf
 
Media as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern EraMedia as a Mind Controlling Strategy In Old and Modern Era
Media as a Mind Controlling Strategy In Old and Modern Era
 
Bitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXOBitcoin Lightning wallet and tic-tac-toe game XOXO
Bitcoin Lightning wallet and tic-tac-toe game XOXO
 
Eureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 PresentationEureka, I found it! - Special Libraries Association 2021 Presentation
Eureka, I found it! - Special Libraries Association 2021 Presentation
 
María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024María Carolina Martínez - eCommerce Day Colombia 2024
María Carolina Martínez - eCommerce Day Colombia 2024
 
Acorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutesAcorn Recovery: Restore IT infra within minutes
Acorn Recovery: Restore IT infra within minutes
 
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptxsomanykidsbutsofewfathers-140705000023-phpapp02.pptx
somanykidsbutsofewfathers-140705000023-phpapp02.pptx
 
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdfSupercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
Supercharge your AI - SSP Industry Breakout Session 2024-v2_1.pdf
 
Getting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control TowerGetting started with Amazon Bedrock Studio and Control Tower
Getting started with Amazon Bedrock Studio and Control Tower
 
Obesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditionsObesity causes and management and associated medical conditions
Obesity causes and management and associated medical conditions
 
International Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software TestingInternational Workshop on Artificial Intelligence in Software Testing
International Workshop on Artificial Intelligence in Software Testing
 
Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...Announcement of 18th IEEE International Conference on Software Testing, Verif...
Announcement of 18th IEEE International Conference on Software Testing, Verif...
 

Material Design and Backwards Compatibility

  • 2. 2 About Me • Mobile Development • Android • iOS • REST-Api Design • Cloud Infrastructure +Angelo Rüggeberg @s3xy4ngyc http://s3xy4ngyc.github.io
  • 3. Sample app • Source Available at Github: https://github.com/ s3xy4ngyc/Android-L-Samples • Available at Google Play: https://play.google.com/ store/apps/details? id=s3xy.de.lsamples 3
  • 4. 4
  • 7. Distribution • Devices having Android 5.0 officially: • Nexus 5 • Nexus 7 • Nexus 9 • LG G3 6
  • 11. 9
  • 12. 9 dependencies { compile 'com.android.support:support-v4:21.0.2' compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.android.support:cardview-v7:21.0.2' compile 'com.android.support:recyclerview-v7:21.0.2' compile 'com.android.support:gridlayout-v7:21.0.2' compile 'com.android.support:mediarouter-v7:21.0.2' compile 'com.android.support:palette-v7:21.0.2' compile 'com.android.support:support-v13:21.0.2' compile 'com.android.support:leanback-v17:21.0.2' compile 'com.android.support:support-annotations:21.0.2' }
  • 13. 9 dependencies { compile 'com.android.support:support-v4:21.0.2' compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.android.support:cardview-v7:21.0.2' compile 'com.android.support:recyclerview-v7:21.0.2' compile 'com.android.support:gridlayout-v7:21.0.2' compile 'com.android.support:mediarouter-v7:21.0.2' compile 'com.android.support:palette-v7:21.0.2' compile 'com.android.support:support-v13:21.0.2' compile 'com.android.support:leanback-v17:21.0.2' compile 'com.android.support:support-annotations:21.0.2' } ‚//material Theme, ActionBar, etc.
  • 14. 9 dependencies { compile 'com.android.support:support-v4:21.0.2' compile 'com.android.support:appcompat-v7:21.0.2' compile 'com.android.support:cardview-v7:21.0.2' compile 'com.android.support:recyclerview-v7:21.0.2' compile 'com.android.support:gridlayout-v7:21.0.2' compile 'com.android.support:mediarouter-v7:21.0.2' compile 'com.android.support:palette-v7:21.0.2' compile 'com.android.support:support-v13:21.0.2' compile 'com.android.support:leanback-v17:21.0.2' compile 'com.android.support:support-annotations:21.0.2' } ‚//material Theme, ActionBar, etc. ‚//New Components for Pre 5.0
  • 16. 11
  • 18. 11 android: Theme.Material android: Theme.Material.Light
  • 19. Theme.AppCompat Theme.AppCompat.Light 11 android: Theme.Material android: Theme.Material.Light
  • 21. Apply Material Theme • Custom Style Extending Appcompat Style 12
  • 22. Apply Material Theme • Custom Style Extending Appcompat Style • Things to note: 12
  • 23. Apply Material Theme • Custom Style Extending Appcompat Style • Things to note: • No more @android duplicates 12
  • 24. Apply Material Theme • Custom Style Extending Appcompat Style • Things to note: • No more @android duplicates • No more v14+ Style Folder 12
  • 25. 13
  • 26. 13
  • 27. 13
  • 28. 13
  • 29. 13
  • 30. 13
  • 31. 13
  • 33. Apply Material Theme • Ui Elements that Get Material Design: • EditText • Spinner • CheckBox • RadioButton • Switch • CheckedTextView 14
  • 34. Apply Material Theme • Ui Elements that Get Material Design: • EditText • Spinner • CheckBox • RadioButton • Switch • CheckedTextView • All Other UI Elements do not get Styled and Need Custom Styling/Views 14
  • 35. Action Bar Drawer Toggle 15
  • 36. 16 Action Bar Drawer Toggle
  • 37. 16 Action Bar Drawer Toggle
  • 38. Action Bar Drawer Toggle 17
  • 39. Action Bar Drawer Toggle • import android.support.v7.app.ActionBarDrawerT oggle • Extend from ActionBarActivity • Init DrawerToggle with Drawer Layout • Assign DrawerToggle to DrawerLayout 17
  • 40. 18
  • 41. 18 DrawerLayout mDrawerLayout; ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.app_name, R.string.app_name) { }; mDrawerLayout.setDrawerListener(drawerToggle); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); }
  • 42. 18 DrawerLayout mDrawerLayout; ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.app_name, R.string.app_name) { }; mDrawerLayout.setDrawerListener(drawerToggle); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); }
  • 43. 18 DrawerLayout mDrawerLayout; ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.app_name, R.string.app_name) { }; mDrawerLayout.setDrawerListener(drawerToggle); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); }
  • 44. 18 DrawerLayout mDrawerLayout; ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.app_name, R.string.app_name) { }; mDrawerLayout.setDrawerListener(drawerToggle); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); }
  • 45. 18 DrawerLayout mDrawerLayout; ActionBarDrawerToggle drawerToggle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_my); drawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.app_name, R.string.app_name) { }; mDrawerLayout.setDrawerListener(drawerToggle); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); }
  • 48. Card View • Support for rounded Corners • Elevation Shadows 20
  • 49. Card View • Support for rounded Corners • Elevation Shadows • Limitations: • On Pre-L no Clipping for Children with Round Corners • On Pre-L Adds Padding to Draw Shadows 20
  • 50. 21
  • 51. 22
  • 52. 22 <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/cardView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="5dp" android:background="?android:selectableItemBackground" app:cardCornerRadius="2dp" app:cardElevation="5dp" app:cardPreventCornerOverlap="true" app:cardUseCompatPadding="true"> <!-- Place Your Textviews etc. in here --> <LinearLayout...> </android.support.v7.widget.CardView>
  • 55. Recycler View • „Replacement“ for ListView • Implements the ViewHolderPattern • Improved Recycling • LayoutManager • Vertical List View • Horizontal List View • Staggered Grid View 24
  • 56. 25
  • 61. 26
  • 62. 27 Recycler View - Adapter
  • 63. 27 Recycler View - Adapter Old Adapter: class MenuAdapterOld extends ArrayAdapter<String> {
  • 64. 27 Recycler View - Adapter Old Adapter: class MenuAdapterOld extends ArrayAdapter<String> { New Adapter: import android.support.v7.widget.RecyclerView; public class MenuAdapter extends RecyclerView.Adapter<MenuAdapter.ViewHolder> {
  • 65. 28 Recycler View - Adapter
  • 66. 28 private ArrayList<String> mDataset; private OnItemClickListener mListener; public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { mDataset = myDataset; mListener = listener; } Recycler View - Adapter
  • 67. 29 Recycler View - Adapter
  • 68. 29 private ArrayList<String> mDataset; private OnItemClickListener mListener; public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { mDataset = myDataset; mListener = listener; } Recycler View - Adapter
  • 69. 29 private ArrayList<String> mDataset; private OnItemClickListener mListener; public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { mDataset = myDataset; mListener = listener; } Recycler View - Adapter
  • 70. 29 private ArrayList<String> mDataset; private OnItemClickListener mListener; public MenuAdapter(ArrayList<String> myDataset, OnItemClickListener listener) { mDataset = myDataset; mListener = listener; } Recycler View - Adapter @Override public int getItemCount() { return mDataset.size(); }
  • 71. 30 Recycler View - Adapter
  • 72. 30 public static class ViewHolder extends RecyclerView.ViewHolder { ImageView mPhoto; TextView mPhotoTitle; CardView mCardView; public ViewHolder(View itemView) { super(itemView); mPhoto = (ImageView) itemView.findViewById(R.id.photo); mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); mCardView = (CardView) itemView.findViewById(R.id.cardView); } } Recycler View - Adapter
  • 73. 30 public static class ViewHolder extends RecyclerView.ViewHolder { ImageView mPhoto; TextView mPhotoTitle; CardView mCardView; public ViewHolder(View itemView) { super(itemView); mPhoto = (ImageView) itemView.findViewById(R.id.photo); mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); mCardView = (CardView) itemView.findViewById(R.id.cardView); } } Recycler View - Adapter
  • 74. 30 public static class ViewHolder extends RecyclerView.ViewHolder { ImageView mPhoto; TextView mPhotoTitle; CardView mCardView; public ViewHolder(View itemView) { super(itemView); mPhoto = (ImageView) itemView.findViewById(R.id.photo); mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); mCardView = (CardView) itemView.findViewById(R.id.cardView); } } Recycler View - Adapter
  • 75. 30 public static class ViewHolder extends RecyclerView.ViewHolder { ImageView mPhoto; TextView mPhotoTitle; CardView mCardView; public ViewHolder(View itemView) { super(itemView); mPhoto = (ImageView) itemView.findViewById(R.id.photo); mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); mCardView = (CardView) itemView.findViewById(R.id.cardView); } } Recycler View - Adapter
  • 76. 30 public static class ViewHolder extends RecyclerView.ViewHolder { ImageView mPhoto; TextView mPhotoTitle; CardView mCardView; public ViewHolder(View itemView) { super(itemView); mPhoto = (ImageView) itemView.findViewById(R.id.photo); mPhotoTitle = (TextView) itemView.findViewById(R.id.photoTitle); mCardView = (CardView) itemView.findViewById(R.id.cardView); } } Recycler View - Adapter
  • 77. 31 Recycler View - Adapter
  • 78. 31 @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void onBindViewHolder(final ViewHolder viewHolder, final int i) { Photo p = photos.get(i); mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. drawable.stat_notify_sync).into(viewHolder.mPhoto); viewHolder.mPhotoTitle.setText(p.getId()); if (viewHolder.mPhotographerTitle != null) { viewHolder.mPhotographerTitle.setText(p.getTitle()); } viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onClick(viewHolder.mPhoto, i); } }); } Recycler View - Adapter
  • 79. 31 @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void onBindViewHolder(final ViewHolder viewHolder, final int i) { Photo p = photos.get(i); mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. drawable.stat_notify_sync).into(viewHolder.mPhoto); viewHolder.mPhotoTitle.setText(p.getId()); if (viewHolder.mPhotographerTitle != null) { viewHolder.mPhotographerTitle.setText(p.getTitle()); } viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onClick(viewHolder.mPhoto, i); } }); } Recycler View - Adapter
  • 80. 31 @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void onBindViewHolder(final ViewHolder viewHolder, final int i) { Photo p = photos.get(i); mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. drawable.stat_notify_sync).into(viewHolder.mPhoto); viewHolder.mPhotoTitle.setText(p.getId()); if (viewHolder.mPhotographerTitle != null) { viewHolder.mPhotographerTitle.setText(p.getTitle()); } viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onClick(viewHolder.mPhoto, i); } }); } Recycler View - Adapter
  • 81. 31 @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void onBindViewHolder(final ViewHolder viewHolder, final int i) { Photo p = photos.get(i); mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. drawable.stat_notify_sync).into(viewHolder.mPhoto); viewHolder.mPhotoTitle.setText(p.getId()); if (viewHolder.mPhotographerTitle != null) { viewHolder.mPhotographerTitle.setText(p.getTitle()); } viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onClick(viewHolder.mPhoto, i); } }); } Recycler View - Adapter
  • 82. 31 @Override public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { View v = LayoutInflater.from(viewGroup.getContext()).inflate(rowLayout, viewGroup, false); return new ViewHolder(v); } @Override public void onBindViewHolder(final ViewHolder viewHolder, final int i) { Photo p = photos.get(i); mPicasso.load(p.getUrl()).error(android.R.drawable.stat_notify_error).placeholder(android.R. drawable.stat_notify_sync).into(viewHolder.mPhoto); viewHolder.mPhotoTitle.setText(p.getId()); if (viewHolder.mPhotographerTitle != null) { viewHolder.mPhotographerTitle.setText(p.getTitle()); } viewHolder.mCardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mListener.onClick(viewHolder.mPhoto, i); } }); } Recycler View - Adapter
  • 83. 32
  • 84. 32 • Linear Layout Manager
  • 85. 32 • Linear Layout Manager • Supports Smooth Scrolling
  • 86. 32 • Linear Layout Manager • Supports Smooth Scrolling
  • 87. 33
  • 88. 33 • Linear Layout Manager
  • 89. 33 • Linear Layout Manager • Orientation Horizontal
  • 90. 33 • Linear Layout Manager • Orientation Horizontal
  • 91. 34
  • 92. 34 • Staggered Grid Layout Manager
  • 93. 34 • Staggered Grid Layout Manager • Grid Size can be defined
  • 94. 34 • Staggered Grid Layout Manager • Grid Size can be defined • Supports Vertical and Horizontal Scrolling
  • 95. 34 • Staggered Grid Layout Manager • Grid Size can be defined • Supports Vertical and Horizontal Scrolling
  • 97.
  • 99. Toolbar • ActionBar == Toolbar • Toolbar is a ViewGroup • Styleable • Positionable 37
  • 104. Limitations • Activity Transitions are Possible, BUT won’t be applied on PRE 5.0 Devices • Many „New“ Ui Elements are not available in the API, thus require separate Implementation/Style. 41
  • 106. Limitations • Elements not Included: • Fancy Material Progressbars • Buttons • Flat • Raised • Round / Floating • Sliders • Snackbars 42
  • 108. Limitations • Things not Supported on Pre 5.0: • Activity transitions • Touch feedback • Reveal animations • Path-based animations • Vector drawables • Drawable tinting 43
  • 110. Useful Links • Official Documentation: http://developer.android.com/tools/ support-library/index.html • Index for Open Source Libraries: https://android-arsenal.com/ • e.G. Missing Ui Elements 45
  • 111.
  • 112. Questions? AngeloRüggeberg twitter.com/ s3xy4ngyc google.com/+ s3xy4ngyc .github.io github.com/ s3xy4ngyc