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; #endregion }
The first part we see here are two Point
objects for specific (x, y) coordinates...