Welcome back. Our parameterized view seems to be working well.
We should make the report update automatically
when the user changes the number of seconds they want to ignore,
and that's an easy change to make.
We're already observing the database, using the content observer
that we create on line 35 of the DurationsViewModel class.
Changes to the database result in the OnChange function being called
and that loads the report data again on line 38.
At the moment, we're only observing the timings table.
We set that up in the init block
on line 100.
We can use the same observer to observe changes in more than one table.
In this case, we want to reload the data if the parameter changes.
The code is the same as on line 100,
but we use the ParametersContract URI instead.
Run the app, and let's go back to the reports.
Make a mental note of the values or refer to your spreadsheet,
then set the ignore timings value back to 0 in the settings.
Let's watch task 1 it's currently at 5 minutes and 4 seconds.
Tap okay,
and the report updates immediately as we can see task 1 is now 5 minutes
and 7 seconds.
I'll try a few more tests just to be sure.
Change the ignore timings to less than 30.
And as you can see the report now shows much smaller values.
As you try different values, make sure the report is correct.
It's also worth setting the value to its maximum,
which should remove all data from the report
unless you did some very long timings.
Remember set it back to a smaller value,
otherwise you'll wonder where your data's all gone.
In the next video, we'll look at the last item in our list of improvements,
the collation issue. We'll see what the issue is,
and how to fix it.
I'll see you in that one.