1
00:00:00,760 --> 00:00:06,790
Welcome back and this video, we are going to edit the card name here and put it into the edit text

2
00:00:06,790 --> 00:00:11,680
and also we are going to add the delete button and I'd say, yeah, let's get started.

3
00:00:12,010 --> 00:00:19,780
So the first thing is that I will need to use a new stream, which I'm just going to call delete card.

4
00:00:19,960 --> 00:00:22,030
So here, string name.

5
00:00:23,220 --> 00:00:29,940
Will be the lead card, which will then just say delete kaat.

6
00:00:31,180 --> 00:00:37,560
All right, so that's News Stream that we will require and then I'm going to also create a new menu.

7
00:00:38,020 --> 00:00:42,580
So it's going to be similar to the one where we had.

8
00:00:43,840 --> 00:00:51,340
Menu members, actually, it's more like this one at members and I'm going to call this one menu delete

9
00:00:52,180 --> 00:00:52,660
card.

10
00:00:54,310 --> 00:01:00,160
All right, let's look at this lead card, so here we have an item in it and I'm going to give this.

11
00:01:01,140 --> 00:01:08,670
And you ID I'm going to call this one delete card, so action delete card, then the category will stay

12
00:01:08,670 --> 00:01:09,180
the same.

13
00:01:09,390 --> 00:01:18,420
The text here should be our lead card text that we prepared, and it should also be shown as action

14
00:01:18,420 --> 00:01:20,270
always because it's just one item.

15
00:01:20,490 --> 00:01:25,260
And of course, I want to use a different vector here because it should be a delete vector.

16
00:01:25,260 --> 00:01:27,600
So let's go ahead and create a new vector for this.

17
00:01:27,990 --> 00:01:32,180
Therefore we can just search for the lead.

18
00:01:32,970 --> 00:01:35,460
I think this one will be good enough for this.

19
00:01:35,950 --> 00:01:37,800
So let's use this icon here.

20
00:01:39,440 --> 00:01:45,110
And I'm going to call this one, I see Vector to lead 24.

21
00:01:47,890 --> 00:01:48,420
There we are.

22
00:01:50,430 --> 00:01:52,740
I see Victor delete.

23
00:01:54,520 --> 00:01:55,710
24 DPE.

24
00:01:56,590 --> 00:02:00,250
And for some reason, it doesn't take it, I see.

25
00:02:01,200 --> 00:02:04,170
Underscore Victor Gilead, 24.

26
00:02:04,530 --> 00:02:05,550
All right, that's the one.

27
00:02:06,870 --> 00:02:09,479
OK, so this is the ICAM.

28
00:02:10,530 --> 00:02:12,210
And the menu button.

29
00:02:13,530 --> 00:02:19,830
Now I want to inflate that menu file, so this menu button, so to speak, and that should happen in

30
00:02:19,830 --> 00:02:24,060
the card details activity because that's where it should be displayed here, right at the top right

31
00:02:24,060 --> 00:02:25,970
corner instead of the menu.

32
00:02:26,370 --> 00:02:28,290
So I need to add that there.

33
00:02:28,770 --> 00:02:34,890
And in order to inflate it, I need to override a function in here which is on.

34
00:02:36,160 --> 00:02:37,570
Create options menu.

35
00:02:41,110 --> 00:02:48,100
This one here and there, I can go ahead and use the menu inflator.

36
00:02:50,410 --> 00:02:54,550
To inflate our thought menu thought.

37
00:02:55,600 --> 00:02:56,650
Many credit card.

38
00:02:58,620 --> 00:03:03,660
I also need to pass in the menu itself, so here I'm going to person menu.

39
00:03:05,640 --> 00:03:09,960
For now, we're not going to take care of the event that should happen once we click on it, but we

40
00:03:09,960 --> 00:03:12,330
just want to display it on top of that.

41
00:03:12,330 --> 00:03:14,760
What we want to display is also.

42
00:03:15,790 --> 00:03:22,910
The edited text, so I'm just going to set the edit text card details, so this added text right here.

43
00:03:23,710 --> 00:03:29,340
I want to populated with the same title as we have in the action bar.

44
00:03:29,770 --> 00:03:30,240
All right.

45
00:03:30,250 --> 00:03:32,590
So basically, it's the same thing.

46
00:03:32,920 --> 00:03:33,940
So we can just.

47
00:03:34,990 --> 00:03:36,510
Copy this whole part here.

48
00:03:38,460 --> 00:03:40,290
And set that as text.

49
00:03:42,500 --> 00:03:44,960
So it will be ambered details.

50
00:03:47,580 --> 00:03:51,870
List at the top of the list position and the cards.

51
00:03:54,180 --> 00:03:54,560
Name.

52
00:03:57,470 --> 00:04:01,880
And as it seems, it doesn't like the property, so I'm just going to use to set text.

53
00:04:03,410 --> 00:04:10,670
Function here to do pretty much the same thing, we just need to close it at the end and that seems

