-
Title:
Views
-
Description:
-
Step one is about picking
the views that you want to use.
-
First I should explain what
exactly a view an Android is.
-
Simply put, a view is a rectangle on
the screen that shows some content.
-
It can be an image,
a piece of text or a button or
-
anything else that the app can display.
-
Now these individual views make up
what we call the layout of the screen.
-
Everything about what you see and
-
interact with in your app is called
the user interface, or UI for short.
-
There are different types of
views with different names.
-
A view that shows some
text is called a TextView.
-
Here are some examples.
-
A view that shows an image is called an
ImageView, and these are some examples.
-
A view that shows a button is called,
well, a Button.
-
These are some examples.
-
Now, there are many other types of views
in Android which are really helpful to
-
use, but we're going to
focus on these three first.
-
Earlier I mentioned that every
view is a rectangle on the screen,
-
but where are all the rectangles?
-
Well, technically they're invisible,
but I will draw them for you so
-
you can see where the bounds
of each rectangle is.
-
As you can see,
-
every app can be broken down into
the individual view that make it up.
-
In other words, a view is the basic
building block that you use
-
to build up the layout for your app.
-
To help you understand the idea of
views being rectangles on a screen,
-
here's a situation you may
be more familiar with.
-
If you ever use an application
like paint or Google drawings
-
then you may have added a text box to
the canvas, then you type in your text.
-
If you click outside of it though,
-
you don't see the bounds of
the rectangle but they are there.
-
And bounds actually do start
to matter when you start to
-
do things like adding
a background color or
-
adding a border around it then it
does matter how big the rectangle is.
-
I also want to point out that the format
of these view names is in camel case.
-
Camel case means that there are no
spaces in-between words, and
-
the beginning of each
word is capitalized.
-
The reason why it's called
camel case is because
-
the outline of the word goes up and
down like the humps of a camel's back.
-
You're going to be seeing camel
case more throughout this course.
-
Okay, let's practice what you learned.
-
This is a screen shot of the new
email app from Google, called Inbox.
-
Can you identify the different
types of views here?
-
To help you,
I've highlighted the individual views.
-
For example for A,
-
can you tell me if it's a TextView,
an ImageView, or a Button.
-
Do the same for B,
as well as the rest of the views.