Welcome back.
And this video, we're going to start with the start screen or the main activity of our application
of the quiz up.
So let's get started with this empty activity when selecting a new template for the project.
So I'm just going to press next year and I'm going to call this one quiz app.
Everything else can stay the same.
Maybe I should be 21 and then finish.
So let's test this application on our device.
Just to directly see what we already have, so this is the app that we have right now.
And let me turn it around.
As you can see, it's not turning that's great, because that's exactly what I wanted.
I don't want it to turn.
But if you really want to make sure that it's not going to turn, you can go to your Android manifest
and then add a new setting here to your activity.
And when it comes to the screen orientation, you have many different options here.
You can read through them in the documentation.
The one that I want to use is to portray one.
So only the policy orientation will be accepted in my application.
So here, I'll just add a screen orientation setting and I'm going to set out to portray portrait now,
even though it's complaining, I'm still going to leave it as that because it's still going to work
totally fine.
Then I would like to assign a theme here.
And the theme that I want to use is one that I will create myself.
Because I want to have control over the style of this action there at the top.
And how can I do that?
Well, I can go to my values and then there is this style XML file in which I can create different styles.
For example, you can see there is one style already with a dark action bar, and now we can create
a light action bar as well.
So I'm just going to do that.
I'm just going to create a new style here, which I'm going to call.
No action bar scene and its parent is going to be theme thought up compared to what a light.
Thought no action bar.
So this will be the parent theme, so we are going to pretty much use this theme here, but we're going
to adjust it slightly.
OK, so the things that I want to adjust here are the colors.
So as you can see here, there are three colors which are set in there.
And I want to do the same here.
Now, you might wonder why would we even do that?
Well, the thing is, I would like to have no action bar in my main activity.
So here this main activity, our first screen should not have an action bar at the top.
But still, if I use this theme as I define it here, so when I now go ahead and use my no action bar
thing that I just created, which is in my style.
This one here, when I use that, then it still needs the default colors and these are the default colors.
So the color primer will be used from our colors, which in there is also called color primary.
Our color primary dark, which we set for this theme, will be defined in this color color, primary
dark.
So even though the names are duplicative, it's still very important to distinguish.
So in this style, we can define those three colors, but we could choose different colors here for
this particular style.
OK, but we're going to use still the same colors as we would use in a default.
Theme that we have here, but we are going to use to parent, which is to no action bar style, again,
if you still want to have an action bar, then we can go back to our default theme that had a dark action
bar at the top.
So coming back to our manifest, you can see it's complaining here because we need to add a style and
then the no action bar theme, this one here.
That we created ourselves.
And then the next thing that I need to assign here is to add the Windows soft input mode and here I'm
gonna use a just resource.
So what that will do is it will resize our UI so that when the keyboard comes in, so the soft input,
which means the keyboard of Android, when debt comes into play and is visible on the screen, that
our UI will be resized, adjusted and resized so that it still fits on the screen and still looks good
enough so that we can still see where we are actually entering a value.
There are multiple options that you have here, you can see state visible adjust resources and so forth,
so multiple different options and what they pretty much do, how the main window of the activity interacts
with a window containing on screen soft keyboards.
And the setting for does attribute effects to things to the state of the soft keyboard, whether it's
hidden or visible, when the activity becomes the focus of user attention and then the adjustment made
to the activities main window, whether it was resized smaller to make more room for the soft keyboard
or whether its contents pan to make the current focus visible when part of the window is covered by
the soft keyboard.
OK, because sometimes when the part of our activity that is relevant for the user to enter data, for
example, they textfield where he needs to enter something.
So an added text and the soft keyboard is on top of it, then you cannot see what you're typing.
And that's something that we want to avoid.
All right, coming back to our project here, there's one more thing that I would like to set up for
this video, and that's going to be our gradle.
So in our great Allscripts here on the built gradle in the module lab, that's where I want to add another
dependancy.
So I want to use the dependency of Google, which is the material design.
So here I'm going to add implementation
apostrophe come dot, Google dot, Android dot material, Colen material.
Kolon 1.0, dot zero.
All right, so this is what we need in here, and once you enter and you dependancy, what you need
to do is you need to think now.
So this feature here with the dependencies is a pretty powerful tool.
So we are adjusting our gradle and it will then download necessary dependencies and the necessary code,
so to speak, that we can then reuse.
So it's going to download libraries for us, which we then can use.
And in this case, we're going to use the Android Material Design Library.
All right.
So that's just a preparation for the next video in which we are going to then set up the whole style
of this activity, main XML file, because currently the only thing that we see in here is does have
a world text view.
And I would, of course, like to change that and create a beautiful screen in here.
All right.
So see you in the next video.