Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-android
Commits
cf44d053
Unverified
Commit
cf44d053
authored
Sep 12, 2019
by
Dylan Jones
Browse files
Add an address to location
parent
a53e789c
Pipeline
#4684
passed with stages
in 4 minutes and 34 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/srct/whatsopen/model/Location.kt
View file @
cf44d053
...
...
@@ -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
()
{
}
app/src/main/java/srct/whatsopen/views/activities/DetailActivity.java
View file @
cf44d053
...
...
@@ -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
);
...
...
app/src/main/res/layout-v21/activity_detail.xml
View file @
cf44d053
...
...
@@ -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=
"
20
sp"
/>
android:textSize=
"
16
sp"
/>
</LinearLayout>
...
...
app/src/main/res/layout/activity_detail.xml
View file @
cf44d053
...
...
@@ -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=
"
20
sp"
/>
android:textSize=
"
16
sp"
/>
</LinearLayout>
...
...
app/src/test/java/srct/whatsopen/FacilityPresenterUnitTest.java
View file @
cf44d053
...
...
@@ -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
,
""
);
...
...
app/src/test/java/srct/whatsopen/MainPresenterUnitTest.java
View file @
cf44d053
...
...
@@ -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
,
""
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment