So it's actually to go back and say to me an activity that I will fight here and as you can see I actually
instantiated this object in 9:19.
So now it's actually to create a class called al-Ahmad.
OK so just click on this find new and then click on double class.
So here for the name of your class just type in here and on and then click on OK.
So here I want to actually put in the variables or the misfits that are only specific to these Animal
class.
So now let's actually track some images into our project.
OK.
So here as you can see we have these tribal folder inside of his folder here so I can just copy these
images that are on my desktop.
OK.
And then I can just select is triable for that.
And then I can just paste them here and then click on OK.
OK.
So now I have these images and here I want to actually put in 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 pasted inside of this Animal class.
Ok so first of all I actually created an alley of integer values animal images and I actually declared
this at a as an aesthetic value.
So as you can see here the reason that I actually put this static keyboard here is that I can actually
access these variables these arrays without creating an object from this animal class.
So for example inside this main activity the java file if you want to actually access these are animal
images.
Arii I can access that array by just referring to this animal class that animal image is OK without
creating an object from the Animal class.
So that's the reason that I actually put that static keyboard here.
OK.
So this is very important.
And here I created an array of integer values as you can see animal images.
And these are the ideas of the resources of my images in our application.
In our project as you can see these are the images inside the tribal folder and these are the animal
names.
Ari this is the type of these are a string.
And we can see these values.
And again this is static.
OK.
So I can access these areas without creating an object from this animal class.
OK so now let's actually create another class called Galili adapter.
OK.
So I just need to click on this file new and then click on Java class.
So here for the name of your class just type in here a gallery adapter and then click on OK.
So here as you can see inside these jobs there you have these classes here.
OK.
So I just need to double click on the tab so that this area this editor area is now much wider.
So now if we want to actually implement the gallery in our project we need to actually to extend from
the base adapter class.
OK so base adapter.
Here as you can see of we need to actually implement the right the actually the inherited methods that
you actually inherit from these spaces after class.
So here Argenta us right clicking is Gallery.
After our class generates.
OK.
And then we can implement MFX.
So as you can see here these are the methods that we that we need to actually implement in our gallery
after class.
OK.
So I just need to click on OK.
And these are the methods.
OK so first let's actually put in some lines of code here and then we can actually go go ahead and putting
our own implementations inside of these methods.
So inside of this gallery adapter class let's actually declare an instance variable context OK context
semicolon.
And here I need to actually create a constructor for this Galeria after class so I can just type in
public.
OK.
And the name of my constructor must be the same as the name of my class Galeria adapter.
And here inside Apprentice's I can just typing Kunst context.
OK context.
OK.
And I need to actually open the open and close this constructor by using the curly braces.
So here I need to actually initialize my context that actually created in inline 40.
Ok so I can't just refer to the name of this context.
So as you can see here as I actually typed in context this context actually refers to this context argument.
OK so here I just need to put in these dots Cuber.
OK this that context.
Now it is actually referring to this instance variable.
Ok this is the context assignment operator context.
OK.
So hopefully that makes sense.
And now let's actually put in our own implementations inside these it misfits.
OK.
So as you can see here this is the Get count counterfeit.
OK.
And here we need to actually return the number of elements that are actually inside our at.
So as you can see here inside of this gallery or after class we don't have any Arey here and we actually
declared our arrays inside of these animal class.
OK.
And these arrays are actually declared static.
So we can actually use these areas without creating an object.
OK.
From these animal class.
So inside this gallery after class here for this I get counter benefit.
I can just refer to the name of this animal class animal.
OK.
That's our animal images thought Lynn.
OK.
So now I am actually returning the length of these animal images.
Aure OK.
And here we need to actually return.
Are there specific objects that are actually inside of or for example this Ari.
OK.
So for this get item Meffert I can actually do return to this animal class that animal images Suppe
position.
OK.
And here we need to actually turn the ID of odd objects.
So the idea would be that position OK the index of the indexes that are actually inside of our array.
For example this anyone who may.
And here we need to actually put in our own implementation inside of this Gates view method.
OK.
So let's actually change these arguments name to view.
And now I'm going to actually pasting 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 pasted here.
So first about in 9:43 I created an image view object.
OK.
And then here I specify the context for this constructed of this image view and in line of 44 I actually
called our method on this image.
So I interviewed that set image resource.
OK.
So I want to actually set up an image to this image view animal that animal images are supposition.
OK.
So here it's going to be assigned those images to this image view and then in line forty five as you
can see IMJ view that set level perhaps.
So here I want to actually specify the width and height of my images inside the actually inside the
Gelati.
OK so I'll give you that certainly and perhaps an inside the apprentice's new as you can see I put this
new viewport gallery.
So because my images are going to be inside the gelati I need to refer to this gallery here.
This is the parent.
OK.
This is the Pallant of my image views that lay out the palms of 1000 for the left feet for my image.
And 1040s image view height.
OK.
And 9:46 I actually referred to this image again.
I interviewed that set padding here.
I want to actually specify the paddings of my image view of one for the lift one hundred for the top
100 for the right and 100 for the actually the bottom.
OK.
And here I am actually returning this image view return.
I can give you.
OK.
So now let's actually go back inside this main activity that double fight here and now let's actually
create an object from this Gellatly that after after class.
So if Galerie adapter adapter assignments.
Operator new Gallerie adapter and here are I need to actually specify the context for the constructor
of this Gellatly after class as you can see here we have this constructor here.
So the context would be main activity that this.
So this is the context the name of our class.
OK.
And now I need to actually refer to the name of this gelati object as you can see here.
So again the dot sets adapter as you can see here and here I need to put in the adapter here.
OK adapter.
And now let's actually run our project and see what happens.
So as you can see here our application is actually running on this emulator and it says these are our
animals images inside the gallery.
OK.
And as you can see here this is our image and if they actually scroll to the left I can see the other
image is OK.
And these images are actually inside the gallery OK.
And if you scroll to the left I can see the other images here.
OK.
So hopefully that makes sense.
And now let's actually as you can see we need to actually put putting our own images inside a horizontal
scroll.
OK.
These are our animal images inside the horizontal scroll view.
So now let's actually go back to our main activity the double fight here.