1
00:00:01,190 --> 00:00:01,760
Welcome back.

2
00:00:02,000 --> 00:00:08,060
And this video, we are going to make a couple of changes to our application allowing us to edit and

3
00:00:08,060 --> 00:00:09,140
delete the entries.

4
00:00:09,210 --> 00:00:15,230
OK, therefore, we will need to set up these two methods update record dialogue and delete record dialog.

5
00:00:15,260 --> 00:00:20,150
I'm going to go over those in this video and there's a lot happening there, so it will be a longer

6
00:00:20,150 --> 00:00:27,950
video and the general goal is to, well, pass them to our item adapter.

7
00:00:27,950 --> 00:00:28,340
Let me see.

8
00:00:28,370 --> 00:00:35,390
So too, the item adapter here, because in the last video, we uncommitted this item adapter stuff

9
00:00:35,390 --> 00:00:36,680
that we had prepared before.

10
00:00:36,680 --> 00:00:39,920
So this update listener as well as this delete listener.

11
00:00:40,160 --> 00:00:46,520
So let's put them back in and let's put this update listener invoke back in as well and this one.

12
00:00:46,760 --> 00:00:53,570
So we're going to invoke the method that we will use as a delete listener, which will be some sort

13
00:00:53,570 --> 00:00:56,140
of a it will be a lambda right.

14
00:00:56,150 --> 00:00:58,520
It will be a anonymous function.

15
00:00:58,790 --> 00:01:03,680
And we're going to invoke that anonymous function, passing the idea of the individual item that we're

16
00:01:03,680 --> 00:01:09,110
currently at in order to then allow to click on the update and the delete buttons.

17
00:01:09,530 --> 00:01:14,990
So let's go ahead and implement those methods and therefore we will need to make a change to this item

18
00:01:14,990 --> 00:01:15,440
adapter.

19
00:01:15,650 --> 00:01:20,720
Don't be confused about the video not having this stuff here, because as I said, I cut the video a

20
00:01:20,720 --> 00:01:21,290
little bit.

21
00:01:21,500 --> 00:01:26,870
So the video is going to like this stuff, but we are going to have to now implement everything that

22
00:01:26,870 --> 00:01:29,510
we need to add to the item adapter for it to work.

23
00:01:29,960 --> 00:01:32,060
So let me comment this out.

24
00:01:32,060 --> 00:01:35,600
For now, we are going to implement it in this video, however.

25
00:01:36,080 --> 00:01:37,520
OK, so let's get started.

26
00:01:37,820 --> 00:01:39,380
So let's set those two up.

27
00:01:39,560 --> 00:01:47,630
Therefore, I'm going to comment this out for now, and let's prepare the update record entry.

28
00:01:48,380 --> 00:01:58,070
So let's create this function update record dialog, which is going to be internally, then updating

29
00:01:58,070 --> 00:01:58,670
our data.

30
00:01:59,450 --> 00:02:06,440
So we need to get the ID of the item that we want to update, and we need to get the employee down in

31
00:02:06,440 --> 00:02:08,750
order to make changes to our database.

32
00:02:09,590 --> 00:02:14,450
Because the employee now, as you recall, has all of these functions like insert, update, delete

33
00:02:14,450 --> 00:02:15,110
and so forth.

34
00:02:16,010 --> 00:02:19,940
But in order to get access to it, we need to get the employee down object.

35
00:02:20,720 --> 00:02:24,140
So we are going to use an update dialog.

36
00:02:25,880 --> 00:02:28,580
Which is just going to be a dialogue object.

37
00:02:28,880 --> 00:02:29,210
OK?

38
00:02:29,300 --> 00:02:34,460
A dialogue with the context of this, and it's going to use the theme dialogue style.

39
00:02:35,030 --> 00:02:37,720
OK, so there's this style said, Ah.

40
00:02:37,910 --> 00:02:41,040
And let's see theme dialogue.

41
00:02:42,140 --> 00:02:44,300
I think this one would be good theme.

42
00:02:44,300 --> 00:02:45,220
Have competition.

43
00:02:45,830 --> 00:02:48,920
And we need to import the dialogue class for this to work.

44
00:02:49,560 --> 00:02:52,700
OK, now let's set up this update dialogue.

45
00:02:52,820 --> 00:02:56,630
So let's give it a property of said Kent syllable.

