YouSub
Untitled

en English

Untitled English subtitles

0 downloads · 67 lines · added Nov 7, 2015

Report a problem
What's wrong?
Advertisement

English transcript

If you haven't already noticed, the text is kind of tiny on this device screen.
I mean, my eyesight is terrible, so I really need it to be a lot bigger.
Luckily for us,
there is an attribute that we can declare to change the text size.
Oh, but wait there is an error down here.
It says the computer wasn't able to understand my XML.
Double checking the code I see this new line that we added is actually appearing
in black font, whereas everything above has blue for
the attribute name and red for the attribute value.
So there's something wrong with this line.
Oh wait, I see it now.
Forward slash in the closing angle bracket are on this side up here.
This is actually a common beginner mistake to add the attribute
after the tack has been closed.
Technically, this is hanging out in XML limbo or
something because it's not tied to an XML element.
What we really want is to copy these symbols and move them down here.
That's better.
There's no error, and this is valid XML, and then our font is bigger.
Woo hoo!
It's much more readable now.
Note how the text size is set to be 45 sp.
Sp stands for scale independent pixels.
It is a unit of measure similar to dp which makes the app look
consistent across different devices of different densities.
Sp is only used for fonts because it adjusts based on the user's
preferences and settings for text size.
Let's look at that now.
Let me show you where the setting is.
Go to the settings app, then tap on display, and there's an option for
font size.
If you click on that, you can see the different font sizes.
If I click on huge, and it increases the font size of everything.
So always use sp to declare your font sizes so it will scale up or
down according to the user's preference.
In a moment you'll change the text size of the text view.
However, I first wanted to show you one thing.
This is the material design spec.
Material design is a new design language developed by Google
to help people create consistent and
beautiful apps across different devices and platforms, like web and mobile.
The design specification, or design specs for
short, highlights the best practices for designing your app.
It provides guidance on the layout of your app, visual style, imagery,
animations, and much more.
There's also a section on typography, or fonts.
It lists a whole bunch of information here that you can read later.
But the most important thing is this guide here,
that talks about the recommended text sizes.
If you're displaying a really big header,
you can use some of these text size values.
If you're trying to do a title or some body text or a caption,
you can use some of these sizes.
This will help guide you on what types values you can pick depending on what
your use case is.
But be careful, because if you pick too many type sizes or
styles in your app, it can be very overwhelming for the user.
So just pick a couple of styles to display the information that you want.
When you change the text size for
the TextView, try a couple of these values here.
Go ahead and change the TextView font size using the material design spec.
And then if you're up for
a challenge, you can try learning about the text appearance attribute
from the Google+ Android Dev Protip that I've posted below.
And then you can try this in the XML Visualizer as well.
The link to the XML Visualizer with the code for
you to get started is linked below.

Need subtitles from another video?