1
00:00:00,220 --> 00:00:04,940
Hi everyone in this theater I a touch about spinner in Android.

2
00:00:05,070 --> 00:00:11,690
So let's create an android studio project so the name of the application is going to be Spanair in Android

3
00:00:12,160 --> 00:00:16,580
and that you can specify the company domain the package name and the project location just going to

4
00:00:16,590 --> 00:00:19,430
the next dimension is going to be as always.

5
00:00:19,430 --> 00:00:24,300
API 16 Android 4.1 jellybean for phone and tablet next.

6
00:00:24,510 --> 00:00:26,930
And here is empty activity next.

7
00:00:26,940 --> 00:00:27,930
So here are.

8
00:00:28,050 --> 00:00:29,310
Just don't change anything.

9
00:00:29,310 --> 00:00:30,550
Just click on finish.

10
00:00:30,690 --> 00:00:34,870
Just leave things as default.

11
00:00:35,000 --> 00:00:38,010
So now as you can see here my project is created.

12
00:00:38,120 --> 00:00:40,260
So let's first design the application.

13
00:00:40,270 --> 00:00:48,640
So inside this android structure here just open up this app folder and then open this rest folder and

14
00:00:48,650 --> 00:00:50,110
in here you can see this layout folder.

15
00:00:50,120 --> 00:00:54,170
Just open it and double click and this activity underlayment and examine.

16
00:00:54,290 --> 00:00:58,430
So let's actually close this preview by just clicking on this option here.

17
00:00:58,440 --> 00:01:02,120
This sidebar button actually so that you can actually collapse it.

18
00:01:02,120 --> 00:01:03,850
So let's go to the Design tab.

19
00:01:04,250 --> 00:01:05,910
And now let's delete this.

20
00:01:05,960 --> 00:01:07,130
Hello world view.

21
00:01:07,130 --> 00:01:12,110
First of all at the bottom it's actually just click on the text tab and you can see that we have this

22
00:01:12,110 --> 00:01:13,430
constraint layout.

23
00:01:13,520 --> 00:01:17,410
I don't want this constant entry at least actually to change to a relatively short.

24
00:01:17,510 --> 00:01:20,940
So just select it and just type in here really play out.

25
00:01:21,440 --> 00:01:27,050
And now as you can see the address that you put is relatively healthy it inside is a closing tag.

26
00:01:27,320 --> 00:01:28,940
So let's go back to Design tab.

27
00:01:29,060 --> 00:01:33,180
Let me actually just double click on this activity on the last minute example tab here.

28
00:01:33,320 --> 00:01:35,040
In order to make this area there.

29
00:01:35,240 --> 00:01:41,210
First of all I'm going to actually write linearly as vertical here into this relatively as here.

30
00:01:41,240 --> 00:01:44,990
So this pallet section you can see different taps.

31
00:01:44,990 --> 00:01:49,210
So let's click on these layouts tab and then you can see these options.

32
00:01:49,370 --> 00:01:52,410
Let's select these linearly out vertical here.

33
00:01:52,820 --> 00:01:58,300
Just drag it and put it here at the center of this relatively out and then release it.

34
00:01:58,310 --> 00:02:00,800
So now we have this linearly as vertical here.

35
00:02:01,010 --> 00:02:05,120
Let's write a text into this linearly out where it's called.

36
00:02:05,120 --> 00:02:11,810
So instead these politicians can all select these text view and to strike it here into these linear

37
00:02:11,810 --> 00:02:18,500
layouts where ethical and less actually change the ID to do don't have to change the ID because we don't

38
00:02:18,500 --> 00:02:23,860
want to interact with mistakes from our job because let's change the text of this text view.

39
00:02:24,050 --> 00:02:29,920
So the text is going to be Please select one of.

40
00:02:30,070 --> 00:02:35,740
Please select one sport one sport and that person into the general keyboard.

41
00:02:35,810 --> 00:02:36,860
So that's enough.

42
00:02:36,860 --> 00:02:41,290
Let's actually try a spinner into our linearly out of vertical.

43
00:02:41,720 --> 00:02:47,180
So in order to actually use our spinnet into our linearly spectacle that's actually at the bottom just

44
00:02:47,180 --> 00:02:50,090
click and this takes tab here at the bottom.

45
00:02:50,240 --> 00:02:57,390
So here I want to show you that you can also create a user interface component just by using XML codes.

46
00:02:57,680 --> 00:03:02,690
So now I am I have this relatively out right inside this relatively out.

47
00:03:02,690 --> 00:03:08,540
We have this linearly out and inside it linearly and we have these takes you can also take a look at

48
00:03:08,540 --> 00:03:12,510
the preview by just clicking on this preview button here.

49
00:03:12,550 --> 00:03:14,330
Now let me close this preview.

50
00:03:14,330 --> 00:03:17,780
So after this takes you I am still inside this linearly.

