1
00:00:00,760 --> 00:00:08,100
And I actually tested some padding for these values OK for the left padding This is one hundred for

2
00:00:08,100 --> 00:00:11,920
the top zero for the right zero and for the bottom zero.

3
00:00:11,940 --> 00:00:12,610
OK.

4
00:00:12,960 --> 00:00:16,460
And then I actually assign a color to this view.

5
00:00:16,620 --> 00:00:18,270
Ok text color.

6
00:00:18,570 --> 00:00:23,700
And as you can see here the colors of these are actually the color of these group names are actually

7
00:00:23,900 --> 00:00:24,510
blue.

8
00:00:24,750 --> 00:00:26,140
OK color blue.

9
00:00:26,520 --> 00:00:33,230
And actually sets a size to the stakes to view the size of these values is actually 40.

10
00:00:33,480 --> 00:00:34,110
OK.

11
00:00:34,380 --> 00:00:36,720
And I asked you to returned this takes you.

12
00:00:36,900 --> 00:00:37,310
OK.

13
00:00:37,350 --> 00:00:43,460
And as you can see here the Smurfette this gets group view if it actually returns a value of type view.

14
00:00:43,560 --> 00:00:44,060
OK.

15
00:00:44,250 --> 00:00:46,960
And this text is actually a subclass of view.

16
00:00:47,100 --> 00:00:47,490
OK.

17
00:00:47,580 --> 00:00:50,580
So we can actually turn this text view from the Smurfette.

18
00:00:50,700 --> 00:00:55,380
And as you can see here these are the values that this method actually retains.

19
00:00:55,470 --> 00:00:56,050
OK.

20
00:00:56,810 --> 00:00:58,270
So hopefully that makes sense.

21
00:00:58,370 --> 00:01:03,290
And now we need to actually return the children of these group views as you can see here sport class

22
00:01:03,590 --> 00:01:10,250
as you can see this sport view actually has some has our children as you can see here this sport if

23
00:01:10,250 --> 00:01:11,220
you have children.

24
00:01:11,240 --> 00:01:16,450
OK so if anything I should return these values from this good child human effort.

25
00:01:16,550 --> 00:01:17,260
OK.

26
00:01:17,540 --> 00:01:22,250
So this is for actually the returning the children of these group views.

27
00:01:22,250 --> 00:01:25,270
OK Computer as you can see here and other values.

28
00:01:25,310 --> 00:01:32,090
So here let's actually did it is written not here and now we can actually put in our own implementations

29
00:01:32,420 --> 00:01:33,950
inside of this method.

30
00:01:33,950 --> 00:01:38,010
So as you can see here this is actually the return a value of type view.

31
00:01:38,270 --> 00:01:42,550
And we have group position child position is last child.

32
00:01:42,560 --> 00:01:47,060
This is actually a boolean argument and we have this convert view.

33
00:01:47,120 --> 00:01:50,310
So we can actually to change these arguments and into view.

34
00:01:50,480 --> 00:01:53,190
And we have a view called a parent OK.

35
00:01:53,300 --> 00:01:56,900
The players are actually the parent of these children.

36
00:01:56,910 --> 00:02:02,090
OK so now I'm gonna paste in some lines of code here and then I'm going to explain to you what's going

37
00:02:02,090 --> 00:02:02,980
on here.

38
00:02:03,440 --> 00:02:07,400
So as you can see here these are the lines of code that they actually the pace that he had inside of

39
00:02:07,400 --> 00:02:08,130
this method.

40
00:02:08,270 --> 00:02:09,010
OK.

41
00:02:09,350 --> 00:02:13,510
And as you can see first of all again I created an takes object.

42
00:02:13,520 --> 00:02:13,880
OK.

43
00:02:13,910 --> 00:02:15,800
Takes the view assignment operator.

44
00:02:15,800 --> 00:02:22,040
Here I am initializing this object new text view and then for the constructor of this class I need to

45
00:02:22,040 --> 00:02:24,250
assign a value of type context.

46
00:02:24,260 --> 00:02:25,290
So this is context.

47
00:02:25,340 --> 00:02:26,000
OK.

48
00:02:26,390 --> 00:02:33,080
And then as you can see here inside of our emulator we have these techniques the view that takes the

49
00:02:33,080 --> 00:02:34,110
child names.

50
00:02:34,220 --> 00:02:37,820
So these are the child names as you can see we have this as a child names.

51
00:02:37,820 --> 00:02:41,750
This is actually a two dimensional array or an array of arrays.

52
00:02:41,750 --> 00:02:42,380
OK.

53
00:02:42,800 --> 00:02:45,130
So child names girl position.

54
00:02:45,140 --> 00:02:46,850
So if you have this group position here.

55
00:02:46,910 --> 00:02:47,620
OK.

56
00:02:47,650 --> 00:02:49,690
Sup child position.

57
00:02:50,010 --> 00:02:50,480
OK.

58
00:02:50,630 --> 00:02:55,470
So we can as you can see we have this sport boxing kickboxing judo football basketball.

59
00:02:55,670 --> 00:02:56,250
OK.

60
00:02:56,340 --> 00:02:58,610
So the group position is sports.

