1
00:00:10,730 --> 00:00:11,790
High students.

2
00:00:11,930 --> 00:00:16,860
So now it is teetotally I want to talk about pop up window in Android.

3
00:00:17,150 --> 00:00:26,150
So let's create an android city or project the application is going to be pop up window and you can

4
00:00:26,150 --> 00:00:32,240
specify the company domain package name and the project location here which is the next.

5
00:00:32,300 --> 00:00:41,130
So here for the minimum STK choose API 16 Android 4.1 Philipine and then click next and he has to choose

6
00:00:41,190 --> 00:00:43,130
interactivity next.

7
00:00:43,130 --> 00:00:52,570
And then he can specify the activity name here and then click and finish.

8
00:00:52,600 --> 00:00:58,580
So now as you can see here our project is actually created so it's actually with a little bit now.

9
00:00:58,590 --> 00:00:59,090
OK.

10
00:00:59,320 --> 00:01:04,630
The project is ready so let's go to this activity under last minute exam and in order to design the

11
00:01:04,630 --> 00:01:06,560
user interface our application.

12
00:01:06,790 --> 00:01:10,270
So let's select this hello world text and then delete it.

13
00:01:10,410 --> 00:01:16,390
And now let's actually just track a pothead into this play out here.

14
00:01:16,390 --> 00:01:23,350
So inside these widgets folder just select a spot and just strike it here at the center of this layout

15
00:01:24,190 --> 00:01:25,080
and select the spot.

16
00:01:25,090 --> 00:01:35,170
So for the idea to step in here Pythian show pop up window between show of a window and that person

17
00:01:35,230 --> 00:01:44,410
into your keyboard and then for the text that's attribute here to stay in here show pop up window

18
00:01:47,370 --> 00:01:49,360
and then person until the key on your keyboard.

19
00:01:49,680 --> 00:01:53,520
So now let's create another XML file in here.

20
00:01:53,520 --> 00:01:59,730
Inside this layout folders are just open displays folder here and then open this layout folder and at

21
00:01:59,730 --> 00:02:04,450
the top just get you can find new and then click on layout resource void.

22
00:02:04,470 --> 00:02:13,810
So for the file name here I can say pop up the filename is going to be pop up on the line window.

23
00:02:14,380 --> 00:02:19,010
So make sure that your file name starts with a lower case letter.

24
00:02:19,180 --> 00:02:24,910
As you can see here pop up on the line window the root element is going to be linear lay out the source

25
00:02:24,910 --> 00:02:29,970
said is main and the directory name is a lay out and then click on OK.

26
00:02:30,010 --> 00:02:32,670
So now we have this pop up on the line.

27
00:02:32,710 --> 00:02:36,790
We know that XML file inside this ex-directory.

28
00:02:36,850 --> 00:02:42,890
So now with this pop up window selected here at the border and just click on a text tab here.

29
00:02:43,240 --> 00:02:48,050
So now you can see that we have this linearly out here.

30
00:02:48,270 --> 00:02:55,210
So the orientation is where it's called out which is mass panic and the lever height is much parent.

31
00:02:55,300 --> 00:02:56,110
Right.

32
00:02:56,560 --> 00:03:02,360
So because this is going to be the pop up even though Let's change the linear length to a relatively

33
00:03:02,380 --> 00:03:08,510
out and because this is actually relatively out we don't need this orientation attribute.

34
00:03:08,710 --> 00:03:13,770
As you can see here this orientation attribute is only used for linear layouts.

35
00:03:13,780 --> 00:03:16,030
So let's delete it here.

36
00:03:16,270 --> 00:03:19,510
So we have only the lay out and the height attribute.

37
00:03:19,510 --> 00:03:22,720
And now let's go to the Design tab here at the bottom.

38
00:03:22,880 --> 00:03:25,950
And now I can actually track a text view here.

39
00:03:25,990 --> 00:03:32,230
So let's say like takes you inside these widgets folder and just throw it here at the center of this

40
00:03:32,520 --> 00:03:34,950
pop up view here inside is relatively out.

41
00:03:34,960 --> 00:03:37,110
As you can see so look at these guidelines.

42
00:03:37,150 --> 00:03:43,690
These dotted lines that is actually specifying that I am actually putting the space in at the center

43
00:03:43,690 --> 00:03:45,590
of this relative out.

44
00:03:45,700 --> 00:03:47,230
So this is my take.

45
00:03:47,410 --> 00:03:53,200
Let's try an image button here or we can actually see it right an image view here an image.

46
00:03:53,380 --> 00:03:57,730
So let's actually just find these images and media there.

