SlideShare a Scribd company logo
1 of 20
Download to read offline
VIEW CUSTOMIZATION
IN A NUTSHELL
@bernhardpflug
plus.google.com/+BernhardPflug
Iconmobile
170
Headquarter
BMW
BMW remote apps
The app
UX Don’t just start coding
Make it easy to
send feedback
Analyse usage
One UX example
Custom view drawing with animation
public class TankView extends ViewGroup {
!
. . .
!
private void updateBoilerAppearance() {
. . .
liquidPaths[i] = new Path();

liquidPaints[i] = new Paint(liquidPaint);



liquidPaints[i].setShader(new LinearGradient(. . .}, new float[] { . . . },
Shader.TileMode.CLAMP));
!
liquidPaths[i].moveTo(. . .);
liquidPaths[i].lineTo(. . .);
liquidPaths[i].quadTo(. . .);

. . .
!
liquidPathEffects[i].add(new DashPathEffect(new float[] { . . . ));
!
}
!
. . .
}
!
!
!
@Override

protected void dispatchDraw(Canvas canvas) {



canvas.saveLayerAlpha(0, 0, canvas.getWidth(), canvas.getHeight(), alpha,
Canvas.HAS_ALPHA_LAYER_SAVE_FLAG);



canvas.drawPath(boilerContour, contourPaint);


. . .


if (state == State.HEATING) {

// draw pipe

canvas.drawRect(pipeBounds, fillPaint);

canvas.drawLine(. . . );

canvas.drawLine(. . . );



// draw liquid

for (int i = 0; i < liquidPaths.length; i++) {

canvas.drawPath(liquidPaths[i], liquidPaints[i]);

}



liquidAnimHandler.postDelayed(liquidAnimation, 50);

}

}
Custom view drawing with animation
@Override

protected void onSizeChanged(int w, int h, int oldw, int oldh) {



updateBoilerAppearance();

super.onSizeChanged(w, h, oldw, oldh);

}
Custom view drawing with animation
public class SvgView extends View {
!
. . .
!
@Override

protected void onSizeChanged(int w, int h, int oldw, int oldh) {

super.onSizeChanged(w, h, oldw, oldh);



if (w > 0 && h > 0 && svg != null) {

svg.setDocumentWidth(w);

svg.setDocumentHeight(h);

Bitmap svgBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);

Canvas bitmapCanvas = new Canvas(svgBitmap);

// Render our document onto our canvas

svg.renderToCanvas(bitmapCanvas);

setBackgroundDrawable(new BitmapDrawable(getResources(), svgBitmap));

}

}
!
. . .
}
Consider SVG instead of dpi graphics
{} @ github.com/bernhardpflug/AndroidUtilities
Custom swipe component
Custom swipe component
Ground View
Sky View
public class VerticalViewPager extends ViewGroup {
. . .
!
@Override

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {



int width = getDefaultSize(0, widthMeasureSpec);

int height = getDefaultSize(0, heightMeasureSpec);

setMeasuredDimension(width, height);



int hPadding = getPaddingLeft()+getPaddingRight();

int vPadding = getPaddingTop()+getPaddingBottom();



int contentWidth = getChildMeasureSpec(widthMeasureSpec, hPadding , width);

int contentHeight = getChildMeasureSpec(heightMeasureSpec,vPadding , height);


groundView.measure(contentWidth, contentHeight);



int skyViewHeight = skyView.getLayoutParams().height;

int skyHeight = getChildMeasureSpec(heightMeasureSpec, vPadding, skyViewHeight);

skyView.measure(contentWidth, skyHeight);


}
!
. . .
!
}
Implementing custom swipe components
{} @ github.com/bernhardpflug/AndroidUtilities
Ground View
Sky View
@Override

protected void onLayout(boolean changed, int l, int t, int r, int b) {

final int width = r - l;

final int height = b - t;



int skyViewHeight = skyView.getMeasuredHeight();

skyView.layout(0, 0, width, skyView.getMeasuredHeight());

groundView.layout(0, skyViewHeight, width, height + skyViewHeight);


}
Implementing custom swipe components
{} @ github.com/bernhardpflug/AndroidUtilities
Ground View
Sky View
@Override