46
00:02:56,930 --> 00:02:58,880
So said Cancel Lobo.

47
00:03:00,730 --> 00:03:05,620
Which is this one, and we're going to say that this is not going to be cancelled in the sense that

48
00:03:05,620 --> 00:03:07,120
you cannot click away from it.

49
00:03:07,360 --> 00:03:10,960
So if you want to update, clicking next to it will do nothing.

50
00:03:11,650 --> 00:03:13,810
Only once you click on the update or the cancel button.

51
00:03:14,260 --> 00:03:19,480
OK, so we say, said Constable Faults, and now we need to set up the binding object.

52
00:03:19,480 --> 00:03:26,410
So binding will be our dialog update binding and we inflate our layout inflator here.

53
00:03:26,800 --> 00:03:33,580
So basically, we're saying I want to use this dialogue update x l file this one here.

54
00:03:33,910 --> 00:03:40,270
And because we're using view binding, we can access this XML file using the name of the XML file binding

55
00:03:40,840 --> 00:03:43,000
and then we can inflate with the layout inflator.

56
00:03:43,240 --> 00:03:50,860
Now we can use this dialogue binding for this XML file that we just looked at to set the content view.

57
00:03:51,250 --> 00:03:52,720
So we're saying binding that route.

58
00:03:53,200 --> 00:04:00,250
So what's happening here is if you look at it, it just sets the dialog to appear or to look like this

59
00:04:01,090 --> 00:04:06,430
XML file so that this design here which we have created, which has this update record, name and surname

60
00:04:06,430 --> 00:04:08,680
and so forth because we want to be able to edit it, right?

61
00:04:09,730 --> 00:04:10,180
OK.

62
00:04:11,590 --> 00:04:19,480
So now that we have set up how this dialogue is supposed to look like, let's take care of preparing

63
00:04:19,480 --> 00:04:20,860
our data.

64
00:04:21,459 --> 00:04:29,230
So when we click the update button, you see that the added texts are populated, so they're not empty.

65
00:04:29,470 --> 00:04:32,080
We're not saying updated with a new entry.

66
00:04:32,410 --> 00:04:37,750
We're saying it's updated with what we have in the entry already and now you can make changes to it.

67
00:04:38,110 --> 00:04:40,410
So that's how a good updated functionality would work.

68
00:04:40,420 --> 00:04:45,070
Of course, you could also not populate those two, but I want to populate those added texts with the

69
00:04:45,070 --> 00:04:48,220
data that is inside of the database for that particular position.

70
00:04:48,730 --> 00:04:49,900
So how do we get that?

71
00:04:50,410 --> 00:04:57,400
Well, we can use our lifecycle scope again because this is stuff that has to run in the background.

72
00:04:57,400 --> 00:04:59,140
So we need to use call routines here.

73
00:04:59,530 --> 00:05:07,900
So we are inside of this quarantine scope and we can now use our employee down to call its methods.

74
00:05:08,230 --> 00:05:12,190
And I'm going to call the method that will give me a particular entry.

75
00:05:12,520 --> 00:05:20,920
So I'm going to get the employee by its ID, by passing the ID and collecting the data.

76
00:05:21,580 --> 00:05:28,870
So I'm using the collect method here, which I can then get the data from our binding object.

77
00:05:29,020 --> 00:05:33,730
So binding that had a text update name that set text.

78
00:05:35,170 --> 00:05:38,360
And I can set the name here.

79
00:05:39,310 --> 00:05:41,470
OK, so it, Missy.

80
00:05:42,700 --> 00:05:46,960
So this collect method should give me the it.

81
00:05:48,680 --> 00:05:51,630
If that's not the case, then I'm doing something wrong here, let me check.

82
00:05:52,710 --> 00:05:55,020
So I'm dial fetch employee.

83
00:05:56,200 --> 00:05:57,400
Thought collect.

84
00:05:58,530 --> 00:06:00,610
Now, OK, so it was just an arrow there.

85
00:06:00,630 --> 00:06:02,340
I don't know, maybe I misspelled something.

86
00:06:02,550 --> 00:06:05,760
But now you see we get it, which is the employee entity.

87
00:06:06,060 --> 00:06:07,170
So this is a lumber here.

88
00:06:07,200 --> 00:06:12,480
You see, we get the employee entity, which is our employee object.

89
00:06:12,480 --> 00:06:16,740
So if you look at it, it gives me the name of the employee entry.

90
00:06:18,220 --> 00:06:31,570
OK, so now let's do the same thing with ITI update email ID, and this one will be also the sad text.

91
00:06:33,580 --> 00:06:36,670
And here we need to use it or it email.

92
00:06:36,820 --> 00:06:39,490
OK, so we're now assigning the email as well.

93
00:06:40,180 --> 00:06:44,680
OK, so this is where we are populating the data here.

94
00:06:44,860 --> 00:06:48,550
So this information into the added text.

95
00:06:49,150 --> 00:06:54,130
So now let's add what should happen once we click on the update button this one here.

96
00:06:54,760 --> 00:06:56,950
So let's use our binding object again.

97
00:06:57,700 --> 00:07:01,990
That TV update to set on click listener.

98
00:07:03,210 --> 00:07:08,130
So once we click on the update button, we want to execute some code, and this is the update button,

99
00:07:08,250 --> 00:07:11,250
which is not really button, it's a text view, but it's fine.

100
00:07:11,250 --> 00:07:15,720
I called the TV update, which is a text view update, which is this one here.

101
00:07:15,900 --> 00:07:18,780
So if you look at the ID, it says TV update.

102
00:07:19,740 --> 00:07:28,390
OK, so now here we can now get the name from those or we need to get this value.

103
00:07:28,410 --> 00:07:29,490
We need to get this value.

104
00:07:29,490 --> 00:07:31,320
So we get those from the edit text, right?

105
00:07:31,740 --> 00:07:38,160
So the name, we get it from our binding that it update name, text to string.

106
00:07:39,670 --> 00:07:48,490
And the same thing for the email, so email will be binding that he tee up the email ID, but text the

107
00:07:48,520 --> 00:07:53,500
string, so we get the text and we make a string out of it because that's what we want to store inside

108
00:07:53,500 --> 00:07:55,270
of this email variable.

109
00:07:55,870 --> 00:08:00,850
So now we can check if those two aren't empty, because if the user for some reason entered an empty

110
00:08:00,850 --> 00:08:02,590
entry, then we don't want to do anything.

111
00:08:03,010 --> 00:08:09,940
So if name is not empty and our email is not empty.

112
00:08:11,850 --> 00:08:18,300
Only then do we want to store something, so only then do we want to do a similar thing, as we did

113
00:08:18,300 --> 00:08:26,100
with the create method you recall here where we inserted something and we, well, we need to close

114
00:08:26,100 --> 00:08:27,060
the dialog at this point.

115
00:08:27,360 --> 00:08:31,770
But here you see, we used to empty out inserts to empty your entity with the name and the email.

116
00:08:32,190 --> 00:08:33,720
So let's do something similar here.

117
00:08:34,169 --> 00:08:35,400
Let's use our employees Guidall.

118
00:08:35,400 --> 00:08:40,950
But of course, this is again stuff that has to run in the background, so use a call routine again.

119
00:08:42,950 --> 00:08:49,310
So here, let's use our employee down to call the update method at this update method needs to an employee

120
00:08:49,310 --> 00:08:49,970
entity.

121
00:08:50,280 --> 00:08:58,250
OK, employee entity object with the ID that we want to change the name that we want to change and the

122
00:08:58,250 --> 00:08:58,690
email.

123
00:08:58,700 --> 00:09:00,770
So here you see, the name and email is not enough.

124
00:09:00,770 --> 00:09:05,450
We need to pass the ID as well because we want the only update one particular item, because if you

125
00:09:05,450 --> 00:09:08,930
look at the update method, you see, well, you don't see much.

126
00:09:08,960 --> 00:09:11,990
It's just an empty entity that we need to pass, which has those values.

127
00:09:12,410 --> 00:09:17,420
So when you're creating, you don't need to add the ID because the IDs generate for you automatically.

128
00:09:17,420 --> 00:09:20,150
But when you're making changes, you need to pass the ID.

129
00:09:21,470 --> 00:09:22,140
OK.

130
00:09:23,060 --> 00:09:29,150
So why are we doing all of this update stuff before even displaying the data?

131
00:09:29,180 --> 00:09:36,010
Well, the problem is we can't display the data because our adapter uses the update stuff as well.

132
00:09:36,020 --> 00:09:41,150
So if we would have not used to update listeners here, it would have been a lot easier.

