And here I need to actually be called a Meffert on this.
I am just so each other object so.
So here I can just say I am just the future Dadds said factory.
OK.
And here we need to actually putting up defectively.
OK.
The class that actually is a factory blanks.
OK.
So we need to actually put in the context here.
So main activity got this OK.
It is actually like the uncle listener interface.
OK.
So here at the top here we need to actually implement these of this of your factory interface so here
I can just type in view switcher OK DOD's view factory.
So here we are.
Actually you want to implement this of your factory interface.
And if I actually hover my mouse pointer over the edge of the area it says class activity must either
be declared abstract or implement abstract.
If it makes you in view effectively so as you can see here we need to actually implement this.
Make sure you abstract perfet.
OK we need to implement this method here.
And as you can see here this is our fifth and let's actually delete this line of code here and then
we can actually put our own implementations in say the Smurfit So as you can see here this method actually
returns an object of type view.
OK.
So now inside of these Smurfette I'm going actually 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 these are the lines of code that they actually paste that here.
OK.
So first of all in line of THIRTY-NINE I created an object of type image view and the name of this object
is I enjoy a view and here as you can see I am actually instantiating this object and in say The Apprentice's
I am putting the actually to put the context OK.
And here in line are 40.
I actually said this type of these are image view.
OK I give you that cityscape scale type image view that scale type that fits underline Ex-White.
OK.
You can actually put in other values too.
So if actually did it is that you can actually put these values here.
OK.
And as you can see here here I am actually sitting out part of this image view as you can see here.
We want to actually set the image view of it and the image view height.
OK.
So I image of you that set sets out prompts me you so because our image views are going to be inside
this image switcher.
OK.
Here we need to actually live within this class new image Swisher's that out poems.
And here I want to actually put in the value of content.
OK.
View group layouts perhaps that wraps content you can actually change the value to other value.
For example I can't delete this and if I actually put this data here I can actually choose.
Match parent OK or feel padded but I prefer this lack of content.
And here as you can see this is the value for the Wii.
OK.
DVDs of our image.
And here we have this wrapped content for a height of this image.
Ok for the height of this image view.
And now here we are actually returning this image view as you can see image view is actually a subclass
of view.
So we can actually written this image view.
And let's actually go back and say This creates Mefford and now I want to actually put in some lines
of code here.
But first let's actually create a method inside our class here.
OK so I'm gonna paste this method here and then I'm going to explain to you what's going on here.
So as you can see here this is Armathwaite and the name of this method is let's set layout prompts for
image view.
So let's actually change this letter to chapiter letter P.
OK let's lay out perhaps for image view image view and here inside the method as you can see I am setting
the image view as you can see this image is the argument.
OK image view that set layout perhaps.
So here I want to actually specify the beach and the height of my image view.
OK.
New linearly out OK.
So if my view is actually inside it linearly out then we can actually specify the beats which is 1000
and the height 1000 OK.
So here inside is uncreate benefit.
Now I'm going to paste in some lines of code here and then I'm going to explain to you what's going
on here.
So as you can see here these are the lines of code that they actually paste that here inside this uncreate
method.
So first of all I actually create a for loop.
OK.
And here inside the apprentice's I created a body of type integer and the name of this variable is indexed
and I assigned a value 0 to this variable.
And here I actually created a condition which determines how many times this fruit loop is going to
be executed.
So until the value of the index value is less than the value of the length of this animal images array
that is inside of this animal class then this loop is going to be you Ted.
And here it says that after each execution of this for loop the value of this Nixzmary is going to be
incremented by 1.
So he had to be created a constant.
OK.
Final int the name of this constant is I.
And then I assigned the value of this index of idea about to this I here and here we are actually creating
an image view.
So Image view image view and here SPC I specify that our context of our application and and here I want
to actually to set the image to this image view so animal that animate images.
Index.
OK.
And then here you are actually doing the we are actually specifying the layout actually to the image
and the image height of our image view as you can see here.
So as you can see inside this content underline made that example we have this linearly out horizontal
here.
OK so if you're going to actually put this are put our images inside this linearly and horizontal and
inside the main activity that of file here as you can see is Smurfette here as you can see of you are
actually specifying the image view and the image view height.
OK.
So as you can see here I put this new keyboard linearly out.
That leads to problems.
So because our images are going to be inside this linear inside these linearly out here as you can see
here we needed to actually inside this Mefford.
Let's lay out perhaps for you here we needed to put this linearly out here.
OK.
Linear layout that lay out the bottoms.
Okay.
And then here as you can see of you have these Meffert as you can see here.
And I assigned these image view to these lists that lay out perhaps for image view.
I actually felt this image view and then here I am setting the pattern for this image view 100 for the
left 100 for the top 100 for the right and 100 for the bottom.
And then here I am making this image view and unclick listener.
OK.
So this really is going to actually listen to the clicks of the user.
OK so you got to listen a new view that unclick listener and he had as you can see I am actually creating
an anonymous class that actually implements this article listener interface so that you can see these
are Mfat here.
So it's to actually implement this method here.
And inside this method I actually fit to this image switcher.
So inside this content underlayment at XM and as you can see if you have this image switcher I am just
inside this linearly out vertical here.
OK so I referred to the object.
I am just switch to set image resource.
OK animal that animal images.
OK so whenever the user clicks on the actually on this image as you can see here we have these images.
So whenever the user clicks on this image as you can see we can see this image here.
So here we have this image switcher and the images are going to be in sight and the images are actually
going to be assigned to this image image switcher here.
OK.
So again if I click on this image now we can see this image inside this image switcher.
OK.
And so I have to say I am just had that set image resource animal.
That animal is just an animal images some index as you can see here.
So animal that animal images some of it.
And he actually created a post here as you can see.
So let me actually create a new line here and then you can see these values better.
So toast that text and here for the first argument I actually specified the context of our activity.
Main activity that this.
And he had this is the text that is going to be to be shown to the user.
This is our Plus animal names.
As you can see here and here this is the duration of the taste that is going to be shown to the user
data show.
OK so now as you can see after this so thanklessness and a Meffert as you can see here we have these
linearly out horizontal.
So here I referred to this linearly out here as you can see inside this content underline minute example
if you have this linearly out here in say this horizontal scroll view.
OK.
So linearly out horizontal that's at view image view.
OK so now you are actually adding this image is linearly out horizontal.
OK so now let's actually run our project and see what happens.