54
00:04:10,670 --> 00:04:11,670
to work totally fine.

55
00:04:12,140 --> 00:04:16,579
So for some reason, it doesn't like me to use the property name directly.

56
00:04:17,000 --> 00:04:17,390
All right.

57
00:04:17,390 --> 00:04:21,470
So the same goes for the selection.

58
00:04:22,390 --> 00:04:28,630
So I will set the selection for my ETTY name card details.

59
00:04:30,760 --> 00:04:33,850
Dots, text to string.

60
00:04:35,300 --> 00:04:35,990
Total length.

61
00:04:37,730 --> 00:04:47,420
What that allows me to do is to set the focus directly onto the ending of the length of the text, so

62
00:04:47,420 --> 00:04:48,750
at the end of the text, pretty much.

63
00:04:48,770 --> 00:04:53,390
So this when I click on it, you could see directly the focus goes over from the left hand side to the

64
00:04:53,390 --> 00:04:54,030
right hand side.

65
00:04:54,320 --> 00:04:57,410
So that's what I get with this line, said Selection's.

66
00:04:59,560 --> 00:05:06,310
And then we can also do and that is really just necessary, and if you decided to take the same approach

67
00:05:06,310 --> 00:05:12,040
that I do, is that you don't want to load the screen all the time when going back.

68
00:05:12,040 --> 00:05:16,210
So only if the world changes made, for example, then you can, of course.

69
00:05:17,540 --> 00:05:23,660
Also used to approach where you would refresh everything in the resume function, as we have covered

70
00:05:23,660 --> 00:05:24,560
in the last video.

71
00:05:24,770 --> 00:05:30,480
So what I'm going to do is I'm going to implement the activity for result approach.

72
00:05:30,500 --> 00:05:37,370
So first of all, I need to have a new variable here in my companion object const.

73
00:05:38,690 --> 00:05:41,620
Wild card details.

74
00:05:43,040 --> 00:05:49,390
Request code, teachers request code, which will be an integer, and I'm going to assign 14 to it.

75
00:05:51,550 --> 00:05:57,340
And now going back to the start, activity for result here.

76
00:05:59,000 --> 00:06:02,510
Your card details, I can now go ahead and.

77
00:06:03,820 --> 00:06:07,420
Not only start the activity, but actually started for a result.

78
00:06:09,710 --> 00:06:14,900
And here, I'm just going to use the card details request code.

79
00:06:16,700 --> 00:06:17,870
As the Unicode.

80
00:06:19,470 --> 00:06:21,330
And then on activity result.

81
00:06:22,840 --> 00:06:23,260
Here.

82
00:06:24,060 --> 00:06:24,780
I will.

83
00:06:26,050 --> 00:06:33,040
Make a small adjustment, so here, I don't only want to check the request code equals members.

84
00:06:34,130 --> 00:06:34,940
Request code.

85
00:06:36,040 --> 00:06:41,200
But alternatively, it should be the request code should be.

86
00:06:44,280 --> 00:06:45,300
Card details.

87
00:06:47,800 --> 00:06:48,570
Request cut.

88
00:06:51,160 --> 00:06:54,400
All right, so in either case, I want to.

89
00:06:55,860 --> 00:06:58,620
Pretty much go ahead and refresh the page.

90
00:06:59,820 --> 00:07:06,300
So if the activity result, OK, is the result code and the request code is either member's request

91
00:07:06,300 --> 00:07:08,730
or card details request code.

92
00:07:09,980 --> 00:07:18,140
Which means that we either get back from this member's activity here and the word changes or we go back

93
00:07:18,140 --> 00:07:24,230
from the card activity and we made changes in either case, I want to refresh this page.

94
00:07:24,230 --> 00:07:28,640
Otherwise, I don't want to make any changes on this page or on this activity here.

95
00:07:30,770 --> 00:07:32,750
All right, for now, let's just test it.

96
00:07:33,020 --> 00:07:39,650
Let's keep this video super short so that we still have enough time for longer videos later on.

97
00:07:40,130 --> 00:07:45,080
Well, we will, of course, implement the actual functionality behind it, because for now, the only

98
00:07:45,080 --> 00:07:52,920
thing that we do is to display the car title name and also display the icon at the top right corner.

99
00:07:52,940 --> 00:07:53,690
So let's see.

100
00:07:54,630 --> 00:08:02,250
Board with image, let's click on random name, we can see it's edited or it's added in here, it's

101
00:08:02,250 --> 00:08:05,160
populated and we have this delete button as well.

102
00:08:05,790 --> 00:08:06,200
All right.

103
00:08:06,330 --> 00:08:07,770
So that is it for this video.

104
00:08:07,770 --> 00:08:13,050
In the next video, we're going to add some more steps here, which will then allow us to, of course,

105
00:08:13,050 --> 00:08:15,610
delete it and also some other settings.

106
00:08:15,850 --> 00:08:17,040
So you in the next video.