133
00:09:41,780 --> 00:09:50,300
So if we were to comment these two out and comment this part out here, we could get the data without

134
00:09:50,300 --> 00:09:51,290
doing the update stuff.

135
00:09:51,930 --> 00:09:53,630
OK, but we're doing everything at once.

136
00:09:53,630 --> 00:09:55,250
So let's look at this.

137
00:09:55,490 --> 00:09:56,960
So we have the employee.

138
00:09:56,960 --> 00:09:58,880
Don't we now update the entry?

139
00:09:59,330 --> 00:10:02,930
And now let's also let the user know that we updated the record.

140
00:10:03,500 --> 00:10:06,200
So we're just displaying it via toast.

141
00:10:06,770 --> 00:10:11,780
And let's make sure that the dialog that we have just opened is going to be dismissed because it's super

142
00:10:11,780 --> 00:10:15,710
annoying if you have to update and then cancel too close to record.

143
00:10:16,160 --> 00:10:19,610
So we want to dismiss the dialog as well.

144
00:10:20,120 --> 00:10:26,330
And if they are empty, so if either of them is empty, I'm just going to have this else block here,

145
00:10:26,330 --> 00:10:29,180
which is going to display name or email cannot be blank.

146
00:10:30,890 --> 00:10:31,460
OK.

147
00:10:32,530 --> 00:10:36,910
And now you see, we have two buttons that we have to update and the cancel button now let's also implement

148
00:10:36,910 --> 00:10:37,720
the cancel button.

149
00:10:38,230 --> 00:10:42,640
So let's say binding dot TV cancel.

150
00:10:43,060 --> 00:10:46,900
So once we click on it, which means we need to add an account, click listener.

151
00:10:48,040 --> 00:10:50,080
Let's dismiss the update dialog as well.

152
00:10:51,800 --> 00:10:57,860
And of course, what's super important, we need to shoulder update dialogue at all.

153
00:10:59,970 --> 00:11:07,170
OK, so this method will never be called because we are not setting up the data into our recyclables

154
00:11:07,170 --> 00:11:10,380
so we can notice it until we have displayed everything.

155
00:11:10,830 --> 00:11:12,570
So that's our update record dialog.

156
00:11:13,020 --> 00:11:17,160
Now let's look at how we can have a delete dialog.

157
00:11:17,460 --> 00:11:22,260
OK, we'll be very similar because if you look at it, well, it just this very basic dialogue here.

158
00:11:22,560 --> 00:11:24,900
Super simple, yes, no delete record.

159
00:11:25,500 --> 00:11:29,640
But it also needs to have the ID needs to know which idea we want to delete.

160
00:11:30,450 --> 00:11:35,880
So let's created fun delete record alert dialog.

161
00:11:36,060 --> 00:11:40,710
So we're using an alert dialog this time and not a custom dialogue that we created manually.

162
00:11:40,710 --> 00:11:48,720
So with this record update record dialog that we created based on our own XML file.

163
00:11:49,350 --> 00:11:50,610
But here we're not using that.

164
00:11:50,610 --> 00:11:53,310
We're just using a default alert dialog.

165
00:11:54,030 --> 00:11:59,850
So we need to pass the ID, which is of type integer, and we need to pass in the employee double in

166
00:11:59,850 --> 00:12:03,750
order to well, then be able to make changes to the database.

167
00:12:04,380 --> 00:12:09,090
So let's create the builder object, which will be the alert dialog builder.

168
00:12:11,800 --> 00:12:18,520
With the context of this, then we need to set the title, so said title, which will be the delete

169
00:12:18,910 --> 00:12:24,010
record title, which you see here, the lead record is just a title.

170
00:12:25,400 --> 00:12:30,580
And then I need to set the positive button and the negative button, so this is the negative button,

171
00:12:30,590 --> 00:12:31,730
this is the positive button.

172
00:12:32,060 --> 00:12:33,200
So let's set those up.

173
00:12:33,770 --> 00:12:37,940
So use the builder that set positive button.

174
00:12:38,600 --> 00:12:41,630
And here we need to say which text it should display.

175
00:12:41,660 --> 00:12:49,160
So I'm going to say yes, and now we can use this lambda in order to, first of all, get the dialog

176
00:12:49,850 --> 00:12:50,870
interface here.

