forked from upstream-mirrors/OpenTracks
Removed aggregated stats activity.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
(tbd): OpenTracks
|
(tbd): OpenTracks
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
-
|
- Removed aggregated stats
|
||||||
|
|
||||||
Bugfix:
|
Bugfix:
|
||||||
-
|
-
|
||||||
|
|||||||
@@ -30,10 +30,6 @@ limitations under the License.
|
|||||||
<!-- Activities -->
|
<!-- Activities -->
|
||||||
<activity android:name=".AboutActivity" />
|
<activity android:name=".AboutActivity" />
|
||||||
|
|
||||||
<activity
|
|
||||||
android:name=".AggregatedStatsActivity"
|
|
||||||
android:label="@string/menu_aggregated_statistics" />
|
|
||||||
|
|
||||||
<activity android:name=".DeleteActivity" />
|
<activity android:name=".DeleteActivity" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Google Inc.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
|
||||||
* the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
||||||
* License for the specific language governing permissions and limitations under
|
|
||||||
* the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package de.dennisguse.opentracks;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import de.dennisguse.opentracks.content.ContentProviderUtils;
|
|
||||||
import de.dennisguse.opentracks.content.Track;
|
|
||||||
import de.dennisguse.opentracks.stats.TripStatistics;
|
|
||||||
import de.dennisguse.opentracks.util.StatsUtils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An activity to view aggregated stats from all recorded tracks.
|
|
||||||
*
|
|
||||||
* @author Fergus Nelson
|
|
||||||
*/
|
|
||||||
public class AggregatedStatsActivity extends AbstractActivity {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
StatsUtils.setTripStatisticsValues(this, getTripStatistics(), null);
|
|
||||||
StatsUtils.setLocationValues(this, null, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected int getLayoutResId() {
|
|
||||||
return R.layout.stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the aggregated trip statistics for all the recorded tracks or null if
|
|
||||||
* there is no track.
|
|
||||||
*/
|
|
||||||
private TripStatistics getTripStatistics() {
|
|
||||||
List<Track> tracks = ContentProviderUtils.Factory.get(this).getAllTracks();
|
|
||||||
TripStatistics tripStatistics = null;
|
|
||||||
if (!tracks.isEmpty()) {
|
|
||||||
tripStatistics = new TripStatistics(tracks.iterator().next().getTripStatistics());
|
|
||||||
for (int i = 1; i < tracks.size(); i++) {
|
|
||||||
tripStatistics.merge(tracks.get(i).getTripStatistics());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return tripStatistics;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -184,7 +184,6 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
|||||||
// Menu items
|
// Menu items
|
||||||
private MenuItem searchMenuItem;
|
private MenuItem searchMenuItem;
|
||||||
private MenuItem startGpsMenuItem;
|
private MenuItem startGpsMenuItem;
|
||||||
private MenuItem aggregatedStatisticsMenuItem;
|
|
||||||
private MenuItem deleteAllMenuItem;
|
private MenuItem deleteAllMenuItem;
|
||||||
|
|
||||||
private final OnClickListener stopListener = new OnClickListener() {
|
private final OnClickListener stopListener = new OnClickListener() {
|
||||||
@@ -392,7 +391,6 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
|||||||
ActivityUtils.configureSearchWidget(this, searchMenuItem, trackController);
|
ActivityUtils.configureSearchWidget(this, searchMenuItem, trackController);
|
||||||
|
|
||||||
startGpsMenuItem = menu.findItem(R.id.track_list_start_gps);
|
startGpsMenuItem = menu.findItem(R.id.track_list_start_gps);
|
||||||
aggregatedStatisticsMenuItem = menu.findItem(R.id.track_list_aggregated_statistics);
|
|
||||||
deleteAllMenuItem = menu.findItem(R.id.track_list_delete_all);
|
deleteAllMenuItem = menu.findItem(R.id.track_list_delete_all);
|
||||||
|
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
@@ -447,10 +445,6 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
|||||||
intent = IntentUtils.newIntent(this, MarkerListActivity.class);
|
intent = IntentUtils.newIntent(this, MarkerListActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
return true;
|
return true;
|
||||||
case R.id.track_list_aggregated_statistics:
|
|
||||||
intent = IntentUtils.newIntent(this, AggregatedStatsActivity.class);
|
|
||||||
startActivity(intent);
|
|
||||||
return true;
|
|
||||||
case R.id.track_list_delete_all:
|
case R.id.track_list_delete_all:
|
||||||
deleteTracks(new long[]{-1L});
|
deleteTracks(new long[]{-1L});
|
||||||
return true;
|
return true;
|
||||||
@@ -539,9 +533,6 @@ public class TrackListActivity extends AbstractListActivity implements ConfirmDe
|
|||||||
startGpsMenuItem.setIcon(isGpsStarted ? R.drawable.ic_gps_fixed_24dp : R.drawable.ic_gps_off_24dp);
|
startGpsMenuItem.setIcon(isGpsStarted ? R.drawable.ic_gps_fixed_24dp : R.drawable.ic_gps_off_24dp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (aggregatedStatisticsMenuItem != null) {
|
|
||||||
aggregatedStatisticsMenuItem.setVisible(hasTrack);
|
|
||||||
}
|
|
||||||
if (deleteAllMenuItem != null) {
|
if (deleteAllMenuItem != null) {
|
||||||
deleteAllMenuItem.setVisible(hasTrack && !isRecording);
|
deleteAllMenuItem.setVisible(hasTrack && !isRecording);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ limitations under the License.
|
|||||||
android:icon="@drawable/ic_marker_show_24dp"
|
android:icon="@drawable/ic_marker_show_24dp"
|
||||||
android:title="@string/menu_markers"
|
android:title="@string/menu_markers"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
<item
|
|
||||||
android:id="@+id/track_list_aggregated_statistics"
|
|
||||||
android:icon="@drawable/ic_statistics_24dp"
|
|
||||||
android:title="@string/menu_aggregated_statistics" />
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/track_list_delete_all"
|
android:id="@+id/track_list_delete_all"
|
||||||
android:icon="@drawable/ic_delete_forever_24dp"
|
android:icon="@drawable/ic_delete_forever_24dp"
|
||||||
|
|||||||
Reference in New Issue
Block a user