public boolean onTouchEvent(MotionEvent event) {
!
. . .
!
switch (event.getAction()) {

. . .



case MotionEvent.ACTION_MOVE:
!
int touchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();




if (!verticalScrolling && Math.abs(deltaY) > touchSlop) {

verticalScrolling = true;



requestDisallowInterceptTouchEvent(true);
!
if (getScrollY() + deltaY <= State.CLOSED && getScrollY() + deltaY >= State.OPEN)
{

scrollBy(0, (int) deltaY);



}


}
!
!
}
Implementing custom swipe components
{} @ github.com/bernhardpflug/AndroidUtilities
@Override

public boolean onTouchEvent(MotionEvent event) {
!
. . .
!
switch (event.getAction()) {

. . .



case MotionEvent.ACTION_UP:



scroller.startScroll(0, getScrollY(), 0, getY(destinationState) - getScrollY());


break;
!
!
}
Implementing custom swipe components
{} @ github.com/bernhardpflug/AndroidUtilities
@Override

public void computeScroll() {

if (scroller.computeScrollOffset()) {



int x = scroller.getCurrX();

int y = scroller.getCurrY();



scrollTo(x, y);



postInvalidate();

}
}
Implementing custom swipe components
{} @ github.com/bernhardpflug/AndroidUtilities
at.bernhardpflug.heating
Give it a try
Google Play
{} @ github.com/bernhardpflug/AndroidUtilities
Thank you!
plus.google.com/+BernhardPflug
@bernhardpflug

More Related Content

Viewers also liked

Knock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentKnock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentMamdouh Tarabishi
 
[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel
[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel
[MBF2] APIs Deezer par Cédric Pascal & Louis CheynelBeMyApp
 
Deloitte UK / Facebook : a people based telecom business - breathing new lif...
Deloitte UK / Facebook  : a people based telecom business - breathing new lif...Deloitte UK / Facebook  : a people based telecom business - breathing new lif...
Deloitte UK / Facebook : a people based telecom business - breathing new lif...yann le gigan
 
[MBF2] Webinar plate-forme Salesforce #1
[MBF2] Webinar plate-forme Salesforce #1[MBF2] Webinar plate-forme Salesforce #1
[MBF2] Webinar plate-forme Salesforce #1BeMyApp
 
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...yann le gigan
 
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian AnderkaBeMyApp
 
L'oculus rift de a à z meetup unity
L'oculus rift de a à z   meetup unityL'oculus rift de a à z   meetup unity
L'oculus rift de a à z meetup unityBeMyApp
 
HP Helion European Webinar Series ,Webinar #3
HP Helion European Webinar Series ,Webinar #3 HP Helion European Webinar Series ,Webinar #3
HP Helion European Webinar Series ,Webinar #3 BeMyApp
 
HP Helion Webinar #2
HP Helion Webinar #2 HP Helion Webinar #2
HP Helion Webinar #2 BeMyApp
 
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian Frank
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian FrankHP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian Frank
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian FrankBeMyApp
 
[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra
[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra
[MirrorLink Hackathon] Introduction Slideshow by Alexandre SutraBeMyApp
 
Augmented Reality (AR) in Education
Augmented Reality (AR) in EducationAugmented Reality (AR) in Education
Augmented Reality (AR) in EducationSteve Yuen
 

Viewers also liked (13)

Knock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game developmentKnock knock on GameDev gateway! - Introduction to Game development
Knock knock on GameDev gateway! - Introduction to Game development
 
Web Server Load Balancing
Web Server Load BalancingWeb Server Load Balancing
Web Server Load Balancing
 
[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel
[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel
[MBF2] APIs Deezer par Cédric Pascal & Louis Cheynel
 
Deloitte UK / Facebook : a people based telecom business - breathing new lif...
Deloitte UK / Facebook  : a people based telecom business - breathing new lif...Deloitte UK / Facebook  : a people based telecom business - breathing new lif...
Deloitte UK / Facebook : a people based telecom business - breathing new lif...
 
[MBF2] Webinar plate-forme Salesforce #1
[MBF2] Webinar plate-forme Salesforce #1[MBF2] Webinar plate-forme Salesforce #1
[MBF2] Webinar plate-forme Salesforce #1
 
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...
“Les Français et les Campagnes «Santé»” Enquête Future Thinking / FNAIM - Fév...
 
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka
[Ultracode Munich Meetup #9] From Sand to Silicon by Christian Anderka
 
L'oculus rift de a à z meetup unity
L'oculus rift de a à z   meetup unityL'oculus rift de a à z   meetup unity
L'oculus rift de a à z meetup unity
 
HP Helion European Webinar Series ,Webinar #3
HP Helion European Webinar Series ,Webinar #3 HP Helion European Webinar Series ,Webinar #3
HP Helion European Webinar Series ,Webinar #3
 
HP Helion Webinar #2
HP Helion Webinar #2 HP Helion Webinar #2
HP Helion Webinar #2
 
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian Frank
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian FrankHP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian Frank
HP Helion Webinar #1 - Introduction to HP Helion OpenStack w/Christian Frank
 
[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra
[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra
[MirrorLink Hackathon] Introduction Slideshow by Alexandre Sutra
 
Augmented Reality (AR) in Education
Augmented Reality (AR) in EducationAugmented Reality (AR) in Education
Augmented Reality (AR) in Education
 

Similar to [Ultracode Munich Meetup #7] Android view customization in a nutshell

Creating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfCreating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfShaiAlmog1
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views Lars Vogel
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)Katsumi Kishikawa
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear EssentialsNilhcem
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
 
HTML5って必要?
HTML5って必要?HTML5って必要?
HTML5って必要?GCS2013
 
Responsive layouts by Maqbool
Responsive layouts by MaqboolResponsive layouts by Maqbool
Responsive layouts by MaqboolNavin Agarwal
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsNaman Dwivedi
 
Sperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copySperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copySalvatore Iaconesi
 
Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011Johan Nilsson
 
Manual Layout Revisited
Manual Layout RevisitedManual Layout Revisited
Manual Layout Revisitedgillygize
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QATed Drake
 
Drawing with the HTML5 Canvas
Drawing with the HTML5 CanvasDrawing with the HTML5 Canvas
Drawing with the HTML5 CanvasHenry Osborne
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom viewsMu Chun Wang
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developersDarryl Bayliss
 

Similar to [Ultracode Munich Meetup #7] Android view customization in a nutshell (20)

Creating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdfCreating an Uber Clone - Part XXIV - Transcript.pdf
Creating an Uber Clone - Part XXIV - Transcript.pdf
 
Android design and Custom views
Android design and Custom views Android design and Custom views
Android design and Custom views
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)
 
Prototype UI
Prototype UIPrototype UI
Prototype UI
 
Android Wear Essentials
Android Wear EssentialsAndroid Wear Essentials
Android Wear Essentials
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
HTML5って必要?
HTML5って必要?HTML5って必要?
HTML5って必要?
 
Responsive layouts by Maqbool
Responsive layouts by MaqboolResponsive layouts by Maqbool
Responsive layouts by Maqbool
 
Enhancing UI/UX using Java animations
Enhancing UI/UX using Java animationsEnhancing UI/UX using Java animations
Enhancing UI/UX using Java animations
 
Canvas al ajillo
Canvas al ajilloCanvas al ajillo
Canvas al ajillo
 
Sperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copySperimentazioni lezione6 from_designtoapplication copy
Sperimentazioni lezione6 from_designtoapplication copy
 
Prototype UI Intro
Prototype UI IntroPrototype UI Intro
Prototype UI Intro
 
Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011Custom UI Components at Android Only 2011
Custom UI Components at Android Only 2011
 
Manual Layout Revisited
Manual Layout RevisitedManual Layout Revisited
Manual Layout Revisited
 
Android accessibility for developers and QA
Android accessibility for developers and QAAndroid accessibility for developers and QA
Android accessibility for developers and QA
 
Drawing with the HTML5 Canvas
Drawing with the HTML5 CanvasDrawing with the HTML5 Canvas
Drawing with the HTML5 Canvas
 
Intro to HTML5
Intro to HTML5Intro to HTML5
Intro to HTML5
 
Android query
Android queryAndroid query
Android query
 
Creating custom views
Creating custom viewsCreating custom views
Creating custom views
 
Android development for iOS developers
Android development for iOS developersAndroid development for iOS developers
Android development for iOS developers
 

More from BeMyApp

Introduction to epid
Introduction to epidIntroduction to epid
Introduction to epidBeMyApp
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetupBeMyApp
 
Présentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM WatsonPrésentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM WatsonBeMyApp
 
Crédit Agricole S.A. Personae et Parcours
Crédit Agricole S.A. Personae et ParcoursCrédit Agricole S.A. Personae et Parcours
Crédit Agricole S.A. Personae et ParcoursBeMyApp
 
Cisco Paris DevNet Hackathon slideshow - Intro
Cisco Paris DevNet Hackathon slideshow - IntroCisco Paris DevNet Hackathon slideshow - Intro
Cisco Paris DevNet Hackathon slideshow - IntroBeMyApp
 
Tumeurs Neuroendocrines : une vue d'ensemble
Tumeurs Neuroendocrines : une vue d'ensembleTumeurs Neuroendocrines : une vue d'ensemble
Tumeurs Neuroendocrines : une vue d'ensembleBeMyApp
 
Building your first game in Unity 3d by Sarah Sexton
Building your first game in Unity 3d  by Sarah SextonBuilding your first game in Unity 3d  by Sarah Sexton
Building your first game in Unity 3d by Sarah SextonBeMyApp
 
Using intel's real sense to create games with natural user interfaces justi...
Using intel's real sense to create games with natural user interfaces   justi...Using intel's real sense to create games with natural user interfaces   justi...
Using intel's real sense to create games with natural user interfaces justi...BeMyApp
 
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon CollinsIntroduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon CollinsBeMyApp
 
Audio Mixer in Unity5 - Andy Touch
Audio Mixer in Unity5 - Andy TouchAudio Mixer in Unity5 - Andy Touch
Audio Mixer in Unity5 - Andy TouchBeMyApp
 
Shaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the BestShaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the BestBeMyApp
 
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
[HACKATHON CISCO PARIS] Slideshow du workshop Smart CityBeMyApp
 
Tools to Save Time
Tools to Save TimeTools to Save Time
Tools to Save TimeBeMyApp
 
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateurBeMyApp
 
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...BeMyApp
 
[IoT World Forum Webinar] Review of CMX Cisco technology
[IoT World Forum Webinar] Review of CMX Cisco technology[IoT World Forum Webinar] Review of CMX Cisco technology
[IoT World Forum Webinar] Review of CMX Cisco technologyBeMyApp
 
HP Helion Episode 6: Cloud Foundry Summit Recap
HP Helion Episode 6: Cloud Foundry Summit RecapHP Helion Episode 6: Cloud Foundry Summit Recap
HP Helion Episode 6: Cloud Foundry Summit RecapBeMyApp
 
Webinar UI/UX by Francesco Marcellino
Webinar UI/UX by Francesco MarcellinoWebinar UI/UX by Francesco Marcellino
Webinar UI/UX by Francesco MarcellinoBeMyApp
 
HP Helion Webinar #5 - Security Beyond Firewalls
HP Helion Webinar #5 - Security Beyond FirewallsHP Helion Webinar #5 - Security Beyond Firewalls
HP Helion Webinar #5 - Security Beyond FirewallsBeMyApp
 
HP Helion Webinar #4 - Open stack the magic pill
HP Helion Webinar #4 - Open stack the magic pillHP Helion Webinar #4 - Open stack the magic pill
HP Helion Webinar #4 - Open stack the magic pillBeMyApp
 

More from BeMyApp (20)

Introduction to epid
Introduction to epidIntroduction to epid
Introduction to epid
 
Introduction ciot workshop premeetup
Introduction ciot workshop premeetupIntroduction ciot workshop premeetup
Introduction ciot workshop premeetup
 
Présentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM WatsonPrésentation des APIs cognitives IBM Watson
Présentation des APIs cognitives IBM Watson
 
Crédit Agricole S.A. Personae et Parcours
Crédit Agricole S.A. Personae et ParcoursCrédit Agricole S.A. Personae et Parcours
Crédit Agricole S.A. Personae et Parcours
 
Cisco Paris DevNet Hackathon slideshow - Intro
Cisco Paris DevNet Hackathon slideshow - IntroCisco Paris DevNet Hackathon slideshow - Intro
Cisco Paris DevNet Hackathon slideshow - Intro
 
Tumeurs Neuroendocrines : une vue d'ensemble
Tumeurs Neuroendocrines : une vue d'ensembleTumeurs Neuroendocrines : une vue d'ensemble
Tumeurs Neuroendocrines : une vue d'ensemble
 
Building your first game in Unity 3d by Sarah Sexton
Building your first game in Unity 3d  by Sarah SextonBuilding your first game in Unity 3d  by Sarah Sexton
Building your first game in Unity 3d by Sarah Sexton
 
Using intel's real sense to create games with natural user interfaces justi...
Using intel's real sense to create games with natural user interfaces   justi...Using intel's real sense to create games with natural user interfaces   justi...
Using intel's real sense to create games with natural user interfaces justi...
 
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon CollinsIntroduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
Introduction to using the R200 camera & Realsense SDK in Unity3d - Jon Collins
 
Audio Mixer in Unity5 - Andy Touch
Audio Mixer in Unity5 - Andy TouchAudio Mixer in Unity5 - Andy Touch
Audio Mixer in Unity5 - Andy Touch
 
Shaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the BestShaders - Claudia Doppioslash - Unity With the Best
Shaders - Claudia Doppioslash - Unity With the Best
 
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
[HACKATHON CISCO PARIS] Slideshow du workshop Smart City
 
Tools to Save Time
Tools to Save TimeTools to Save Time
Tools to Save Time
 
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
[Workshop e résidents] présentation intent, craft ai, dalkia et incubateur
 
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
[Webinar E-résidents #1] Présentation des différents métiers du bâtiment conn...
 
[IoT World Forum Webinar] Review of CMX Cisco technology
[IoT World Forum Webinar] Review of CMX Cisco technology[IoT World Forum Webinar] Review of CMX Cisco technology
[IoT World Forum Webinar] Review of CMX Cisco technology
 
HP Helion Episode 6: Cloud Foundry Summit Recap
HP Helion Episode 6: Cloud Foundry Summit RecapHP Helion Episode 6: Cloud Foundry Summit Recap
HP Helion Episode 6: Cloud Foundry Summit Recap
 
Webinar UI/UX by Francesco Marcellino
Webinar UI/UX by Francesco MarcellinoWebinar UI/UX by Francesco Marcellino
Webinar UI/UX by Francesco Marcellino
 
HP Helion Webinar #5 - Security Beyond Firewalls
HP Helion Webinar #5 - Security Beyond FirewallsHP Helion Webinar #5 - Security Beyond Firewalls
HP Helion Webinar #5 - Security Beyond Firewalls
 
HP Helion Webinar #4 - Open stack the magic pill
HP Helion Webinar #4 - Open stack the magic pillHP Helion Webinar #4 - Open stack the magic pill
HP Helion Webinar #4 - Open stack the magic pill
 

Recently uploaded

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementNuwan Dias
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
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
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
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
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?IES VE
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPathCommunity
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
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
 
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
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
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
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaborationbruanjhuli
 

Recently uploaded (20)

VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
The Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API ManagementThe Kubernetes Gateway API and its role in Cloud Native API Management
The Kubernetes Gateway API and its role in Cloud Native API Management
 
20230104 - machine vision
20230104 - machine vision20230104 - machine vision
20230104 - machine vision
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
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
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
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
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 
How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?How Accurate are Carbon Emissions Projections?
How Accurate are Carbon Emissions Projections?
 
UiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation DevelopersUiPath Community: AI for UiPath Automation Developers
UiPath Community: AI for UiPath Automation Developers
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
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...
 
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
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
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)
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online CollaborationCOMPUTER 10: Lesson 7 - File Storage and Online Collaboration
COMPUTER 10: Lesson 7 - File Storage and Online Collaboration
 

[Ultracode Munich Meetup #7] Android view customization in a nutshell

  • 6. UX Don’t just start coding Make it easy to send feedback Analyse usage
  • 8. Custom view drawing with animation public class TankView extends ViewGroup { ! . . . ! private void updateBoilerAppearance() { . . . liquidPaths[i] = new Path();
 liquidPaints[i] = new Paint(liquidPaint);
 
 liquidPaints[i].setShader(new LinearGradient(. . .}, new float[] { . . . }, Shader.TileMode.CLAMP)); ! liquidPaths[i].moveTo(. . .); liquidPaths[i].lineTo(. . .); liquidPaths[i].quadTo(. . .);
 . . . ! liquidPathEffects[i].add(new DashPathEffect(new float[] { . . . )); ! } ! . . . } ! !
  • 9. ! @Override
 protected void dispatchDraw(Canvas canvas) {
 
 canvas.saveLayerAlpha(0, 0, canvas.getWidth(), canvas.getHeight(), alpha, Canvas.HAS_ALPHA_LAYER_SAVE_FLAG);
 
 canvas.drawPath(boilerContour, contourPaint); 
 . . . 
 if (state == State.HEATING) {
 // draw pipe
 canvas.drawRect(pipeBounds, fillPaint);
 canvas.drawLine(. . . );
 canvas.drawLine(. . . );
 
 // draw liquid
 for (int i = 0; i < liquidPaths.length; i++) {
 canvas.drawPath(liquidPaths[i], liquidPaints[i]);
 }
 
 liquidAnimHandler.postDelayed(liquidAnimation, 50);
 }
 } Custom view drawing with animation
  • 10. @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
 
 updateBoilerAppearance();
 super.onSizeChanged(w, h, oldw, oldh);
 } Custom view drawing with animation
  • 11. public class SvgView extends View { ! . . . ! @Override
 protected void onSizeChanged(int w, int h, int oldw, int oldh) {
 super.onSizeChanged(w, h, oldw, oldh);
 
 if (w > 0 && h > 0 && svg != null) {
 svg.setDocumentWidth(w);
 svg.setDocumentHeight(h);
 Bitmap svgBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
 Canvas bitmapCanvas = new Canvas(svgBitmap);
 // Render our document onto our canvas
 svg.renderToCanvas(bitmapCanvas);
 setBackgroundDrawable(new BitmapDrawable(getResources(), svgBitmap));
 }
 } ! . . . } Consider SVG instead of dpi graphics {} @ github.com/bernhardpflug/AndroidUtilities
  • 14. public class VerticalViewPager extends ViewGroup { . . . ! @Override
 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
 
 int width = getDefaultSize(0, widthMeasureSpec);
 int height = getDefaultSize(0, heightMeasureSpec);
 setMeasuredDimension(width, height);
 
 int hPadding = getPaddingLeft()+getPaddingRight();
 int vPadding = getPaddingTop()+getPaddingBottom();
 
 int contentWidth = getChildMeasureSpec(widthMeasureSpec, hPadding , width);
 int contentHeight = getChildMeasureSpec(heightMeasureSpec,vPadding , height); 
 groundView.measure(contentWidth, contentHeight);
 
 int skyViewHeight = skyView.getLayoutParams().height;
 int skyHeight = getChildMeasureSpec(heightMeasureSpec, vPadding, skyViewHeight);
 skyView.measure(contentWidth, skyHeight); 
 } ! . . . ! } Implementing custom swipe components {} @ github.com/bernhardpflug/AndroidUtilities Ground View Sky View
  • 15. @Override
 protected void onLayout(boolean changed, int l, int t, int r, int b) {
 final int width = r - l;
 final int height = b - t;
 
 int skyViewHeight = skyView.getMeasuredHeight();
 skyView.layout(0, 0, width, skyView.getMeasuredHeight());
 groundView.layout(0, skyViewHeight, width, height + skyViewHeight); 
 } Implementing custom swipe components {} @ github.com/bernhardpflug/AndroidUtilities Ground View Sky View
  • 16. @Override
 public boolean onTouchEvent(MotionEvent event) { ! . . . ! switch (event.getAction()) {
 . . .
 
 case MotionEvent.ACTION_MOVE: ! int touchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); 
 
 if (!verticalScrolling && Math.abs(deltaY) > touchSlop) {
 verticalScrolling = true;
 
 requestDisallowInterceptTouchEvent(true); ! if (getScrollY() + deltaY <= State.CLOSED && getScrollY() + deltaY >= State.OPEN) {
 scrollBy(0, (int) deltaY);
 
 } 
 } ! ! } Implementing custom swipe components {} @ github.com/bernhardpflug/AndroidUtilities
  • 17. @Override
 public boolean onTouchEvent(MotionEvent event) { ! . . . ! switch (event.getAction()) {
 . . .
 
 case MotionEvent.ACTION_UP:
 
 scroller.startScroll(0, getScrollY(), 0, getY(destinationState) - getScrollY()); 
 break; ! ! } Implementing custom swipe components {} @ github.com/bernhardpflug/AndroidUtilities
  • 18. @Override
 public void computeScroll() {
 if (scroller.computeScrollOffset()) {
 
 int x = scroller.getCurrX();
 int y = scroller.getCurrY();
 
 scrollTo(x, y);
 
 postInvalidate();
 } } Implementing custom swipe components {} @ github.com/bernhardpflug/AndroidUtilities
  • 19. at.bernhardpflug.heating Give it a try Google Play {} @ github.com/bernhardpflug/AndroidUtilities