47
00:03:57,890 --> 00:04:03,040
And just like this image for you here just select this image and just like it here at the right hand

48
00:04:03,040 --> 00:04:05,550
side of this relatively out.

49
00:04:05,650 --> 00:04:07,110
And look at these guidelines here.

50
00:04:07,120 --> 00:04:12,160
Look at this out all that is especially specifically that I am actually putting this image for you.

51
00:04:12,310 --> 00:04:19,750
According to the right hand side of the relatively out and just really sit here and now are actually

52
00:04:19,750 --> 00:04:20,800
specify an image.

53
00:04:20,830 --> 00:04:22,700
I don't want to specify any image here.

54
00:04:22,840 --> 00:04:27,000
So let's click on cancel here as you can see if you click on cancel.

55
00:04:27,040 --> 00:04:30,290
You cannot actually just put this image through here.

56
00:04:30,310 --> 00:04:33,220
So we must actually select an image here.

57
00:04:33,220 --> 00:04:39,400
So let's take it just like it here and put it here and now as you can see we must select an image.

58
00:04:39,400 --> 00:04:42,430
So just select is Eisley luncher and then click on OK.

59
00:04:42,490 --> 00:04:46,240
Just this is just a placeholder.

60
00:04:46,300 --> 00:04:49,650
So and now we have this text view we have this image.

61
00:04:49,750 --> 00:04:56,340
So let's just drag a button or we can actually track Yes.

62
00:04:56,370 --> 00:04:58,020
Let's try a bottom here.

63
00:04:59,470 --> 00:05:04,930
I think at the right hand at the left hand side of this relatively out as you can see.

64
00:05:04,930 --> 00:05:07,310
So just really sit here.

65
00:05:07,540 --> 00:05:12,160
So I notice that I am positioning these components in one light.

66
00:05:12,220 --> 00:05:12,910
Right.

67
00:05:12,910 --> 00:05:15,420
So this is really important to just really sit here.

68
00:05:15,730 --> 00:05:19,690
So now I have a button takes you and an image view.

69
00:05:19,720 --> 00:05:24,380
So now let's pro-white an image for this image view here.

70
00:05:24,580 --> 00:05:30,070
So let me actually show you the photos so you can actually download this image from the resources section

71
00:05:30,070 --> 00:05:31,150
of this lecture.

72
00:05:31,180 --> 00:05:38,380
So let's just copy this image and then here I can just go here inside the structure and the structure.

73
00:05:38,530 --> 00:05:44,800
And I can select this triable folder inside the Swiss folder and then just right click on it and then

74
00:05:44,800 --> 00:05:46,530
click on paste.

75
00:05:46,540 --> 00:05:48,760
So now just click on OK.

76
00:05:49,090 --> 00:05:58,390
And now we have this image flubber that PAGG here and now I can just open the view all properties here

77
00:05:58,930 --> 00:06:02,640
and I just need to search for S R C attributes.

78
00:06:02,650 --> 00:06:08,440
So in order to search for a specific property you just need to select one of these properties here and

79
00:06:08,440 --> 00:06:12,790
then just type in your specific property that you are looking for.

80
00:06:12,820 --> 00:06:15,840
So I am looking for this attribute.

81
00:06:15,970 --> 00:06:21,310
So this is this is that's the attribute and here I can just click on this ellipsis button this button

82
00:06:21,310 --> 00:06:21,570
here.

83
00:06:21,580 --> 00:06:23,000
Dot dot dot.

84
00:06:23,080 --> 00:06:26,720
And now here as you can see the joy is selected.

85
00:06:26,950 --> 00:06:30,690
And now I can actually search for the name of the emet flavor.

86
00:06:31,210 --> 00:06:33,240
So here is that flavor image.

87
00:06:33,250 --> 00:06:33,890
And then we can.

88
00:06:33,890 --> 00:06:34,500
OK.

89
00:06:35,850 --> 00:06:41,010
And here are actually I actually specify the image of this image view to be Flubber.

90
00:06:41,110 --> 00:06:45,000
But as you can see the image is not changed.

91
00:06:45,010 --> 00:06:53,140
Let's actually search for it as compact as soci compact So as you can see the RC compact is says that

92
00:06:53,140 --> 00:06:56,880
the image of this image is going to be ice icy luncher.

93
00:06:56,890 --> 00:07:01,840
So let's actually swell you here and then present it on your keyboard.

94
00:07:01,960 --> 00:07:03,890
So now you can see this image here.

95
00:07:04,270 --> 00:07:08,100
And now as you can see the height and width of this image is too large.

