Unverified Commit cf44d053 authored by Dylan Jones's avatar Dylan Jones
Browse files

Add an address to location

parent a53e789c
Pipeline #4684 passed with stages
in 4 minutes and 34 seconds
...@@ -5,5 +5,9 @@ import io.realm.RealmObject ...@@ -5,5 +5,9 @@ import io.realm.RealmObject
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
open class Location( open class Location(
@PrimaryKey @SerializedName("building") var building: String = "" @PrimaryKey @SerializedName("building") var building: String = "",
) : RealmObject() @SerializedName("lat") var lat: Double = 0.0,
@SerializedName("lon") var lon: Double = 0.0,
@SerializedName("address") var address: String = ""
) : RealmObject() {
}
...@@ -51,6 +51,8 @@ public class DetailActivity extends BaseThemeActivity implements FacilityView, ...@@ -51,6 +51,8 @@ public class DetailActivity extends BaseThemeActivity implements FacilityView,
TextView openDurationTextView; TextView openDurationTextView;
@BindView(R.id.location_text) @BindView(R.id.location_text)
TextView locationTextView; TextView locationTextView;
@BindView(R.id.location_link)
TextView locationLinkView;
@BindView(R.id.schedule_text) @BindView(R.id.schedule_text)
TextView scheduleTextView; TextView scheduleTextView;
@BindView(R.id.special_schedule_duration_text) @BindView(R.id.special_schedule_duration_text)
...@@ -204,6 +206,7 @@ public class DetailActivity extends BaseThemeActivity implements FacilityView, ...@@ -204,6 +206,7 @@ public class DetailActivity extends BaseThemeActivity implements FacilityView,
openDurationTextView.setText(mFacility.getStatusDuration()); openDurationTextView.setText(mFacility.getStatusDuration());
locationTextView.setText(mFacility.getLocation().getBuilding()); locationTextView.setText(mFacility.getLocation().getBuilding());
locationLinkView.setText(mFacility.getLocation().getAddress());
Calendar now = Calendar.getInstance(); Calendar now = Calendar.getInstance();
Schedule currentSchedule = mPresenter.getActiveSchedule(mFacility, now); Schedule currentSchedule = mPresenter.getActiveSchedule(mFacility, now);
......
...@@ -101,8 +101,15 @@ ...@@ -101,8 +101,15 @@
android:id="@+id/location_text" android:id="@+id/location_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="0dp"
android:textSize="16sp"/>
<TextView
android:id="@+id/location_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:textSize="20sp"/> android:textSize="16sp"/>
</LinearLayout> </LinearLayout>
......
...@@ -101,8 +101,15 @@ ...@@ -101,8 +101,15 @@
android:id="@+id/location_text" android:id="@+id/location_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="0dp"
android:textSize="16sp"/>
<TextView
android:id="@+id/location_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="12dp" android:paddingBottom="12dp"
android:textSize="20sp"/> android:textSize="16sp"/>
</LinearLayout> </LinearLayout>
......
...@@ -34,7 +34,7 @@ public class FacilityPresenterUnitTest { ...@@ -34,7 +34,7 @@ public class FacilityPresenterUnitTest {
MainSchedule mainSchedule = new MainSchedule(openTimesList, MainSchedule mainSchedule = new MainSchedule(openTimesList,
"2017-01-09", "2017-01-15", false); "2017-01-09", "2017-01-15", false);
Location location = new Location("Whitetop Hall"); Location location = new Location("Whitetop Hall", 38.8342037, -77.3138995, "4302 Occoquan River Lane");
mFacility = new Facility("Chef's Table at Brooklyn Fare", location, mFacility = new Facility("Chef's Table at Brooklyn Fare", location,
mainSchedule, new RealmList<>(), false, true, ""); mainSchedule, new RealmList<>(), false, true, "");
......
...@@ -42,7 +42,7 @@ public class MainPresenterUnitTest { ...@@ -42,7 +42,7 @@ public class MainPresenterUnitTest {
specialSchedules.add(s1); specialSchedules.add(s1);
specialSchedules.add(s2); specialSchedules.add(s2);
Location location = new Location("Johnson Center"); Location location = new Location("Johnson Center", 0.0, 0.0, "");
mFacility = new Facility("The French Laundry", location, mFacility = new Facility("The French Laundry", location,
mainSchedule, specialSchedules, false, true, ""); mainSchedule, specialSchedules, false, true, "");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment