YouSub
Untitled

en English

Untitled English subtitles

0 downloads · 81 lines · added Nov 7, 2015

Report a problem
What's wrong?
Advertisement

English transcript

The documentation for Android, it's on a site called developer.android.com.
It contains a lot of helpful information, such as code samples,
tutorials and articles.
You can think of it as an instruction manual for how to build apps.
I use this site daily, and often times I get to it using a Google search.
I'll show you what I mean.
Let's look at the documentation for text view.
So I search for textview android.
The top link that comes up is a developer.android.com site, so
I click on that.
This is what we call the reference documentation for TextView.
I know there's a lot of information on this page and it can be overwhelming.
But usually when you're looking at reference documentation,
you're trying to solve a specific problem.
So you can actually filter out all the unnecessary information
that you don't need.
When I come to this page I check that it is indeed for TextView.
I may read the class overview, and then I can scroll down.
This is the interesting part.
It lists out the XML attributes.
These are all the possible XML attributes for TextView.
It also includes a nice description on the right-hand side for what it does.
Now you don't need to memorize all of these attributes.
In fact, I haven't used some of them.
I usually work with a small subset of them on a regular basis.
But I know that if I ever need something special, I can always come to
the TextView documentation to find that specific attribute.
Here's one that we recognize.
Android:textSize.
So we click on it, and it links to the description of this attribute.
It says that this controls the size of the text.
And the recommended dimension type for text is sp for
scaled pixels, for example, 15sp.
Cool, so we learned this earlier.
And if you ever forget you can always come back to the TextView documentation
and look up what the attribute is.
Now say for example I don't know what the exact name is.
In your web browser you can use the find feature to search the page.
The other way to open up this Find window is to use Cmd+F on Mac, or
Ctrl+F on Windows.
Then I can type in what I'm looking for.
Say, for example, I'm looking for
a way to capitalize all the letters in a TextView.
This might be useful for example, if I'm trying to show tabs like this, or
if I'm creating a snack bar at the bottom of the screen,
like this UNDO text here is in all caps.
Buttons are also in all caps.
Going back to the TextView documentation, I can search for caps.
I can browse through all the search results, but these look pretty good.
It says that there's an XML attribute called android:textAllCaps, and
this description says to present the text in all caps.
If I click on it and read the description,
it sounds like what I'm looking for, and it says the possible values for
this attribute are either true or false.
So I can try this out in code now.
So going back to the XML Visualizer, say I have this TextView on screen and
I want to change it to be all caps.
According to the documentation, I can add an attribute here that says
android:textAllCaps, and then I can set it to be true or false.
If I set it to true then look, it's all in caps, cool.
The nice thing about this attribute is that I don't have to go and
change the text.
Like, oh the possibilities, and capitalize everything.
Instead I can leave the text as is, and all I need to
do is just toggle this attribute to change it from true to false.
Now, it's your turn to practice.
Being able to look at documentation and then update your code accordingly to try
it out, is a really useful skill to have.
That means you don't have to memorize everything you could possibly ever want
to do in Android.
It's only a Google search away and you can find it when you need it.
So first, I want you to Google search for
textview android to find the reference documentation for TextView.
Then I want you to use the Find feature in your web browser to search the page
for the XML attribute that makes the TextView text bold or italic.
We haven't covered this XML attribute before, so this is an opportunity for
you to learn it on you own.
Once you find something that might work, go ahead and try to use it.
If that doesn't work then no problem at all.
Just keep going back to the documentation until you find the one
that works.

Need subtitles from another video?