Cleaned up warnings.
Fixed out-of-control train length/arrival est. refresh rate error.
This commit is contained in:
parent
57ef900ee6
commit
6abb0f35b6
@ -22,7 +22,7 @@ import com.dougkeen.bart.model.Departure;
|
||||
|
||||
public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
|
||||
|
||||
public static int refreshCounter = 0;
|
||||
private int refreshCounter = 1;
|
||||
|
||||
public DepartureArrayAdapter(Context context, int textViewResourceId,
|
||||
Departure[] objects) {
|
||||
@ -52,6 +52,10 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
|
||||
public DepartureArrayAdapter(Context context, int textViewResourceId) {
|
||||
super(context, textViewResourceId);
|
||||
}
|
||||
|
||||
public void incrementRefreshCounter() {
|
||||
refreshCounter++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
@ -19,18 +19,17 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.dougkeen.bart.data.RoutesColumns;
|
||||
import com.dougkeen.bart.model.Constants;
|
||||
import com.dougkeen.bart.model.Departure;
|
||||
import com.dougkeen.bart.model.RealTimeDepartures;
|
||||
import com.dougkeen.bart.model.ScheduleInformation;
|
||||
import com.dougkeen.bart.model.ScheduleItem;
|
||||
import com.dougkeen.bart.model.StationPair;
|
||||
import com.dougkeen.bart.model.RealTimeDepartures;
|
||||
import com.dougkeen.bart.model.Station;
|
||||
import com.dougkeen.bart.model.StationPair;
|
||||
import com.dougkeen.bart.networktasks.GetRealTimeDeparturesTask;
|
||||
import com.dougkeen.bart.networktasks.GetScheduleInformationTask;
|
||||
|
||||
@ -45,7 +44,7 @@ public class ViewDeparturesActivity extends ListActivity {
|
||||
private int mAverageTripLength;
|
||||
private int mAverageTripSampleCount;
|
||||
|
||||
private ArrayAdapter<Departure> mDeparturesAdapter;
|
||||
private DepartureArrayAdapter mDeparturesAdapter;
|
||||
|
||||
private ScheduleInformation mLatestScheduleInfo;
|
||||
|
||||
@ -430,7 +429,7 @@ public class ViewDeparturesActivity extends ListActivity {
|
||||
|
||||
private void runAutoUpdate() {
|
||||
if (mIsAutoUpdating && mDeparturesAdapter != null) {
|
||||
DepartureArrayAdapter.refreshCounter++;
|
||||
mDeparturesAdapter.incrementRefreshCounter();
|
||||
mDeparturesAdapter.notifyDataSetChanged();
|
||||
}
|
||||
if (hasWindowFocus()) {
|
||||
|
@ -3,8 +3,6 @@ package com.dougkeen.bart.model;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import android.R.integer;
|
||||
|
||||
public class ScheduleInformation {
|
||||
|
||||
public ScheduleInformation(Station origin, Station destination) {
|
||||
|
@ -4,11 +4,9 @@ import java.text.DateFormat;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.helpers.DefaultHandler;
|
||||
@ -16,10 +14,6 @@ import org.xml.sax.helpers.DefaultHandler;
|
||||
import android.util.Log;
|
||||
|
||||
import com.dougkeen.bart.model.Constants;
|
||||
import com.dougkeen.bart.model.Departure;
|
||||
import com.dougkeen.bart.model.Line;
|
||||
import com.dougkeen.bart.model.RealTimeDepartures;
|
||||
import com.dougkeen.bart.model.Route;
|
||||
import com.dougkeen.bart.model.ScheduleInformation;
|
||||
import com.dougkeen.bart.model.ScheduleItem;
|
||||
import com.dougkeen.bart.model.Station;
|
||||
|
Loading…
Reference in New Issue
Block a user