177
00:12:50,960 --> 00:13:00,500
So if you look at it, we get the dialogue interface as well as another entry.

178
00:13:00,500 --> 00:13:01,640
I'm not going to use that.

179
00:13:01,850 --> 00:13:06,680
So this will be the lander and I'm going to use and now I can use my lifecycle scope.

180
00:13:07,280 --> 00:13:11,440
Launch it again because here we're actually going to do the little delete thingy.

181
00:13:11,720 --> 00:13:14,960
So once we click on the Yes button, then we want to delete.

182
00:13:15,890 --> 00:13:20,780
So here I'm just going to use employee Dow to lead the employee entity.

183
00:13:21,860 --> 00:13:28,940
Employee entity at the current ID, so that the idea that we get from calling the method will be passed

184
00:13:28,940 --> 00:13:30,590
ID to the method itself.

185
00:13:32,060 --> 00:13:37,760
And then we can also let the user know that we made the change, that we deleted this, so we make the

186
00:13:37,760 --> 00:13:44,330
text here, we delete it and we need to show the post and then we also want to make sure that we close

187
00:13:44,330 --> 00:13:45,380
the dialog interface.

188
00:13:46,390 --> 00:13:48,370
So now if we click the no button.

189
00:13:49,760 --> 00:13:53,750
Then I also want to this Mr interface, the dialogue.

190
00:13:53,930 --> 00:13:59,090
OK, so here builders said negative button, I'm going to say, no, I'm going to get the dialogue interface

191
00:13:59,090 --> 00:14:02,370
and the which which I'm not using so we can use to underscore here as well.

192
00:14:02,390 --> 00:14:06,440
This is the lambda expression that I'm using and this missing the dialogue here.

193
00:14:06,920 --> 00:14:07,900
So if you click on, no.

194
00:14:08,660 --> 00:14:13,310
So now that we have set up the alert dialog builder.

195
00:14:13,600 --> 00:14:19,430
So this builder and we can now set up the alert dialog itself, which is going to be of type alert dialog

196
00:14:19,430 --> 00:14:24,980
and to can put like this, I can use my builder and call the Create Method, which will now create the

197
00:14:24,980 --> 00:14:25,790
alert dialog.

198
00:14:26,030 --> 00:14:29,000
And now I'm going to make this alert dialog.

199
00:14:29,000 --> 00:14:31,070
Also not cancel lable.

200
00:14:31,100 --> 00:14:34,370
So set cancel concealable to false.

201
00:14:34,760 --> 00:14:37,040
And then let's display the alert dialog.

202
00:14:37,190 --> 00:14:37,970
So show it.

203
00:14:38,210 --> 00:14:39,590
Otherwise it won't do anything.

204
00:14:39,950 --> 00:14:45,020
And now this function, we can make it private because no other class can use it anyway, so I should

205
00:14:45,020 --> 00:14:45,350
use it.

206
00:14:46,440 --> 00:14:48,720
Because they wouldn't have an employee Dow, I guess.

207
00:14:48,930 --> 00:14:52,080
And the same goes, by the way, for the update record.

208
00:14:52,380 --> 00:14:55,200
So private fund update record dialogue.

209
00:14:56,710 --> 00:15:03,940
OK, so now that we have those methods ready, we can use them in and set up lists of data into our

210
00:15:03,940 --> 00:15:04,870
recycler view.

211
00:15:05,020 --> 00:15:09,270
So if the employee list is not empty, let's set up our item adapter.

212
00:15:09,280 --> 00:15:10,410
We have the employee list.

213
00:15:10,420 --> 00:15:11,230
We get that here.

214
00:15:11,380 --> 00:15:13,750
OK, we get it passed to our method.

215
00:15:14,530 --> 00:15:17,500
So here we now pass in the employee list.

216
00:15:17,770 --> 00:15:25,990
And now what I'm going to do is I'm going to create a closure here where I get an integer, which is

217
00:15:25,990 --> 00:15:26,830
the update ID.

218
00:15:27,220 --> 00:15:34,540
So Update ID, I'm going to use this number again, use my update record dialog percent to update ID

219
00:15:35,170 --> 00:15:36,580
as well as the employee, though.

220
00:15:38,960 --> 00:15:39,410
All right.

221
00:15:39,800 --> 00:15:40,370
And now.

