And now it's actually to go back inside these uncreate Smurfette here.
So I'm going to actually paste in some lines of code here and then I'm going to explain to you what's
going on here.
And so it is on create method.
OK.
So as you can see here these are the lines of code that they actually paste that here.
First of all in line for 56 as you can see here I called this method.
Let's add the images to the view flipper as you can see here.
I call this method and here is going to actually add the images to the view flipper as you can see inside
this content on the underlined that minute minute example here you have this of your flipper.
So if you want to actually add the images to this view flip it OK.
And here in line for 87 I actually called Let's add the images to the view animator.
OK.
And I actually passed this animated object to the Smurfette.
So inside this content underline minute example if you have this view animated and we want to actually
look at the images to this view animator.
So here I actually passed this animated object and here are for this method I actually passed this view
flipper object.
OK as you can see here you flipper.
OK.
And here in line 49 as you can see here.
I actually called use animation for a view of view from people.
And I actually passed this view of the object.
So as you can see if you have this method here use animation for a view flippen and then you have these
and other Mfat use animation for you animator.
And then I passed this of your animated object to this method.
OK so now let's actually make these buttons make these up between animal animal image next button and
these are between an animal image previous button a listener to the clicks of the user.
OK.
So here I can just type in PETN and an image next that said unclick listener.
OK.
And here inside Apprentice's I need to actually pass the context of our application.
So here I need to pass the context object.
OK.
So here I can just type in main activity that this OK and now are I need to actually implement the uncle
listener here.
So here I can just type in implement.
So I need to implement the uncle Ikhlas and her interface.
So here I am just typing on click listener.
So he had a view that I can listen at and now it's going and it is natural and error.
So if I asked you to hover my mouse pointer over the error area it says classman activity must either
be declared abstract or implement abstract Meffert unclick in unclick listener.
So here as you can see now this error is gone here.
So here in this main activity class I need to actually call the actually the abstract method that we
actually inherit from these unclick listener interface.
OK so remember that because we are actually implementing this uncle class in an interface there is and
actually is a relationship between this main activity class and this uncle class or interface.
So here we need to actually implement that abstract method.
Unclick Meffert on click.
So here I just need to press on Enter key on my keyboard.
So as you can see here this is the uncle Meffert And now as you can see the error is gone.
OK.
And now let's actually make this another button These are between an animal image and previous button
are listening to the clicks of the user.
So here I can just type in between animal image previous thought sets unclick listener.
OK.
And here I need to actually pass the context.
So here I can just say the main activity that this OK and now inside is unclear.
I need to actually differentiate between these two buttons.
So whenever the user clicks on this bitty bitty animal image.
Next up some lines of code.
It's going to be executed.
And when the user clicks on this between an animal image previous button some other lines of code is
going to be executed here.
We can actually we have this argument in on my fat uncle.
And as you can see it is actually the first view so we can actually change this name to.
And we have this view here as an argument so we can actually by using this object we can actually differentiate
between these two buttons.
OK.
So here in say this if I can just typing a switch switch between view.
OK that gets I-T OK.
And now let's actually open and close the switch statement by using these curly braces.
OK.
So here I can just type in case our dad's ID that's pretty an image next.
OK Blake.
And now let's actually take in case our thought Id that between image previous Colin bridge.
OK so here we are actually switching between the values of the ideas of this view object that we actually
receive as an argument.
OK.
So this uncle actually can understand which type of object or the use that is actually clicking.
OK.
So we have this of you object as an argument and we can use that object in order to actually switch
between the ideas of this object and then we can actually differentiate between these buttons and then
we can actually execute the lines of code that are related to these specific objects to the specific
components in our application.
OK.
So for this or an animal image next here as you can see for this type of a button of any use or click
on that button here I want to actually create some lines of code are here.
I want to ask a question from myself.
OK what do I want to happen when the user clicks on this.
Next Next button here.
As you can see here.
OK.
I want for example this of your flipper to actually show the next image to the user.
OK.
So when the user clicks on the next button as you can see here I want to give you flipper to show the
next image to the user.
So here inside this switch statement and for this case are that ID that's between an animal image next
and just typing of view flipper.
OK.
So we have this view Flipper here.
We actually did declare it inside this class so we can actually refer to the name of that of your flipper
object inside this and click Mefford.
So if you put that show next.
So this is going to show the next image to the user.
OK.
And what other kinds of things.
I want to I want to happen.
When you when the user clicks on this next image I want this view animated.
Also should the next image to the user.
So here again just again refer to the name of that object if you animator that show next.
OK.
So if I actually click on this next button here as you can see now we can see these images actually
change.
OK.
And now let's actually here.
In this case a statement case or that I did that between animate image previous.
So when the user clicks on the previous button here I want this of you flip here to show the previous
image to the user as you can see here.
So here again just typing a view flipper that show previous.
OK.
And again as I can see it when the user clicks on the previous button I want this of you animated to
actually show the previous image to the user.
So here I can just refer to the name of that object view animator that show previous.
OK.
So as you can see if I click on the previous button here now you can see that these two components actually
show the previous image.
OK so now let's actually run our project and see what happens.
So now as you can see here our application is actually running on this emulator here.
And if I actually click on this next button here.
Now as you can see this image changed.
And if you actually click on this or previous one and now you can see this.
These images actually are changing.
And here this is our view animator.
And here you can see that these images actually change.
OK.
So I think that's enough for this application.
OK.
And if you have any questions please post the discussion in the course and then I'll do my best to answer
all of your questions.
Thank you very much for watching and I'll see you in the next tutorial.