Building the FocusView
The FocusView
is going to be used as an overlay view with a target image for touching focus points. This will be a CustomRenderer
as we have to use native libraries for retrieving specific (x, y) coordinates on touch points.
Start with adding a new file into the Controls
folder called FocusView.cs
and implement the following:
public sealed class FocusView : RelativeLayout { #region Constant Properties const int IMG_TARGET_BOUND = 100; #endregion #region Private Properties private bool _isAnimating; private bool _startingPointsAssigned; private readonly CustomImage _focalTarget; private Point _pStartingOrientation; private Point _pFlippedOrientation; #endregion #region Public Events public event EventHandler<Point> TouchFocus; ...
Get Xamarin Blueprints now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.