Death to tabs! Long live spaces!

This commit is contained in:
Doug Keen 2015-08-11 18:56:23 -07:00
parent 9285836e61
commit 00faa9ec76
66 changed files with 5526 additions and 5546 deletions

View File

@ -58,8 +58,7 @@
</activity> </activity>
<activity <activity
android:name=".activities.ViewMapActivity" android:name=".activities.ViewMapActivity"
android:label="@string/system_map" > android:label="@string/system_map"></activity>
</activity>
<service <service
android:name=".services.BoardedDepartureService" android:name=".services.BoardedDepartureService"

View File

@ -153,7 +153,9 @@ public class RoutesListActivity extends Activity implements TickSubscriber {
refreshFares(); refreshFares();
} }
/** Called when the activity is first created. */ /**
* Called when the activity is first created.
*/
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);

View File

@ -296,7 +296,7 @@ public class ViewDeparturesActivity extends Activity implements
* wants to board * wants to board
*/ */
setBoardedDeparture( setBoardedDeparture(
(Departure) getListAdapter().getItem(position), true); getListAdapter().getItem(position), true);
} }
} }
}; };
@ -306,7 +306,7 @@ public class ViewDeparturesActivity extends Activity implements
public boolean onItemLongClick(AdapterView<?> adapterView, View view, public boolean onItemLongClick(AdapterView<?> adapterView, View view,
int position, long id) { int position, long id) {
mWasLongClick = true; mWasLongClick = true;
setSelectedDeparture((Departure) getListAdapter().getItem(position)); setSelectedDeparture(getListAdapter().getItem(position));
startDepartureActionMode(); startDepartureActionMode();
return false; return false;
} }
@ -472,7 +472,7 @@ public class ViewDeparturesActivity extends Activity implements
startService(intent); startService(intent);
if (startActionMode) { if (startActionMode) {
((Checkable) mYourTrainSection).setChecked(true); mYourTrainSection.setChecked(true);
startYourTrainActionMode(); startYourTrainActionMode();
} }
} }

View File