96
00:07:08,350 --> 00:07:11,250
So let's actually decrease the beach and the height of this image.

97
00:07:11,390 --> 00:07:21,790
So at the top for the layout which is about 100 or even 50 percent the value of 50 for the beach and

98
00:07:25,720 --> 00:07:29,670
for their height for the length height assigned the value 50.

99
00:07:29,710 --> 00:07:34,360
So now we have these image lay out piece under the height is 50.

100
00:07:34,570 --> 00:07:41,800
So now if you have this takes view so this selectees takes view and let's actually search for the text

101
00:07:41,860 --> 00:07:42,650
attribute.

102
00:07:42,670 --> 00:07:46,720
So again select one of these properties and search for text attributes.

103
00:07:47,580 --> 00:07:55,020
So as you can see at the bottom here we have some of these attributes but we do not have the specific

104
00:07:55,050 --> 00:07:56,210
text attributes.

105
00:07:56,250 --> 00:07:58,240
So this is the text attribute here.

106
00:07:58,230 --> 00:08:07,720
And I can't just type indices pop up view pop up if we do actually.

107
00:08:07,780 --> 00:08:11,770
So here it is the text and I can actually select the spot.

108
00:08:12,220 --> 00:08:20,220
And for the patent for the ID just type in here between close and in person into the general keyboard.

109
00:08:20,230 --> 00:08:27,730
So we put the spots in here in order to allow the user to close the pop up window and search for the

110
00:08:27,730 --> 00:08:32,050
text attribute of this button switch or step into your text.

111
00:08:32,200 --> 00:08:33,560
Here it is the text attribute.

112
00:08:33,580 --> 00:08:39,600
And for the text that appears just step in here close and then present it to you on your keyboard.

113
00:08:40,060 --> 00:08:47,680
So now we designed the user interface here and now it's better to actually go to this activity underlaid

114
00:08:47,730 --> 00:08:54,460
minute segment here and let's actually change the background color here of this relatively or so just

115
00:08:54,460 --> 00:09:00,430
select it's relatively old and that you can actually go to this view all properties and search for background

116
00:09:00,900 --> 00:09:01,500
by going.

117
00:09:01,510 --> 00:09:03,380
And here it is back in the attributes.

118
00:09:03,580 --> 00:09:10,060
And here I can say for example hashtag of 5 5 5 5 and then person enter here on your keyboard.

119
00:09:10,060 --> 00:09:17,340
So I changed the background color of my left relatively out here and now let's go to main activity.

120
00:09:17,350 --> 00:09:18,440
Java here.

121
00:09:19,650 --> 00:09:27,760
And now let's just actually create some properties here let's create some variables.

122
00:09:27,840 --> 00:09:31,400
So the first variable that you want to create is for the Spartan.

123
00:09:31,800 --> 00:09:35,980
So now I like you to go to the main activity that a file on inside this class.

124
00:09:36,030 --> 00:09:46,760
I can just say a private Botta PTEN and the name of my variable is going to be between show and she'll

125
00:09:46,770 --> 00:09:47,460
pop up window

126
00:09:51,030 --> 00:09:54,140
and then just put a semicolon at the end of your statement.

127
00:09:54,160 --> 00:09:55,550
And now let's go into this.

128
00:09:55,640 --> 00:10:02,790
Insight is on create Mefford analogy instead between a show a pop up window assignment operator and

129
00:10:02,820 --> 00:10:05,300
just put a pair of pants.

130
00:10:05,580 --> 00:10:11,270
And so the instead Apprentice's just cast this object to a button object and just type it here find

131
00:10:11,280 --> 00:10:17,560
view ID are that ID that and show up of a window semicolon.

132
00:10:17,770 --> 00:10:26,110
And here I can say a bit here and show up in that set and click listener new view.

133
00:10:26,250 --> 00:10:28,690
So just put the new keyboard and the capital V.

134
00:10:28,950 --> 00:10:33,200
And now the autocomplete feature of anthrax that you is going to help you to choose this option.

135
00:10:33,210 --> 00:10:34,070
Uncle listener.

136
00:10:34,170 --> 00:10:35,720
So look at this syntax.

137
00:10:35,830 --> 00:10:39,750
We have these curly braces and inside these curly braces we have dot dot dot.

138
00:10:39,900 --> 00:10:43,020
So choose this one and that person have on your keyboard.

139
00:10:43,020 --> 00:10:47,390
So now the autocomplete feature of Android suit you put these codes here for me automatically.

140
00:10:47,730 --> 00:10:50,480
So now let's go inside is unclear each method here.

