Book Image

Xamarin Blueprints

By : Michael Williams
Book Image

Xamarin Blueprints

By: Michael Williams

Overview of this book

Do you want to create powerful, efficient, and independent apps from scratch that will leverage the Xamarin framework and code with C#? Well, look no further; you’ve come to the right place! This is a learn-as-you-build practical guide to building eight full-fledged applications using Xamarin.Forms, Xamarin Android, and Xamarin iOS. Each chapter includes a project, takes you through the process of building applications (such as a gallery Application, a text-to-speech service app, a GPS locator app, and a stock market app), and will show you how to deploy the application’s source code to a Google Cloud Source Repository. Other practical projects include a chat and a media-editing app, as well as other examples fit to adorn any developer’s utility belt. In the course of building applications, this book will teach you how to design and prototype professional-grade applications implementing performance and security considerations.
Table of Contents (14 chapters)
Xamarin Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Xamarin.Forms animations


Xamarin.Forms has multiple functions for animating views. We have access to the following functions:

  • FadeTo: This is used to animate opacity (that is, fade in/out).

  • RotateTo: This is used to animate rotations.

  • ScaleTo: This is used to animate size.

  • TranslateTo: This is used to animate (x, y) positions.

  • LayoutTo: This is used to animate x, y, width, and height.

Tip

Stay away from the LayoutTo function. Jason Smith (the creator of Xamarin.Forms) recommends you stick with the TranslateTo instead. The issue with LayoutTo is the parent of the view you are calling LayoutTo on will not be aware of the translation/resize that happened and will simply overwrite it at the next layout cycle (like when you rotate the device). This is because LayoutTo is calling the same method Layouts call to position children.

We are now going to use a few of these animation functions to animate our target image when a use touches to focus. The AnimateFocalTarget function will be responsible for performing...