WEBVTT

00:00.830 --> 00:02.390
In Jetpack Compose.

00:02.390 --> 00:08.120
The text composable is used to display text within your user interface.

00:08.120 --> 00:12.110
It's one of the fundamental building blocks for creating user interfaces.

00:12.110 --> 00:13.340
In Jetpack Compose.

00:13.340 --> 00:22.940
With text, you can display static text or dynamically updated based on variables or other stateful

00:22.940 --> 00:23.870
information.

00:23.870 --> 00:31.910
The text composable takes a text parameter which specifies the content of the text to be displayed.

00:31.910 --> 00:36.860
This can be simple, string literal, or a dynamically generated text.

00:36.860 --> 00:38.000
For example.

00:38.030 --> 00:42.560
Hello master coding app.

00:42.560 --> 00:47.180
Let's create another text that uses a dynamic text.

00:47.210 --> 00:52.670
Hello, and I'll use the name, variable and parameter that it is passed to.

00:52.700 --> 00:54.830
Greeting function name.

00:54.830 --> 01:04.150
If we click on the text control and left mouse or you hover your mouse, you can get all parameters

01:04.150 --> 01:07.750
that we can specify for the text composable.

01:07.750 --> 01:11.950
So Ctrl and left mouse we can open the composable function.

01:11.950 --> 01:19.030
And you can see there are a lot of attributes we can specify for the text.

01:19.030 --> 01:26.200
For example the modifier, the color, font size, font style, font weight, family and others.

01:26.230 --> 01:30.700
Okay, so for example, I can use the color.

01:30.730 --> 01:32.260
Let me show you.

01:32.290 --> 01:40.150
For the first text I'm going to use color equals to color dot red.

01:40.150 --> 01:45.490
If we click on this split mode we can see there are two texts.

01:45.520 --> 01:49.660
Two texts are displayed or and overlapped.

01:49.690 --> 01:54.520
I'll remove this text for now in order to see the changes.

01:54.520 --> 01:58.750
On the first text, you can see the color red is applied.

01:58.750 --> 02:03.110
You can customize the appearance of the text using the style Parameter.

02:03.140 --> 02:09.050
This includes properties such as font size, font family, font weight, text color, and more.

02:09.080 --> 02:13.730
For example, I'm going to use the font style.

02:13.760 --> 02:21.950
Don't miss to separate attributes by comma font style and I'll use for example, italic.

02:21.980 --> 02:30.470
Moreover, you can use font family and you can define your own fonts, but I'll use the predefined font

02:30.500 --> 02:33.260
families, for example cursive.

02:33.290 --> 02:36.980
You can see the cursive text is applied.

02:37.010 --> 02:44.540
Also I can use text style and decoration equals to text decoration dot line through.

02:44.600 --> 02:48.950
Okay, so there are a lot of styling for the text.

02:48.950 --> 02:54.290
I can combine, underline and line through using a list.

02:54.320 --> 02:55.820
Please pay attention here.

02:55.820 --> 02:59.660
Text decoration I'm going to use the combine function.

02:59.660 --> 03:08.320
And here I define a list of the decoration that I want to set for the text decoration attribute, for

03:08.320 --> 03:08.950
example.

03:08.980 --> 03:10.510
Text decoration line through.

03:10.540 --> 03:14.500
This is the first styling and the text decoration.

03:14.500 --> 03:22.360
This is the second element inside this list of text decorations that I want to apply to my text.

03:22.390 --> 03:27.130
You can see that I have a line through and underline okay.

03:27.160 --> 03:29.080
This is a very important point.

03:29.080 --> 03:33.940
Also for alignment I can use text align attribute.

03:33.940 --> 03:37.900
I can set text align center as a quick recap.

03:37.900 --> 03:45.190
You can customize the appearance and behavior of the text by providing additional parameters to the

03:45.190 --> 03:45.610
text.

03:45.610 --> 03:51.970
Composable like the color, font style, font family, text decoration, text alignment, and others.

03:52.000 --> 04:00.430
The text composable is versatile and essential for displaying textual content in Jetpack Compose based

04:00.430 --> 04:02.410
Android applications