61
00:02:58,630 --> 00:02:58,940
OK.

62
00:02:58,940 --> 00:03:02,720
For example for their first group position this is zero.

63
00:03:02,720 --> 00:03:03,260
OK.

64
00:03:03,260 --> 00:03:09,060
So the this group position if this group position is zero this value would be sport.

65
00:03:09,320 --> 00:03:14,570
And as you can see if you have this Chinese position these are the columns as you can see we have these

66
00:03:14,780 --> 00:03:21,320
values that are inside of the actually index zero of these child names two dimensional array.

67
00:03:21,320 --> 00:03:21,820
OK.

68
00:03:21,920 --> 00:03:25,460
So it's going to return these values to us.

69
00:03:25,460 --> 00:03:25,850
OK.

70
00:03:25,940 --> 00:03:28,350
As you can see here these these are the values.

71
00:03:28,660 --> 00:03:33,870
And here I am actually setting some setting the padding of these a text view.

72
00:03:33,950 --> 00:03:34,270
OK.

73
00:03:34,300 --> 00:03:40,250
One hundred for the left 0 for the top zero for the right and a zero for the bottom.

74
00:03:40,490 --> 00:03:46,640
And as you can see the color of these child children as you can see here this takes views that are inside

75
00:03:46,640 --> 00:03:48,890
of this group as you can see this is red.

76
00:03:48,890 --> 00:03:51,710
These are the colors of these attacks.

77
00:03:51,890 --> 00:03:57,450
It is red as you can see and the size of these text views is actually 50.

78
00:03:57,870 --> 00:03:58,870
OK.

79
00:03:59,120 --> 00:04:00,760
So hopefully that makes sense.

80
00:04:00,890 --> 00:04:10,850
And I actually specified a certain click listen for this text view the view object as you can see here

81
00:04:11,120 --> 00:04:13,990
if I click on these children is going I should respond.

82
00:04:14,060 --> 00:04:14,470
OK.

83
00:04:14,570 --> 00:04:16,340
But there is an error here.

84
00:04:16,550 --> 00:04:23,330
So here I actually created a tossed object toast that make text Our first we need to specify the context

85
00:04:24,260 --> 00:04:29,410
and second we need to actually specify the text that you want to actually show to the user.

86
00:04:29,510 --> 00:04:36,830
And the first argument is actually the length of our applet of the text the duration of the text that

87
00:04:36,830 --> 00:04:38,610
is actually shown to the user.

88
00:04:38,810 --> 00:04:41,570
And then we are calling the shome effect on these toast.

89
00:04:41,600 --> 00:04:45,920
So if I click on this for example each in here it says kickboxing here.

90
00:04:45,920 --> 00:04:46,460
OK.

91
00:04:46,670 --> 00:04:49,650
Boxing boxing basketball.

92
00:04:49,690 --> 00:04:50,880
Basketball OK.

93
00:04:51,170 --> 00:04:53,190
But as you can see here there is an error here.

94
00:04:53,210 --> 00:04:53,780
OK.

95
00:04:53,870 --> 00:04:56,020
And it says that you cannot.

96
00:04:56,020 --> 00:05:02,370
Valuable the view is X is accessed from within a class needs to be declared final.

97
00:05:02,540 --> 00:05:08,270
So as you can see here as I said earlier in this section that are when you create an inner class as

98
00:05:08,270 --> 00:05:13,280
you can see here we are creating an entire class an anonymous inner class and that in a class that anonymous

99
00:05:13,510 --> 00:05:17,540
class is actually implementing this article class in an interface.

100
00:05:17,570 --> 00:05:23,080
And because that class is implementing this interface it can actually overwrite the Smurfette here.

101
00:05:23,300 --> 00:05:30,320
So if we have this anonymous in a class and B inside of this or in a class we cannot refer to a value

102
00:05:30,380 --> 00:05:32,170
to a variable that is not final.

103
00:05:32,210 --> 00:05:32,670
OK.

104
00:05:32,810 --> 00:05:34,260
That is actually not constant.

105
00:05:34,310 --> 00:05:38,340
So here we need to actually declare this text view as final.

106
00:05:38,880 --> 00:05:41,830
OK and now as you can see the error is gone.

107
00:05:42,230 --> 00:05:42,800
OK.

108
00:05:42,800 --> 00:05:47,770
And here after this a Satanical lesson we are returning this TXI the view object.

109
00:05:47,780 --> 00:05:48,770
OK.

110
00:05:49,100 --> 00:05:50,780
And here we have another method.

111
00:05:50,810 --> 00:05:52,710
Is child selectable.

112
00:05:53,090 --> 00:05:56,310
So the default implementation is enough for this Meffert.

113
00:05:56,370 --> 00:06:02,130
If you want to actually find the description about this effort to actually go to the documentation as

114
00:06:02,130 --> 00:06:08,280
you can see here and here inside the search bar I can actually copy the name of this method and put

115
00:06:08,280 --> 00:06:09,250
it here.

116
00:06:09,840 --> 00:06:10,710
OK.

117
00:06:10,710 --> 00:06:11,930
As you can see this is the method.

