diff --git a/app/src/main/java/com/dougkeen/bart/activities/AbstractRouteSelectionFragment.java b/app/src/main/java/com/dougkeen/bart/activities/AbstractRouteSelectionFragment.java
index 0834ef8..a23c9e0 100644
--- a/app/src/main/java/com/dougkeen/bart/activities/AbstractRouteSelectionFragment.java
+++ b/app/src/main/java/com/dougkeen/bart/activities/AbstractRouteSelectionFragment.java
@@ -14,6 +14,8 @@ import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.Toast;
@@ -80,6 +82,16 @@ public abstract class AbstractRouteSelectionFragment extends DialogFragment {
.findViewById(R.id.destination_spinner);
destinationSpinner.setAdapter(destinationSpinnerAdapter);
destinationSpinner.setSelection(lastSelectedDestinationPosition);
+
+ final ImageButton swapButton = (ImageButton) dialog.findViewById(R.id.swap_button);
+ swapButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ int destinationSelection = destinationSpinner.getSelectedItemPosition();
+ destinationSpinner.setSelection(originSpinner.getSelectedItemPosition());
+ originSpinner.setSelection(destinationSelection);
+ }
+ });
}
@NonNull
diff --git a/app/src/main/res/drawable-hdpi/ic_action_action_swap_vert.png b/app/src/main/res/drawable-hdpi/ic_action_action_swap_vert.png
new file mode 100755
index 0000000..b38e013
Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_action_swap_vert.png differ
diff --git a/app/src/main/res/drawable-mdpi/ic_action_action_swap_vert.png b/app/src/main/res/drawable-mdpi/ic_action_action_swap_vert.png
new file mode 100755
index 0000000..a150679
Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_action_swap_vert.png differ
diff --git a/app/src/main/res/drawable-xhdpi/ic_action_action_swap_vert.png b/app/src/main/res/drawable-xhdpi/ic_action_action_swap_vert.png
new file mode 100755
index 0000000..4e909de
Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_action_swap_vert.png differ
diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_action_swap_vert.png b/app/src/main/res/drawable-xxhdpi/ic_action_action_swap_vert.png
new file mode 100755
index 0000000..b926188
Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_action_swap_vert.png differ
diff --git a/app/src/main/res/drawable-xxxhdpi/ic_action_action_swap_vert.png b/app/src/main/res/drawable-xxxhdpi/ic_action_action_swap_vert.png
new file mode 100755
index 0000000..1236129
Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi/ic_action_action_swap_vert.png differ
diff --git a/app/src/main/res/layout/route_form.xml b/app/src/main/res/layout/route_form.xml
index 4f99219..552ffbd 100644
--- a/app/src/main/res/layout/route_form.xml
+++ b/app/src/main/res/layout/route_form.xml
@@ -38,16 +38,25 @@
android:text="@string/origin"
android:textSize="15sp">
+
+