In this theater we're going to go ahead and create another Android application.
So just click on this.
Start in your Android studio project and for the application name just type in your app 58 next and
he has choose AP 16 Android 4.1 Dehli been for a minimum STK and then click on next.
And here choose Blanche activity next and then click on finish.
So now let's actually select this hello world takes here and then press on delete key on your keyboard.
And let's actually double click on these arrests for that layout and then double click and this activity
underline made that example.
And then here are selectees floating action button.
And then presently here on your keyboard.
So now it's actually double click and this content underline mentalism and tap here in order to make
this area wider.
So now we can actually designed to use an interface of our application.
But first of all let me ask you to show you that more of the application that you want to create in
this tutorial.
So this is our application and here as you can see I actually have an image switcher inside this layout.
And here I can actually scroll to the left in order to actually the images as you can see here.
And if I actually click on this image now I can see the images at the bottom.
OK.
But as you can see we can see some animation effects here.
If I click on this image here now you can see that there is a there is an extra The animation effect
here.
And I want to actually show you how we can actually use animation effects in your application.
OK so if I click on this image view here now as you can see our previous image will fade out OK.
And this image that is going to be our inside of this image view is actually fading.
OK.
So that's the animation effect that we want to actually create in this application.
OK so now if I click on this image now that image that now I can actually scroll down to see the other
image.
So let me actually click on this image.
Now this that previous image faded out.
OK so now let's actually go back to our content underlined in that example.
So now let's actually write our linearly out vertical into this relatively out here.
So just select is linearly out vertical and put it at the center of this relatively out here.
And then let's actually drag our scroll you are vertical scroll you into These are linearly out vertical.
So just select this scroll view these vertical scroll view that is inside of these containers folder
and put it inside.
These are linearly out vertical here.
OK so just put it at the center of this linearly reticle and then actually direct and either linearly
as we have to call into this scroll view here.
OK and now let's actually put our user interface components into this linearly Ellsworthy call that
is inside of this scroll view OK.
So first of all let's actually track a horizontal scroll view inside these linearly out 20 call.
OK.
So inside these containers fall there.
If you have these a horizontal scroll view.
So just put it inside this linearly outwards to call here.
And then let's actually drag up a horizontal linearly out as you can see these linearly or horizontally
into these horizontal scroll view.
OK so now I want these are linearly out horizontal as you can see here that is inside of this horizontal
scroll you.
I want these a horizontal scroll view to be at the center of the screen.
OK.
So here first of all it's actually to select this vertical scroll view as you can see the layout of
this scroll is Metropolit.
So just change this to wrap content.
OK let's actually change the layout height of this scroll.
As you can see here.
So just change it to wrap content.
OK.
So it can actually wrap the content of its child OK of its children.
So now let's actually click on this linearly Ellsworthy Karl.
OK.
So as you can see here we have a gravity attribute.
So just open this gravity attribute and then check it is a center check box here.
OK.
And then you have this linearly out vertical here.
OK.
Select it.
And as you can see here we have this our gravity attribute here.
OK.
So just so just check these centers take a box here.
OK.
And now as you can see this scroll view as you can see here is at the center of this screen.
OK.
And as you can see here it's choice which is this linearly or vertical.
It is also at the center.
And we have this horizontal scroll view that is inside of this linearly as well as the code.
It is also at the center of the screen.
OK.
And this is as you can see here this linearly or horizontal is actually at the center of just because
it is a child of these horizontal you OK.
So now let's actually go inside these experts for that as you can see here we have these experts there.
And inside this folder we have this image switcher.
OK.
So just selected OK and put it inside this linearly out vertical here.
OK so this is our image switcher.
OK.
Now let's actually find the ID attribute.
So for the ID just type in here I m g switcher.
Sweet chip.
And then press enter key on your keyboard.
OK so now let's actually go inside this main activity that double file here and this actually did it.
Are these lines of code that are related to the Options menu and then Adelaida this block of code that
is related to the floating action button.
So here are let's actually create a class called animal.
So click on file name and then click on Dobber class.
So for the class name just type in here and command and then click on.
OK.
So now I want to actually put some images into my project.
So as you can see here we have this triable folder and these are my images.
I just need to copy these images OK and then paste them inside this tribal folder.
And as it gets here you have these images here.
OK.
So now our inside is Animal class.
I want to actually put in some lines of code here.
OK so now I'm going to paste in some lines of code here.
So as you can see here these are two arrows.
OK animal images as you can see we have an array of integer values.
And this area is static.
OK so we can actually access these animal images at that's creating an object from this animal class.
And if you have another at a here animal names and this is also static.
OK.
So let's actually go back and say this main activity that java file here and now inside this class let's
actually putting some lines of code here.
So inside of this main activity class I'm pasting some lines of code and then I'm going to explain to
you what's going on here.
So as you can see here I actually pasted these lines of code here.
The first one is actually of type linearly out as you can see I created an object of type linearly out
and the name of this object is linearly out horizontal and the second object is of type or image switcher
and the name of this object is IMJ so each are OK.
So now let's actually go back and say this content underline line that example and here are selectees
linearly at horizontal.
That is insane.
Inside of this horizontal scroll view.
OK select this linearly or horizontal and actually find the ID attributes.
So as you can see here we have this id attribute here that is related to this linearly out horizontal.
So for the ID to step in here a linear layout horizontal OK.
And then our prison enter here on your keyboard.
So here I need to put in our capital letter H.
Ok linearly out horizontal and then press on until key on your keyboard.
OK so now let's you go back and say this main activity that.
And here I want to actually instantiate these two objects that they actually declared inside this main
activity class.
So here I can just type in linearly out horizontal.
Assignment operator and here I need to actually cast this object to linearly out object as you can see
here linearly out find the by ID that Id dots linearly out horizontal and then I need to put in a semi-colon
at the end of my statement and then I need to actually instantiate this.
I am just twitcher object that you declared in line 12.
So here I need to refer to the name of that object.
I just do it for assignment operator and then here I need to actually cast this object to an image switch
an object.
So Image switcher.
Ok find view by ID or that ID that I am the switcher.
So in order to use this I am just to each an object that is of type image each.
We need to actually implement the view factory interface.
Ok so what is this new factory.
So as you can see here in Android documentation you can actually put in this you are in your browser
and then you will be guided to this page.
And as you can see here if you have an interface called view switch that view factory OK.
And as you can see here this is actually an interface.
OK.
And here as you can see it says it creates views in a view suture.
OK.
So in order to use the image switcher in order to use the image of you switcher we need to actually
implement this view factory or this interface.
OK.
Because it actually creates views in a view switcher and an image we use which is actually a subclass
of these views to each other.
OK you switch the class.
So now as you can see this is the abstract method that we need to actually implement in our class view
it creates a new value to be added interviews to each other.
OK so now let's actually to go back to our Andrex studio of Iepe.