SlideShare a Scribd company logo
Make your designers
love (working with) you!
Vinay Shenoy
Software Engineer
HomeLane.com
• Static Assets exported by designer

1. Reexport for every supported density

2. More assets -> more time

3. Who loves Nine-Patches?

• Sharing and organising assets

1. Designer has their own naming and organising
preference

2. Developer has to reorganise and rename according
to Android format

• Iteration is terribly inefficient for image assets

1. Tiniest change in design requires re-export of asset

2. Rename, Restructure, Rebuild

3. Rinse, Repeat
Unnecessary work is bad!
1. Backgrounds and Borders using Shape Drawables

2. Textured Backgrounds and Shapes using Bitmap
Shaders

3. Custom views
Shape Drawables
• Single XML file to represent
the drawable, scales across
densities

• Supports multiple basic
shapes

• Supports solid/stroked
shapes

• Has basic gradient support

• Very useful for border and
backgrounds
Backgrounds
<solid color=“”/>
<corners radius=“”/>
<stroke width=“”/>
• Solids and Strokes are NOT mutually exclusive.
Strokes are drawn on top of the solid

• The Size tag in the drawable is not a fixed size. The
drawable will expand to fill the View

• Can be used in StateListDrawables for visual
feedback
Borders
<stroke width=“”/>
<dashWidth=“”/>
<dashGap=“”/>
Gradients
startColor
centerColor
endColor
centerX & centerY
angle=45
angle=90
Image Drawing
• Images(especially avatars)
often need to be drawn in
different shapes

• Drawing images of
arbitrary shapes can be
achieved using Paths and
Bitmap Shaders
Paths
• A collection of geometric constructs(Circles, Rectangles,
Lines) that are encapsulated in the Path class

• Can be used for drawing and clipping

• Can also be used for drawing text

• Canvas#drawPath(path, paint) will draw the
constructed path with a particular paint object

• Path provides shape, paint provides colour
Bitmap Shaders
• By itself, a Paint object supports a single colour only

• A shader can be used to provide spans of colours instead
of a single colour when drawing anything on a Canvas

• The android framework provides multiple shaders, like
LinearGradient which is used in gradient shape which we
saw earlier

• Bitmap shader allows you to provide colour spans from
an image
BitmapShader Tile Modes
• Control how a Bitmap Shader selects a colour for a pixel
if the source bitmap is smaller than the area to be drawn

• Three tile modes are available

1. Clamp - The edge colour of the Bitmap is repeated

2. Mirror - The source Bitmap is mirrored

3. Repeat - The source Bitmap is repeated
Clamp Repeat Mirror
Tile Modes
Textured Backgrounds
• Full size textured backgrounds will
not work because the image will
scale on different resolutions and
aspect ratios

• Creating multiple full size
backgrounds adds extra size to the
APK and is still not guaranteed to
scale well across the entire device
spectrum

• Bitmap Shaders are extremely
helpful to handle this case
Textured Backgrounds
• All you need is a texture that is created
in a specific way, called a seamless,
repeatable texture

• A seamless, repeatable texture is one
that can be placed next to itself and it
will appear to be a complete image

• A seamless texture + a bitmap shader
with Repeat tile mode will handle
everything
Practical Applications
• Rounded corners, so
needs multiple densities

• Has to accommodate
dynamic content so has to
be nine-patch

• IF we were going the static
asset route
Custom Drawing
• Use a seamless, repeatable texture for the
background

• Use a Path to create the shape

• Use a BitmapShader to draw the path, with the
background texture
Creating the Shape
• We create a Path with two components - The
Rounded rectangle and the little triangle in the
corner

• We also need to set the dimensions of the View, for
which we need to know how large the content is

• StaticLayout is great for measuring and drawing
text
You Have The
Power!

More Related Content

What's hot

Using Graphics in Real-World Tech Comm
Using Graphics in Real-World Tech CommUsing Graphics in Real-World Tech Comm
Using Graphics in Real-World Tech Comm
seanb_us
 
Multimedia tools(images)
Multimedia tools(images)Multimedia tools(images)
Multimedia tools(images)dhruv patel
 
Technical file powerpoint
Technical file powerpointTechnical file powerpoint
Technical file powerpointMaguire94
 
Lecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & ConceptsLecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & Conceptsmgordon320
 
P1.1
P1.1P1.1
Lecture5 graphics
Lecture5   graphicsLecture5   graphics
Lecture5 graphicsMr SMAK
 
Developing iOS Map Applications with C#
Developing iOS Map Applications with C#Developing iOS Map Applications with C#
Developing iOS Map Applications with C#
Xamarin
 
Animation software by Er. Suvisha Gupta
Animation software by Er. Suvisha GuptaAnimation software by Er. Suvisha Gupta
Animation software by Er. Suvisha GuptaSuvisha Gupta
 
An introduction to photoshop
An introduction to photoshopAn introduction to photoshop
An introduction to photoshop
Sibghatullah Khattak
 
Chapter 3 : IMAGE
Chapter 3 : IMAGEChapter 3 : IMAGE
Chapter 3 : IMAGE
azira96
 
