WEBVTT

00:00.080 --> 00:00.960
Welcome back.

00:01.240 --> 00:05.440
Till now we have the title, the text fields and the button.

00:05.440 --> 00:08.720
We need to display the results here in a card.

00:08.720 --> 00:13.600
So inside the screens package, create a new Kotlin file.

00:13.640 --> 00:17.760
Name it as prediction result card.

00:17.800 --> 00:22.160
Start with composable prediction result card.

00:22.160 --> 00:25.560
And this card takes an MPEG.

00:26.120 --> 00:29.080
It's of type float as a parameter.

00:29.080 --> 00:31.120
Let me hide this window.

00:31.480 --> 00:35.920
And here let's start with the card composable.

00:35.920 --> 00:38.200
Specify some parameters.

00:38.320 --> 00:43.240
Modifier fill maximum width and the card defaults.

00:43.240 --> 00:51.240
Import card defaults and import the fill maximum width card elevation for DP which is good, and inside

00:51.240 --> 01:03.000
this card start with a new column modifier padding 24 DP horizontal alignment alignment dot center horizontal.

01:03.100 --> 01:06.620
Let's create a new column inside it.

01:06.620 --> 01:10.220
Or another composable text composable.

01:10.220 --> 01:13.940
And here we need to set like a predicted mileage.

01:13.940 --> 01:24.980
So a title it represents a typo for the predicted mileage style equals to material theme typography

01:25.220 --> 01:26.660
dot title media.

01:26.700 --> 01:28.820
This is the first composable.

01:28.820 --> 01:36.980
Inside this column, create another text and the MPG float that it is passed here.

01:37.020 --> 01:42.180
Create a spacer between them ADP copy and paste it here.

01:42.220 --> 01:42.700
Okay.

01:42.860 --> 01:49.460
The last thing we need to display is the ratio or fuel efficiency rating.

01:49.460 --> 01:53.780
So here efficiency rating we need to display it in a text.

01:53.780 --> 01:56.500
So text a fuel efficiency rating.

01:56.660 --> 01:59.780
Also you can replace it with rating.

01:59.780 --> 02:03.220
So here let me show you like this.

02:03.220 --> 02:05.060
Create a new variable.

02:05.170 --> 02:07.730
Efficiency equals to when.

02:08.050 --> 02:10.210
This is the logic here.

02:10.210 --> 02:15.970
If mpg less than 15 or greater than 15.

02:16.130 --> 02:18.730
Let me make it greater than 15.

02:18.770 --> 02:19.850
It's average.

02:20.050 --> 02:21.170
So average.

02:21.330 --> 02:26.210
If mpg greater than 20 it's good.

02:26.250 --> 02:31.810
If mpg greater than 25 it's excellent.

02:31.810 --> 02:36.890
Otherwise display it is low or poor okay.

02:36.930 --> 02:37.450
Okay.

02:37.490 --> 02:38.530
This is the logic.

02:38.530 --> 02:41.290
We need to see the MPG.

02:41.330 --> 02:43.570
If it is greater than 20, go and display.

02:43.570 --> 02:45.490
Good greater than 25.

02:45.530 --> 02:46.090
Excellent.

02:46.090 --> 02:47.370
Greater than 15.

02:47.410 --> 02:50.170
Average and else display poor.

02:50.210 --> 02:56.890
Here set the text to the efficiency variable material theme title medium.

02:56.930 --> 03:06.170
Okay, this is the prediction result card and this is used to display the result under the button here.