118
00:06:12,000 --> 00:06:17,900
This is actually an abstract method and the return type of this if it is Boolean is child selectable.

119
00:06:18,030 --> 00:06:22,940
And this method actually accepts two arguments of type integer group position type position.

120
00:06:22,950 --> 00:06:29,450
And this is the description of this method where there is the child at the specified position is selectable.

121
00:06:29,670 --> 00:06:36,010
OK so we can specify that whether each child of this group use as you can see here are actually two

122
00:06:36,010 --> 00:06:37,250
selectable or not.

123
00:06:37,490 --> 00:06:44,070
OK but for this application it is enough the default implementation implementation is enough return

124
00:06:44,070 --> 00:06:51,180
false and now it's actually to go to the main activity that double file here and now let's actually

125
00:06:51,270 --> 00:06:56,570
create an object of these from these expandable adapter.

126
00:06:56,720 --> 00:06:57,310
OK.

127
00:06:57,720 --> 00:07:04,600
So here I can just type in expandable list view adapter and the name of this object is and expandable

128
00:07:04,600 --> 00:07:05,740
this view adapter.

129
00:07:05,910 --> 00:07:08,980
Or I could just name this object as adapter.

130
00:07:09,120 --> 00:07:15,050
OK it is simple assignment operator new expandable adapter.

131
00:07:15,270 --> 00:07:20,200
And as you can see inside the Prentice's for this constructed I need to specify the context.

132
00:07:20,220 --> 00:07:23,900
So inside is expendible adapter for the constructor of this class.

133
00:07:23,970 --> 00:07:29,810
I specified that this constructor actually accepts an argument of type context.

134
00:07:29,860 --> 00:07:37,750
OK so here of any to actually pass this context and this context with the past to this context instance

135
00:07:37,750 --> 00:07:38,880
worry about OK.

136
00:07:39,150 --> 00:07:45,710
So here again just typing our main activity that this.

137
00:07:46,110 --> 00:07:47,500
OK so this is the context.

138
00:07:47,520 --> 00:07:49,590
I mean I think that this this is our class.

139
00:07:49,890 --> 00:07:52,770
And here I can just type in expandable this view.

140
00:07:52,770 --> 00:07:57,420
So if you have this expandable view OK in say this content underline minute example here.

141
00:07:57,450 --> 00:07:59,340
This is our this view.

142
00:07:59,340 --> 00:08:05,760
Now we want to actually bind to data that we actually get from these expandable adapter and put that

143
00:08:05,820 --> 00:08:08,690
they are inside these expandable view.

144
00:08:08,700 --> 00:08:15,970
So here I can't just type in expandable list view that set adapter.

145
00:08:16,360 --> 00:08:16,990
OK.

146
00:08:17,010 --> 00:08:19,420
So here we need to specify the adapter.

147
00:08:19,500 --> 00:08:22,230
So we have this adapter here adapter.

148
00:08:22,690 --> 00:08:26,490
OK so now let's actually run our project and see what happens.

149
00:08:26,610 --> 00:08:32,020
So now I want to actually show you an important point about two dimensional Olly's.

150
00:08:32,250 --> 00:08:36,810
So here as you can see our application is actually running on the simulator.

151
00:08:36,900 --> 00:08:42,120
And if I actually click on this support group view you can see the children of this group view boxing

152
00:08:42,120 --> 00:08:48,530
kickboxing judo football basketball and if I actually click on these items I can see these tossed here

153
00:08:48,540 --> 00:08:49,590
kickboxing.

154
00:08:49,890 --> 00:08:53,010
And now let's actually click on the computer.

155
00:08:53,010 --> 00:08:54,570
Good view here.

156
00:08:55,170 --> 00:08:58,150
And as you can see here our application crashed.

157
00:08:58,140 --> 00:09:01,200
Unfortunately at 35 has stopped.

158
00:09:01,210 --> 00:09:03,950
So let's let's actually go to the log here at the bottom.

159
00:09:04,260 --> 00:09:12,320
And now we can see that here it says our That land that Arey index out of bounds.

160
00:09:12,330 --> 00:09:15,850
Exception OK lead free index free.

161
00:09:15,980 --> 00:09:21,690
So we actually accessed an index of an array that actually doesn't exist.

162
00:09:22,080 --> 00:09:22,610
OK.

163
00:09:22,770 --> 00:09:27,840
And here as you can see it says expandable view adapter does get Chinese view.

164
00:09:27,840 --> 00:09:33,740
So the error is actually the error is actually happened on this MFL tried to view Meffert.

165
00:09:33,750 --> 00:09:35,960
So if I click on this link here.

166
00:09:36,480 --> 00:09:40,660
Now we can see these are actually line of code.

167
00:09:40,680 --> 00:09:47,070
The error actually happened in this line of code and here I am actually getting the children of this

168
00:09:47,310 --> 00:09:54,220
group of group view here as you can see we have this view and we have these child names at it.

169
00:09:54,300 --> 00:09:59,880
So now as you can see here you have these get group count.

170
00:10:00,180 --> 00:10:00,710
OK.

171
00:10:00,870 --> 00:10:02,790
And we have these kids children challenge.

