So now I'm going to paste in some lines of code here.
Inside is uncreate Meffert.
And then I'm going to explain to you what's going on here.
So as you can see here these are lines of code that I pasted here first about in line for 88.
I want to I try to initialize this takes the bill amount object which is of the view that I declared
in line 18.
As you can see here.
So to the amount.
Assignment operator and then here I am actually testing this object to a text view object find view
by id r that ID that 8:36 to be the mount.
So I actually deferred to the ID of this the bill amount takes a.
And here in line 39 am initialising 66 percent assignment operator error.
Here I am casting this object which takes a few object find your way Id are that ID that 80 percent.
And here we have this the tip assignment operator.
Again I am casting this object which takes few object point view by ID or that ID that X the type.
Here you have you are actually initializing this takes the total amount.
And here again as you can see find your way Id are that ID that takes the total amount and in line 43
here I am actually setting the text of this tip.
So the tip that it takes and here inside Apprentice's of this text Mefford I actually referred to the
name of this currency format value object as you can see here currency format value object data format.
So it's going to actually format this value that we pass to this format Meffert despite the number 0
and it's going to actually return a string value of that specific format that is specific to that locale.
Here for example four different countries.
It depends on the settings of the users the price that which actually which locale is actually used
for that specific device.
So it's going to actually turn up a specific value for that specific locale currency format value that
format number 0 is going to actually return a string value.
OK.
And then add the total bill amount here that said text again I actually referred to the name of this
currency for value object that form at number zero.
Let's actually look at these lines of Cahir in line 46 I am initialising this TXI is safe.
Percent.
OK this is to say percent object which I actually declared here a line at twenty five as you can see
here.
So Th to say person assignment operator here I am casting this object to a text object find view by
ID or that ID that is to say for ascent in line 4 to 7.
I am actually initialized this takes the money saved object assignment operator takes you find view
way id or ID that actually takes the money saved and in 949 I am actually setting the text of this 360
the money saved.
That takes the currency format value as you can see here again that format number 0.
So that is actually on our project here in order to show you some of these changes on the screen on
the emulator.
So here as you can see our application is running on the simulator.
And here you can see that the value of this tip is the tip as you can see here actually to set the text
of the text to keep in line.
Our first Iffley currency format that format number zero.
So here you can see we have this value.
So the locale of my emulator is actually us.
So we have this dollar sign here dollar sign 0.00 which is actually at our table about you as you can
see here and here I actually said this takes the total amount.
This is the total amount.
Again we have this dollar sign zero point zero zero and now we can see that 11:49 actually set the takes
of this takes the money saved currency from value that format number zero.
So here you can see this value dollar signs zero point zero zero.
Right.
So that's the job of this currency format value in order to actually give us the specific format of
that is actually suitable for that specific locale.
So hopefully that makes sense.
And now we're actually pasting some more lines of code here inside this uncreate Mefford and then I'm
going to explain to you what's going on here.
So here inside this uncreate method before I actually add the logic.
First let me tell you that first of all I want to actually add the logic in order to in order for this
calculator to work.
Okay.
And then I add the logic for the savings calculator.
Okay.
First I want this tip calculator here.
So now I'm going to paste in some lines of code here.
As you can see here these are the lines of code that I pasted here in line 55.
I actually created an object of type edit takes and the name of my object is the amount of the text.
Right.
So as you can see here these are the lines of code that I pasted here inline 55.
I actually created an object of type editor.
And the name of my object is EDT money amount.
Right.
Assignment operator and then here I Chastity's object to a test object find view ID or that ID that
it is the money amount.
So let's actually show you the application of the emulator.
So here I am actually referring to this ID tastier and helping out here as you can see here it is the
money amount.
And now in 56 you can see something different here which you haven't seen so far.
It's the money amount I actually referred to the name of this eddy takes object that add text change
listener.
OK.
So I want to actually make this it it takes actually a listener.
OK.
A listener to what a listener to the changes that is actually happening on this editor.
So if the user for example adds some values into these added text or if the user removes those values
from the edit text or this edit takes here it's going to be aware of those changes.
So here that's why I actually referred to the name of this edit text EDT money amount that ad takes
to change the listener.
So this edits is going to be the listener for those changes is going to actually listen to those changes
that actually happened that actually occur inside these edit text.
And it's great that that editing is going to be a of of a lot of those changes.
And here I assign this value this is actually a handler.
OK.
That actually allowed this edit takes to be aware of those changes.
So now we need to actually define this handler and then let's actually show you this line.
Fifty eight.
Here I am actually again creating an object of type search bar and the name of this object is sick but
person's right.
So here I am actually defining the search bar here an assignment operator here I am actually casting
the object to a search object find your ID or that ID search bar percent.
As you can see here I am actually defining this object here and in line 59 or is referred to the name
of this Seeburg percent object that set on Skipworth change listener.
So here I am 5:42 but a listener to actually these changes when they use it for example changes this
value of these Sebald or when the user seeks on this Seaboard.
This part is going to listen to those changes and then it's going to respond.
So here I actually add this value here.
This handler and Vinita defined his handler in our class.
But as you can see the name of this handler is Tepes each part change the center.
So this handle it is going to allow the search bar to be aware of actually of these changes.
Right.
Of actually seeking this the here.
So first of all it's actually defined this a cheap ADT money amount it takes to watch her handler.
So let's actually go inside this class after the end in calibrates of this and method.
And inside the main activity class and what I'm going to actually pastings some lines of code here and
then I'm going to explain to you what's going on here.
So now let me actually define this handler here manually and then because I want to show you RDL actually
a very important point.
So now private's the access modify it up this handler is private.
And this is actually a constant private final.
And that data type of this handler is actually text Wotcher text Wotcher and the name of this handler
is going to be the value that I put here.
Tepe EDT money amount text whatever so I just copy this value here and paste it here.
Assignment operator new text.
And as you can see here as I actually typed t it the autocomplete feature of the Android studio is helping
me to actually choose this text which are here as you can see.
So just select it and press an interviewee on your keyboard.
And now the Android studio Id actually put these lines of code here automatically.
So first let me actually as you can see we have an error here and at the end of these this calibrates
as you can see if you need to put a semicolon here and now the error is gone.
And these are the methods that are actually put here by the Android studio.
These are the same effects that we need to overwrite.
So as I told you before when you actually create a handler or an interface you are actually creating
an anonymous inner class here and that in a class is actually implementing this text watcher interface.
Right.
And as you can see here these are the methods that that in a class that anonymous class that we can
see that the name of that class here that in a class is actually implementing these methods.
And let me tell you that anonymously in all classes but actually classes without names.
Right.
So this class that actually have no names here is is actually implementing these methods that are actually
related to the sponsor interface and here we can actually use these methods.
First of all we have this Smurfit public void before text changed.
So we're not going to use this method here in this application.
And this is going to be executed before the value of this.
For example let me show you on this emulator.
This Meffert this before text change here is going to be executed before they use it as any values to
these it takes here all the use that is about to add an R values to these inside these edit text.
So we're not going to use this method here and we have an exchange.
So this method is going to be executed when the user is actually adding or removing values into these
edit text.
As you can see here.
So this is the method that you're going to work inside our application.
This is a very important Smurfette and we need to use this method.
And we are going to actually put our logic inside the Smurfit and the last it is the Smurfette after
text changed.
So this is going to be executed after the values of these tests actually changed.
Finally and we can actually put a logic here in order to execute.
But the most important method here is the Smurfette on takes changed.
So let's actually go inside the Smurfette and now I'm going to paste in some lines of code here.
Inside the Smurfette and then I'm going to explain to you what's going on here.