Graphics and imagea
Graphics and imageaGraphics and imagea
Graphics and imagea
Hasnain Akram
 
Image capture powerpoint
Image capture powerpointImage capture powerpoint
Image capture powerpoint
cbottomleyct
 

What's hot (14)

Raster vs vector
Raster vs vectorRaster vs vector
Raster vs vector
 
Digital imaging
Digital imagingDigital imaging
Digital imaging
 
Using Graphics in Real-World Tech Comm
Using Graphics in Real-World Tech CommUsing Graphics in Real-World Tech Comm
Using Graphics in Real-World Tech Comm
 
Multimedia tools(images)
Multimedia tools(images)Multimedia tools(images)
Multimedia tools(images)
 
Technical file powerpoint
Technical file powerpointTechnical file powerpoint
Technical file powerpoint
 
Lecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & ConceptsLecture 1.1 - Terms & Concepts
Lecture 1.1 - Terms & Concepts
 
P1.1
P1.1P1.1
P1.1
 
Lecture5 graphics
Lecture5   graphicsLecture5   graphics
Lecture5 graphics
 
Developing iOS Map Applications with C#
Developing iOS Map Applications with C#Developing iOS Map Applications with C#
Developing iOS Map Applications with C#
 
Animation software by Er. Suvisha Gupta
Animation software by Er. Suvisha GuptaAnimation software by Er. Suvisha Gupta
Animation software by Er. Suvisha Gupta
 
An introduction to photoshop
An introduction to photoshopAn introduction to photoshop
An introduction to photoshop
 
Chapter 3 : IMAGE
Chapter 3 : IMAGEChapter 3 : IMAGE
Chapter 3 : IMAGE
 
Graphics and imagea
Graphics and imageaGraphics and imagea
Graphics and imagea
 
Image capture powerpoint
Image capture powerpointImage capture powerpoint
Image capture powerpoint
 

Similar to Make your designers love (working with) you

Raster vs vector
Raster vs vectorRaster vs vector
Raster vs vector
akn4fotos
 
GJU MM Unit 3.pdf
GJU MM Unit 3.pdfGJU MM Unit 3.pdf
GJU MM Unit 3.pdf
diljots78
 
P1.1
P1.1 P1.1
Scct2013 topic 3_graphics
Scct2013 topic 3_graphicsScct2013 topic 3_graphics
Scct2013 topic 3_graphicsAnies Syahieda
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
nooramirahazmn
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
Steve Guinan
 
Chapter Six
Chapter SixChapter Six
Chapter Six
Nada G.Youssef
 
Vector tile style editor workshop
Vector tile style editor workshopVector tile style editor workshop
Vector tile style editor workshop
Aileen Buckley
 
Chapter 6 Graphics
Chapter 6 GraphicsChapter 6 Graphics
Chapter 6 Graphics
shelly3160
 
Ace exam guide_photoshop_cs5
Ace exam guide_photoshop_cs5Ace exam guide_photoshop_cs5
Ace exam guide_photoshop_cs5
muhnusairat
 
Photoshop graphic intro ppt by kartik mandothiya
Photoshop graphic intro ppt by kartik mandothiyaPhotoshop graphic intro ppt by kartik mandothiya
Photoshop graphic intro ppt by kartik mandothiya
Kartik Mandothiya
 
Lesson 3 graphics types
Lesson 3  graphics typesLesson 3  graphics types
Lesson 3 graphics types
hwells2101
 
Let there be color! 논문 설명 입니다.
Let there be color! 논문 설명 입니다.Let there be color! 논문 설명 입니다.
Let there be color! 논문 설명 입니다.
Joowon Moon
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
Ahmed Badr
 

Similar to Make your designers love (working with) you (20)

Raster vs vector
Raster vs vectorRaster vs vector
Raster vs vector
 
Learn Illustrator
Learn IllustratorLearn Illustrator
Learn Illustrator
 
GJU MM Unit 3.pdf
GJU MM Unit 3.pdfGJU MM Unit 3.pdf
GJU MM Unit 3.pdf
 
P1.1
P1.1 P1.1
P1.1
 
Portfolio Task 5
Portfolio Task 5Portfolio Task 5
Portfolio Task 5
 
Portfolio T
Portfolio TPortfolio T
Portfolio T
 
Portfolio Task 5
Portfolio Task 5Portfolio Task 5
Portfolio Task 5
 
Scct2013 topic 3_graphics
Scct2013 topic 3_graphicsScct2013 topic 3_graphics
Scct2013 topic 3_graphics
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 23: Web Images
Chapter 23: Web ImagesChapter 23: Web Images
Chapter 23: Web Images
 
Chapter Six
Chapter SixChapter Six
Chapter Six
 
Vector tile style editor workshop
Vector tile style editor workshopVector tile style editor workshop
Vector tile style editor workshop
 
Chapter 6 Graphics
Chapter 6 GraphicsChapter 6 Graphics
Chapter 6 Graphics
 