141
00:10:50,700 --> 00:10:58,060
So here in order to create a pop up window we need to create a valuable of type layout inflator.

142
00:10:58,140 --> 00:11:04,860
So here I can just type in LeAnn's inflator and the name is going to be laid out inflator assignment

143
00:11:04,860 --> 00:11:05,250
operator.

144
00:11:05,260 --> 00:11:07,430
So notice that this is just the variable.

145
00:11:07,440 --> 00:11:08,790
This is the name of my body.

146
00:11:09,150 --> 00:11:14,190
And we are going to actually create the actual object here at the right hand side of the assignment

147
00:11:14,190 --> 00:11:19,230
operator and we're going to assign that object to this value which is of inflator.

148
00:11:19,380 --> 00:11:25,820
And this is the same actually the case for this but in here we created this variable which is of the.

149
00:11:26,060 --> 00:11:27,270
And in line number 20.

150
00:11:27,270 --> 00:11:32,340
And inside this uncreate method we actually referred to the actual button object.

151
00:11:32,370 --> 00:11:38,780
We just it means that we created about an object actually and the assigned that reference to this between

152
00:11:38,900 --> 00:11:42,300
and she'll pop up the window Vaadia which is of the bottom.

153
00:11:42,750 --> 00:11:48,390
And now here after this assignment operator here I can actually say first we need to actually put a

154
00:11:48,390 --> 00:11:55,170
pair of pants here in order to test this object that we're going to create two and two are layette inflated

155
00:11:55,200 --> 00:11:55,940
object.

156
00:11:55,950 --> 00:12:02,860
So inside Apprentice's just the left inflator and then just type in here get base context.

157
00:12:03,150 --> 00:12:07,500
So as you can see the skit based context is going to return a value of type context.

158
00:12:07,500 --> 00:12:14,730
So in this way we actually have access to the context and by having access to the context we can have

159
00:12:14,760 --> 00:12:20,580
access to all the services outside of Android outside of the current context which is the actually the

160
00:12:20,580 --> 00:12:21,460
main activity.

161
00:12:21,660 --> 00:12:28,890
So I can say database context that gets system service and insight Apprentice's just a bit here to lay

162
00:12:28,890 --> 00:12:31,850
out inflator service semi-colon.

163
00:12:32,370 --> 00:12:37,080
So let me create a new line here so that you can see these values here better.

164
00:12:37,260 --> 00:12:43,420
So I created a variable of the play at inflator and then I cast that object to our last inflator object.

165
00:12:43,560 --> 00:12:50,220
And then just typing here a guess based context to get system service lay out inflator service.

166
00:12:50,550 --> 00:12:55,060
And here I can I can actually say view.

167
00:12:55,440 --> 00:12:58,290
So I'm going to create a valuable type view.

168
00:12:58,320 --> 00:12:58,840
Right.

169
00:12:59,100 --> 00:13:03,710
And the name of my variable is going to be Pop-Pop you.

170
00:13:04,110 --> 00:13:08,420
Assignment operator and now I'm going to refer to this layout inflator.

171
00:13:08,430 --> 00:13:12,830
So layout inflator does inflate.

172
00:13:12,930 --> 00:13:17,680
So as you can see here we have different versions of the Smurfit here.

173
00:13:17,700 --> 00:13:19,840
So let's actually just type in here.

174
00:13:19,910 --> 00:13:21,310
Inflator that inflate.

175
00:13:21,450 --> 00:13:25,500
Let's use this one and you can see this version here.

176
00:13:25,500 --> 00:13:31,920
For example this version for the first argument accepts a value of the integer and the name is a resource.

177
00:13:31,920 --> 00:13:32,720
Right.

178
00:13:32,850 --> 00:13:35,550
So now we need to specify the resource.

179
00:13:35,550 --> 00:13:39,290
What is the resource that resources that actually pop up into that exemplified.

180
00:13:39,390 --> 00:13:40,250
Right.

181
00:13:40,290 --> 00:13:46,940
So here I can see our data lay out that pop up window come up.

182
00:13:47,310 --> 00:13:50,960
And for the second argument we don't want to actually pass any arguments here.

183
00:13:50,970 --> 00:13:54,520
So we just about the value null here.

184
00:13:54,630 --> 00:14:00,360
So this is going to be the root of we don't want to pass the root here because we are actually putting

185
00:14:00,360 --> 00:14:03,220
the pop up view on them actually with the other limited access.

186
00:14:03,220 --> 00:14:06,090
And so we don't need to specify that value here.

187
00:14:06,090 --> 00:14:10,920
Now we need to create and of a variable of type pop up window.

