SlideShare a Scribd company logo
1 of 112
Download to read offline
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
Android Lollipop - Webinar am 11.12.2014
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
Android Lollipop - Webinar am 11.12.2014
Questions? 
AngeloRüggeberg 
twitter.com/ 
s3xy4ngyc 
google.com/+ 
s3xy4ngyc 
.github.io 
github.com/ 
s3xy4ngyc

More Related Content

Similar to Android Lollipop - Webinar am 11.12.2014

Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatcbeyls
 
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 TechniquesEdgar Gonzalez
 
Android UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesAndroid UI Tips, Tricks and Techniques
Android UI Tips, Tricks and TechniquesMarakana Inc.
 
Android Design Patterns
Android Design PatternsAndroid Design Patterns
Android Design PatternsGodfrey 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 LibraryJoe Birch
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesMichael Galpin
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in androidAngelo Rüggeberg
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureAlexey Buzdin
 
Overview of Android Infrastructure
Overview of Android InfrastructureOverview of Android Infrastructure
Overview of Android InfrastructureC.T.Co
 
Embracing the Lollipop
Embracing the LollipopEmbracing the Lollipop
Embracing the LollipopSonja 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
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best PracticesYekmer Simsek
 
Volley lab btc_bbit
Volley lab btc_bbitVolley lab btc_bbit
Volley lab btc_bbitCarWash1
 
Getting Started With Material Design
Getting Started With Material DesignGetting Started With Material Design
Getting Started With Material DesignYasin 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 ComponentsHassan Abid
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdfImranS18
 

Similar to Android Lollipop - Webinar am 11.12.2014 (20)

Android Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompatAndroid Support Library: Using ActionBarCompat
Android Support Library: Using ActionBarCompat
 
Action bar
Action barAction bar
Action bar
 
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
 
Implementing cast in android
Implementing cast in androidImplementing cast in android
Implementing cast in android
 
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
 
Android Best Practices
Android Best PracticesAndroid Best Practices
Android Best Practices
 
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
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 
07_UIAndroid.pdf
07_UIAndroid.pdf07_UIAndroid.pdf
07_UIAndroid.pdf
 

More from inovex GmbH

lldb – Debugger auf Abwegen
lldb – Debugger auf Abwegenlldb – Debugger auf Abwegen
lldb – Debugger auf Abwegeninovex GmbH
 
Are you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIAre you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIinovex GmbH
 
Why natural language is next step in the AI evolution
Why natural language is next step in the AI evolutionWhy natural language is next step in the AI evolution
Why natural language is next step in the AI evolutioninovex GmbH
 
Network Policies
Network PoliciesNetwork Policies
Network Policiesinovex GmbH
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learninginovex GmbH
 
Jenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen UmgebungenJenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen Umgebungeninovex GmbH
 
AI auf Edge-Geraeten
AI auf Edge-GeraetenAI auf Edge-Geraeten
AI auf Edge-Geraeteninovex GmbH
 
Prometheus on Kubernetes
Prometheus on KubernetesPrometheus on Kubernetes
Prometheus on Kubernetesinovex GmbH
 
Deep Learning for Recommender Systems
Deep Learning for Recommender SystemsDeep Learning for Recommender Systems
Deep Learning for Recommender Systemsinovex GmbH
 
Representation Learning von Zeitreihen
Representation Learning von ZeitreihenRepresentation Learning von Zeitreihen
Representation Learning von Zeitreiheninovex GmbH
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenteninovex GmbH
 
Künstlich intelligent?
Künstlich intelligent?Künstlich intelligent?
Künstlich intelligent?inovex GmbH
 
Das Android Open Source Project
Das Android Open Source ProjectDas Android Open Source Project
Das Android Open Source Projectinovex GmbH
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretabilityinovex GmbH
 
Performance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use casePerformance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use caseinovex GmbH
 
People & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessPeople & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessinovex GmbH
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumiinovex GmbH
 

More from inovex GmbH (20)

lldb – Debugger auf Abwegen
lldb – Debugger auf Abwegenlldb – Debugger auf Abwegen
lldb – Debugger auf Abwegen
 
Are you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AIAre you sure about that?! Uncertainty Quantification in AI
Are you sure about that?! Uncertainty Quantification in AI
 
Why natural language is next step in the AI evolution
Why natural language is next step in the AI evolutionWhy natural language is next step in the AI evolution
Why natural language is next step in the AI evolution
 
WWDC 2019 Recap
WWDC 2019 RecapWWDC 2019 Recap
WWDC 2019 Recap
 
Network Policies
Network PoliciesNetwork Policies
Network Policies
 
Interpretable Machine Learning
Interpretable Machine LearningInterpretable Machine Learning
Interpretable Machine Learning
 
Jenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen UmgebungenJenkins X – CI/CD in wolkigen Umgebungen
Jenkins X – CI/CD in wolkigen Umgebungen
 
AI auf Edge-Geraeten
AI auf Edge-GeraetenAI auf Edge-Geraeten
AI auf Edge-Geraeten
 
Prometheus on Kubernetes
Prometheus on KubernetesPrometheus on Kubernetes
Prometheus on Kubernetes
 
Deep Learning for Recommender Systems
Deep Learning for Recommender SystemsDeep Learning for Recommender Systems
Deep Learning for Recommender Systems
 
Azure IoT Edge
Azure IoT EdgeAzure IoT Edge
Azure IoT Edge
 
Representation Learning von Zeitreihen
Representation Learning von ZeitreihenRepresentation Learning von Zeitreihen
Representation Learning von Zeitreihen
 
Talk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale AssistentenTalk to me – Chatbots und digitale Assistenten
Talk to me – Chatbots und digitale Assistenten
 
Künstlich intelligent?
Künstlich intelligent?Künstlich intelligent?
Künstlich intelligent?
 
Dev + Ops = Go
Dev + Ops = GoDev + Ops = Go
Dev + Ops = Go
 
Das Android Open Source Project
Das Android Open Source ProjectDas Android Open Source Project
Das Android Open Source Project
 
Machine Learning Interpretability
Machine Learning InterpretabilityMachine Learning Interpretability
Machine Learning Interpretability
 
Performance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use casePerformance evaluation of GANs in a semisupervised OCR use case
Performance evaluation of GANs in a semisupervised OCR use case
 
People & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madnessPeople & Products – Lessons learned from the daily IT madness
People & Products – Lessons learned from the daily IT madness
 
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with PulumiInfrastructure as (real) Code – Manage your K8s resources with Pulumi
Infrastructure as (real) Code – Manage your K8s resources with Pulumi
 

Recently uploaded

Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...Aggregage
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 

Recently uploaded (20)

20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
The Data Metaverse: Unpacking the Roles, Use Cases, and Tech Trends in Data a...
 
20150722 - AGV
20150722 - AGV20150722 - AGV
20150722 - AGV
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 

Android Lollipop - Webinar am 11.12.2014

  • 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
  • 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
  • 112. Questions? AngeloRüggeberg twitter.com/ s3xy4ngyc google.com/+ s3xy4ngyc .github.io github.com/ s3xy4ngyc