@ -22,6 +22,7 @@ package com.dougkeen.bart.controls;
import static com.nineoldandroids.view.ViewHelper.setAlpha; import static com.nineoldandroids.view.ViewHelper.setAlpha;
import static com.nineoldandroids.view.ViewHelper.setTranslationX; import static com.nineoldandroids.view.ViewHelper.setTranslationX;
import static com.nineoldandroids.view.ViewPropertyAnimator.animate; import static com.nineoldandroids.view.ViewPropertyAnimator.animate;
import android.util.Log; import android.util.Log;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.VelocityTracker; import android.view.VelocityTracker;
@ -40,7 +41,7 @@ import com.nineoldandroids.animation.ValueAnimator;
* callback). Also, a {@link android.view.View.OnTouchListener} that makes any * callback). Also, a {@link android.view.View.OnTouchListener} that makes any
* {@link View} dismissable when the user swipes (drags her finger) horizontally * {@link View} dismissable when the user swipes (drags her finger) horizontally
* across the view. * across the view.
* * <p>
* <p> * <p>
* <em>For {@link android.widget.ListView} list items that don't manage their own touch events * <em>For {@link android.widget.ListView} list items that don't manage their own touch events
* (i.e. you're using * (i.e. you're using
@ -48,11 +49,11 @@ import com.nineoldandroids.animation.ValueAnimator;
* or an equivalent listener on {@link android.app.ListActivity} or * or an equivalent listener on {@link android.app.ListActivity} or
* {@link android.app.ListFragment}, use {@link SwipeDismissListViewTouchListener} instead.</em> * {@link android.app.ListFragment}, use {@link SwipeDismissListViewTouchListener} instead.</em>
* </p> * </p>
* * <p>
* <p> * <p>
* Example usage: * Example usage:
* </p> * </p>
* * <p>
* <pre> * <pre>
* view.setOnTouchListener(new SwipeDismisser(view, null, // Optional * view.setOnTouchListener(new SwipeDismisser(view, null, // Optional
* // token/cookie * // token/cookie
@ -94,10 +95,8 @@ public class SwipeHelper implements View.OnTouchListener {
* Called when the user has indicated they she would like to dismiss the * Called when the user has indicated they she would like to dismiss the
* view. * view.
* *
* @param view * @param view The originating {@link View} to be dismissed.
* The originating {@link View} to be dismissed. * @param token The optional token passed to this object's constructor.
* @param token
* The optional token passed to this object's constructor.
*/ */
void onDismiss(View view, Object token); void onDismiss(View view, Object token);
} }
@ -105,13 +104,10 @@ public class SwipeHelper implements View.OnTouchListener {
/** /**
* Constructs a new swipe-to-dismiss touch listener for the given view. * Constructs a new swipe-to-dismiss touch listener for the given view.
* *
* @param view * @param view The view to make dismissable.
* The view to make dismissable. * @param token An optional token/cookie object to be passed through to the
* @param token
* An optional token/cookie object to be passed through to the
* callback. * callback.
* @param callback * @param callback The callback to trigger when the user has indicated that she
* The callback to trigger when the user has indicated that she
* would like to dismiss this view. * would like to dismiss this view.
*/ */
public SwipeHelper(View view, Object token, OnDismissCallback callback) { public SwipeHelper(View view, Object token, OnDismissCallback callback) {

View File

@ -7,7 +7,7 @@ import android.content.Context;
import android.os.Handler; import android.os.Handler;
public class Ticker { public class Ticker {
public static interface TickSubscriber { public interface TickSubscriber {
int getTickInterval(); int getTickInterval();
void onTick(long mTickCount); void onTick(long mTickCount);
@ -78,7 +78,7 @@ public class Ticker {
mForceStop = true; mForceStop = true;
} }
}; }
public synchronized static Ticker getInstance() { public synchronized static Ticker getInstance() {
if (sInstance == null) { if (sInstance == null) {

View File

@ -128,10 +128,10 @@ public class YourTrainLayout extends RelativeLayout implements Checkable {
R.drawable.nobike)); R.drawable.nobike));
} }
if (boardedDeparture.getRequiresTransfer()) { if (boardedDeparture.getRequiresTransfer()) {
((ImageView) findViewById(R.id.yourTrainXferIcon)) findViewById(R.id.yourTrainXferIcon)
.setVisibility(View.VISIBLE); .setVisibility(View.VISIBLE);
} else { } else {
((ImageView) findViewById(R.id.yourTrainXferIcon)) findViewById(R.id.yourTrainXferIcon)
.setVisibility(View.INVISIBLE); .setVisibility(View.INVISIBLE);
} }

View File

@ -179,10 +179,10 @@ public class DepartureArrayAdapter extends ArrayAdapter<Departure> {
bikeIcon.setImageDrawable(noBikeDrawable); bikeIcon.setImageDrawable(noBikeDrawable);
} }
if (departure.getRequiresTransfer()) { if (departure.getRequiresTransfer()) {
((ImageView) view.findViewById(R.id.xferIcon)) view.findViewById(R.id.xferIcon)
.setVisibility(View.VISIBLE); .setVisibility(View.VISIBLE);
} else { } else {
((ImageView) view.findViewById(R.id.xferIcon)) view.findViewById(R.id.xferIcon)
.setVisibility(View.INVISIBLE); .setVisibility(View.INVISIBLE);
} }

View File

@ -8,7 +8,7 @@ public enum RoutesColumns {
"AVE_TRIP_LENGTH", "INTEGER", true); "AVE_TRIP_LENGTH", "INTEGER", true);
// This class cannot be instantiated // This class cannot be instantiated
private RoutesColumns(String string, String type, Boolean nullable) { RoutesColumns(String string, String type, Boolean nullable) {
this.string = string; this.string = string;
this.sqliteType = type; this.sqliteType = type;
this.nullable = nullable; this.nullable = nullable;

View File

@ -253,7 +253,7 @@ public class Departure implements Parcelable, Comparable<Departure> {
} }
public int getMeanSecondsLeft() { public int getMeanSecondsLeft() {
return (int) getMeanSecondsLeft(getMinEstimate(), getMaxEstimate()); return getMeanSecondsLeft(getMinEstimate(), getMaxEstimate());
} }
public int getMeanSecondsLeft(long min, long max) { public int getMeanSecondsLeft(long min, long max) {

View File

@ -53,7 +53,7 @@ public enum Line {
protected final Line transferLine2; protected final Line transferLine2;
private Line(boolean directionMayInvert, Station... stationArray) { Line(boolean directionMayInvert, Station... stationArray) {
this.requiresTransfer = false; this.requiresTransfer = false;
this.directionMayInvert = directionMayInvert; this.directionMayInvert = directionMayInvert;
stations = Arrays.asList(stationArray); stations = Arrays.asList(stationArray);
@ -61,7 +61,7 @@ public enum Line {
this.transferLine2 = null; this.transferLine2 = null;
} }
private Line(Line transferLine1, Line transferLine2, Line(Line transferLine1, Line transferLine2,
Station... stationArray) { Station... stationArray) {
this.requiresTransfer = true; this.requiresTransfer = true;
this.directionMayInvert = false; this.directionMayInvert = false;
@ -70,7 +70,7 @@ public enum Line {
this.transferLine2 = transferLine2; this.transferLine2 = transferLine2;
} }
private Line(boolean directionMayInvert, Line transferLine1, Line(boolean directionMayInvert, Line transferLine1,
Line transferLine2, Station... stationArray) { Line transferLine2, Station... stationArray) {
this.requiresTransfer = true; this.requiresTransfer = true;
this.directionMayInvert = directionMayInvert; this.directionMayInvert = directionMayInvert;

View File

@ -78,20 +78,20 @@ public enum Station {
public final static int DEFAULT_DEPARTURE_EQUALITY_TOLERANCE = 119999; public final static int DEFAULT_DEPARTURE_EQUALITY_TOLERANCE = 119999;
private Station(String abbreviation, String name, String shortName, Station(String abbreviation, String name, String shortName,
boolean invertDirection, boolean endOfLine) { boolean invertDirection, boolean endOfLine) {
this(abbreviation, name, shortName, invertDirection, endOfLine, null, this(abbreviation, name, shortName, invertDirection, endOfLine, null,
null, false, DEFAULT_DEPARTURE_EQUALITY_TOLERANCE); null, false, DEFAULT_DEPARTURE_EQUALITY_TOLERANCE);
} }
private Station(String abbreviation, String name, String shortName, Station(String abbreviation, String name, String shortName,
boolean invertDirection, boolean endOfLine, String transferStation) { boolean invertDirection, boolean endOfLine, String transferStation) {
this(abbreviation, name, shortName, invertDirection, endOfLine, this(abbreviation, name, shortName, invertDirection, endOfLine,
transferStation, null, false, transferStation, null, false,
DEFAULT_DEPARTURE_EQUALITY_TOLERANCE); DEFAULT_DEPARTURE_EQUALITY_TOLERANCE);
} }
private Station(String abbreviation, String name, String shortName, Station(String abbreviation, String name, String shortName,
boolean invertDirection, boolean endOfLine, boolean invertDirection, boolean endOfLine,
String inboundTransferStation, String outboundTransferStation) { String inboundTransferStation, String outboundTransferStation) {
this(abbreviation, name, shortName, invertDirection, endOfLine, this(abbreviation, name, shortName, invertDirection, endOfLine,
@ -99,7 +99,7 @@ public enum Station {
DEFAULT_DEPARTURE_EQUALITY_TOLERANCE); DEFAULT_DEPARTURE_EQUALITY_TOLERANCE);
} }
private Station(String abbreviation, String name, String shortName, Station(String abbreviation, String name, String shortName,
boolean invertDirection, boolean endOfLine, boolean invertDirection, boolean endOfLine,
String inboundTransferStation, String outboundTransferStation, String inboundTransferStation, String outboundTransferStation,
boolean longStationLinger, int departureEqualityTolerance) { boolean longStationLinger, int departureEqualityTolerance) {

View File

@ -122,9 +122,7 @@ public class StationPair implements Parcelable {
StationPair other = (StationPair) obj; StationPair other = (StationPair) obj;
if (destination != other.destination) if (destination != other.destination)
return false; return false;
if (origin != other.origin) return origin == other.origin;
return false;
return true;
} }
@Override @Override

View File

@ -26,7 +26,7 @@ public class NetworkUtils {
} }
public static HttpResponse executeWithRecovery(final HttpUriRequest request) public static HttpResponse executeWithRecovery(final HttpUriRequest request)
throws IOException, ClientProtocolException { throws IOException {
try { try {
return getHttpClient().execute(request); return getHttpClient().execute(request);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {

View File

@ -20,8 +20,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:padding="10dp" android:padding="10dp"
android:visibility="gone" > android:visibility="gone"></com.dougkeen.bart.controls.YourTrainLayout>
</com.dougkeen.bart.controls.YourTrainLayout>
<TextView <TextView
android:id="@android:id/empty" android:id="@android:id/empty"

View File

@ -36,8 +36,7 @@
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingTop="15dip" android:paddingTop="15dip"
android:text="@string/origin" android:text="@string/origin"
android:textSize="15sp" > android:textSize="15sp"></TextView>
</TextView>
<Spinner <Spinner
android:id="@+id/destination_spinner" android:id="@+id/destination_spinner"
@ -63,8 +62,7 @@
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingTop="15dip" android:paddingTop="15dip"
android:text="@string/destination" android:text="@string/destination"
android:textSize="15sp" > android:textSize="15sp"></TextView>
</TextView>
<CheckBox <CheckBox
android:id="@+id/return_checkbox" android:id="@+id/return_checkbox"

View File

@ -9,8 +9,7 @@
android:id="@+id/numberPicker" android:id="@+id/numberPicker"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" > android:layout_weight="1"></NumberPicker>
</NumberPicker>
<TextView <TextView
android:id="@+id/textView1" android:id="@+id/textView1"

View File

@ -11,8 +11,7 @@
android:drawableLeft="@drawable/ic_action_alarm" android:drawableLeft="@drawable/ic_action_alarm"
android:gravity="center_vertical" android:gravity="center_vertical"
android:textSize="16dp" android:textSize="16dp"
android:visibility="gone" > android:visibility="gone"></TextView>
</TextView>
<TextView <TextView
android:id="@+id/yourTrainHeader" android:id="@+id/yourTrainHeader"

View File

@ -4,6 +4,5 @@
android:id="@+id/boardTrain" android:id="@+id/boardTrain"
android:icon="@drawable/ic_action_boarding" android:icon="@drawable/ic_action_boarding"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/getting_on_this_train"> android:title="@string/getting_on_this_train"></item>
</item>
</menu> </menu>

View File

@ -5,13 +5,11 @@
android:id="@+id/view" android:id="@+id/view"
android:icon="@drawable/ic_action_departure" android:icon="@drawable/ic_action_departure"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/view_departures"> android:title="@string/view_departures"></item>
</item>
<item <item
android:id="@+id/delete" android:id="@+id/delete"
android:icon="@drawable/ic_action_delete" android:icon="@drawable/ic_action_delete"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/delete"> android:title="@string/delete"></item>
</item>
</menu> </menu>

View File

@ -5,13 +5,11 @@
android:id="@+id/view_on_bart_site_button" android:id="@+id/view_on_bart_site_button"
android:icon="@drawable/ic_action_web" android:icon="@drawable/ic_action_web"
android:showAsAction="never" android:showAsAction="never"
android:title="@string/view_on_bart_site"> android:title="@string/view_on_bart_site"></item>
</item>
<item <item
android:id="@+id/view_system_map_button" android:id="@+id/view_system_map_button"
android:icon="@drawable/ic_action_map" android:icon="@drawable/ic_action_map"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/view_system_map"> android:title="@string/view_system_map"></item>
</item>
</menu> </menu>

View File

@ -5,19 +5,16 @@
android:id="@+id/add_favorite_menu_button" android:id="@+id/add_favorite_menu_button"
android:icon="@drawable/ic_action_new" android:icon="@drawable/ic_action_new"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/add_route"> android:title="@string/add_route"></item>
</item>
<item <item
android:id="@+id/view_system_map_button" android:id="@+id/view_system_map_button"
android:icon="@drawable/ic_action_map" android:icon="@drawable/ic_action_map"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="@string/view_system_map"> android:title="@string/view_system_map"></item>
</item>
<item <item
android:id="@+id/elevator_button" android:id="@+id/elevator_button"
android:icon="@drawable/ic_action_elevator" android:icon="@drawable/ic_action_elevator"
android:showAsAction="ifRoom|withText" android:showAsAction="ifRoom|withText"
android:title="Check elevator status"> android:title="Check elevator status"></item>
</item>
</menu> </menu>

View File

@ -21,7 +21,6 @@
android:id="@+id/delete" android:id="@+id/delete"
android:icon="@drawable/ic_action_delete" android:icon="@drawable/ic_action_delete"
android:showAsAction="always|withText" android:showAsAction="always|withText"
android:title="@string/delete"> android:title="@string/delete"></item>
</item>
</menu> </menu>

View File

@ -3,8 +3,7 @@
<!-- Base application theme is the default theme. --> <!-- Base application theme is the default theme. -->
<style name="AppTheme" parent="@style/Holo.Theme"> <style name="AppTheme" parent="@style/Holo.Theme"></style>
</style>
<style name="ButtonBar"> <style name="ButtonBar">
<item name="android:layout_width">fill_parent</item> <item name="android:layout_width">fill_parent</item>