Skip to content

Commit

Permalink
Merge pull request #132 from ItsCalebJones/dev
Browse files Browse the repository at this point in the history
Dev - 2.6.2
  • Loading branch information
ItsCalebJones committed Sep 28, 2018
2 parents 4b109d4 + 2293846 commit 9b69463
Show file tree
Hide file tree
Showing 153 changed files with 9,651 additions and 5,864 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ext {
app = [
versionMajor : 2,
versionMinor : 6,
versionPatch : 1
versionPatch : 2

]
// Sdk and tools
Expand Down
6 changes: 3 additions & 3 deletions data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ dependencies {
implementation "io.reactivex.rxjava2:rxjava:2.1.15"
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-simplexml:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.jakewharton.timber:timber:4.6.0'
}
2 changes: 1 addition & 1 deletion data/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#}

-keep class me.calebjones.spacelaunchnow.data.** { *; }

-dontwarn java.lang.invoke.**
-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@
import android.view.ViewPropertyAnimator;
import android.view.animation.PathInterpolator;

import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Utils {

Expand Down Expand Up @@ -104,4 +110,22 @@ public static boolean isNetworkAvailable(Context context) {
return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
}

public static class EpochDateConverter extends TypeAdapter<Date> {
@Override
public void write(JsonWriter out, Date value) throws IOException {
if (value == null)
out.nullValue();
else
out.value(value.getTime() / 1000);
}

@Override
public Date read(JsonReader in) throws IOException {
if (in != null)
return new Date(in.nextLong() * 1000);
else
return null;
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ public final class Constants {

public static String FORECAST_IO_BASE_URL = "https://api.forecast.io/";
public static String API_BASE_URL = "https://spacelaunchnow.me/";
public static String API_DEBUG_BASE_URL = "http://10.0.2.2:8000/";
public static String LIBRARY_BASE_URL = "https://launchlibrary.net/";
public static String DEBUG_BASE_URL = "https://launchlibrary.net/";
public static String NEWS_BASE_URL = "https://api.spaceflightnewsapi.net";

//These values are +1'd at runtime.
public static final int DEFAULT_BLUR = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import java.util.List;

import io.realm.RealmList;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
Expand All @@ -25,12 +23,9 @@ public class Agency extends RealmObject {
@SerializedName("featured")
@Expose
public Boolean featured;
@SerializedName("launchers")
@SerializedName("launcherConfigs")
@Expose
public String launchers_string;
@SerializedName("orbiters")
@Expose
public String orbiters;
@SerializedName("description")
@Expose
public String description;
Expand Down Expand Up @@ -69,15 +64,18 @@ public class Agency extends RealmObject {
public String type;
@SerializedName("launcher_list")
@Expose
public RealmList<Launcher> launchers;
public RealmList<LauncherConfig> launcherConfigs;
@SerializedName("orbiter_list")
@Expose
public RealmList<Orbiter> orbiters;


public RealmList<Launcher> getLaunchers() {
return launchers;
public RealmList<LauncherConfig> getLauncherConfigs() {
return launcherConfigs;
}

public void setLaunchers(RealmList<Launcher> launchers) {
this.launchers = launchers;
public void setLauncherConfigs(RealmList<LauncherConfig> launcherConfigs) {
this.launcherConfigs = launcherConfigs;
}

public Integer getId() {
Expand Down Expand Up @@ -120,11 +118,11 @@ public void setLaunchers_string(String launchers_string) {
this.launchers_string = launchers_string;
}

public String getOrbiters() {
public RealmList<Orbiter> getOrbiters() {
return orbiters;
}

public void setOrbiters(String orbiters) {
public void setOrbiters(RealmList<Orbiter> orbiters) {
this.orbiters = orbiters;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package me.calebjones.spacelaunchnow.data.models.main;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import io.realm.RealmObject;

public class Landing extends RealmObject{

@SerializedName("success")
@Expose
public Boolean success;
@SerializedName("attempt")
@Expose
public Boolean attempt;
@SerializedName("description")
@Expose
public String description;
@SerializedName("type")
@Expose
public LandingType landingType;
@SerializedName("location")
@Expose
public LandingLocation landingLocation;


public Boolean getSuccess() {
return success;
}

public void setSuccess(Boolean success) {
this.success = success;
}

public Boolean getAttempt() {
return attempt;
}

public void setAttempt(Boolean attempt) {
this.attempt = attempt;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public LandingType getLandingType() {
return landingType;
}

public void setLandingType(LandingType landingType) {
this.landingType = landingType;
}

public LandingLocation getLandingLocation() {
return landingLocation;
}

public void setLandingLocation(LandingLocation landingLocation) {
this.landingLocation = landingLocation;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package me.calebjones.spacelaunchnow.data.models.main;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import io.realm.RealmObject;

public class LandingLocation extends RealmObject{

@SerializedName("name")
@Expose
public String name;
@SerializedName("abbrev")
@Expose
public String abbrev;
@SerializedName("description")
@Expose
public String description;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAbbrev() {
return abbrev;
}

public void setAbbrev(String abbrev) {
this.abbrev = abbrev;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package me.calebjones.spacelaunchnow.data.models.main;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import io.realm.RealmObject;

public class LandingType extends RealmObject{

@SerializedName("name")
@Expose
public String name;
@SerializedName("abbrev")
@Expose
public String abbrev;
@SerializedName("description")
@Expose
public String description;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAbbrev() {
return abbrev;
}

public void setAbbrev(String abbrev) {
this.abbrev = abbrev;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

}

0 comments on commit 9b69463

Please sign in to comment.