WEBVTT 00:00:08.760 --> 00:00:14.490 In this video we are going to write code corresponding to changing the progress of our reading using 00:00:14.490 --> 00:00:16.160 the progress slider. 00:00:16.200 --> 00:00:20.130 So using this slide we can go backward or forward. 00:00:20.590 --> 00:00:28.050 OK so if we are in reading mode we are going to say in reading mode. 00:00:28.380 --> 00:00:29.140 OK. 00:00:29.610 --> 00:00:37.260 And if we are lost in reading mode we say non-reading but so every time we change the value of this 00:00:37.860 --> 00:00:43.520 slider we are going to get a new word from our array. 00:00:43.650 --> 00:00:50.760 So to get a new word we need to get the value of the counter which changes when we change the value 00:00:50.760 --> 00:00:52.990 of the progress bar. 00:00:53.580 --> 00:01:00.510 So to save time we can copy the code from the speed slider 00:01:04.200 --> 00:01:12.570 and change the ID to progress light. 00:01:15.120 --> 00:01:16.870 So we our depression is lighter. 00:01:17.300 --> 00:01:24.970 OK this gets the new value and then we get I guess the value of the slider. 00:01:25.110 --> 00:01:30.210 We're going to use to change our counter variable. 00:01:30.750 --> 00:01:37.310 OK so before changing the counter variable we're going to need to stop reading. 00:01:37.410 --> 00:01:40.400 OK so we can delete this line of code. 00:01:40.750 --> 00:01:42.780 Ok you need it. 00:01:43.230 --> 00:01:44.870 So after we stopped reading. 00:01:45.300 --> 00:01:50.620 Now we are ready to change the counter. 00:01:51.550 --> 00:01:52.530 OK. 00:01:53.100 --> 00:01:57.210 So we are going to set the counter variable 00:02:00.420 --> 00:02:03.170 using the value of hours later 00:02:06.380 --> 00:02:08.470 . 00:02:09.540 --> 00:02:16.220 Also we will need to change the value of the progress span. 00:02:16.230 --> 00:02:19.140 OK. 00:02:20.460 --> 00:02:21.390 So there's going to be 00:02:36.600 --> 00:02:38.490 progress or percentage 00:02:46.180 --> 00:02:50.400 access they span using his ID which is percentage 00:02:53.700 --> 00:02:55.140 than before. 00:02:55.260 --> 00:02:57.750 And we're going to change its text 00:03:03.480 --> 00:03:08.770 using the formula we used before. 00:03:08.880 --> 00:03:09.390 OK. 00:03:09.570 --> 00:03:14.160 So that's the counter divided by the number of words minus one 00:03:17.210 --> 00:03:19.620 or the length of the array minus one. 00:03:20.130 --> 00:03:30.990 And then we multiply by 100 to get a percentage and we placed that earlier inside the month those flawed 00:03:31.050 --> 00:03:32.340 method. 00:03:33.260 --> 00:03:34.970 OK. 00:03:36.560 --> 00:03:38.200 OK. 00:03:39.480 --> 00:03:42.400 Now we need to change the word as well. 00:03:42.570 --> 00:03:42.900 OK. 00:03:42.900 --> 00:03:43.880 Using the counter. 00:03:43.890 --> 00:03:44.720 Very well. 00:03:44.890 --> 00:03:48.450 So right after assessing the counts of variable 00:03:51.780 --> 00:03:56.160 we can change the word. 00:03:57.660 --> 00:03:59.970 So you can access the word using 00:04:03.270 --> 00:04:04.670 the variable counter. 00:04:05.010 --> 00:04:11.630 So first of all we need to access the reading box using its ID which is the result and then we said 00:04:11.670 --> 00:04:23.520 in the text by going to the array and using the index counts All right. 00:04:24.420 --> 00:04:30.240 So if we all if we were already in reading mode we need to go back to reading. 00:04:30.840 --> 00:04:34.210 Otherwise we just stay in the not reading mode. 00:04:34.350 --> 00:04:34.710 So 00:04:37.890 --> 00:04:48.120 we're going to change this piece of code so if we are if you were already reading which means that our 00:04:48.120 --> 00:04:50.210 reading variable was set to true. 00:04:50.460 --> 00:04:50.910 OK. 00:04:51.000 --> 00:04:54.270 We're going to go back to reading. 00:04:54.720 --> 00:04:55.020 All right. 00:04:55.020 --> 00:05:00.210 Now let's save our code and try this. 00:05:00.980 --> 00:05:02.400 So let's play some text in there 00:05:09.440 --> 00:05:12.580 and start reading. 00:05:13.920 --> 00:05:19.410 So if we move the handle back go backward. 00:05:19.530 --> 00:05:20.210 OK. 00:05:20.510 --> 00:05:27.850 If we move it forward we can go forward if we pause and we change. 00:05:27.920 --> 00:05:33.480 You can see that's both the word and the progress change 00:05:33.480 --> 00:05:39.150 . 00:05:39.290 --> 00:05:41.760 OK. 00:05:44.700 --> 00:05:51.270 So now we finished all the functionality of our app and we are ready to publish is in the Google Play 00:05:51.300 --> 00:05:52.590 and absol. 00:05:52.650 --> 00:06:00.130 So in the next video we're going to learn how to do that.