Book Image

Mastering Xamarin UI Development

By : Steven F. Daniel
Book Image

Mastering Xamarin UI Development

By: Steven F. Daniel

Overview of this book

<p>Xamarin is the most powerful cross-platform mobile development framework. If you are interested in creating stunning user interfaces for the iOS and Android mobile platforms using the power of Xamarin and Xamarin.Forms, then this is your ticket.</p> <p>This book will provide you the practical skills required to develop real-world Xamarin applications. You will learn how to implement UI structures and layouts, create customized elements, and write C# scripts to customize layouts. You will create UI layouts from scratch so that you can tweak and customize a given UI layout to suit your needs by using Data Templates.</p> <p>Moving on, you will use third-party libraries – such as the Razor template engine that allows you to create your own HTML5 templates within the Xamarin environment – to build a book library Hybrid solution that uses the SQLite.Net library to store, update, retrieve, and delete information within a SQLite local database. You’ll also implement key data-binding techniques that will make your user interfaces dynamic, and create personalized animations and visual effects within your user interfaces using Custom Renderers and the PlatformEffects API to customize and change the appearance of control elements.</p> <p>At the end of this book, you will test your application UI for robust and consistent behavior and then explore techniques to deploy to different platforms.</p>
Table of Contents (19 chapters)
Mastering Xamarin UI Development
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Customer Feedback
Dedication
Preface

Creating PlatformEffects using the Effects API for the Android platform


In this section, we will build the Android portion of our PlatformEffects that will allow us to customize the appearance of Xamarin.Forms control elements just like we did for the iOS portion, and we will be implementing the same PlatformEffects--LabelShadow and ButtonShadow to show you how these implementations differ on each platform, even though the resulting rendering is the same.

Let's take a look at how we can achieve this, by following the steps:

  1. Create a new folder within the TrackMyWalks.Droid project, called PlatformEffects.

  2. Next, create an empty class within the PlatformEffects folder for our TrackMyWalks.Droid project.

  3. Then, enter ButtonShadowEffect as the name of the new class file to create, ensure that the ButtonShadowEffect.cs file is displayed within the code editor, and enter the following code snippet:

            // 
            //  ButtonShadowEffect.cs 
            //  TrackMyWalks Button Shadow Effect...