188
00:14:11,250 --> 00:14:16,510
So let's scroll to the top and inside this class main activity class let's actually create another value

189
00:14:16,540 --> 00:14:22,340
but so private and the name of my variable is going to be pop up window and the name of this variable

190
00:14:22,350 --> 00:14:24,560
is going to be pop up into a semicolon.

191
00:14:24,900 --> 00:14:27,400
So we just declared this variable here right.

192
00:14:27,420 --> 00:14:29,210
Let's scroll down here.

193
00:14:29,440 --> 00:14:31,730
And now inside is Uncle Camelford.

194
00:14:31,830 --> 00:14:35,820
And when I say a pop up window pop up window.

195
00:14:36,180 --> 00:14:40,700
Assignment operator so now I'm going to I'm going to initialize these variables here.

196
00:14:40,800 --> 00:14:45,140
So now I'm going to create an actual object of type pop up window.

197
00:14:45,240 --> 00:14:51,960
So just type in here new and just type in here pop up with capital a pop up window.

198
00:14:52,700 --> 00:14:54,980
And now we need to pass some arguments.

199
00:14:55,040 --> 00:14:59,240
So the first argument that I'm going to pass is going to be the context or the view.

200
00:14:59,240 --> 00:15:00,040
Right.

201
00:15:00,080 --> 00:15:01,960
So we already created this view here.

202
00:15:01,980 --> 00:15:03,260
This view about evil.

203
00:15:03,420 --> 00:15:08,940
This pop up view that actually uses the and inflator in order to inflate the view.

204
00:15:08,960 --> 00:15:16,070
So for the first argument we passed the pop up view here come up for the second argument if you need

205
00:15:16,070 --> 00:15:19,110
to specify the Viets of a pop up window.

206
00:15:19,190 --> 00:15:23,670
So we want to actually put the pop up window inside a pop up view.

207
00:15:23,930 --> 00:15:26,830
And now we need to specify the width of our pop up window.

208
00:15:26,930 --> 00:15:31,850
So this is going to be so just typing here relatively out.

209
00:15:31,850 --> 00:15:37,810
So we are used to relatively out because let me actually show you the pop up window that is him and

210
00:15:37,930 --> 00:15:39,390
and at the bottom.

211
00:15:39,410 --> 00:15:45,320
If I actually click on this takes step here as you can see we have actually relatively out here right.

212
00:15:45,560 --> 00:15:50,770
So that's why here inside this main activity that of a file for initialising does pop up into our used

213
00:15:50,820 --> 00:15:59,840
relatively out so relatively that lay out Putnam's with a capital M L actually lay out perhaps that

214
00:16:00,840 --> 00:16:03,850
rap content comma.

215
00:16:03,860 --> 00:16:08,050
So this is my actually which of the pop up window.

216
00:16:08,570 --> 00:16:11,290
And then again just type in here relatively out.

217
00:16:11,390 --> 00:16:20,060
Now I'm going to specify the height that lay out perhaps that's the rap content semi-colon.

218
00:16:20,060 --> 00:16:24,480
So let me create a new line here so that you can see these values better.

219
00:16:24,890 --> 00:16:31,230
So I specified the beach and the height both of them got content and now I can't say.

220
00:16:31,340 --> 00:16:38,350
So now we need to specify the location of our pop up window inside our activity and the like minute

221
00:16:38,360 --> 00:16:39,080
exempt.

222
00:16:39,140 --> 00:16:45,280
So when I when I actually actually condescend to use that actually touches this BT and Sharpeville window.

223
00:16:45,550 --> 00:16:48,250
It can actually show a pop up window to the user.

224
00:16:48,440 --> 00:16:56,570
But now it wants to actually it wants us the Android wants us to actually specify the location of the

225
00:16:56,570 --> 00:17:01,300
pop of being inside that a view inside that activity Underland minute example.

226
00:17:01,640 --> 00:17:03,050
So how we can specify that.

227
00:17:03,170 --> 00:17:08,230
Let's go through this activity underly minute exam examined here and now let's select this activity

228
00:17:08,230 --> 00:17:08,840
on the line.

229
00:17:08,870 --> 00:17:15,020
This is actually a relatively short flight and for the idea is actually give an A meaningful ID to this

230
00:17:15,080 --> 00:17:15,850
relatively well.

231
00:17:15,980 --> 00:17:24,620
So let's actually just name it relative lay out as the id and then press an entry on your keyboard.

232
00:17:24,640 --> 00:17:32,260
So I assigned the value relative ID relatively and actually to the ID attribute of this relatively out