Ace exam guide_photoshop_cs5
Ace exam guide_photoshop_cs5Ace exam guide_photoshop_cs5
Ace exam guide_photoshop_cs5
 
graphics
graphicsgraphics
graphics
 
Photoshop graphic intro ppt by kartik mandothiya
Photoshop graphic intro ppt by kartik mandothiyaPhotoshop graphic intro ppt by kartik mandothiya
Photoshop graphic intro ppt by kartik mandothiya
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Lesson 3 graphics types
Lesson 3  graphics typesLesson 3  graphics types
Lesson 3 graphics types
 
Let there be color! 논문 설명 입니다.
Let there be color! 논문 설명 입니다.Let there be color! 논문 설명 입니다.
Let there be color! 논문 설명 입니다.
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
 

Recently uploaded

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
ankuprajapati0525
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
Kamal Acharya
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
PrashantGoswami42
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
AafreenAbuthahir2
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
karthi keyan
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
DuvanRamosGarzon1
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
SamSarthak3
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
Kamal Acharya
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
Robbie Edward Sayers
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
Jayaprasanna4
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
The role of big data in decision making.
The role of big data in decision making.The role of big data in decision making.
The role of big data in decision making.
 
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfCOLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdf
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
CME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional ElectiveCME397 Surface Engineering- Professional Elective
CME397 Surface Engineering- Professional Elective
 
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSETECHNICAL TRAINING MANUAL   GENERAL FAMILIARIZATION COURSE
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSE
 
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdfAKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
AKS UNIVERSITY Satna Final Year Project By OM Hardaha.pdf
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
ethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.pptethical hacking-mobile hacking methods.ppt
ethical hacking-mobile hacking methods.ppt
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 

Make your designers love (working with) you

  • 1. Make your designers love (working with) you! Vinay Shenoy Software Engineer HomeLane.com
  • 2. • Static Assets exported by designer 1. Reexport for every supported density 2. More assets -> more time 3. Who loves Nine-Patches? • Sharing and organising assets 1. Designer has their own naming and organising preference 2. Developer has to reorganise and rename according to Android format • Iteration is terribly inefficient for image assets 1. Tiniest change in design requires re-export of asset 2. Rename, Restructure, Rebuild 3. Rinse, Repeat
  • 3. Unnecessary work is bad! 1. Backgrounds and Borders using Shape Drawables 2. Textured Backgrounds and Shapes using Bitmap Shaders 3. Custom views
  • 4. Shape Drawables • Single XML file to represent the drawable, scales across densities • Supports multiple basic shapes • Supports solid/stroked shapes • Has basic gradient support • Very useful for border and backgrounds
  • 7. • Solids and Strokes are NOT mutually exclusive. Strokes are drawn on top of the solid • The Size tag in the drawable is not a fixed size. The drawable will expand to fill the View • Can be used in StateListDrawables for visual feedback
  • 12. Image Drawing • Images(especially avatars) often need to be drawn in different shapes • Drawing images of arbitrary shapes can be achieved using Paths and Bitmap Shaders
  • 13. Paths • A collection of geometric constructs(Circles, Rectangles, Lines) that are encapsulated in the Path class • Can be used for drawing and clipping • Can also be used for drawing text • Canvas#drawPath(path, paint) will draw the constructed path with a particular paint object • Path provides shape, paint provides colour
  • 14. Bitmap Shaders • By itself, a Paint object supports a single colour only • A shader can be used to provide spans of colours instead of a single colour when drawing anything on a Canvas • The android framework provides multiple shaders, like LinearGradient which is used in gradient shape which we saw earlier • Bitmap shader allows you to provide colour spans from an image
  • 15.
  • 16. BitmapShader Tile Modes • Control how a Bitmap Shader selects a colour for a pixel if the source bitmap is smaller than the area to be drawn • Three tile modes are available 1. Clamp - The edge colour of the Bitmap is repeated 2. Mirror - The source Bitmap is mirrored 3. Repeat - The source Bitmap is repeated
  • 18. Textured Backgrounds • Full size textured backgrounds will not work because the image will scale on different resolutions and aspect ratios • Creating multiple full size backgrounds adds extra size to the APK and is still not guaranteed to scale well across the entire device spectrum • Bitmap Shaders are extremely helpful to handle this case
  • 19. Textured Backgrounds • All you need is a texture that is created in a specific way, called a seamless, repeatable texture • A seamless, repeatable texture is one that can be placed next to itself and it will appear to be a complete image • A seamless texture + a bitmap shader with Repeat tile mode will handle everything
  • 20. Practical Applications • Rounded corners, so needs multiple densities • Has to accommodate dynamic content so has to be nine-patch • IF we were going the static asset route
  • 21. Custom Drawing • Use a seamless, repeatable texture for the background • Use a Path to create the shape • Use a BitmapShader to draw the path, with the background texture
  • 22. Creating the Shape • We create a Path with two components - The Rounded rectangle and the little triangle in the corner • We also need to set the dimensions of the View, for which we need to know how large the content is • StaticLayout is great for measuring and drawing text
  • 23.
  • 24.
  • 25.