
Explore the tutorial application built in the Android custom views masterclass, clone the GitHub repo, build in Android Studio, and navigate the home screen’s demonstrations and exercises with accompanying solutions.
Explore the scaffold of a custom view by extending the base view class, overriding constructors, and implementing onSizeChanged and onDraw to initialize size-dependent values and render on the canvas.
Explore how Android views use a screen-aligned coordinate system with x and y axes, where each view’s getX and getY are relative to its parent’s origin, not the screen.
Draw a circle in Android Studio with canvas draw circle and a center. Fetch color from colors.xml via context compat and compute center coordinates and radius in size change.
Master the concepts of view positioning in Android custom views, including left, translationX, and x properties, and learn how the layout system and UI post calls affect post-layout updates.
Explore the basics of animations, defined as gradual changes of properties over time, and learn how motion provides visual feedback, ripple effects, progress indicators, and data visualization in Android apps.
Learn to use the Path class to draw custom shapes, such as an equilateral triangle, via moveTo, lineTo, and close, with padding and anti-aliasing for smooth edges.
Practice drawing a green check mark in an Android custom view, then animate it, scaling to fit width or height, calculating vertices from a right triangle, and animating the path.
Build a states progression indicator in a custom view that auto sizes to content, draws bullet points and names with active and inactive colors, and uses invalidate and requestLayout appropriately.
Master rotating elements in Android custom views with matrices by translating to a pivot and applying rotation. Learn that the operation order matters for rotation around the pivot.
Concatenate matrices to perform multiple transformations in one operation with the standard matrices api, and learn to order post scale, post rotate, and post translate.
Explore a solution to exercise nine, implementing a draggable crosshair with fractional positions for save state and restore, and canvas transformations that draw four rotated hairs.
Learn to implement a custom two-finger rotation gesture detector in Android, handling multi-touch pointers, angle calculation, and rotation begin/end callbacks, since Android lacks a built‑in rotation detector.
Design an interactive smiley with matrix transformations enabling drag, scale, and rotate gestures, using scale and rotation gesture detectors, and preserve state across configuration changes and process death.
Master matrix transformations, combining translation, scaling, and rotation into a single matrix with inverse options, and learn gesture detection for taps, long presses, and two-finger scales, rotation requires custom code.
Learn to leverage Custom Android Views to create unique user interfaces that go beyond the standard Android components! From simple shapes to complex interactive widgets with animations, Custom Android Views can accommodate any requirement. There are truly no limits!
Benefits of Custom Views:
Simpler Code: Replace complex XML files and drawables with a single Custom View.
Reusable: Custom View's logic is encapsulated in one class, making it easily reusable in other projects.
Efficient: Creating a custom View can be quicker and more straightforward than working with multiple standard components.
Though a bit challenging at first, creating custom Android Views is not a rocket science. In this course, you'll learn all about Custom Views, from the basics to the most advanced concepts. Furthermore, you'll get a chance to apply your newly acquired knowledge in a set of carefully designed, hands-on exercises.
Topics covered in this course:
Coordinate Systems
Density Independent Pixels
Canvas and Paint
Line, rectangle, circle and free-form shapes
Text
User interactions
Animations
Gestures recognition
Matrix transformations
State preservation on configuration changes and process death
and more
By the end of this course, you'll feel completely confident using custom Views in your Android application.
So, if you want to master this versatile tool that enhances your productivity as an Android developer, enroll now and join me on this journey into the world of Custom Android Views!