eleith
/
calchoochoo
Archived
1
0
Fork 0

default to base parcel serialization

This commit is contained in:
eleith 2017-07-01 22:38:19 -07:00
parent a8c11a9f49
commit 22bfbe069a
8 changed files with 11 additions and 33 deletions

View File

@ -8,8 +8,8 @@ android {
applicationId "com.eleith.calchoochoo"
minSdkVersion 22
targetSdkVersion 25
versionCode 14
versionName "1.14"
versionCode 15
versionName "1.15"
resValue "string", "GOOGLE_MAPS_API_KEY", GOOGLE_MAPS_API_KEY
}
buildTypes {
@ -52,8 +52,8 @@ dependencies {
// sqliteasset helper
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
//Parceler
compile 'org.parceler:parceler-api:1.1.1'
apt 'org.parceler:parceler:1.1.1'
compile 'org.parceler:parceler-api:1.1.9'
apt 'org.parceler:parceler:1.1.9'
// chrome custom tabs
compile 'com.android.support:customtabs:25.3.1'
}

View File

@ -31,7 +31,6 @@
android:supportsRtl="true"
android:theme="@style/CalChooChooTheme">
<activity
android:alwaysRetainTaskState="true"
android:name=".MapSearchActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

View File

@ -53,27 +53,18 @@ public class StopActivity extends AppCompatActivity {
subscription = rxBus.observeEvents(RxMessage.class).subscribe(new HandleRxMessages());
ChooChooDrawer chooChooDrawer = new ChooChooDrawer(this, getWindow().getDecorView().getRootView());
Intent intent = getIntent();
Boolean valid = false;
if (savedInstanceState != null) {
unWrapBundle(savedInstanceState);
valid = true;
} else if (intent != null) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
String stopId = bundle.getString(BundleKeys.STOP);
if (stopId != null) {
valid = true;
chooChooLoader.loadPossibleTrains(stopId, new LocalDateTime());
chooChooLoader.loadStopByParentId(stopId);
chooChooDrawer.setStopSource(stopId);
}
chooChooLoader.loadPossibleTrains(stopId, new LocalDateTime());
chooChooLoader.loadStopByParentId(stopId);
chooChooDrawer.setStopSource(stopId);
}
}
if (!valid) {
chooChooRouterManager.loadMapSearchActivity(this);
}
}
@Override

View File

@ -82,11 +82,9 @@ public class TripActivity extends AppCompatActivity {
chooChooFab.setImageDrawable(getDrawable(R.drawable.ic_add_alarm_black_24dp));
chooChooFab.setBackgroundTintList(ColorStateList.valueOf(ColorUtils.getThemeColor(this, R.attr.colorAccent)));
Intent intent = getIntent();
Boolean valid = false;
if (savedInstanceState != null) {
unWrapBundle(savedInstanceState);
valid = true;
} else if (intent != null) {
Bundle bundle = intent.getExtras();
if (bundle != null) {
@ -99,24 +97,16 @@ public class TripActivity extends AppCompatActivity {
if (tripId != null) {
if (tripStops == null) {
valid = true;
chooChooLoader.loadTripStops(tripId);
}
if (destinationId != null && possibleTrip == null) {
valid = true;
chooChooLoader.loadPossibleTrip(tripId, sourceId, destinationId);
}
if (valid) {
loadFragments();
}
loadFragments();
}
}
if (!valid) {
chooChooRouterManager.loadMapSearchActivity(this);
}
}
private void changeNotificationPreferences(int departureMinutes, int arrivalMinutes) {

View File

@ -101,8 +101,6 @@ public class TripFilterActivity extends AppCompatActivity {
} else {
chooChooRouterManager.loadTripFilterFragment(null, stopMethod, new LocalDateTime(stopDateTime), stopSourceId, stopDestinationId);
}
} else {
chooChooRouterManager.loadMapSearchActivity(this);
}
}

View File

@ -3,7 +3,7 @@ package com.eleith.calchoochoo.data;
import org.joda.time.LocalTime;
import org.parceler.Parcel;
@Parcel(Parcel.Serialization.BEAN)
@Parcel
public class PossibleTrain {
private String stopParentId;
private String stopId;

View File

@ -3,7 +3,7 @@ package com.eleith.calchoochoo.data;
import org.joda.time.LocalTime;
import org.parceler.Parcel;
@Parcel(Parcel.Serialization.BEAN)
@Parcel
public class PossibleTrip {
private String firstStopId = "";
private String firstStopName = "";

View File

@ -6,7 +6,7 @@ import org.parceler.Parcel;
import java.util.Comparator;
@Parcel(Parcel.Serialization.BEAN)
@Parcel
public class Stop {
public String stop_id;
public String stop_name;