222
00:15:42,070 --> 00:15:45,590
Let's do the same thing with our final entry.

223
00:15:45,670 --> 00:15:46,870
And that is the.

224
00:15:48,060 --> 00:15:50,460
The lead listener.

225
00:15:50,580 --> 00:15:55,590
OK, so the lead listener here, it's the delete idea that I get.

226
00:15:57,720 --> 00:16:05,610
They lead I.D. again a London, and I'm calling the delete record alert dialog, I pass into the lead

227
00:16:05,610 --> 00:16:05,880
ID.

228
00:16:06,630 --> 00:16:09,030
And I use my employee, though.

229
00:16:10,590 --> 00:16:11,700
Two now deleted.

230
00:16:11,940 --> 00:16:17,460
So here basically, this is this entire quote here is basically just setting up this item adapter because

231
00:16:17,460 --> 00:16:24,480
you see if we look at our item adapter, it requires an update listener with an I.D. and the lead listener.

232
00:16:25,110 --> 00:16:31,770
So we used this idea that we're getting and we're calling the update record dialogue method.

233
00:16:32,400 --> 00:16:34,530
This one here, which will then.

234
00:16:36,160 --> 00:16:40,420
Take that idea and to empower you, Dole to update the current entry.

235
00:16:41,950 --> 00:16:43,760
And the same goes for the Delete ID.

236
00:16:44,290 --> 00:16:51,670
So we used that here as well to then delete the entry of using the delete record dialog.

237
00:16:52,060 --> 00:16:57,130
So the dialog itself takes care of the deletion, which only happens once you click on the Yes button.

238
00:17:01,350 --> 00:17:01,920
OK.

239
00:17:02,070 --> 00:17:05,579
So now that we have the item adapter.

240
00:17:06,750 --> 00:17:11,040
OK, at this point, we are going to implement these things as we had done before.

241
00:17:11,190 --> 00:17:17,520
So just make sure that you have the item adapter with the correct settings here and set up all of this

242
00:17:17,520 --> 00:17:18,210
binding stuff.

243
00:17:20,300 --> 00:17:25,910
And also just quickly, because I'm not sure what I explained it correctly so this year is basically

244
00:17:26,119 --> 00:17:34,250
we are creating what we need to pass to our item adapter, which you see is an update listener that

245
00:17:34,250 --> 00:17:35,930
is a function that returns nothing.

246
00:17:35,960 --> 00:17:42,350
OK, so we're basically creating this function call of like an anonymous function here where we used

247
00:17:42,350 --> 00:17:44,210
the update aid that is given to us.

248
00:17:44,210 --> 00:17:51,110
So we are getting the ID and we're making sure of that up here so where we are invoking it with the

249
00:17:51,110 --> 00:17:51,410
ID.

250
00:17:52,100 --> 00:17:55,580
So the update ID, the same goes for the Delete listener ID.

251
00:17:56,060 --> 00:18:04,610
So we are invoking when we click on the items, we are invoking this method, which then invokes or

252
00:18:04,610 --> 00:18:13,010
calls the update record dialog method, and it takes the update I.D. that we get from our item adapter

253
00:18:13,010 --> 00:18:17,840
when we invoke it for the specific line that we are currently looking at.

254
00:18:18,560 --> 00:18:22,340
OK, so that's what's happening here with this line as well as with this one here.

255
00:18:23,960 --> 00:18:27,970
OK, now let's test this application and see what it's going to look like.

256
00:18:28,010 --> 00:18:34,880
So we see here we have our Dennis Infowars.com and I can now delete the entry.

257
00:18:35,540 --> 00:18:36,280
You see, it's gone.

258
00:18:36,290 --> 00:18:42,860
So now let me add another entry here again, add record and click on the edit button, which unfortunately

259
00:18:42,860 --> 00:18:43,970
doesn't work correctly yet.

260
00:18:43,970 --> 00:18:49,270
So we have this update window wood, which opens up, but it's not working correctly.

261
00:18:49,580 --> 00:18:52,700
So we are going to create our own style for that.

262
00:18:52,700 --> 00:18:58,250
So I mean, the themes folder now and I unfortunately have to create my own style because otherwise

263
00:18:58,280 --> 00:18:59,750
doesn't seem to work correctly.

264
00:19:00,110 --> 00:19:04,370
So the style that I'm going to use, and this is really just the last part that we need to add to this