233
00:17:32,380 --> 00:17:35,770
inside this activity underlayment and examine.

234
00:17:36,130 --> 00:17:42,610
Let's go to the main activity that Java file and at the top let's create another variable so private

235
00:17:43,480 --> 00:17:48,230
and Riehle type is going to be relatively out and the name is going to be relatively semi-colon.

236
00:17:48,550 --> 00:17:51,530
Let's go to this uncreate Smurfette.

237
00:17:51,890 --> 00:17:56,790
Now after this line of code that actually initializes disputant Pythian pop up window.

238
00:17:56,890 --> 00:18:01,540
Let's initialize around the table which is of type relatively out so I can say relatively else.

239
00:18:01,750 --> 00:18:08,080
Assignment operator and inside Apprentice's I can just specify that this object that are going to create

240
00:18:08,080 --> 00:18:09,640
is going to be of table relatively.

241
00:18:09,670 --> 00:18:20,620
So I think this object to a relatively old find view by id art does lay out order are actually are Id

242
00:18:20,690 --> 00:18:28,890
thought a relative lay out semi-colon because of the fact that they left relatively out of value as

243
00:18:28,890 --> 00:18:35,670
the id of these relatively insight or activity underline minute segment and now we have this relatively

244
00:18:35,670 --> 00:18:36,070
out.

245
00:18:36,090 --> 00:18:42,050
So here I can actually say it is unclear that after this line of code that actually initializers this

246
00:18:42,060 --> 00:18:52,060
pop up window I can actually say pop up window that location show as location.

247
00:18:52,810 --> 00:18:55,520
And now we need to pass some arguments to this Smurfit.

248
00:18:55,660 --> 00:18:57,680
The first one is going to be the parent.

249
00:18:57,700 --> 00:19:01,870
So what is the parent the parent is going to be.

250
00:19:01,880 --> 00:19:03,830
They are relatively out right.

251
00:19:03,860 --> 00:19:10,250
So we want to put this pop up window incited activity and eliminate examen So we have to relatively

252
00:19:10,260 --> 00:19:14,540
have as the parent of the pop up window that you want to show to the user.

253
00:19:14,620 --> 00:19:19,170
So lets go back to this minute activity that job offer here inside this ugly.

254
00:19:19,210 --> 00:19:25,140
And as the argument as the first element I'm going to pass the value relative lay out OK.

255
00:19:25,230 --> 00:19:29,160
Come on now we need to specify other arguments here.

256
00:19:29,590 --> 00:19:35,770
So the are the other arguments is going to be the location of these parents so the location is going

257
00:19:35,770 --> 00:19:37,390
to be gravity.

258
00:19:37,960 --> 00:19:40,210
So after this come I just step in here.

259
00:19:40,360 --> 00:19:49,440
Gravity that center with capital C gravity the center comma and then we need to specify the X.

260
00:19:49,600 --> 00:19:56,520
So for the expertly press the values 0 we always pass the value 0 for the x and y.

261
00:19:56,590 --> 00:20:02,620
I actually passed the value 0 again because I actually said OK the parent is relatively out and I want

262
00:20:02,620 --> 00:20:07,160
to put this up pop up into the center of our relatively and so forth.

263
00:20:07,270 --> 00:20:13,510
And the way we passed the values zero are because we dont need to actually pass any other values and

264
00:20:13,640 --> 00:20:16,980
they are 0 for the X and 0 for the Y means.

265
00:20:16,990 --> 00:20:21,890
And actually at the top left corner of the actually a pop up window.

266
00:20:21,940 --> 00:20:28,450
So we pass zero and zero and then we show that value is a pop up window on this relatively out.

267
00:20:28,600 --> 00:20:32,400
So now let's do another application and let's see what happens here.

268
00:20:32,410 --> 00:20:35,950
I just need to specify our device and then we can OK.

269
00:20:36,310 --> 00:20:39,920
So as you can see here our application is running on the simulator.

270
00:20:40,030 --> 00:20:42,050
So now let's actually click on the spot in.

271
00:20:42,370 --> 00:20:44,660
And now we can see this pop up window here.

272
00:20:44,800 --> 00:20:45,370
Right.

273
00:20:45,670 --> 00:20:53,830
So we have this close button we have this text which is not shown here actually perfectly and we have

274
00:20:54,070 --> 00:20:55,530
this image here.

275
00:20:55,600 --> 00:20:58,120
So Vinita actually just specify that.

276
00:20:58,130 --> 00:20:58,410
OK.

277
00:20:58,480 --> 00:21:00,150
I cannot close this part of it.

