Preferred rate is used for aggregated stats. Fixes #321.

Lambda expression for Observer.
This commit is contained in:
Román
2020-07-15 21:26:50 +02:00
committed by Dennis Guse
parent a2b53c75f4
commit b8d2d14d68
2 changed files with 12 additions and 12 deletions
@@ -23,15 +23,12 @@ public class AggregatedStatisticsActivity extends AbstractActivity {
listView.setEmptyView(findViewById(R.id.aggregated_stats_empty_view));
final AggregatedStatisticsModel viewModel = new ViewModelProvider(this).get(AggregatedStatisticsModel.class);
viewModel.getAggregatedStats().observe(this, new Observer<AggregatedStatistics>() {
@Override
public void onChanged(AggregatedStatistics aggregatedStatistics) {
if (aggregatedStatistics != null) {
adapter = new AggregatedStatisticsAdapter(getApplicationContext(), aggregatedStatistics);
listView.setAdapter(adapter);
}
adapter.notifyDataSetChanged();
viewModel.getAggregatedStats().observe(this, aggregatedStatistics -> {
if (aggregatedStatistics != null) {
adapter = new AggregatedStatisticsAdapter(getApplicationContext(), aggregatedStatistics);
listView.setAdapter(adapter);
}
adapter.notifyDataSetChanged();
});
}