51
00:03:17,830 --> 00:03:18,360
Right.

52
00:03:18,380 --> 00:03:24,890
I can actually create a spinner or just open attack and just open spinner and just press on and can

53
00:03:24,890 --> 00:03:29,030
you keyboard just select this option and then press on until you on your keyboard.

54
00:03:29,060 --> 00:03:34,530
So we have Android that support that visitant that widget that app compered spinner.

55
00:03:34,970 --> 00:03:40,600
So for the layout we just assign the value that content.

56
00:03:40,880 --> 00:03:43,900
And for the layout height also assigned the value or content.

57
00:03:44,060 --> 00:03:44,710
OK.

58
00:03:44,900 --> 00:03:51,590
So now let's specify an ID for these spinners so just came in here already and just this one an at sign

59
00:03:51,590 --> 00:03:54,500
Plus Id choose this one and then present it to your keyboard.

60
00:03:54,500 --> 00:03:57,190
So not after this slash I can specify the item.

61
00:03:57,260 --> 00:04:02,530
So it's very important that that you when you want to specify an item for a component first add sign

62
00:04:02,540 --> 00:04:05,000
Plus the slash after the slash.

63
00:04:05,000 --> 00:04:06,660
I can't say spinner.

64
00:04:06,860 --> 00:04:08,490
So this is going to be the ID.

65
00:04:08,720 --> 00:04:09,300
Right.

66
00:04:09,590 --> 00:04:13,360
So now we have the sticks and this and this spinner.

67
00:04:13,390 --> 00:04:15,470
And take a look at this preview.

68
00:04:15,470 --> 00:04:18,180
We have the stakes here and we have this spinner.

69
00:04:18,440 --> 00:04:21,320
So let's see how we can actually use this spinner.

70
00:04:21,320 --> 00:04:26,390
Let's open the Andray structure here looking at the top just click on view windows and then click on

71
00:04:26,390 --> 00:04:32,720
project in order to actually the height or actually show this view here.

72
00:04:32,930 --> 00:04:38,150
Now let's open the app folder open the rest folder and then open these values folder.

73
00:04:38,180 --> 00:04:40,770
Just click on these things that XML file.

74
00:04:41,240 --> 00:04:43,220
And now we have these resources here.

75
00:04:43,400 --> 00:04:45,360
I want to create an R-ALA resources.

76
00:04:45,390 --> 00:04:52,120
So inside these resources Tadg I actually put an opening tag and just type in here.

77
00:04:53,100 --> 00:05:03,200
So select is one string at a certain name is going to be sports underline name sports name and then

78
00:05:03,410 --> 00:05:05,410
just put a closing in here.

79
00:05:05,690 --> 00:05:08,620
So now we have this closing tag and R8 right.

80
00:05:08,750 --> 00:05:09,880
So insert this at a.

81
00:05:09,920 --> 00:05:11,340
I can actually put items.

82
00:05:11,370 --> 00:05:19,370
So just open attack item and then close it but just putting a closing tag and inside this tag I can

83
00:05:19,370 --> 00:05:21,750
just type in the first spot.

84
00:05:21,830 --> 00:05:27,450
Could be football I can create another item here.

85
00:05:27,470 --> 00:05:30,670
So again hit him and then close it.

86
00:05:30,710 --> 00:05:36,640
And the second spot is going to be for example boxing.

87
00:05:36,700 --> 00:05:38,440
Let's create another sport.

88
00:05:38,470 --> 00:05:42,830
So the first stop at the first sport is going to be for example teach boxing.

89
00:05:46,110 --> 00:05:48,290
Open item.

90
00:05:48,390 --> 00:05:53,820
The fourth one is going to be body building for example body building.

91
00:05:55,980 --> 00:06:00,100
And let's create another item so here I can get you to say take one do

92
00:06:04,220 --> 00:06:04,710
OK.

93
00:06:04,920 --> 00:06:09,180
And here I can create another item.

94
00:06:09,210 --> 00:06:13,930
So the last one is going to be to do.

95
00:06:14,430 --> 00:06:15,180
So that's enough.

96
00:06:15,180 --> 00:06:17,570
OK so we have actually a strange array.

97
00:06:17,820 --> 00:06:19,570
And inside this area we have these items.

98
00:06:19,580 --> 00:06:21,920
So these are the elements of this Adye.

99
00:06:21,990 --> 00:06:25,880
So now let's go to main activity of a fight.

100
00:06:26,130 --> 00:06:30,620
And first of all of you to actually create some valuables inside this class.

101
00:06:30,660 --> 00:06:36,270
So the first one is going to be actually spinner and the name is going to be Spino semicolon.

102
00:06:36,270 --> 00:06:38,010
I just declare this valuable here.

103
00:06:38,100 --> 00:06:42,170
And the second one is going to be adapter and the name is going to be adapter's semi-colon.

