Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building Android UIs with Custom Views

You're reading from   Building Android UIs with Custom Views Build amazing custom user interfaces with Android custom views

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781785882869
Length 294 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Raimon Ràfols Montane Raimon Ràfols Montane
Author Profile Icon Raimon Ràfols Montane
Raimon Ràfols Montane
Arrow right icon
View More author details
Toc

Drawing operations

As we've just mentioned, we have already seen and used some drawing operations, but that was only the envelope of what's inside. We'll see new drawing operations and how to combine them.

Bitmaps

Let's start by drawing bitmaps or images. Instead of having a white background, we'll use an image as background for our custom view. Using the source code from our previous example, we could do some very simple modifications to draw an image:

First, let's define a Bitmap object that will hold a reference to the image:

private Bitmap backgroundBitmap; 

To start, let's initialize it with the application icon we already have on our application:

public CircularActivityIndicator(Context...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image