forked from upstream-mirrors/OpenTracks
Tidy up to adhere to style guidlines
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
package com.google.android.apps.mytracks;
|
package com.google.android.apps.mytracks;
|
||||||
|
|
||||||
import java.util.List;
|
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||||
|
import com.google.android.apps.mytracks.content.Track;
|
||||||
|
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||||
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
@@ -12,10 +15,7 @@ import android.view.Window;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
import java.util.List;
|
||||||
import com.google.android.apps.mytracks.content.Track;
|
|
||||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
|
||||||
import com.google.android.maps.mytracks.R;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activity for viewing the combined statistics for all the recorded tracks.
|
* Activity for viewing the combined statistics for all the recorded tracks.
|
||||||
@@ -24,8 +24,8 @@ import com.google.android.maps.mytracks.R;
|
|||||||
*
|
*
|
||||||
* @author Fergus Nelson
|
* @author Fergus Nelson
|
||||||
*/
|
*/
|
||||||
public class AggregatedStatsActivity extends Activity
|
public class AggregatedStatsActivity extends Activity implements
|
||||||
implements OnSharedPreferenceChangeListener {
|
OnSharedPreferenceChangeListener {
|
||||||
|
|
||||||
private final StatsUtilities utils;
|
private final StatsUtilities utils;
|
||||||
|
|
||||||
@@ -39,7 +39,8 @@ public class AggregatedStatsActivity extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
|
||||||
|
String key) {
|
||||||
Log.d(MyTracksConstants.TAG, "StatsActivity: onSharedPreferences changed "
|
Log.d(MyTracksConstants.TAG, "StatsActivity: onSharedPreferences changed "
|
||||||
+ key);
|
+ key);
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
@@ -64,11 +65,10 @@ public class AggregatedStatsActivity extends Activity
|
|||||||
ScrollView sv = ((ScrollView) findViewById(R.id.scrolly));
|
ScrollView sv = ((ScrollView) findViewById(R.id.scrolly));
|
||||||
sv.setScrollBarStyle(ScrollView.SCROLLBARS_OUTSIDE_INSET);
|
sv.setScrollBarStyle(ScrollView.SCROLLBARS_OUTSIDE_INSET);
|
||||||
|
|
||||||
SharedPreferences preferences =
|
SharedPreferences preferences = getSharedPreferences(
|
||||||
getSharedPreferences(MyTracksSettings.SETTINGS_NAME, 0);
|
MyTracksSettings.SETTINGS_NAME, 0);
|
||||||
if (preferences != null) {
|
if (preferences != null) {
|
||||||
metricUnits = preferences.getBoolean(MyTracksSettings.METRIC_UNITS,
|
metricUnits = preferences.getBoolean(MyTracksSettings.METRIC_UNITS, true);
|
||||||
true);
|
|
||||||
preferences.registerOnSharedPreferenceChangeListener(this);
|
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
utils.setMetricUnits(metricUnits);
|
utils.setMetricUnits(metricUnits);
|
||||||
@@ -85,9 +85,8 @@ public class AggregatedStatsActivity extends Activity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1. Reads tracks from the db
|
* 1. Reads tracks from the db 2. Merges the trip stats from the tracks 3.
|
||||||
* 2. Merges the trip stats from the tracks
|
* Updates the view
|
||||||
* 3. Updates the view
|
|
||||||
*/
|
*/
|
||||||
private void loadAggregatedStats() {
|
private void loadAggregatedStats() {
|
||||||
List<Track> tracks = retrieveTracks();
|
List<Track> tracks = retrieveTracks();
|
||||||
|
|||||||
@@ -70,8 +70,6 @@ import android.widget.RelativeLayout;
|
|||||||
import android.widget.TabHost;
|
import android.widget.TabHost;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import org.xml.sax.SAXException;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -80,6 +78,8 @@ import java.util.Random;
|
|||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The super activity that embeds our sub activities.
|
* The super activity that embeds our sub activities.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.content;
|
package com.google.android.apps.mytracks.content;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility to access data from the mytracks content provider.
|
* Utility to access data from the mytracks content provider.
|
||||||
*
|
*
|
||||||
|
|||||||
+3
-3
@@ -15,8 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.content;
|
package com.google.android.apps.mytracks.content;
|
||||||
|
|
||||||
import java.util.LinkedList;
|
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -25,7 +24,8 @@ import android.location.Location;
|
|||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class providing easy access to locations and tracks in the
|
* Helper class providing easy access to locations and tracks in the
|
||||||
|
|||||||
Reference in New Issue
Block a user