Book Image

Building Android UIs with Custom Views

By : Raimon Ràfols Montane
Book Image

Building Android UIs with Custom Views

By: Raimon Ràfols Montane

Overview of this book

To build great user interfaces for your Android apps that go beyond the standard UI elements, you need to use custom Android views. With these, you can give your app a distinctive look and ensure that it functions properly across multiple devices. This book will help you construct a great UI for your apps by teaching you how to create custom Android views. You will start by creating your first Android custom view and go through the design considerations. You will then see how the right choices will enable your custom view to perform seamlessly across multiple platforms and Android versions. You will create custom styleable attributes that work with Android XML layouts, learn to process touch events, define custom attributes, and add properties and events to them. By the end of this book, you will be able to create apps with custom views that are responsive and adaptable to make your app distinctive and an instant hit with its users.
Table of Contents (12 chapters)

What this book covers

Chapter 1, Getting Started, explains what custom views are and when we need them, and shows you how to build your first custom view.

Chapter 2, Implementing Your First Custom View, covers in more details about measurement, instantiating, parameterizing, and some basic rendering to start getting a feeling for what we can do with custom views.

Chapter 3, Handling Events, shows the reader how to make a custom view interactive and react to user interactions.

Chapter 4, Advanced 2D Rendering, adds additional rendering primitives and operations and how to combine them to build more complex custom views.

Chapter 5, Introducing 3D Custom Views, as we are not only limited to 2D rendering, this chapter introduces how we can use OpenGL ES to render custom Views in 3D.

Chapter 6, Animations, covers how to add animations to custom views, both by using standard Android components and by doing it ourselves.

Chapter 7, Performance Considerations, exposes some recommendations and best practices when building a custom view and what the impact of not following them could be.

Chapter 8, Sharing Our Custom View, covers how to package and share our custom view and make it publicly available.

Chapter 9, Implementing Your Own EPG, shows how to build a more complex example of a custom view by combining many of the things we’ve seen in the book.

Chapter 10, Building a Charts Component, shows in detail how to build a chart custom view and make it customizable step by step.

Chapter 11, Creating a 3D Spinning Wheel Menu, covers how to build a more complex 3D custom view that can be used as a selection menu.