265
00:19:04,370 --> 00:19:05,900
video then we're done.

266
00:19:06,050 --> 00:19:07,820
I'm going to call this one theme dialog.

267
00:19:08,540 --> 00:19:14,690
OK, and the parent of it will be the theme overlay app compared to dialogue.

268
00:19:16,070 --> 00:19:23,360
OK, and now the style will have an item name of Android with major.

269
00:19:24,650 --> 00:19:25,250
Let me see.

270
00:19:25,460 --> 00:19:31,250
It's called Android when we know men with major.

271
00:19:31,350 --> 00:19:36,830
OK, so Android calling this a property call like this, and I want to set that value to 90 percent

272
00:19:36,920 --> 00:19:42,260
because I want to make sure that it takes 90 percent of the width of the screen and the minor should

273
00:19:42,260 --> 00:19:43,820
also be 90 percent of the screen.

274
00:19:44,150 --> 00:19:49,910
So I want to make sure that this dialogue is going to take 90 percent of the screen with otherwise,

275
00:19:50,180 --> 00:19:51,890
it's just not going to do correctly.

276
00:19:52,340 --> 00:19:55,460
So now we just need to use this theme dialogue that we just created.

277
00:19:55,700 --> 00:20:01,610
So our style theme on the score dialogue, the one that was just created instead of our update record

278
00:20:01,610 --> 00:20:02,930
dialogue function.

279
00:20:03,380 --> 00:20:09,510
And now we should be golden and finally be able to update entries as well.

280
00:20:09,590 --> 00:20:11,930
So let's go over here.

281
00:20:12,440 --> 00:20:13,400
Let's update this.

282
00:20:13,400 --> 00:20:17,330
You see, now it's taking 90 percent of the screen and it seems to work.

283
00:20:17,340 --> 00:20:19,820
So the email address that I entered wasn't correct.

284
00:20:19,820 --> 00:20:23,150
So let's use the correct one or a proper one.

285
00:20:23,450 --> 00:20:28,010
Let's click on the update method, and you see the update has been done.

286
00:20:29,120 --> 00:20:36,650
However, we still have one little while you could say security issue in our application, and that

287
00:20:36,650 --> 00:20:44,540
is once we do click on the update method, we're not checking if the ID employee employer entity is

288
00:20:44,780 --> 00:20:46,040
in fact empty or not.

289
00:20:46,340 --> 00:20:49,460
So let's just make sure that it really isn't null.

290
00:20:49,760 --> 00:20:52,790
Before we do the binding.

291
00:20:52,910 --> 00:20:59,570
OK, before we find the employee entity to our updated features.

292
00:20:59,870 --> 00:21:07,060
So if we run this again now, then we should see you me had something here at this record.

293
00:21:07,070 --> 00:21:08,210
Let's make a change.

294
00:21:09,050 --> 00:21:14,630
It's updated and now deleted, and you see our application doesn't crash.

295
00:21:14,630 --> 00:21:15,530
Everything is good.

296
00:21:16,100 --> 00:21:18,660
And now let's make a change to this one as well.

297
00:21:18,680 --> 00:21:22,970
Update And now, well, not deleted.

298
00:21:23,570 --> 00:21:27,050
It's now deleted and we see no records available.

299
00:21:27,620 --> 00:21:34,190
OK, so now we have a running application which does all of the crude operations.

300
00:21:34,370 --> 00:21:36,950
I know it's been quite a bit that we had to set up.

301
00:21:37,010 --> 00:21:42,980
It's quite a bunch of code and we are using a bunch of concepts that we have not used before, like

302
00:21:43,280 --> 00:21:53,150
flow, like a bunch of add annotations here using Dow and using couple routines a lot and room, and

303
00:21:53,150 --> 00:21:54,260
it's quite a bit.

304
00:21:54,620 --> 00:22:02,150
But the thing is, once you've done it once and you have the general structure for such an application,

305
00:22:02,330 --> 00:22:04,430
you can now easily extend it.

306
00:22:04,550 --> 00:22:10,220
And to then, the next time that you need to use a database, you can just use this as an example.

307
00:22:10,730 --> 00:22:11,080
OK.

308
00:22:11,180 --> 00:22:12,370
So that's it for this video.

309
00:22:12,380 --> 00:22:15,590
Let's implement this into our seven minute workout app.