278
00:21:00,150 --> 00:21:06,940
Now I need to actually just create a new listener for the spot for this close at hand.

279
00:21:07,210 --> 00:21:12,470
So that when they use that actually touches the spot in the pop up window is going to be closed and

280
00:21:12,500 --> 00:21:15,400
you're going to be guided to there are mainly out.

281
00:21:15,590 --> 00:21:18,160
So let's go back to android studio here.

282
00:21:18,410 --> 00:21:26,810
So now after this line of code here that actually specifies the location of the pop up window here I

283
00:21:26,810 --> 00:21:35,690
can actually say so here I can create a value of type buttons so button PTEN close assignment operator.

284
00:21:35,810 --> 00:21:37,800
So a way to pay attention here.

285
00:21:38,180 --> 00:21:45,050
I'm going to actually cast this object to a button object here and now I am going to refer to this pop

286
00:21:45,050 --> 00:21:45,980
up view.

287
00:21:46,010 --> 00:21:46,700
Why.

288
00:21:46,700 --> 00:21:52,700
Because the actually the button the close button is actually inside the pop up window and the pop of

289
00:21:52,700 --> 00:21:55,060
window is actually inside a pop up view.

290
00:21:55,070 --> 00:22:02,300
So in order to refer to that button all you need to actually refer to the pop up view.

291
00:22:02,390 --> 00:22:08,420
So here I'm going to say pop up you got and now I can actually search for that specific button for that

292
00:22:08,420 --> 00:22:18,560
close button pop up you that find the ID or that ID that PTEN close semicolon that deputy and close

293
00:22:18,560 --> 00:22:20,520
is inside a pop up view.

294
00:22:20,570 --> 00:22:25,380
This is really important if you don't put this pop up view here your application is going to crash.

295
00:22:25,730 --> 00:22:33,570
So I went to create a listener for the city and close so between close setup click listener new view

296
00:22:33,590 --> 00:22:41,350
that Uncle listener and insight is un-Christian if it were to say just pop up even though that the Smiths.

297
00:22:41,570 --> 00:22:45,240
So now let's try another application and let's see what happens.

298
00:22:45,380 --> 00:22:51,080
Let me show you the emulator and now I'm going to click on the shop window.

299
00:22:51,390 --> 00:22:56,560
So this is a pop in the here and now I am going to click on the close button.

300
00:22:56,580 --> 00:22:58,910
So another pop up in do is actually close.

301
00:22:58,950 --> 00:23:02,310
Let's click on this one again close again.

302
00:23:02,310 --> 00:23:06,350
So now let's actually solve the problem with these components here.

303
00:23:06,390 --> 00:23:08,480
So I don't want this close button to be here.

304
00:23:08,470 --> 00:23:15,290
I want this coolest button here to be according to the left hand side of the device of the screen actually.

305
00:23:15,450 --> 00:23:18,700
And I want to see the whole value of this text here.

306
00:23:18,870 --> 00:23:24,950
So let's go back to android studio and let's go to this pop up on the line of Windows that exemplify.

307
00:23:25,080 --> 00:23:26,660
Let's go to the design tab.

308
00:23:26,860 --> 00:23:30,460
And now let's actually just select this text here.

309
00:23:30,540 --> 00:23:33,340
This text view.

310
00:23:33,470 --> 00:23:35,060
And let's actually put it here.

311
00:23:35,930 --> 00:23:37,800
And let's select the spot.

312
00:23:37,960 --> 00:23:45,340
Just like it here to the left and let's select this takes you and just like it here a little bit to

313
00:23:45,340 --> 00:23:46,850
the left here.

314
00:23:49,860 --> 00:23:52,070
And now I think it's fine.

315
00:23:52,070 --> 00:23:54,130
So let's actually run an application again.

316
00:23:55,100 --> 00:23:56,400
Let me show you the emulator

317
00:23:59,260 --> 00:24:06,400
let me click on this show off a window and now I can see this button here close and I can see this it

318
00:24:06,490 --> 00:24:12,310
takes you and I can see this of you but you can see that at the below Actually it'd be really out there

319
00:24:12,310 --> 00:24:14,460
relatively old blue below this pop up window.

320
00:24:14,650 --> 00:24:16,380
It's actually not.

321
00:24:16,370 --> 00:24:21,270
It's not allowing us to see these values these components clearly.

322
00:24:21,580 --> 00:24:24,710
So let's go back to android studio.

323
00:24:24,850 --> 00:24:27,350
So there are two ways to solve this problem.

324
00:24:27,520 --> 00:24:29,890
Let's go to a main activity that you have a file.

