YouSub
Untitled

en English

Untitled English subtitles

0 downloads · 66 lines · added Nov 12, 2015

Report a problem
What's wrong?
Advertisement

English transcript

Okay, so at this point we've got our drawing or layout.
We've identified the views, and we've started our thoughts of positioning by
picking a relative layout as our view group.
This is a great time to start coding.
Okay, so what I have opened here is the code that we were working on before,
which is activity_main.xml located in the layout folder.
Now it's first creating the views.
We already have about half of the work done.
We have a relative layout and
we have one text view that says Happy Birthday Ben.
To get all of the views you need your going to make an image view.
You're also going to make one additional text view.
Adding the additional text view should be pretty easy.
The image view requires a little bit more work because you actually
need that Android part of your picture.
In the instructor notes, we've included a link to that picture so
that you can download it.
Okay, so I've downloaded the picture and I've saved it to my desktop.
It's saved as androidparty.jpg.
Now you might recall before when we added images our XML, we
said that we'd saved them in a folder on the computer called the drawable folder.
Also remember how our app has a bunch of files and folders associated with it,
which we can see in the directory structure on the left.
These include layouts, pictures, sometimes music, and so on.
A lot of these types of files are going to be housed in the res directory,
which is short for resources.
The res directory contains sub-directories for all the image,
text, layout, and other resources the app might need.
And as we said, for images, there's this folder called drawable.
For this app, all images should be placed inside of the drawable folder.
Once you've put the image into the drawable folder,
you can use the source attribute of an image view,
and give it the value @drawable and then the name of the image.
Note, when you're writing the image name you do not need to add
the file extension.
Okay, so now I'm going to show you how to actually put a picture into
the drawable folder.
Okay. This image is in the Instructor Notes.
Go ahead and download it to your Desktop.
Next, I want you to open Android Studio.
In Android Studio, you can go over here and Right-click the Drawable folder.
>From there, you should see something that says reveal in finder or
reveal in explorer.
Here I can see the Drawable folder.
So right now I'm going to move the androidparty.jpg
into the drawable folder and I'm just going to do that by dragging it over.
Okay so make sure you're starting with the correct XML code.
And if you don't have the correct code, you can go ahead and copy and
paste it from the instructor notes.
All right, first things first, download androidparty.jpg.
Then take androidparty.jpg and move it to the drawable folder.
Once that's done, go ahead and add the TextView that says,
from and then your name.
And after that, add the ImageView with the source attribute as android party.
There's actually a lot of default padding
in the code that you're working with.
So you can go ahead and delete that.
What do I mean by default padding?
Well, it's this paddingBottom, paddingLeft, paddingRight, and
paddingTop.
You can go ahead, And just delete it.
Finally, click the green arrow to run the app on your phone.
When you've finished all of these steps, your app should look like this.
Note, it's a little bit hard to see on this screen, but
the text views are actually overlapping.
That's completely normal and something that we're going to deal with next.

Need subtitles from another video?