by Dmytro Danylyk & William Shakespeare
Dmytro Danylyk - Android Developer, Lemberg Solutions Limited
Big fan of android, flat design, stackoverflow, git, Intellij IDEA. Eclipse IDE hater.
Montague (Developers) and Capulet (Designers) - are involved in a team feud that goes back years before any of the members were born.
ONCE UPON A TIME
Juliet meets Romeo on android project discussion where displaying video must take place.
"To Intent, or not to Intent, that is the question?" - Romeo
"We need a custom..." - Juliet
WHEN TO INTENT?
- when functionality is hard to implement (send email)
- when you need social sharing (facebook, twitter)
- when you don't need extra functionality (play video)
THE TRAGICAL HISTORY OF
THINK WILL WORK
"I forgot to tell..." - Juliet
"We need to make it draggable like in YouTube app"
"We need to display list of videos like in Instagram app"
"Could you remove black lines"
WELCOME TO WORLD OF BLACK PIXELS
WHAT HAPPENS WHEN YOU SCROLL
WHAT HAPPENS WHEN YOU ANIMATE
IF YOU CROP
WHY ARE YOU DOING THIS TO ME?
"Surface view creates a new window, placed behind your application’s window, to manage content."
HOW IT WORKS?
Chestburster design pattern - make a hole in your application to inject extra functionality.
- Unexpected behavior inside scrollable container
- Unexpected behavior with animations
- No way to crop content
WHEN TO USE?
- Play Video
- Stream Camera
- Render OpenGL
WHY TO USE?
"Texture View - does not create a separate window but behaves as a regular view."
"Because it uses hardware accelerated 2D rendering - it is so fast and efficient."
- Android 4.0 APIs
- Hardware Acceleration
VIDEO FROM ASSETS
- Texture View - Intro
- Texture View - Playing video
- Texture View - Video Cropping
TEXTURE VIDEO VIEW
"Texture Video View - is custom view based on android Texture View which gives you ability easily play and crop video.
WHY TO USE?
HOW IT LOOKS?
PREVENT FROM APPEARING IN GOOGLE PLAY
CHECK IF DEVICE HAS CAMERA
CHECK IF CAMERA IS AVAILABLE
LOCK ACTIVITY SCREEN ORIENTATION
CALCULATE PREVIEW SIZE
CHECK IF FEATURE IS AVAILABLE BEFORE USING IT
DON'T LOCK CAMERA FOREVER, YOU ARE NOT ALONE
Q / A
Content Stream - Android Tragedy
By Dmytro Danylyk