325
00:24:30,130 --> 00:24:35,860
And after this line of code that actually sets the location of the pop up window that is it can actually

326
00:24:35,950 --> 00:24:40,740
set the location of the pop up into and it's going to show that pop up window on that location after

327
00:24:40,750 --> 00:24:42,240
this line of code here.

328
00:24:42,420 --> 00:24:54,450
You can say PTEN sure of a window that said visibility view that invisible right.

329
00:24:54,650 --> 00:25:00,320
And after we actually did it click on this pop up view pop up window that dismiss here.

330
00:25:00,400 --> 00:25:11,310
I can actually say a bit here and show pop up window that said visibility view that visible.

331
00:25:11,710 --> 00:25:14,140
So let's run our application now.

332
00:25:14,140 --> 00:25:15,610
Now let's click on this.

333
00:25:15,610 --> 00:25:21,680
Sure pop up window and here you can see that the button that between show up a window is now invisible.

334
00:25:21,690 --> 00:25:22,430
Right.

335
00:25:22,540 --> 00:25:24,730
And if you actually click on this close button again.

336
00:25:24,760 --> 00:25:26,280
Now this button is visible.

337
00:25:26,470 --> 00:25:27,380
If I click on it again.

338
00:25:27,400 --> 00:25:34,570
Now we have this pop up window and the BT and sure pop up window here below is a pop up into it is now

339
00:25:34,570 --> 00:25:35,750
visible invisible.

340
00:25:35,950 --> 00:25:39,250
And if I actually click on this close with and again it is now visible.

341
00:25:39,670 --> 00:25:41,820
So this is one way to solve this problem.

342
00:25:41,830 --> 00:25:48,820
Another way is to actually go to these pop up window that exemplified here and I can just select this

343
00:25:48,880 --> 00:25:54,770
relatively out and now I can get you to specify a value for the background color.

344
00:25:54,850 --> 00:25:55,470
Right.

345
00:25:55,510 --> 00:26:01,990
So here just select is relatively out and inside this property section I can select one of these properties

346
00:26:02,020 --> 00:26:08,500
and search for background attribute or I can actually go to these text type here at the bottom and here

347
00:26:08,530 --> 00:26:11,050
at the top as you can see we have this relatively off right.

348
00:26:11,140 --> 00:26:16,450
So below this ending type I can actually just type in here background and I can actually paste this

349
00:26:16,450 --> 00:26:21,300
value here hash tag 41 69 eeven.

350
00:26:21,310 --> 00:26:24,690
So this is actually a color you can see this color here.

351
00:26:25,070 --> 00:26:30,550
And now let's go to our design Tatman and now you can see that the back in of the relatively is now

352
00:26:30,580 --> 00:26:31,880
changed.

353
00:26:32,030 --> 00:26:33,640
Let's run an application here.

354
00:26:33,640 --> 00:26:35,490
Let me show you the emulator.

355
00:26:36,070 --> 00:26:37,620
So now our application is running.

356
00:26:37,660 --> 00:26:39,750
Let's click on the shop window.

357
00:26:39,760 --> 00:26:46,360
Now you can see that the background color of this actually of this pop up window is now this color is

358
00:26:46,360 --> 00:26:47,370
now changed.

359
00:26:47,620 --> 00:26:48,970
Let's go to this activity.

360
00:26:49,000 --> 00:26:50,940
Let's go to the main activity that of a fine.

361
00:26:51,130 --> 00:26:57,440
And here let's comment out these codes that actually sets the visibility of the BT and sure pop up window.

362
00:26:57,640 --> 00:27:00,220
Let's run the application again.

363
00:27:00,220 --> 00:27:01,720
Let me show you the emulator.

364
00:27:03,590 --> 00:27:04,940
Now let's click on this.

365
00:27:04,940 --> 00:27:11,680
Sure pop up window and here you can see that I'll do that but it is below these pop up window.

366
00:27:11,690 --> 00:27:16,040
You can actually see these pop up into here we can see all these components.

367
00:27:16,040 --> 00:27:20,700
The button the text and the imagery you click on this close here.

368
00:27:21,020 --> 00:27:22,420
So now it is gone.

369
00:27:22,880 --> 00:27:25,060
So I think that's enough for this application.

370
00:27:25,070 --> 00:27:30,620
And if you have any questions about pop up into Android please post the discussion in the course and

371
00:27:30,620 --> 00:27:32,820
then I'll do my best to answer all of your questions.

372
00:27:32,990 --> 00:27:36,280
Thank you very much for watching and seeing the next 30 odd.

