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
import io.realm.annotations.PrimaryKey
open class Location(
@PrimaryKey @SerializedName("building") var building: String = ""
) : RealmObject()
@PrimaryKey @SerializedName("building") var building: String = "",
@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,
TextView openDurationTextView;
@BindView(R.id.location_text)
TextView locationTextView;
@BindView(R.id.location_link)
TextView locationLinkView;
@BindView(R.id.schedule_text)
TextView scheduleTextView;
@BindView(R.id.special_schedule_duration_text)
......@@ -204,6 +206,7 @@ public class DetailActivity extends BaseThemeActivity implements FacilityView,
openDurationTextView.setText(mFacility.getStatusDuration());
locationTextView.setText(mFacility.getLocation().getBuilding());
locationLinkView.setText(mFacility.getLocation().getAddress());
Calendar now = Calendar.getInstance();
Schedule currentSchedule = mPresenter.getActiveSchedule(mFacility, now);
......
......@@ -101,8 +101,15 @@
android:id="@+id/location_text"
android:layout_width="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:textSize="20sp"/>
android:textSize="16sp"/>
</LinearLayout>
......
......@@ -101,8 +101,15 @@
android:id="@+id/location_text"
android:layout_width="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:textSize="20sp"/>
android:textSize="16sp"/>
</LinearLayout>
......
......@@ -34,7 +34,7 @@ public class FacilityPresenterUnitTest {
MainSchedule mainSchedule = new MainSchedule(openTimesList,
"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,
mainSchedule, new RealmList<>(), false, true, "");
......
......@@ -42,7 +42,7 @@ public class MainPresenterUnitTest {
specialSchedules.add(s1);
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,
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