1 00:00:01,090 --> 00:00:05,650 There are some Gotland concepts and styles used in compose that we need to talk about. 2 00:00:06,010 --> 00:00:10,870 Some we already discussed in the previous column lectures but need to go over them again. 3 00:00:11,110 --> 00:00:16,450 And others you might be hearing for the first time because Jetpack Compose is built around Scotland 4 00:00:16,450 --> 00:00:24,910 specific styles we need to get familiar with so that we can easily understand the APIs Campos has available 5 00:00:24,910 --> 00:00:25,360 for us. 6 00:00:26,860 --> 00:00:33,580 So default arguments are initial values given to a method parameter is at the point of creation. 7 00:00:33,970 --> 00:00:42,250 So for example, the Button Composable is created with several parameters for which most of them have 8 00:00:42,250 --> 00:00:49,420 initial values or default arguments, making it possible to call a button composable without needing 9 00:00:49,420 --> 00:00:51,730 to provide values for all of them. 10 00:00:52,270 --> 00:00:55,120 So let's look at the use of button elements. 11 00:00:56,050 --> 00:01:00,730 So the Button Composable requires on click and content arguments. 12 00:01:01,450 --> 00:01:08,590 When we look back in the previous slide, we see that both declarations had no assignment symbol that 13 00:01:08,590 --> 00:01:16,320 is this equal sign, making it necessary to provide them when the method is called and others are optional, 14 00:01:16,510 --> 00:01:20,050 depending on the requirements you have for the composable. 15 00:01:20,530 --> 00:01:26,650 So you see here there are many that have an equal sign, which means they have something defined to 16 00:01:26,650 --> 00:01:27,460 them by default. 17 00:01:29,620 --> 00:01:30,010 All right. 18 00:01:30,100 --> 00:01:36,550 Another concept is higher order functions, which are functions that accept order functions as an argument 19 00:01:36,910 --> 00:01:39,400 and compose uses them a lot. 20 00:01:40,660 --> 00:01:47,530 Let's look at this example with the court block we can directly at the function body with what should 21 00:01:47,530 --> 00:01:55,540 happen when the button is clicked, and that is using a function as an argument, which is possible 22 00:01:55,540 --> 00:01:56,680 with the help of Lambda. 23 00:01:57,190 --> 00:02:03,160 So we can also decide to create a normal functioning and call it within the block itself. 24 00:02:05,130 --> 00:02:09,210 So we have used trailing lambdas already in previous lectures. 25 00:02:09,509 --> 00:02:15,930 They are a special syntax for calling higher order functions whose power meter is a lambda outside of 26 00:02:15,930 --> 00:02:16,800 parentheses. 27 00:02:17,910 --> 00:02:23,700 So the romance requires a content parameter, which is a London. 28 00:02:24,270 --> 00:02:29,280 So this code works but can look better when placed outside of the parentheses. 29 00:02:30,900 --> 00:02:38,250 This is an example of a trading lumber, which is outside the role parentheses, and therefore the parentheses 30 00:02:38,250 --> 00:02:38,910 is removed. 31 00:02:39,510 --> 00:02:42,930 This way, it looks more concise and less cumbersome. 32 00:02:43,560 --> 00:02:45,210 So let's compare that you see. 33 00:02:46,140 --> 00:02:46,650 Like this. 34 00:02:46,860 --> 00:02:50,340 So we didn't need to define the content in the brackets and so forth. 35 00:02:50,910 --> 00:02:53,280 So next, our delegated properties. 36 00:02:53,460 --> 00:03:00,030 These are variables declared with the by keyword and are usually associated with a state. 37 00:03:00,360 --> 00:03:07,050 For example, the name state is declared using the remember keyword, and then it's used within the 38 00:03:07,050 --> 00:03:10,980 text field to track the value directly when it changes. 39 00:03:11,640 --> 00:03:14,250 We will see more of this in coming lectures. 40 00:03:16,050 --> 00:03:23,850 And then destructing data classes, so destructing simply means creating multiple variables at once, 41 00:03:24,150 --> 00:03:31,110 an example, this one creating reference ID and constraint layout as we have used before with create 42 00:03:31,110 --> 00:03:37,920 refs, we can create different IDs at a goal and use them as required, so we don't need to set them 43 00:03:37,920 --> 00:03:39,420 up all one by one. 44 00:03:39,750 --> 00:03:45,210 A very important additional aspect of what we need to look at our code routines, which offer asynchronous 45 00:03:45,210 --> 00:03:51,930 programming support and can suspend execution without blocking the main threat and jetpack compose is 46 00:03:51,930 --> 00:03:58,200 a reactive UI framework and changes its state as the user interacts with it. 47 00:03:58,770 --> 00:04:05,910 These states can require heavy processing and need to be performed without blocking the UI. 48 00:04:05,950 --> 00:04:14,040 Threat Compose makes this easier by embracing code routine at API level rather than using callbacks. 49 00:04:14,340 --> 00:04:16,140 So let's look at an example here. 50 00:04:16,560 --> 00:04:22,980 A snack bar function is a call routine function, and we can easily call the Remember code routine scope 51 00:04:23,340 --> 00:04:26,910 and then launch a block for show snack bar. 52 00:04:26,910 --> 00:04:28,650 So showing the snack bar. 53 00:04:29,130 --> 00:04:35,790 We're going to learn more about all of the idiomatic Cortland codes in the coming lectures. 54 00:04:36,770 --> 00:04:42,800 All right, so this was a little overview slash introduction to new topics just to give you a first 55 00:04:42,800 --> 00:04:43,580 look at them. 56 00:04:43,760 --> 00:04:48,050 We are going to work with those in more depth, obviously. 57 00:04:48,440 --> 00:04:51,080 So see you in the next couple of videos.