1
00:00:05,200 --> 00:00:09,400
Welcome back. Our parameterized view seems to be working well.

2
00:00:09,800 --> 00:00:12,100
We should make the report update automatically

3
00:00:12,100 --> 00:00:15,200
when the user changes the number of seconds they want to ignore,

4
00:00:15,700 --> 00:00:17,360
and that's an easy change to make.

5
00:00:18,020 --> 00:00:22,010
We're already observing the database, using the content observer

6
00:00:22,010 --> 00:00:26,610
that we create on line 35 of the DurationsViewModel class.

7
00:00:27,410 --> 00:00:31,770
Changes to the database result in the OnChange function being called

8
00:00:32,270 --> 00:00:36,070
and that loads the report data again on line 38.

9
00:00:36,950 --> 00:00:40,550
At the moment, we're only observing the timings table.

10
00:00:40,910 --> 00:00:42,910
We set that up in the init block

11
00:00:45,110 --> 00:00:46,710
on line 100.

12
00:00:47,310 --> 00:00:51,670
We can use the same observer to observe changes in more than one table.

13
00:00:52,220 --> 00:00:56,420
In this case, we want to reload the data if the parameter changes.

14
00:00:57,080 --> 00:00:59,380
The code is the same as on line 100,

15
00:00:59,740 --> 00:01:03,240
but we use the ParametersContract URI instead.

16
00:01:20,140 --> 00:01:22,640
Run the app, and let's go back to the reports.

17
00:01:29,440 --> 00:01:33,240
Make a mental note of the values or refer to your spreadsheet,

18
00:01:33,900 --> 00:01:37,560
then set the ignore timings value back to 0 in the settings.

19
00:01:38,220 --> 00:01:42,680
Let's watch task 1 it's currently at 5 minutes and 4 seconds.

20
00:01:51,680 --> 00:01:52,930
Tap okay,

21
00:01:52,930 --> 00:01:57,290
and the report updates immediately as we can see task 1 is now 5 minutes

22
00:01:57,290 --> 00:01:58,280
and 7 seconds.

23
00:01:59,270 --> 00:02:01,870
I'll try a few more tests just to be sure.

24
00:02:02,860 --> 00:02:05,960
Change the ignore timings to less than 30.

25
00:02:07,150 --> 00:02:10,449
And as you can see the report now shows much smaller values.

26
00:02:11,440 --> 00:02:15,040
As you try different values, make sure the report is correct.

27
00:02:15,920 --> 00:02:18,620
It's also worth setting the value to its maximum,

28
00:02:18,620 --> 00:02:21,220
which should remove all data from the report

29
00:02:21,770 --> 00:02:23,870
unless you did some very long timings.

30
00:02:24,870 --> 00:02:27,370
Remember set it back to a smaller value,

31
00:02:27,370 --> 00:02:29,620
otherwise you'll wonder where your data's all gone.

32
00:02:30,280 --> 00:02:34,680
In the next video, we'll look at the last item in our list of improvements,

33
00:02:34,680 --> 00:02:38,040
the collation issue. We'll see what the issue is,

34
00:02:38,040 --> 00:02:39,340
and how to fix it.

35
00:02:39,940 --> 00:02:40,940
I'll see you in that one.

