Compare commits
161 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04552932d9 | ||
|
|
7c0b57aa01 | ||
|
|
eae347844a | ||
|
|
9a746a1351 | ||
|
|
ad4583640c | ||
|
|
d0ce399627 | ||
|
|
f7691d62fe | ||
|
|
55b5b058f1 | ||
|
|
e8ea9f7982 | ||
|
|
018de5688e | ||
|
|
53ea394ef5 | ||
|
|
9dbbb80594 | ||
|
|
391c0729e4 | ||
|
|
24a4d344d7 | ||
|
|
e19c15428d | ||
|
|
158ddac964 | ||
|
|
43c3060f1e | ||
|
|
de11e59db1 | ||
|
|
036278f829 | ||
|
|
8dc6414464 | ||
|
|
231bef098d | ||
|
|
638198450e | ||
|
|
57edff604e | ||
|
|
04defe4643 | ||
|
|
02c2981d58 | ||
|
|
209e3f3681 | ||
|
|
d87adeec8d | ||
|
|
27a7feb05a | ||
|
|
6edcd7b74f | ||
|
|
5587c318d0 | ||
|
|
9e2144bd08 | ||
|
|
d80f23ff82 | ||
|
|
e57e6cdcda | ||
|
|
37a803b3a6 | ||
|
|
65e7b99c86 | ||
|
|
5e2d49ac08 | ||
|
|
a7495d24ad | ||
|
|
428fa10433 | ||
|
|
6d21ca16b8 | ||
|
|
363899811a | ||
|
|
3880d7b4a2 | ||
|
|
5162dab0ff | ||
|
|
baf30b5dda | ||
|
|
70efd6b97c | ||
|
|
4cc49c77f6 | ||
|
|
7f56cbe30a | ||
|
|
171c75c645 | ||
|
|
efbbe7124b | ||
|
|
39ff2684cb | ||
|
|
b010de709f | ||
|
|
5544da5d2e | ||
|
|
b110d25549 | ||
|
|
0f17e8d1e5 | ||
|
|
2f5b53e2b4 | ||
|
|
4c09192f9a | ||
|
|
8740362553 | ||
|
|
0663dabca5 | ||
|
|
d4abd7a566 | ||
|
|
e286929b77 | ||
|
|
e7f152bc00 | ||
|
|
f3dbb2b1d1 | ||
|
|
cf650f6cf4 | ||
|
|
c15125d0c2 | ||
|
|
1a6fc6a7f0 | ||
|
|
38dbbfc534 | ||
|
|
8169e8c680 | ||
|
|
6eeb0870fc | ||
|
|
20431d019b | ||
|
|
7e99070002 | ||
|
|
452bc00848 | ||
|
|
056c679442 | ||
|
|
01e7cb5fdf | ||
|
|
c98acaf7c0 | ||
|
|
c68bbd4062 | ||
|
|
c778ab2de8 | ||
|
|
7d833c8ec5 | ||
|
|
b3f0497fba | ||
|
|
9da1078998 | ||
|
|
f552afb49e | ||
|
|
2c7db11917 | ||
|
|
f062b1915c | ||
|
|
bbab7b2bb1 | ||
|
|
bbdf9a7d29 | ||
|
|
23beac0cf0 | ||
|
|
f3e636f586 | ||
|
|
5f11d58300 | ||
|
|
12a4737567 | ||
|
|
bd58927573 | ||
|
|
023647d418 | ||
|
|
5cc559d7ef | ||
|
|
bf55bcef3d | ||
|
|
76832f5a54 | ||
|
|
7da259a179 | ||
|
|
115c064f11 | ||
|
|
9a05e486c1 | ||
|
|
22d760bbda | ||
|
|
7f9783aeb1 | ||
|
|
91db76c6d5 | ||
|
|
cb2800977e | ||
|
|
352e6ef5a7 | ||
|
|
195377fada | ||
|
|
da0a919ca1 | ||
|
|
17c39ab63e | ||
|
|
aa6114e257 | ||
|
|
13cc7be1d2 | ||
|
|
611427b0d2 | ||
|
|
e3fc976f5f | ||
|
|
f01f4fbdfa | ||
|
|
16bb984deb | ||
|
|
9828595e8b | ||
|
|
5062a9fa67 | ||
|
|
033052f480 | ||
|
|
564eb597c6 | ||
|
|
6fed07ca41 | ||
|
|
8a453f298a | ||
|
|
615401c0d3 | ||
|
|
a4413ca42c | ||
|
|
c3d317baea | ||
|
|
4d00735f24 | ||
|
|
c2bf1d762a | ||
|
|
5f3fcf2889 | ||
|
|
4021f9903d | ||
|
|
e9a889fe6d | ||
|
|
5f927a5550 | ||
|
|
ae2aab7275 | ||
|
|
0d94d17b2f | ||
|
|
56a14c2482 | ||
|
|
7089524be6 | ||
|
|
f868302d30 | ||
|
|
08b0ca191b | ||
|
|
ebde0c5815 | ||
|
|
aeb676e594 | ||
|
|
cfeb2bc64e | ||
|
|
3df8d36e89 | ||
|
|
93ededb3d1 | ||
|
|
91670fb6f3 | ||
|
|
b2c320dd14 | ||
|
|
ce264d78bc | ||
|
|
f8acc35c5b | ||
|
|
e5e0916555 | ||
|
|
c738deab23 | ||
|
|
223e77cdc8 | ||
|
|
7c9dc07c3d | ||
|
|
187f45b770 | ||
|
|
04487b77a7 | ||
|
|
c921a76dc4 | ||
|
|
5844445555 | ||
|
|
d67d78b385 | ||
|
|
0ea7ee6c31 | ||
|
|
fb2f7e8a66 | ||
|
|
c412f36e6c | ||
|
|
98a1ad799c | ||
|
|
2d9dfe9c0e | ||
|
|
b31ba7023e | ||
|
|
7ba87b71b0 | ||
|
|
edfc125427 | ||
|
|
6d3a092298 | ||
|
|
15608bed2b | ||
|
|
deb4bd5a19 | ||
|
|
05c8951f2c | ||
|
|
a27ebfc0c3 |
@@ -40,8 +40,10 @@ dependencies {
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.gms:play-services-location:17.1.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
// implementation "com.android.support:support-compat:28.0.0"
|
||||
|
||||
// okhttp
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
||||
|
||||
@@ -41,8 +41,8 @@ public class CouponFragmentTest {
|
||||
//the button "Klaar" is shown then the test works
|
||||
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new CouponFragment()).commit();
|
||||
onView(withId(R.id.coupon_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
|
||||
onView(withText("activeren")).inRoot(RootMatchers.isDialog()).perform(click());
|
||||
onView(withText("Klaar")).inRoot(RootMatchers.isDialog()).check(matches(isDisplayed()));
|
||||
onView(withText(R.string.activate)).inRoot(RootMatchers.isDialog()).perform(click());
|
||||
onView(withText(R.string.done)).inRoot(RootMatchers.isDialog()).check(matches(isDisplayed()));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.a1.nextlocation;
|
||||
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
|
||||
import com.a1.nextlocation.fragments.CouponFragment;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static androidx.test.espresso.Espresso.onView;
|
||||
import static androidx.test.espresso.action.ViewActions.click;
|
||||
import static androidx.test.espresso.assertion.ViewAssertions.matches;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||
|
||||
public class LocationDetailFragment {
|
||||
@Rule
|
||||
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
|
||||
|
||||
@Test
|
||||
public void clickBackButton() throws Exception{
|
||||
//Here we click the back button and then we check if the locationFragment is shown
|
||||
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new com.a1.nextlocation.fragments.LocationDetailFragment()).commit();
|
||||
onView(withId(R.id.detail_location_back_button)).perform(click());
|
||||
onView(withId(R.id.locationFragment)).check(matches(isDisplayed()));
|
||||
}
|
||||
}
|
||||
@@ -27,13 +27,4 @@ public class RouteFragmentTest {
|
||||
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void clickDetailButton() throws Exception{
|
||||
//Here we click an item in the recyclerview and then check if the routeDetailFragment is called
|
||||
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new RouteFragment()).commit();
|
||||
onView(withId(R.id.route_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(0, click()));
|
||||
onView(withId(R.id.routeDetailFragment)).check(matches(isDisplayed()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,18 +6,10 @@ import androidx.test.espresso.matcher.RootMatchers;
|
||||
import androidx.test.espresso.matcher.ViewMatchers;
|
||||
import androidx.test.rule.ActivityTestRule;
|
||||
|
||||
import com.a1.nextlocation.fragments.LocationFragment;
|
||||
import com.a1.nextlocation.fragments.SettingsFragment;
|
||||
import com.a1.nextlocation.fragments.StatisticFragment;
|
||||
|
||||
import org.hamcrest.core.AllOf;
|
||||
import org.hamcrest.core.Is;
|
||||
import org.hamcrest.core.IsInstanceOf;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static androidx.test.espresso.Espresso.*;
|
||||
import static androidx.test.espresso.action.ViewActions.*;
|
||||
@@ -25,7 +17,6 @@ import static androidx.test.espresso.assertion.ViewAssertions.*;
|
||||
import static androidx.test.espresso.matcher.RootMatchers.isPlatformPopup;
|
||||
import static androidx.test.espresso.matcher.ViewMatchers.*;
|
||||
import static org.hamcrest.Matchers.allOf;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
public class SettingsFragmentTest {
|
||||
@@ -54,17 +45,14 @@ public class SettingsFragmentTest {
|
||||
@Test
|
||||
public void buttonTest(){
|
||||
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
|
||||
onView(withId(R.id.settingsImperialButton)).check(matches(isClickable()));
|
||||
onView(withId(R.id.settingsOldButton)).check(matches(isClickable()));
|
||||
onView(withId(R.id.settingsEyesButton)).check(matches(isClickable()));
|
||||
onView(withId(R.id.imperial_button)).check(matches(isClickable()));
|
||||
onView(withId(R.id.font_changer)).check(matches(isClickable()));
|
||||
|
||||
onView(withId(R.id.settingsImperialButton)).perform(click());
|
||||
onView(withId(R.id.settingsImperialButton)).check(matches(isChecked()));
|
||||
|
||||
onView(withId(R.id.settingsOldButton)).perform(click());
|
||||
onView(withId(R.id.settingsOldButton)).check(matches(isChecked()));
|
||||
onView(withId(R.id.imperial_button)).perform(click());
|
||||
onView(withId(R.id.imperial_button)).check(matches(isChecked()));
|
||||
|
||||
onView(withId(R.id.settingsEyesButton)).perform(click());
|
||||
onView(withId(R.id.settingsEyesButton)).check(matches(isChecked()));
|
||||
onView(withId(R.id.font_changer)).perform(click());
|
||||
onView(withId(R.id.font_changer)).check(matches(isChecked()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,19 +11,25 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:icon="@drawable/next_location_icon"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:roundIcon="@drawable/next_location_icon"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.NextLocation"
|
||||
android:hardwareAccelerated="false">
|
||||
<activity android:name=".MainActivity">
|
||||
<activity android:name=".MainActivity"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<receiver android:name=".geofencing.GeoFenceBroadcastReceiver">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.USER_PRESENT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
22
app/src/main/assets/coupons-nl.json
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"code": "KROKETMEUP",
|
||||
"reward": "Gratis 2e kroket bij Kees Kroket™"
|
||||
},
|
||||
{
|
||||
"code": "ESCAPEME",
|
||||
"reward": "Gratis ticket voor de escape room!"
|
||||
},
|
||||
{
|
||||
"code": "WOK50",
|
||||
"reward": "50% korting op een tweede wokschotel naar keuze!"
|
||||
},
|
||||
{
|
||||
"code": "JESUSRISE",
|
||||
"reward": "Een gratis rondleiding door het klooster!"
|
||||
},
|
||||
{
|
||||
"code": "FOOTLONGSURPRISE",
|
||||
"reward": "Een gratis Footlong bij Subway!"
|
||||
}
|
||||
]
|
||||
@@ -1,10 +1,22 @@
|
||||
[
|
||||
{
|
||||
"code": "KROKET10",
|
||||
"reward": "Gratis 2e kroket bij Kees Kroket™"
|
||||
"code": "KROKETMEUP",
|
||||
"reward": "Free kroket at Kees Kroket™"
|
||||
},
|
||||
{
|
||||
"code": "654",
|
||||
"reward": ",juygly"
|
||||
"code": "ESCAPEME",
|
||||
"reward": "Free ticket to the escape room!"
|
||||
},
|
||||
{
|
||||
"code": "WOK50",
|
||||
"reward": "50% discount on a second wok dish of choice!"
|
||||
},
|
||||
{
|
||||
"code": "JESUSRISE",
|
||||
"reward": "A free tour through the monastery!"
|
||||
},
|
||||
{
|
||||
"code": "FOOTLONGSURPRISE",
|
||||
"reward": "A free footlong at Subway!"
|
||||
}
|
||||
]
|
||||
157
app/src/main/assets/locations-nl.json
Normal file
@@ -0,0 +1,157 @@
|
||||
[
|
||||
{
|
||||
"name":"McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.586058044064735, 4.775804729737406",
|
||||
"description":"Wist je dat McDonald’s de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen.\n\nAdres:\tKaranemelkstraat 5\nOpeningstijden:\t11:00-23:00\nTelefoon:\t076 533 3000\nAfstand tot (m): ",
|
||||
"imageUrl":"mc_donalds",
|
||||
"iconUrl": "mcdonalds_icon"
|
||||
},
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.586110268250046, 4.775124041110522",
|
||||
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.\n\nAdres:\tKarnemelkstraat 10 A\nOpeningstijden:\t10:00-19:30\nTelefoon:\t076 521 4411\nAfstand tot: ",
|
||||
"imageUrl":"subway",
|
||||
"iconUrl": "subway_icon"
|
||||
},
|
||||
{
|
||||
"name":"Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58648245586817, 4.77757540779623",
|
||||
"description":"Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken – met een kleine hoeveelheid olie – op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een ‘Wokki box’ voor een gezonde levensstijl.\n\nAdres:\tHalstraat 40\nOpeningstijden:\t12:30-21:00\nTelefoon:\t076 522 5643\nAfstand tot: ",
|
||||
"imageUrl":"wok_to_go",
|
||||
"iconUrl": "wok_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.58798587092525, 4.776248508784696",
|
||||
"description":"De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren.\n\nAdres:\tGrote Markt 19\nOpeningstijden:\t12:00-01:00\nTelefoon:\t076 889 8180\nAfstand tot: ",
|
||||
"imageUrl":"de_boter_hal",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Gauchos Grote Markt 33",
|
||||
"coordinates":"51.588456220778504, 4.77602051562935",
|
||||
"description":"De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill.\n\nAdres:\tGrote Markt 33\nOpeningstijden:\t17:00-23:00\nTelefoon:\t076 522 4505\nAfstand tot: ",
|
||||
"imageUrl":"gauchos",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.588914881807106, 4.780460117020282",
|
||||
"description":"Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granola’s / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?\n\nAdres:\tVlaszak 2\nOpeningstijden:\t10:30-16:00\nTelefoon:\t076 303 3302\nAfstand tot: ",
|
||||
"imageUrl":"the_tosti_club",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||
"coordinates":"51.58724065015693, 4.779495750152812",
|
||||
"description":"Welkom bij Coffee & Lunch 4 you! Onze sfeervolle lunchroom is gelegen in het centrum van Breda, in de directe nabijheid van de parkeergarage en de fietsenstalling.\n\nAdres:\tOude Vest 31\nOpeningstijden:\tgesloten\nTelefoon:\t076 888 6000\nAfstand tot: ",
|
||||
"imageUrl":"coffee_and_lunch",
|
||||
"iconUrl": "coffee_icon"
|
||||
},
|
||||
{
|
||||
"name":"t Zusje Breda Vismarktstraat 28",
|
||||
"coordinates":"51.58989852937449, 4.7734114226595885",
|
||||
"description":"Dat is een avond bij ’t Zusje. Gezellig samenzijn in een huiselijke sfeer en genieten van onze kleine gerechtjes, die je de hele avond kunt bestellen. Bij ‘t Zusje ben je thuis: jij bepaalt zelf de invulling van de avond.\nWe horen graag wat je wensen zijn, vinden het leuk je te verrassen met bijzondere gerechtjes en zetten graag die extra stap. We bieden je een avond uit, zoals wij die zelf ook graag zien. Avondvullend Bourgondisch genieten? In het prachtige pand van ons Zusje in Breda beleef je een gezellige avond met avondvullend tapas eten voor 31,80.\nBel snel en reserveer!\n\nAdres:\tVismarktstraat 28\nOpeningstijden:\t17:30-22:30\nTelefoon:\t0900 98753\nAfstand tot: ",
|
||||
"imageUrl":"t_zusje_breda",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"VR-World Nassaustraat 2",
|
||||
"coordinates":"51.59149198370258, 4.786158496485409",
|
||||
"description":"Virtual Reality is hét uitje van dit moment. Zombies verslaan, vuurballen schieten of met laserzwaarden vechten, met Virtual Reality is niks te gek. Bij VR World zijn we elke dag opzoek naar de nieuwste experiences voor jullie.\n\nWat dacht je bijvoorbeeld van een Escape Room, maar dan in Virtual Reality? Bij VR World bieden wij de nieuwste Escapes aan op het gebied van Virtual Reality. Ontsnap bijvoorbeeld uit een Piramide of ontmantel een raket. Durf jij deze uitdaging aan?\n\nVR World is gelegen op een unieke locatie, namelijk de koepelgevangenis van Breda. Deze gevangenis was tot 2016 nog in werking en daarna hebben bedrijven er hun intrek genomen, zo ook VR World.\n\nAdres:\tNassaustraat 2\nOpeningstijden:\t10:00-23:00\nTelefoon:\t085 077 0077\nAfstand tot: ",
|
||||
"imageUrl":"vr_world",
|
||||
"iconUrl": "vr_icon"
|
||||
},
|
||||
{
|
||||
"name":"Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58629976171061, 4.7769606819261",
|
||||
"description":"KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk ‘Verantwoord Frituren’ gebruik mogen maken.\n\nAdres:\tHoutmarkt 9\nOpeningstijden:\t15:00-19:30\nTelefoon:\t076 785 4359\nAfstand tot: ",
|
||||
"imageUrl":"kees_kroket",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.590621347316336, 4.784612424356731",
|
||||
"description":"Prison Escape duurt in het totaal 3 uur en je hebt als doel om te ontsnappen uit de zwaarbewaakte gevangenis. Een cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om een weg naar buiten te vinden. In de gevangenis zijn verschillende objecten verstopt die het wellicht makkelijker zouden kunnen maken om de weg naar buiten te realiseren.\n\nWees op je hoede, kijk goed om je heen, vertrouw (bijna) niemand en stap op mensen af..\nDe klok tikt en jij hebt 1 doel: de weg naar de vrijheid vinden.\n\nAdres:\tKloosterlaan 168\nOpeningstijden:\tvr-za 13:45-22:30\nTelefoon:\t085 065 3268\nAfstand tot: ",
|
||||
"imageUrl":"prison_escape_room",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.59016000704554, 4.788289825900094",
|
||||
"description":"n groepen word je onder begeleiding van een van onze gidsen rondgeleid langs de meest unieke en mooiste monumentale plekken in en rondom de Koepel!\n\u200B\n\nDe gids zal hierbij op de verschillende locaties toelichting geven over het roemruchte verleden. De rondleiding over het gevangenisterrein brengt u onder andere langs de koepel, de authentieke kapel, vrouwengevangenis, verschillende luchtplaatsen en het oude gerechtsgebouw.\n\nAdres:\tNassausingel 26\nOpeningstijden:\t09:00-17:00\nTelefoon:\t076 763 2700",
|
||||
"imageUrl":"de_koepel_future_events",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"Escaping Breda is een nieuwe moderne locatie en heeft op dit moment 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar nog 2 extra escape rooms bij. \n\nOntsnap uit de spannende escape room Let’s Rob The Bank, een kamer geschikt voor volwassenen én kinderen. Ontsnap je liever uit een escape room met een hoger spannings- en spelniveau? Kies dan voor Patient X.\n\nOp onze locatie in Breda hebben we ook een gezellig boardgame café. Combineer je ontsnapping met een drankje, hapje en alle gratis boardgames.\n\nEscaping Breda is de perfecte plek voor een uitje met je familie, vrienden of collega’s.\n\nAdres:\tBoschstraat 114\nOpeningstijden:\tOp reservering\nTelefoon:\t085 401 9567\nAfstand tot: ",
|
||||
"imageUrl":"escaping_room",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.583597834546616, 4.778605421170793",
|
||||
"description":"MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.\n\nAdres:\tKeizerstraat 101\nOpeningstijden:\t-\nTelefoon:\t076 515 6677\nAfstand tot: ",
|
||||
"imageUrl":"mezz_breda",
|
||||
"iconUrl": "mezz_icon"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58774025242826, 4.765006685059431",
|
||||
"description":"In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda”. \nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.\n\nAdres:\tSchorsmolenstraat13\nOpeningstijden:\t09:00-17:00\nTelefoon:\t076 593 8845\nAfstand tot: ",
|
||||
"imageUrl":"het_klooster_breda",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||
"coordinates":"51.591384128082396, 4.771519780736044",
|
||||
"description":"Beach & Lounge Club Spider staat bekent om zijn immens populaire locatie in Bergen op Zoom. Sinds 2020 heeft deze hoog segment lounge club een tweede locatie geopend in Breda genaamd Beach & Lounge Club Spider Rooftop Bar.\n\nAdres:\tNieuwe Prinsenkade\nOpeningstijden:\t-\nTelefoon:\t-\nAfstand tot: ",
|
||||
"imageUrl":"beach_and_lounge_club",
|
||||
"iconUrl": "beach_icon"
|
||||
},
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.59040026960037, 4.775767751364238",
|
||||
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.\n\nAdres:\tKraanstraat 4b\nOpeningstijden:\tdi 11:00-16:00\nTelefoon:\t-\nAfstand tot: ",
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59120082440261, 4.777904512729459",
|
||||
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.\n\nAdres:\t4811 XJ Breda\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ",
|
||||
"imageUrl":"hercules_park_valkenburg",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.59249639550226, 4.779742259785807",
|
||||
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.\n\nAdres:\tDelpratsingel 1\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ",
|
||||
"imageUrl":"nassau_baroniemonument",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||
"coordinates":"51.59569850758307,4.780295549958155",
|
||||
"description":"Station Breda is het centrale spoorwegstation van de Nederlandse stad Breda. Het bevindt zich ten noorden van het centrum van de stad. Omliggende wijken zijn Stationskwartier en Drie Hoefijzers aan de zuidkant, en aan de noordzijde Belcrum, Doornbos-Linie en Havenkwartier.\n\nHet eerste station in Breda werd geopend op 1 mei 1855, toen de Spoorlijn Roosendaal - Breda werd geopend. Dit station werd in 1863 door een nieuw gebouw vervangen, toen de lijn naar Tilburg werd geopend. Omdat Breda toen nog een vesting was en het station onder de beperkingen van de Vestingwet viel, was het zodanig uitgevoerd dat het in tijden van oorlog snel gesloopt zou kunnen worden.\n\nAdres:\tGravinnen van Nassauboulevard 43\nOpeningstijden:\t-\nTelefoon:\t030 751 51 55\nAfstand tot: ",
|
||||
"imageUrl":"station_breda",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Belcrum Beach Veilingkade 12a",
|
||||
"coordinates":"51.59945849923229, 4.765404193295078",
|
||||
"description":"Belcrum Beach is HET stadsstrand van Breda, gelegen op het Haveneiland in de wijk Belcrum. Wij zijn begonnen in 2013 op deze unieke lokatie in Breda. Het strand werkt met drie beheerders en een groot aantal vrijwilligers voor bar, onderhoud, programmering, sponsoring en tuin. Een plek om te relaxen met een drankje en een hapje, genietend van de zon, gezellig kletsen met je vrienden, luisterend naar muziek van een band of DJ, soms in een festival setting. Kinderen die kunnen spelen in het zand of mee kunnen doen aan speciale kinderactiviteiten. Belcrum Beach is ook een unieke lokatie voor een feestje of om je verjaardag te vieren, trouwen op het strand of een trouwfeest behoren ook tot de mogelijkheden.\n\nAdres:\tVeilingskade 12a\nOpeningstijden:\t12:00-19:00\nTelefoon:\t-\nAfstand tot: ",
|
||||
"imageUrl":"belcrum_beach",
|
||||
"iconUrl": "beach_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60052702557225, 4.7689948674496145",
|
||||
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.\n\nAdres:\tSpeelhuislaan 158\nOpeningstijden:\t08:30-18:00\nTelefoon:\t076 521 3080\nAfstand tot: ",
|
||||
"imageUrl":"belcrum_watertoren",
|
||||
"iconUrl": "building_icon"
|
||||
}
|
||||
]
|
||||
@@ -1,135 +1,157 @@
|
||||
[
|
||||
{
|
||||
"name":"McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.58596318905295,4.77586651481887",
|
||||
"description":"Wist je dat McDonald’s de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen. Wil je meer weten over McDonald’s? Lees verder op: https://www.mcdonalds.com/nl/nl-nl/over-ons.html!",
|
||||
"imageUrl":"mc_donalds"
|
||||
"coordinates":"51.586058044064735, 4.775804729737406",
|
||||
"description":"Did you know McDonald's is the largest restaurant chain in the world? This gives us an impressive history. But we prefer to look at our future. New restaurants, better products, and sustainable entrepreneurship.\n\nAdress:\tKaranemelkstraat 5\nOpening hours:\t11:00-23:00\nPhone:\t076 533 3000\nDistance to: ",
|
||||
"imageUrl":"mc_donalds",
|
||||
"iconUrl": "mcdonalds_icon"
|
||||
},
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.58632782568612,4.775219531501114",
|
||||
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.",
|
||||
"imageUrl":"subway"
|
||||
"coordinates":"51.586110268250046, 4.775124041110522",
|
||||
"description":"Subway is an American multinational fast-food chain that mainly sells sandwiches. The company distinguishes itself from many other sandwich shops because the customer can have the sandwich put together themselves. Subway works with franchises. The company has nearly 45,000 offices on all continents.\n\nAdress:\tKarnemelkstraat 10 A\nOpening hours:\t10:00-19:30\nPhone:\t076 521 4411\nDistance to: ",
|
||||
"imageUrl":"subway",
|
||||
"iconUrl": "subway_icon"
|
||||
},
|
||||
{
|
||||
"name":"Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58650312572897,4.777467069592386",
|
||||
"description":"Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken – met een kleine hoeveelheid olie – op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een ‘Wokki box’ voor een gezonde levensstijl.",
|
||||
"imageUrl":"wok_to_go"
|
||||
"coordinates":"51.58648245586817, 4.77757540779623",
|
||||
"description":"At Wok To Go we love fast, healthy and tasty meals. Since 2003 our chefs have been developing the most delicious wok dishes with fresh ingredients. We do this with complete dedication under the motto “ Making people happy through food ”. By stir-frying - with a small amount of oil - on high heat, the taste and healthy nutrients are preserved. We choose healthy and different ingredients and prepare balanced courses in a 'Wokki box' for a healthy lifestyle.\n\nAdress:\tHalstraat 40\nOpening hours:\t12:30-21:00\nPhone:\t076 522 5643\nDistance to: ",
|
||||
"imageUrl":"wok_to_go",
|
||||
"iconUrl": "wok_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.588069667604756,4.7762685632180695",
|
||||
"description":"De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren.",
|
||||
"imageUrl":"de_boter_hal"
|
||||
"coordinates":"51.58798587092525, 4.776248508784696",
|
||||
"description":"De Boterhal in Breda is an international tapas restaurant, specialty beer café, and wine bar. You can enjoy lunch, drinks, and dinner with us. We have an extensive menu with a lot of beers, wines, both per glass and per bottle, lunch, and tapas dishes. In addition to the food we serve, we also have a lot of beers and wines. In addition to the beers on the menu, we have varying beers: five kettle beers and five seasonal beers.\n\nAdress:\tGrote Markt 19\nOpening hours:\t12:00-01:00\nPhone:\t076 889 8180\nDistance to: ",
|
||||
"imageUrl":"de_boter_hal",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Gauchos Grote Markt 33",
|
||||
"coordinates":"51.58859328857082,4.77601349563689",
|
||||
"description":"De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill.",
|
||||
"imageUrl":"gauchos"
|
||||
"coordinates":"51.588456220778504, 4.77602051562935",
|
||||
"description":"The medieval Grote Markt is a historic place in the Burgundian heart of Breda, once in the hands of the Spanish occupier. Gauchos Grill-Restaurant combines Brabant conviviality with professional hospitality. In our Latin kitchen, we prepare a tender Argentinian steak or a tasty fish dish from the grill.\n\\nAdress:\tGrote Markt 33\nOpening hours:\t17:00-23:00\nPhone:\t076 522 4505\nDistance to: ",
|
||||
"imageUrl":"gauchos",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.58905632735254,4.780729463841719",
|
||||
"description":"Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granola’s / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?",
|
||||
"imageUrl":"the_tosti_club"
|
||||
"coordinates":"51.588914881807106, 4.780460117020282",
|
||||
"description":"You can go to all our branches all day because at The Tosti Club you eat around the clock. So come for breakfast, lunch, or a quick bite at the end of the day (how about our The Tosti Slice, our variant on pizza!). If you don't feel like bread, then we can also delight you with acai smoothie bowls, pancakes, granolas/yogurt, or just a nice hot drink with cake. Can we recommend the Red Velvet fudge cake?\n\\nAdress:\tVlaszak 2\nOpening hours:\t10:30-16:00\nPhone:\t076 303 3302\nDistance to: ",
|
||||
"imageUrl":"the_tosti_club",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||
"coordinates":"51.58741730235298,4.779832967540571",
|
||||
"description":"Welkom bij Coffee & Lunch 4 you! Onze sfeervolle lunchroom is gelegen in het centrum van Breda, in de directe nabijheid van de parkeergarage en de fietsenstalling.",
|
||||
"imageUrl":"coffee_and_lunch"
|
||||
"coordinates":"51.58724065015693, 4.779495750152812",
|
||||
"description":"Welcome to Coffee & Lunch 4 you! Our atmospheric lunchroom is located in the center of Breda, near the parking garage and the bicycle shed.\n\nAdress:\tOude Vest 31\nOpening hours:\tClosed\nPhone:\t076 888 6000\nDistance to: ",
|
||||
"imageUrl":"coffee_and_lunch",
|
||||
"iconUrl": "coffee_icon"
|
||||
},
|
||||
{
|
||||
"name":"t Zusje Breda Vismarktstraat 28",
|
||||
"coordinates":"51.590133292554434,4.773911506170458",
|
||||
"description":"Dat is een avond bij ’t Zusje. Gezellig samenzijn in een huiselijke sfeer en genieten van onze kleine gerechtjes, die je de hele avond kunt bestellen. Bij ‘t Zusje ben je thuis: jij bepaalt zelf de invulling van de avond.\nWe horen graag wat je wensen zijn, vinden het leuk je te verrassen met bijzondere gerechtjes en zetten graag die extra stap. We bieden je een avond uit, zoals wij die zelf ook graag zien. Avondvullend Bourgondisch genieten? In het prachtige pand van ons Zusje in Breda beleef je een gezellige avond met avondvullend tapas eten voor 31,80.\nBel snel en reserveer!",
|
||||
"imageUrl":"t_zusje_breda"
|
||||
"coordinates":"51.58989852937449, 4.7734114226595885",
|
||||
"description":"That is an evening at 't Zusje. Cozy get-together in a homely atmosphere and enjoy our small dishes, which you can order all evening. At' t Zusje you are at home: you determine the content of the evening yourself. \nWe would like to hear what your wishes are, would like to surprise you with special dishes, and would like to go the extra mile. We offer you an evening out, as we would like to see in ourselves. Enjoy a full evening of Burgundian? In the beautiful building of our Zusje in Breda, you will experience a pleasant evening with full evening tapas food for 31.80. \nCall quickly and book! \n\nAdress:\tVismarktstraat 28\nOpening hours:\t17:30-22:30\nPhone:\t0900 98753\nDistance to: ",
|
||||
"imageUrl":"t_zusje_breda",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"VR-World Nassaustraat 2",
|
||||
"coordinates":"51.5913566342086,4.786256804321071",
|
||||
"description":"Virtual Reality is hét uitje van dit moment. Zombies verslaan, vuurballen schieten of met laserzwaarden vechten, met Virtual Reality is niks te gek. Bij VR World zijn we elke dag opzoek naar de nieuwste experiences voor jullie.\n\nWat dacht je bijvoorbeeld van een Escape Room, maar dan in Virtual Reality? Bij VR World bieden wij de nieuwste Escapes aan op het gebied van Virtual Reality. Ontsnap bijvoorbeeld uit een Piramide of ontmantel een raket. Durf jij deze uitdaging aan?\n\nVR World is gelegen op een unieke locatie, namelijk de koepelgevangenis van Breda. Deze gevangenis was tot 2016 nog in werking en daarna hebben bedrijven er hun intrek genomen, zo ook VR World.",
|
||||
"imageUrl":"vr_world"
|
||||
"coordinates":"51.59149198370258, 4.786158496485409",
|
||||
"description":"Virtual Reality is the outing of the moment. Beating zombies, shooting fireballs, or fighting with laser swords, nothing is too crazy with Virtual Reality. At VR World we are looking every day for the newest experiences for you. \n\nWhat about for an example of an Escape Room, but in Virtual Reality? At VR World we offer the latest Escapes in Virtual Reality. Escape from a Pyramid or dismantle a rocket, for example. Do you dare to take on this challenge? \n\nVR World is located at a unique location, namely the dome prison of Breda. This prison was still in operation until 2016 and then companies moved in, including VR World.\n\nAdress:\tNassaustraat 2\nOpening hours:\t10:00-23:00\nPhone:\t085 077 0077\nDistance to: ",
|
||||
"imageUrl":"vr_world",
|
||||
"iconUrl": "vr_icon"
|
||||
},
|
||||
{
|
||||
"name":"Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58647180329833,4.77741809637617",
|
||||
"description":"KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk ‘Verantwoord Frituren’ gebruik mogen maken.",
|
||||
"imageUrl":"kees_kroket"
|
||||
"coordinates":"51.58629976171061, 4.7769606819261",
|
||||
"description":"KEEEEES KROKET! For more than ten years, Kees Kroket has been located in the center of Breda, close to shoppers. First in the well-known Houtmarktpassage and since April 2019, we have been located at our new location at Houtmarkt 9. You can taste the quality of our fresh fries. These fries, cut from the Agria potato, are pre-fried in sunflower oil and finished in a mix of vegetable oils. This not only ensures the delicious taste, but also that our fries contain relatively little saturated fats and trans-fatty acids, so may use the logo 'Responsible Frying'.\n\\nAdress:\tHoutmarkt 9\nOpening hours:\t15:00-19:30\nPhone:\t076 785 4359\nDistance to: ",
|
||||
"imageUrl":"kees_kroket",
|
||||
"iconUrl": "restaurant_icon"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59073795635181,4.784917104321059",
|
||||
"description":"Prison Escape duurt in het totaal 3 uur en je hebt als doel om te ontsnappen uit de zwaarbewaakte gevangenis. Een cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om een weg naar buiten te vinden. In de gevangenis zijn verschillende objecten verstopt die het wellicht makkelijker zouden kunnen maken om de weg naar buiten te realiseren.\n\nWees op je hoede, kijk goed om je heen, vertrouw (bijna) niemand en stap op mensen af..\nDe klok tikt en jij hebt 1 doel: de weg naar de vrijheid vinden.",
|
||||
"imageUrl":"prison_escape_room"
|
||||
"coordinates":"51.590621347316336, 4.784612424356731",
|
||||
"description":"Prison Escape lasts a total of 3 hours and your goal is to escape the maximum-security prison. A cast of 25 actors brings the experience to life and it's up to you to find your way out. Hidden objects that might make it easier to realize the way out. \n\nBe careful, look around you, trust (almost) nobody, and approach people .. \nThe clock is ticking and you have 1 goal: to find the way to freedom.\n\nAdress:\tKloosterlaan 168\nOpening hours:\tvr-za 13:45-22:30\nPhone:\t085 065 3268\nDistance to: ",
|
||||
"imageUrl":"prison_escape_room",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.590431588532105,4.786756741648511",
|
||||
"description":"n groepen word je onder begeleiding van een van onze gidsen rondgeleid langs de meest unieke en mooiste monumentale plekken in en rondom de Koepel!\n\u200B\n\nDe gids zal hierbij op de verschillende locaties toelichting geven over het roemruchte verleden. De rondleiding over het gevangenisterrein brengt u onder andere langs de koepel, de authentieke kapel, vrouwengevangenis, verschillende luchtplaatsen en het oude gerechtsgebouw.",
|
||||
"imageUrl":"de_koepel_future_events"
|
||||
"coordinates":"51.59016000704554, 4.788289825900094",
|
||||
"description":"In groups, you will be guided by one of our guides across the most unique and beautiful monumental places in and around the Dome! \n\n The guide will explain the illustrious past at the various locations. tour of the prison grounds will take you past the dome, the authentic chapel, women's prison, various air places, and the old court building.\n\nAdress:\tNassausingel 26\nOpening hours:\t09:00-17:00\nPhone:\t076 763 2700\nDistance to: ",
|
||||
"imageUrl":"de_koepel_future_events",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"Escaping Breda is een nieuwe moderne locatie en heeft op dit moment 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar nog 2 extra escape rooms bij. \n\nOntsnap uit de spannende escape room Let’s Rob The Bank, een kamer geschikt voor volwassenen én kinderen. Ontsnap je liever uit een escape room met een hoger spannings- en spelniveau? Kies dan voor Patient X.\n\nOp onze locatie in Breda hebben we ook een gezellig boardgame café. Combineer je ontsnapping met een drankje, hapje en alle gratis boardgames.\n\nEscaping Breda is de perfecte plek voor een uitje met je familie, vrienden of collega’s.",
|
||||
"imageUrl":"escaping_room"
|
||||
"description":"Escaping Breda is a new modern location and currently has 2 adventurous escape rooms. Besides, 2 extra escape rooms will be added next year. \n\nEscape from the exciting escape room Let's Rob The Bank, a room suitable for adults and children. If you prefer to escape from an escape room with a higher level of excitement and play, then choose Patient X. \n\nOt our location in Breda we also have a cozy board game café. Combine your escape with a drink, snack, and all free board games. \n\nEscaping Breda is the perfect place for an outing with your family, friends, or colleagues.\n\\nAdress:\\tBoschstraat 114\nOpening hours:\tReservation only\nPhone:\t085 401 9567\nDistance to: ",
|
||||
"imageUrl":"escaping_room",
|
||||
"iconUrl": "escape_icon"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.58394697737321,4.779757901349616",
|
||||
"description":"MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.",
|
||||
"imageUrl":"mezz_breda"
|
||||
"coordinates":"51.583597834546616, 4.778605421170793",
|
||||
"description":"MEZZ is an open club, involved, curious and inquisitive. MEZZ has humor, is witty, sometimes provocative, and surprising. Experience and fun are central where we think bottom-up. We are there for you, your MEZZ. Do you have ideas or will you want to know more, contact us. We always respond.\n\nAdress:\tKeizerstraat 101\nOpening hours:\t-\nPhone:\t076 515 6677\nDistance to: ",
|
||||
"imageUrl":"mezz_breda",
|
||||
"iconUrl": "mezz_icon"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58775443759389,4.765568874365066",
|
||||
"description":"In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda”. \nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.",
|
||||
"imageUrl":"het_klooster_breda"
|
||||
"coordinates":"51.58774025242826, 4.765006685059431",
|
||||
"description":"In this old Capuchin monastery a living and working community will be established under the name\" Het Klooster Breda \". \nWith the income from activities, 12 people who are homeless are offered shelter, from which they can regain a place in society.\n\nAdress:\tSchorsmolenstraat13\nOpening hours:\t09:00-17:00\nPhone:\t076 593 8845\nDistance to: ",
|
||||
"imageUrl":"het_klooster_breda",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||
"coordinates":"51.59212977605884,4.774043765582372",
|
||||
"description":"Beach & Lounge Club Spider staat bekent om zijn immens populaire locatie in Bergen op Zoom. Sinds 2020 heeft deze hoog segment lounge club een tweede locatie geopend in Breda genaamd Beach & Lounge Club Spider Rooftop Bar.",
|
||||
"imageUrl":"beach_and_lounge_club"
|
||||
"coordinates":"51.591384128082396, 4.771519780736044",
|
||||
"description":"Beach & Lounge Club Spider is known for its immensely popular location in Bergen op Zoom. Since 2020, this high segment lounge club has opened a second location in Breda called Beach & Lounge Club Spider Rooftop Bar.\n\nAdress:\tNieuwe Prinsenkade\nOpening hours:\t-\nPhone:\t\nDistance to: ",
|
||||
"imageUrl":"beach_and_lounge_club",
|
||||
"iconUrl": "beach_icon"
|
||||
},
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.590645369292396,4.776045124415531",
|
||||
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.",
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen"
|
||||
"coordinates":"51.59040026960037, 4.775767751364238",
|
||||
"description":"Queen Wilhelmina Pavilion is a building in Breda Center in Breda. It belongs to the Royal Military Academy (KMA) and has the status of a national monument. It is located at Kasteelplein 15, just in front of Breda Castle. the west side of the driveway of the castle, with the long right side wall on the castle moat and the long left side wall on the Cingelstraat.\n\nAdress:\tKraanstraat 4b\nOpening hours:\tdi 11:00-16:00\nPhone:\t-\nDistance to: ",
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59130522182325,4.778161739135078",
|
||||
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.",
|
||||
"imageUrl":"hercules_park_valkenburg"
|
||||
"coordinates":"51.59120082440261, 4.777904512729459",
|
||||
"description":"The statue shows Hercules with the skin of the Nemean lion. Heracles or Hercules is a figure from Greek mythology. He was a Greek hero and became famous for the 12 difficult works he performed at the behest of King Eurystheus. The statue is part of the 17 other sandstone statues that Willem III bought between 1670 and 1686. The statues were spread over lawns in the Valkenberg park.\nHercules is the only original statue that remains.\n\nAdress:\t4811 XJ Breda\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ",
|
||||
"imageUrl":"hercules_park_valkenburg",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.592530636759136,4.780278353833301",
|
||||
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.",
|
||||
"imageUrl":"nassau_baroniemonument"
|
||||
"coordinates":"51.59249639550226, 4.779742259785807",
|
||||
"description":"The Baroniemonument or Nassau-Baroniemonument is a statue of the Dutch architect Pierre Cuypers. It is located in Park Valkenberg in Breda. The monument was placed in memorial of the 500-year bond (1904) between Breda and the Oranje-Nassau house. In 1404 Engelbrecht I of Nassau-Siegen was honored as lord of Breda.\n\nAdress:\tDelpratsingel 1\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ",
|
||||
"imageUrl":"nassau_baroniemonument",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||
"coordinates":"51.59569850758307,4.780295549958155",
|
||||
"description":"Station Breda is het centrale spoorwegstation van de Nederlandse stad Breda. Het bevindt zich ten noorden van het centrum van de stad. Omliggende wijken zijn Stationskwartier en Drie Hoefijzers aan de zuidkant, en aan de noordzijde Belcrum, Doornbos-Linie en Havenkwartier.\n\nHet eerste station in Breda werd geopend op 1 mei 1855, toen de Spoorlijn Roosendaal - Breda werd geopend. Dit station werd in 1863 door een nieuw gebouw vervangen, toen de lijn naar Tilburg werd geopend. Omdat Breda toen nog een vesting was en het station onder de beperkingen van de Vestingwet viel, was het zodanig uitgevoerd dat het in tijden van oorlog snel gesloopt zou kunnen worden.",
|
||||
"imageUrl":"station_breda"
|
||||
"description":"Breda Station is the central railway station of the Dutch city of Breda. It is located north of the city center. Surrounding neighborhoods are Stationskwartier and Drie Hoefijzers on the south side, and Belcrum, Doornbos-Linie, and Havenkwartier on the north side. \n\nThe first station in Breda was opened on May 1, 1855, when the Roosendaal - Breda Railway was opened. This station was replaced by a new building in 1863, when the line to Tilburg was opened, because Breda was still a fortress at the time and it station fell under the restrictions of the Fortress Act, it was constructed in such a way that it could be quickly demolished in times of war.\n\nAdress:\tGravinnen van Nassauboulevard 43\nOpening hours:\t-\nPhone:\t030 751 51 55\nDistance to: ",
|
||||
"imageUrl":"station_breda",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Belcrum Beach Veilingkade 12a",
|
||||
"coordinates":"51.599434239284726,4.76632797992092",
|
||||
"description":"Belcrum Beach is HET stadsstrand van Breda, gelegen op het Haveneiland in de wijk Belcrum. Wij zijn begonnen in 2013 op deze unieke lokatie in Breda. Het strand werkt met drie beheerders en een groot aantal vrijwilligers voor bar, onderhoud, programmering, sponsoring en tuin. Een plek om te relaxen met een drankje en een hapje, genietend van de zon, gezellig kletsen met je vrienden, luisterend naar muziek van een band of DJ, soms in een festival setting. Kinderen die kunnen spelen in het zand of mee kunnen doen aan speciale kinderactiviteiten. Belcrum Beach is ook een unieke lokatie voor een feestje of om je verjaardag te vieren, trouwen op het strand of een trouwfeest behoren ook tot de mogelijkheden.",
|
||||
"imageUrl":"belcrum_beach"
|
||||
"coordinates":"51.59945849923229, 4.765404193295078",
|
||||
"description":"Belcrum Beach is THE city beach of Breda, located on the Haveneiland in the Belcrum district. We started in 2013 at this unique location in Breda. The beach works with three managers and a large number of volunteers for the bar, maintenance, programming, sponsoring, and garden. A place to relax with a drink and a snack, enjoying the sun, chatting with your friends, listening to music from a band or DJ, sometimes in a festival setting. Children who can play in the sand or join do special children's activities. Belcrum Beach is also a unique location for a party or to celebrate your birthday, getting married on the beach or a wedding are also possible.\n\nAdress:\tVeilingskade 12a\nOpening hours:\t12:00-19:00\nPhone:\t-\nDistance to: ",
|
||||
"imageUrl":"belcrum_beach",
|
||||
"iconUrl": "beach_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60135351009892,4.7705765989322755",
|
||||
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.",
|
||||
"imageUrl":"belcrum_watertoren"
|
||||
"coordinates":"51.60052702557225, 4.7689948674496145",
|
||||
"description":"The water tower in the Belcrum in Breda is an industrial monument from the interwar period. The tower is the home base for SOAB advisers for housing and living environments and underlines the mission of our office. The tower is part of the Belcrum. As a landmark and as a shelter for activities. For example, the Belcrummers celebrated their 400th anniversary in the tower, and lunches with a guided tour are organized at a high level. Watch and taste.\n\nAdress:\tSpeelhuislaan 158\nOpening hours:\t08:30-18:00\nPhone:\t076 521 3080\nDistance to: ",
|
||||
"imageUrl":"belcrum_watertoren",
|
||||
"iconUrl": "building_icon"
|
||||
}
|
||||
]
|
||||
|
||||
127
app/src/main/assets/routes-nl.json
Normal file
@@ -0,0 +1,127 @@
|
||||
[
|
||||
{
|
||||
"name": "Evenementen Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description": "Escaping Breda is een nieuwe moderne locatie en heeft momenteel 2 avontuurlijke escape rooms. Daarnaast komen er volgend jaar 2 nieuwe escape rooms. \n\n\nOntsnap uit de spannende escape room Let's Rob The Bank, een kamer geschikt voor volwassenen en kinderen. Als je liever ontsnapt uit een escape room met een hoger niveau van spanning en spel, kies dan voor Patiënt X. \n\n\nOp onze locatie in Breda hebben we ook een gezellig bordspelcafé. \nCombineer je ontsnapping met een drankje, een hapje en alle gratis bordspellen. \n\nEscaping Breda \nis de perfecte plek voor een uitje met familie, vrienden of collega's.",
|
||||
"imageUrl": "escaping_room"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.590621347316336, 4.784612424356731",
|
||||
"description": "Prison Escape duurt in totaal 3 uur en je doel is om uit de maximaal beveiligde gevangenis te ontsnappen. \nEen cast van 25 acteurs brengt de ervaring tot leven en het is aan jou om je weg naar buiten te vinden. Verborgen voorwerpen maken het makkelijker om de weg naar buiten te vinden. \n\nPas op, kijk om je heen, vertrouw (bijna) niemand, en benader mensen ... \nDe klok tikt en je hebt 1 doel: de weg naar vrijheid vinden.",
|
||||
"imageUrl": "prison_escape_room"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.59016000704554, 4.788289825900094",
|
||||
"description": "In groepsverband word je door één van onze gidsen rondgeleid over de meest unieke en mooiste monumentale plekken in en rond de Koepel! \n\n De gids vertelt op de verschillende locaties het roemruchte verleden. Een rondleiding over het gevangenisterrein voert je langs de koepel, de authentieke kapel, de vrouwengevangenis, verschillende luchtruimten en het oude gerechtsgebouw.\n",
|
||||
"imageUrl": "de_koepel_future_events"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.583597834546616, 4.778605421170793",
|
||||
"description": "MEZZ is een open club, betrokken, nieuwsgierig en onderzoekend. MEZZ heeft humor, is gevat, soms provocatief en verrassend. Beleving en plezier staan centraal waarbij wij bottom up denken. Wij zijn er voor jou, jouw MEZZ. Heb je ideeën of wil je meer weten, neem contact op. Wij reageren altijd.",
|
||||
"imageUrl": "mezz_breda"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58774025242826, 4.765006685059431",
|
||||
"description": "In dit oude Kapucijnenklooster wordt een woon- en werkgemeenschap gevestigd onder de naam\n”Het Klooster Breda”.\nMet de inkomsten uit bedrijvigheid wordt 12 mensen die dakloos zijn onderdak geboden, van waaruit zij zich weer een plek in de samenleving kunnen verwerven.",
|
||||
"imageUrl": "het_klooster_breda"
|
||||
}
|
||||
],
|
||||
"totalDistance": 1073.0,
|
||||
"totalTime": 342342,
|
||||
"description": "Deze route laat u leuke events verspreid door breda zien! Probeer de escaperooms uit, een event bij de koepel, of een leuk feest bij MEZZ! Met deze route loopt u langs ze allemaal.",
|
||||
"imageURL": "escaping_room"
|
||||
},
|
||||
{
|
||||
"name": "Hongerige Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.586110268250046, 4.775124041110522",
|
||||
"description":"Subway is een Amerikaanse multinationale fastfoodketen die voornamelijk sandwiches verkoopt. Het bedrijf onderscheidt zich van veel andere broodjeszaken doordat de klant zelf de sandwich kan laten samenstellen. Subway werkt met franchisenemers. Het bedrijf heeft bijna 45.000 vestigingen in alle werelddelen.",
|
||||
"imageUrl":"subway"
|
||||
},
|
||||
{
|
||||
"name": "McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.586058044064735, 4.775804729737406",
|
||||
"description": "Wist je dat McDonald’s de grootste restaurantketen ter wereld is? Hierdoor hebben we een indrukwekkende geschiedenis. Maar wij kijken liever naar onze toekomst. Nieuwe restaurants, betere producten en duurzaam ondernemen.",
|
||||
"imageUrl": "mc_donalds"
|
||||
},
|
||||
{
|
||||
"name": "Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58629976171061, 4.7769606819261",
|
||||
"description": "KEEEEES KROKET! Al meer dan tien jaar is Kees Kroket in het centrum van Breda gevestigd, vlakbij het winkelend publiek. Eerst in de welbekende Houtmarktpassage en sinds april 2019 zijn we gevestigd op onze nieuwe locatie aan de Houtmarkt 9. U proeft de kwaliteit bij onze verse frites. Deze, uit de Agria aardappel gesneden frites, wordt in zonnebloemolie voorgebakken en in een mix van plantaardige oliën afgebakken. Dit zorgt niet alleen voor de heerlijke smaak maar ook dat onze frites relatief weinig verzadigde vetten en transvetzuren bevat, waardoor we van het beeldmerk ‘Verantwoord Frituren’ gebruik mogen maken.",
|
||||
"imageUrl": "kees_kroket"
|
||||
},
|
||||
{
|
||||
"name": "Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58648245586817, 4.77757540779623",
|
||||
"description": "Bij Wok To Go houden we van snelle, gezonde en smaakvolle maaltijden. Sinds 2003 ontwikkelen onze chef-koks de lekkerste wokgerechten met verse ingrediënten. We doen dit vól overgave onder het motto “Making people happy through food”. Door het roerbakken – met een kleine hoeveelheid olie – op grote hitte, blijven de smaak en gezonde voedingsstoffen bewaard. We kiezen voor gezonde en unieke ingrediënten en bereiden uitgebalanceerde gerechten in een ‘Wokki box’ voor een gezonde levensstijl.",
|
||||
"imageUrl": "wok_to_go"
|
||||
},
|
||||
{
|
||||
"name": "The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.588914881807106, 4.780460117020282",
|
||||
"description": "Je kunt bij al onze vestigingen de hele dag terecht, want bij The Tosti Club eet je het klokje rond. Dus kom gezellig ontbijten, lunchen of voor een snelle hap aan het einde van de dag (wat dacht je van onze The Tosti Slice, onze variant op pizza!). Even geen zin in brood? Dan kunnen we je ook verblijden met onder andere acaï smoothiebowls, pancakes, granola’s / yoghurt of gewoon een lekkere warme drank met gebak. Mogen we je de Red Velvet fudge cake aanraden?",
|
||||
"imageUrl": "the_tosti_club"
|
||||
},
|
||||
{
|
||||
"name": "Gauchos Grote Markt 33",
|
||||
"coordinates":"51.588456220778504, 4.77602051562935",
|
||||
"description": "De middeleeuwse Grote Markt is een historische plek in het Bourgondische hart van Breda, ooit in handen van de Spaanse bezetter. Gauchos Grill-Restaurant combineert daar Brabantse gemoedelijkheid met professionele gastvrijheid. In onze Latijnse keuken bereiden wij op uw aanwijzing een malse Argentijnse steak of een smakelijk visgerecht van de grill",
|
||||
"imageUrl": "gauchos"
|
||||
},
|
||||
{
|
||||
"name": "De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.58798587092525, 4.776248508784696",
|
||||
"description": "De Boterhal in Breda is een internationaal tapasrestaurant, speciaalbiercafé en wijnbar. Men kan gezellig bij ons lunchen, borrelen en dineren. Wij hebben een uitgebreide menukaart met een hele hoop bieren, wijnen, zowel per glas als per fles te verkrijgen, lunch en tapasgerechtjes. Naast het eten wat wij serveren hebben we ook een hoop bieren en wijnen. Naast de bieren op de kaart hebben wij wisselende bieren; vijf ketelbieren en vijf seizoensbieren",
|
||||
"imageUrl": "de_boter_hal"
|
||||
}
|
||||
],
|
||||
"totalDistance": 955.0,
|
||||
"totalTime": 342342,
|
||||
"description": "Met deze route bezoekt u alle snackbars en restaurants in het centrum van Breda!",
|
||||
"imageURL": "kees_kroket"
|
||||
},
|
||||
{
|
||||
"name": "Historische Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.59040026960037, 4.775767751364238",
|
||||
"description":"Koningin Wilhelmina Paviljoen is een bouwwerk in Breda Centrum in Breda. Het behoort tot de Koninklijke Militaire Academie (KMA) en bezit de status van rijksmonument. Het staat aan het Kasteelplein 15, vlak voor het Kasteel van Breda. Het ligt met de voorgevel aan de westkant van de oprijlaan van het kasteel, met de lange rechterzijgevel aan de kasteelgracht en de lange linkerzijgevel aan de Cingelstraat.\n\nAdres:\tKraanstraat 4b\nOpeningstijden:\tdi 11:00-16:00\nTelefoon:\t-\nAfstand tot: ",
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59120082440261, 4.777904512729459",
|
||||
"description":"Het beeld toont Hercules met de huid van de Nemeïsche leeuw. Herakles of Hercules is een figuur uit de Griekse mythologie. Hij was een Griekse heros en werd beroemd om de 12 moeilijke werken die hij uitvoerde in opdracht van koning Eurystheus. Het beeld maakt onderdeel uit van 17 anderen zandstenen beelden die Willem III tussen 1670 en 1686 kocht. De beelden stonden verdeeld over grasperken in het Valkenberg park.\nHercules is het enige originele beeld dat overgebleven is.\n\nAdres:\t4811 XJ Breda\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ",
|
||||
"imageUrl":"hercules_park_valkenburg",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.59249639550226, 4.779742259785807",
|
||||
"description":"Het Baroniemonument of Nassau-Baroniemonument is een beeld van de Nederlandse architect Pierre Cuypers. Het staat in het Park Valkenberg in Breda. Het monument werd geplaatst ter herinnering aan de 500-jarige band (1904) tussen Breda en het huis Oranje-Nassau. In 1404 werd Engelbrecht I van Nassau-Siegen gehuldigd als heer van Breda.\n\nAdres:\tDelpratsingel 1\nOpeningstijden:\t-\nTelefoon:\t14 076\nAfstand tot: ",
|
||||
"imageUrl":"nassau_baroniemonument",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60052702557225, 4.7689948674496145",
|
||||
"description":"De watertoren in de Belcrum in Breda is een industrieel monument uit het interbellum. De toren is de thuisbasis voor SOAB adviseurs voor woning en leefomgeving en onderstreept de missie van ons bureau. De toren hoort bij de Belcrum. Als landmark en als onderdak voor activiteiten. Zo vierden de Belcrummers hun 400 jaar bestaan in de toren en worden lunches met rondleiding op hoog niveau georganiseerd. Kijken en proeven.\n\nAdres:\tSpeelhuislaan 158\nOpeningstijden:\t08:30-18:00\nTelefoon:\t076 521 3080\nAfstand tot: ",
|
||||
"imageUrl":"belcrum_watertoren",
|
||||
"iconUrl": "building_icon"
|
||||
}
|
||||
],
|
||||
"description": "Met deze route kan je de historische punten ontdekken in het centrum van Breda",
|
||||
"imageURL": "hercules_park_valkenburg"
|
||||
}
|
||||
]
|
||||
@@ -1,40 +1,122 @@
|
||||
[
|
||||
{
|
||||
"name": "rondje stad",
|
||||
"name": "Event Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59073795635181,4.784917104321059",
|
||||
"description":"4811EE Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.590431588532105,4.786756741648511",
|
||||
"description":"4811HP Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"name": "Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"4811GK Breda",
|
||||
"imageUrl":"NULL"
|
||||
"description": "Escaping Breda is a new modern location and currently has 2 adventurous escape rooms. Besides, 2 extra escape rooms will be added next year. \n\nEscape from the exciting escape room Let's Rob The Bank, a room suitable for adults and children. If you prefer to escape from an escape room with a higher level of excitement and play, then choose Patient X. \n\nAt our location in Breda we also have a cozy board game café. Combine your escape with a drink, snack, and all free board games. \n\nEscaping Breda is the perfect place for an outing with your family, friends, or colleagues.",
|
||||
"imageUrl": "escaping_room"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.58394697737321,4.779757901349616",
|
||||
"description":"4811HL Breda",
|
||||
"imageUrl":"NULL"
|
||||
"name": "Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.58774025242826, 4.765006685059431",
|
||||
"description": "Prison Escape lasts a total of 3 hours and your goal is to escape the maximum-security prison. A cast of 25 actors brings the experience to life and it's up to you to find your way out. Hidden objects that might make it easier to realize the way out. \n\nBe careful, look around you, trust (almost) nobody, and approach people .. \nThe clock is ticking and you have 1 goal: to find the way to freedom.",
|
||||
"imageUrl": "prison_escape_room"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58775443759389,4.765568874365066",
|
||||
"description":"4811VN Breda",
|
||||
"imageUrl":"NULL"
|
||||
"name": "De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.59016000704554, 4.788289825900094",
|
||||
"description": "In groups, you will be guided by one of our guides across the most unique and beautiful monumental places in and around the Dome! \n\n The guide will explain the illustrious past at the various locations. tour of the prison grounds will take you past the dome, the authentic chapel, women's prison, various air places, and the old court building.",
|
||||
"imageUrl": "de_koepel_future_events"
|
||||
},
|
||||
{
|
||||
"name": "MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.583597834546616, 4.778605421170793",
|
||||
"description": "MEZZ is an open club, involved, curious and inquisitive. MEZZ has humor, is witty, sometimes provocative, and surprising. Experience and fun are central where we think bottom-up. We are there for you, your MEZZ. Do you have ideas or will you want to know more, contact us. We always respond.",
|
||||
"imageUrl": "mezz_breda"
|
||||
},
|
||||
{
|
||||
"name": "Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58774025242826, 4.765006685059431",
|
||||
"description": "In this old Capuchin monastery a living and working community will be established under the name\" Het Klooster Breda \". \nWith the income from activities, 12 people who are homeless are offered shelter, from which they can regain a place in society .",
|
||||
"imageUrl": "het_klooster_breda"
|
||||
}
|
||||
],
|
||||
"totalDistance": 2.3434,
|
||||
"totalTime": 342342
|
||||
"description": "This route will show you different and fun events scattered all around Breda! Try the escape rooms, an event at the dome or a fun party at MEZZ! With this route you walk past them all!",
|
||||
"imageURL": "escaping_room"
|
||||
},
|
||||
{
|
||||
"name": "Hungry Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.586110268250046, 4.775124041110522",
|
||||
"description":"Subway is an American multinational fast food chain that mainly sells sandwiches. The company distinguishes itself from many other sandwich shops because the customer can have the sandwich put together themselves. Subway works with franchisees. The company has nearly 45,000 offices on all continents.",
|
||||
"imageUrl":"subway"
|
||||
},
|
||||
{
|
||||
"name": "McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.586058044064735, 4.775804729737406",
|
||||
"description": "Did you know McDonald's is the largest restaurant chain in the world? This gives us an impressive history. But we prefer to look at our future. New restaurants, better products, and sustainable entrepreneurship.",
|
||||
"imageUrl": "mc_donalds"
|
||||
},
|
||||
{
|
||||
"name": "Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58629976171061, 4.7769606819261",
|
||||
"description": "KEEEEES KROKET! For more than ten years, Kees Kroket has been located in the center of Breda, close to shoppers. First in the well-known Houtmarktpassage and since April 2019, we have been located at our new location at Houtmarkt 9. You can taste the quality of our fresh fries. These fries, cut from the Agria potato, are pre-fried in sunflower oil and finished in a mix of vegetable oils. This not only ensures the delicious taste, but also that our fries contain relatively little saturated fats and trans-fatty acids, so may use the logo 'Responsible Frying'.",
|
||||
"imageUrl": "kees_kroket"
|
||||
},
|
||||
{
|
||||
"name": "Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58648245586817, 4.77757540779623",
|
||||
"description": "At Wok To Go we love fast, healthy and tasty meals. Since 2003 our chefs have been developing the most delicious wok dishes with fresh ingredients. We do this with complete dedication under the motto “ Making people happy through food ”. By stir-frying - with a small amount of oil - on high heat, the taste and healthy nutrients are preserved. We choose healthy and different ingredients and prepare balanced courses in a 'Wokki box' for a healthy lifestyle. ",
|
||||
"imageUrl": "wok_to_go"
|
||||
},
|
||||
{
|
||||
"name": "The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.588914881807106, 4.780460117020282",
|
||||
"description": "You can go to all our branches all day because at The Tosti Club you eat around the clock. So come for breakfast, lunch, or a quick bite at the end of the day (how about our The Tosti Slice, our variant on pizza!). If you don't feel like bread, then we can also delight you with acai smoothie bowls, pancakes, granolas/yogurt, or just a nice hot drink with cake. Can we recommend the Red Velvet fudge cake?",
|
||||
"imageUrl": "the_tosti_club"
|
||||
},
|
||||
{
|
||||
"name": "Gauchos Grote Markt 33",
|
||||
"coordinates":"51.588456220778504, 4.77602051562935",
|
||||
"description": "The medieval Grote Markt is a historic place in the Burgundian heart of Breda, once in the hands of the Spanish occupier. Gauchos Grill-Restaurant combines Brabant conviviality with professional hospitality. In our Latin kitchen, we prepare a tender Argentinian steak or a tasty fish dish from the grill. ",
|
||||
"imageUrl": "gauchos"
|
||||
},
|
||||
{
|
||||
"name": "De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.58798587092525, 4.776248508784696",
|
||||
"description": "De Boterhal in Breda is an international tapas restaurant, specialty beer café, and wine bar. You can enjoy lunch, drinks, and dinner with us. We have an extensive menu with a lot of beers, wines, both per glass and per bottle, lunch, and tapas dishes. In addition to the food we serve, we also have a lot of beers and wines. In addition to the beers on the menu, we have varying beers: five kettle beers and five seasonal beers. ",
|
||||
"imageUrl": "de_boter_hal"
|
||||
}
|
||||
],
|
||||
"description": "With this route you can visit all snackbars and restaurants in the centre of Breda!",
|
||||
"imageURL": "kees_kroket"
|
||||
},
|
||||
{
|
||||
"name": "Historical Route",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.59040026960037, 4.775767751364238",
|
||||
"description":"Queen Wilhelmina Pavilion is a building in Breda Center in Breda. It belongs to the Royal Military Academy (KMA) and has the status of a national monument. It is located at Kasteelplein 15, just in front of Breda Castle. the west side of the driveway of the castle, with the long right side wall on the castle moat and the long left side wall on the Cingelstraat.\n\nAdress:\tKraanstraat 4b\nOpening hours:\tdi 11:00-16:00\nPhone:\t-\nDistance to: ",
|
||||
"imageUrl":"koningin_wilhelimna_paviljoen",
|
||||
"iconUrl": "building_icon"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59120082440261, 4.777904512729459",
|
||||
"description":"The statue shows Hercules with the skin of the Nemean lion. Heracles or Hercules is a figure from Greek mythology. He was a Greek hero and became famous for the 12 difficult works he performed at the behest of King Eurystheus. The statue is part of the 17 other sandstone statues that Willem III bought between 1670 and 1686. The statues were spread over lawns in the Valkenberg park.\nHercules is the only original statue that remains.\n\nAdress:\t4811 XJ Breda\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ",
|
||||
"imageUrl":"hercules_park_valkenburg",
|
||||
"iconUrl": "statue_icon"
|
||||
},{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.59249639550226, 4.779742259785807",
|
||||
"description":"The Baroniemonument or Nassau-Baroniemonument is a statue of the Dutch architect Pierre Cuypers. It is located in Park Valkenberg in Breda. The monument was placed in memorial of the 500-year bond (1904) between Breda and the Oranje-Nassau house. In 1404 Engelbrecht I of Nassau-Siegen was honored as lord of Breda.\n\nAdress:\tDelpratsingel 1\nOpening hours:\t-\nPhone:\t14 076\nDistance to: ",
|
||||
"imageUrl":"nassau_baroniemonument",
|
||||
"iconUrl": "statue_icon"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60052702557225, 4.7689948674496145",
|
||||
"description":"The water tower in the Belcrum in Breda is an industrial monument from the interwar period. The tower is the home base for SOAB advisers for housing and living environments and underlines the mission of our office. The tower is part of the Belcrum. As a landmark and as a shelter for activities. For example, the Belcrummers celebrated their 400th anniversary in the tower, and lunches with a guided tour are organized at a high level. Watch and taste.\n\nAdress:\tSpeelhuislaan 158\nOpening hours:\t08:30-18:00\nPhone:\t076 521 3080\nDistance to: ",
|
||||
"imageUrl":"belcrum_watertoren",
|
||||
"iconUrl": "building_icon"
|
||||
}
|
||||
],
|
||||
"description": "With this route you can visit some historic points in the centre of Breda!",
|
||||
"imageURL": "hercules_park_valkenburg"
|
||||
}
|
||||
]
|
||||
BIN
app/src/main/icon-playstore.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
@@ -1,20 +1,24 @@
|
||||
package com.a1.nextlocation;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.fragments.HelpPopup;
|
||||
import com.a1.nextlocation.fragments.HomeFragment;
|
||||
import com.a1.nextlocation.fragments.LocationFragment;
|
||||
import com.a1.nextlocation.fragments.Refreshable;
|
||||
import com.a1.nextlocation.fragments.RouteFragment;
|
||||
import com.a1.nextlocation.fragments.SettingsFragment;
|
||||
@@ -30,9 +34,15 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
private static final String TAG = MainActivity.class.getName();
|
||||
private BottomNavigationView bottomNav;
|
||||
private ImageButton infoButton;
|
||||
private HomeFragment homeFragment = new HomeFragment();
|
||||
private RouteFragment routeFragment = new RouteFragment();
|
||||
private StatisticFragment statisticFragment = new StatisticFragment();
|
||||
private SettingsFragment settingsFragment = new SettingsFragment();
|
||||
|
||||
|
||||
/**
|
||||
* onCreate method that creates the main activity
|
||||
*
|
||||
* @param savedInstanceState the saved instance state of the app
|
||||
*/
|
||||
@Override
|
||||
@@ -59,26 +69,30 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
CouponListManager.INSTANCE.load();
|
||||
RouteListManager.INSTANCE.setContext(this);
|
||||
RouteListManager.INSTANCE.load();
|
||||
Data.INSTANCE.setContext(this);
|
||||
Data.INSTANCE.load();
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).commit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* loads the saved language from SharedPreferences
|
||||
*
|
||||
* @return the language as string
|
||||
*/
|
||||
private String loadLocale(){
|
||||
private String loadLocale() {
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("Settings", Activity.MODE_PRIVATE);
|
||||
return sharedPreferences.getString("Language", "nl");
|
||||
}
|
||||
|
||||
/**
|
||||
* sets the language of the application to the desired one
|
||||
*
|
||||
* @param language the desired language
|
||||
*/
|
||||
private void setLocale(String language){
|
||||
private void setLocale(String language) {
|
||||
Locale locale = new Locale(language);
|
||||
Locale.setDefault(locale);
|
||||
Configuration configuration = new Configuration();
|
||||
@@ -87,39 +101,42 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
}
|
||||
|
||||
|
||||
private BottomNavigationView.OnNavigationItemSelectedListener navListener = item -> {
|
||||
private final BottomNavigationView.OnNavigationItemSelectedListener navListener = item -> {
|
||||
Fragment selectedFragment = null;
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.locations:
|
||||
selectedFragment = new HomeFragment();
|
||||
selectedFragment = homeFragment;
|
||||
break;
|
||||
case R.id.routes:
|
||||
selectedFragment = new RouteFragment();
|
||||
selectedFragment = routeFragment;
|
||||
break;
|
||||
case R.id.statistics:
|
||||
selectedFragment = new StatisticFragment();
|
||||
selectedFragment = statisticFragment;
|
||||
break;
|
||||
case R.id.settings:
|
||||
selectedFragment = new SettingsFragment();
|
||||
selectedFragment = settingsFragment;
|
||||
break;
|
||||
}
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit();
|
||||
return true;
|
||||
if (!selectedFragment.isVisible() && selectedFragment != null){
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, selectedFragment).commit();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* refreshes bottom navigation
|
||||
*/
|
||||
@Override
|
||||
public void refresh() {
|
||||
bottomNav.getMenu().clear();
|
||||
bottomNav.inflateMenu(R.menu.navmenu);
|
||||
bottomNav.setSelectedItemId(R.id.settings);
|
||||
public void refreshAndNavigateTo(int id) {
|
||||
this.setContentView(R.layout.activity_main);
|
||||
BottomNavigationView navigationView = (BottomNavigationView) this.findViewById(R.id.navigation_bar);
|
||||
navigationView.setSelectedItemId(id);
|
||||
navigationView.setOnNavigationItemSelectedListener(navListener);
|
||||
}
|
||||
|
||||
private View.OnClickListener onInfoClickListener = new View.OnClickListener() {
|
||||
private final View.OnClickListener onInfoClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -134,7 +151,7 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
|
||||
FragmentManager fragment = getSupportFragmentManager();
|
||||
DialogFragment helpPopupFragment = new HelpPopup();
|
||||
helpPopupFragment.show(fragment, "YEET");
|
||||
helpPopupFragment.show(fragment, "");
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,88 +1,156 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Data {
|
||||
/**
|
||||
* singleton to keep track of different global data
|
||||
*/
|
||||
public enum Data {
|
||||
INSTANCE;
|
||||
|
||||
private float distanceTraveled;
|
||||
private final String TAG = Data.class.getCanonicalName();
|
||||
private double distanceTraveled = 0;
|
||||
private int locationsVisited = 0;
|
||||
private long totalTime = 0;
|
||||
private double zoom = 0;
|
||||
private SharedPreferences.Editor editor;
|
||||
private Context context;
|
||||
private LocationProximityListener locationProximityListener;
|
||||
|
||||
private int locationsVisited;
|
||||
|
||||
private int totalTime;
|
||||
|
||||
private List<Coupon> couponList;
|
||||
|
||||
private Location nextLocation;
|
||||
|
||||
private Location lastLocation;
|
||||
|
||||
private Route currentRoute;
|
||||
|
||||
|
||||
public Data() {
|
||||
this.distanceTraveled = 0;
|
||||
this.locationsVisited = 0;
|
||||
this.totalTime = 0;
|
||||
couponList = new ArrayList<>();
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
||||
public float getDistanceTraveled() {
|
||||
public void setEditor(SharedPreferences.Editor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
|
||||
public LocationProximityListener getLocationProximityListener() {
|
||||
return locationProximityListener;
|
||||
}
|
||||
|
||||
public void setLocationProximityListener(LocationProximityListener locationProximityListener) {
|
||||
this.locationProximityListener = locationProximityListener;
|
||||
}
|
||||
private android.location.Location location;
|
||||
|
||||
public double getZoom() {
|
||||
return zoom;
|
||||
}
|
||||
|
||||
public void setZoom(double zoom) {
|
||||
this.zoom = zoom;
|
||||
}
|
||||
|
||||
private ArrayList<String> visitedNames = new ArrayList<>();
|
||||
|
||||
public void addDistance(double d) {
|
||||
distanceTraveled += d;
|
||||
|
||||
editor.putString("distanceTraveled", String.valueOf(distanceTraveled));
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public long getTotalTime() {
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
public void addTimeWalked(long time) {
|
||||
totalTime += time;
|
||||
|
||||
editor.putLong("timeWalked", totalTime);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public double getDistanceTraveled() {
|
||||
return distanceTraveled;
|
||||
}
|
||||
|
||||
public void setDistanceTraveled(float distanceTraveled) {
|
||||
this.distanceTraveled = distanceTraveled;
|
||||
public void visitLocation(Location location) {
|
||||
if (!visitedNames.contains(location.getName())) {
|
||||
locationsVisited++;
|
||||
visitedNames.add(location.getName());
|
||||
saveVisitedNamesList();
|
||||
editor.putInt("locationsVisited", locationsVisited);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
public int getLocationsVisited() {
|
||||
return locationsVisited;
|
||||
}
|
||||
|
||||
public void setLocationsVisited(int locationsVisited) {
|
||||
this.locationsVisited = locationsVisited;
|
||||
@FunctionalInterface
|
||||
public interface LocationProximityListener {
|
||||
void onLocationVisited(Location location);
|
||||
}
|
||||
|
||||
public int getTotalTime() {
|
||||
return totalTime;
|
||||
public void saveVisitedNamesList(){
|
||||
Gson gson = new Gson();
|
||||
String json = gson.toJson(visitedNames);
|
||||
editor.putString("visitedNames", json);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public void setTotalTime(int totalTime) {
|
||||
this.totalTime = totalTime;
|
||||
public ArrayList<String> loadAndGetVisitedNamesList(){
|
||||
String json = context.getSharedPreferences("Data", Context.MODE_PRIVATE).getString("visitedNames", "[]");
|
||||
Type type = new TypeToken<ArrayList<String>>() {}.getType();
|
||||
visitedNames = new Gson().fromJson(json, type);
|
||||
Log.i(TAG, "loadAndGetVisitedNamesList: visited names: " + Arrays.toString(visitedNames.toArray()));
|
||||
return visitedNames;
|
||||
}
|
||||
|
||||
public List<Coupon> getCouponList() {
|
||||
return couponList;
|
||||
|
||||
public void load(){
|
||||
SharedPreferences prefs = context.getSharedPreferences("Data", Context.MODE_PRIVATE);
|
||||
this.editor = prefs.edit();
|
||||
this.distanceTraveled = (Double.parseDouble(prefs.getString("distanceTraveled", "0")));
|
||||
|
||||
this.locationsVisited = loadAndGetVisitedNamesList().size();
|
||||
syncLocationObjectsWithList();
|
||||
this.totalTime = prefs.getLong("timeWalked", 0);
|
||||
}
|
||||
|
||||
public void setCouponList(List<Coupon> couponList) {
|
||||
this.couponList = couponList;
|
||||
/**
|
||||
* sync the visited boolean for location objects with the received list
|
||||
*/
|
||||
private void syncLocationObjectsWithList() {
|
||||
for (Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
if (visitedNames.contains(l.getName())) l.setVisited(true);
|
||||
}
|
||||
}
|
||||
|
||||
public Location getNextLocation() {
|
||||
return nextLocation;
|
||||
/**
|
||||
* clears the visited locations
|
||||
*/
|
||||
public void clearVisitedLocations() {
|
||||
visitedNames.clear();
|
||||
locationsVisited = 0;
|
||||
for (Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
l.setVisited(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void setNextLocation(Location nextLocation) {
|
||||
this.nextLocation = nextLocation;
|
||||
public boolean isVisited(Location location) {
|
||||
return this.visitedNames.contains(location.getName());
|
||||
}
|
||||
|
||||
public Location getLastLocation() {
|
||||
return lastLocation;
|
||||
public android.location.Location getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLastLocation(Location lastLocation) {
|
||||
this.lastLocation = lastLocation;
|
||||
}
|
||||
|
||||
public Route getCurrentRoute() {
|
||||
return currentRoute;
|
||||
}
|
||||
|
||||
public void setCurrentRoute(Route currentRoute) {
|
||||
this.currentRoute = currentRoute;
|
||||
public void setLocation(android.location.Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,16 @@ package com.a1.nextlocation.data;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
import android.os.Environment;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import org.json.JSONArray;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class FileIO<T> {
|
||||
private final String TAG = FileIO.class.getCanonicalName();
|
||||
@@ -34,18 +22,24 @@ public class FileIO<T> {
|
||||
AssetManager am = context.getAssets();
|
||||
T res = null;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
InputStream is = null;
|
||||
try {
|
||||
InputStream is = am.open(fileName);
|
||||
if (Arrays.asList(context.getResources().getAssets().list("")).contains(fileName)) {
|
||||
is = am.open(fileName);
|
||||
Log.d(TAG, "Opening file: " + fileName);
|
||||
} else {
|
||||
is = am.open(fileName.substring(0, fileName.length() - 8) + ".json");
|
||||
}
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(is);
|
||||
BufferedReader reader = new BufferedReader(inputStreamReader);
|
||||
String line;
|
||||
while ((line = reader.readLine())!= null) {
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
|
||||
|
||||
Log.d(TAG, "readFileData: got string: " + sb.toString());
|
||||
res = gson.fromJson(sb.toString(),typeOf);
|
||||
res = gson.fromJson(sb.toString(), typeOf);
|
||||
Log.d(TAG, "readFileData: got object: " + res);
|
||||
|
||||
reader.close();
|
||||
@@ -58,46 +52,4 @@ public class FileIO<T> {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// public void writeFileData(T objectToWrite, Context context) {
|
||||
// //TODO make
|
||||
// //object naar jsonobject
|
||||
// //jsonarray toevoegen/maken
|
||||
// //filewriter naar file
|
||||
//
|
||||
// String filename = "";
|
||||
// if (objectToWrite instanceof Coupon){
|
||||
// filename = "coupons.json";
|
||||
// }
|
||||
//
|
||||
// if (objectToWrite instanceof Route){
|
||||
// filename = "routes.json";
|
||||
// }
|
||||
//
|
||||
// if (objectToWrite instanceof Location){
|
||||
// filename = "locations.json";
|
||||
// }
|
||||
//
|
||||
// try (FileOutputStream fileOutputStream = context.openFileOutput(filename, Context.MODE_PRIVATE)){
|
||||
// String json = new Gson().toJson(objectToWrite);
|
||||
//
|
||||
// fileOutputStream.write(json.getBytes(StandardCharsets.UTF_8));
|
||||
//
|
||||
// } catch (FileNotFoundException e) {
|
||||
// e.printStackTrace();
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
//
|
||||
// /*try (FileWriter fileWriter = new FileWriter(filename)){
|
||||
//
|
||||
// String json = new Gson().toJson(objectToWrite);
|
||||
//
|
||||
// fileWriter.append(json);
|
||||
// fileWriter.flush();
|
||||
//
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }*/
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ public class Location implements Parcelable {
|
||||
|
||||
@Nullable
|
||||
private String imageUrl;
|
||||
private String iconUrl;
|
||||
|
||||
private boolean visited;
|
||||
|
||||
public Location(@NotNull String name, String coordinates, String description, @Nullable String imageUrl) {
|
||||
this.name = name;
|
||||
@@ -32,11 +35,11 @@ public class Location implements Parcelable {
|
||||
}
|
||||
|
||||
public Location(@NotNull String name, double latCoord, double longCoord, String description, @Nullable String imageUrl) {
|
||||
this(name,getStringFromCoordinates(latCoord,longCoord),description,imageUrl);
|
||||
this(name, getStringFromCoordinates(latCoord, longCoord), description, imageUrl);
|
||||
}
|
||||
|
||||
public Location(String name, android.location.Location loc, String description, String imageUrl) {
|
||||
this(name,getStringFromCoordinates(loc.getLatitude(),loc.getLongitude()),description,imageUrl);
|
||||
this(name, getStringFromCoordinates(loc.getLatitude(), loc.getLongitude()), description, imageUrl);
|
||||
}
|
||||
|
||||
protected Location(Parcel in) {
|
||||
@@ -88,6 +91,10 @@ public class Location implements Parcelable {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public String getIconUrl() {
|
||||
return iconUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(@Nullable String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
@@ -112,17 +119,9 @@ public class Location implements Parcelable {
|
||||
return long1 + "," + lat1;
|
||||
}
|
||||
|
||||
/**
|
||||
* calculates the distance to the other location.
|
||||
* @param other the other location
|
||||
* @return the distance between the locations in meters
|
||||
*/
|
||||
public double getDistance(Location other) {
|
||||
return getDistance(this.getLat(),this.getLong(),other.getLat(),other.getLong());
|
||||
}
|
||||
|
||||
/**
|
||||
* calculates the distance between two coordinates
|
||||
*
|
||||
* @param lat1 the first latitude
|
||||
* @param lon1 the first longitude
|
||||
* @param lat2 the second latitude
|
||||
@@ -130,26 +129,36 @@ public class Location implements Parcelable {
|
||||
* @return the distance between the coordinates in meters
|
||||
*/
|
||||
public static double getDistance(double lat1, double lon1, double lat2, double lon2) {
|
||||
lat1 = Math.toRadians(lat1);
|
||||
lat2 = Math.toRadians(lat2);
|
||||
lon1 = Math.toRadians(lon1);
|
||||
lon2 = Math.toRadians(lon2);
|
||||
|
||||
double dlon = lon2 - lon1;
|
||||
double dlat = lat2 - lat1;
|
||||
double a = Math.pow(Math.sin(dlat / 2), 2)
|
||||
+ Math.cos(lat1) * Math.cos(lat2)
|
||||
* Math.pow(Math.sin(dlon / 2),2);
|
||||
* Math.pow(Math.sin(dlon / 2), 2);
|
||||
|
||||
double c = 2 * Math.asin(Math.sqrt(a));
|
||||
|
||||
double distance;
|
||||
// Radius of earth in kilometers. Use 3956
|
||||
// for miles
|
||||
// if(miles) {
|
||||
// double r = 3956;
|
||||
// distance = c * r;
|
||||
// }
|
||||
// else {
|
||||
double r = 6371;
|
||||
|
||||
// calculate the result
|
||||
double distance = c * r;
|
||||
|
||||
distance = c * r;
|
||||
distance *= 1000;
|
||||
// }
|
||||
return Math.floor(distance);
|
||||
}
|
||||
|
||||
public GeoPoint convertToGeoPoint() {
|
||||
return new GeoPoint(this.getLat(),this.getLong());
|
||||
return new GeoPoint(this.getLat(), this.getLong());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -164,4 +173,12 @@ public class Location implements Parcelable {
|
||||
parcel.writeString(description);
|
||||
parcel.writeString(imageUrl);
|
||||
}
|
||||
|
||||
public boolean isVisited() {
|
||||
return visited;
|
||||
}
|
||||
|
||||
public void setVisited(boolean visited) {
|
||||
this.visited = visited;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public class Route implements Parcelable {
|
||||
private String description;
|
||||
private List<Location> locations;
|
||||
private float totalDistance;
|
||||
private String imageURL;
|
||||
private int totalTime;
|
||||
|
||||
public Route(@NotNull String name) {
|
||||
@@ -66,13 +67,20 @@ public class Route implements Parcelable {
|
||||
}
|
||||
|
||||
public float getTotalDistance() {
|
||||
//TODO calculate total distance according to all locations in list
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
public String getImageURL() {
|
||||
return this.imageURL;
|
||||
}
|
||||
|
||||
public double calculateTotalTimeMinutes() {
|
||||
// 5 km / h walking speed
|
||||
return ((totalDistance / 1000) / 5) * 60;
|
||||
}
|
||||
|
||||
|
||||
public int getTotalTime() {
|
||||
//TODO calculate total time according to all locations in list
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
@@ -104,4 +112,13 @@ public class Route implements Parcelable {
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setLocationVisited(Location location) {
|
||||
for (Location l : this.locations) {
|
||||
if (l.getName().equals(location.getName())) {
|
||||
l.setVisited(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,15 @@ public enum RouteHandler {
|
||||
private int stepCount = 0;
|
||||
private RouteFinishedListener routeFinishedListener;
|
||||
private long startedTime;
|
||||
private double currentRouteDuration;
|
||||
|
||||
public void setCurrentRouteDuration(double currentRouteDuration) {
|
||||
this.currentRouteDuration = currentRouteDuration;
|
||||
}
|
||||
|
||||
public double getCurrentRouteDuration() {
|
||||
return currentRouteDuration;
|
||||
}
|
||||
|
||||
private Polyline currentRouteLine;
|
||||
|
||||
@@ -20,6 +29,7 @@ public enum RouteHandler {
|
||||
this.currentRouteLine = currentRouteLine;
|
||||
}
|
||||
|
||||
|
||||
public Polyline getCurrentRouteLine() {
|
||||
return currentRouteLine;
|
||||
}
|
||||
@@ -28,6 +38,10 @@ public enum RouteHandler {
|
||||
this.routeFinishedListener = routeFinishedListener;
|
||||
}
|
||||
|
||||
public RouteFinishedListener getRouteFinishedListener() {
|
||||
return routeFinishedListener;
|
||||
}
|
||||
|
||||
public int getStepCount() {
|
||||
return stepCount;
|
||||
}
|
||||
@@ -41,12 +55,23 @@ public enum RouteHandler {
|
||||
isFollowingRoute = false;
|
||||
currentRoute = null;
|
||||
currentRouteLine = null;
|
||||
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
|
||||
Data.INSTANCE.addTimeWalked(System.currentTimeMillis() - startedTime);
|
||||
startedTime = 0;
|
||||
}
|
||||
|
||||
public void followRoute(Route route) {
|
||||
if (isFollowingRoute) {
|
||||
Data.INSTANCE.addTimeWalked(System.currentTimeMillis() - startedTime);
|
||||
}
|
||||
this.currentRoute = route;
|
||||
|
||||
// sync the visited locations with the route
|
||||
for (Location l : this.currentRoute.getLocations()) {
|
||||
if (Data.INSTANCE.isVisited(l)) {
|
||||
this.currentRoute.setLocationVisited(l);
|
||||
}
|
||||
}
|
||||
|
||||
setFollowingRoute(true);
|
||||
startedTime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -54,6 +79,7 @@ public enum RouteHandler {
|
||||
public boolean isFollowingRoute(Route route) {
|
||||
return isFollowingRoute && route.equals(currentRoute);
|
||||
}
|
||||
|
||||
public void setFollowingRoute(boolean followingRoute) {
|
||||
isFollowingRoute = followingRoute;
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import org.osmdroid.views.overlay.Polyline;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* singleton to keep track of different global data
|
||||
*/
|
||||
public enum StaticData {
|
||||
INSTANCE;
|
||||
private double distanceTraveled = 0;
|
||||
private int locationsVisited = 0;
|
||||
private long timeWalkedRoute = 0;
|
||||
|
||||
private ArrayList<String> visitedNames = new ArrayList<>();
|
||||
|
||||
public void addDistance(double d) {
|
||||
distanceTraveled += d;
|
||||
}
|
||||
|
||||
public long getTimeWalkedRoute() {
|
||||
return timeWalkedRoute;
|
||||
}
|
||||
|
||||
public void addTimeWalked(long time) {
|
||||
timeWalkedRoute += time;
|
||||
}
|
||||
|
||||
|
||||
public double getDistanceTraveled() {
|
||||
return distanceTraveled;
|
||||
}
|
||||
|
||||
public void visitLocation(Location location) {
|
||||
if (!visitedNames.contains(location.getName())) {
|
||||
locationsVisited++;
|
||||
visitedNames.add(location.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public int getLocationsVisited() {
|
||||
return locationsVisited;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -2,17 +2,16 @@ package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Coupon;
|
||||
import com.a1.nextlocation.recyclerview.CouponAdapter;
|
||||
@@ -26,7 +25,7 @@ public class CouponFragment extends Fragment {
|
||||
private RecyclerView.LayoutManager layoutManager;
|
||||
private List<Coupon> couponList;
|
||||
private CouponAdapter couponAdapter;
|
||||
private ImageButton imageButton;
|
||||
private ImageButton backButton;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -37,20 +36,25 @@ public class CouponFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_coupon, container, false);
|
||||
|
||||
//Makes the recyclerview
|
||||
this.couponRecyclerView = view.findViewById(R.id.coupon_recyclerview);
|
||||
this.couponRecyclerView.setHasFixedSize(true);
|
||||
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||
|
||||
|
||||
//Loads the couponList
|
||||
CouponListManager.INSTANCE.setContext(this.getContext());
|
||||
CouponListManager.INSTANCE.load();
|
||||
this.couponList = CouponListManager.INSTANCE.getCouponList();
|
||||
|
||||
this.couponAdapter = new CouponAdapter(this.getContext(), this.couponList, clickedPosition -> showPopup(this.couponList.get(clickedPosition)));
|
||||
|
||||
this.imageButton = view.findViewById(R.id.coupon_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
//Initialises the back button
|
||||
this.backButton = view.findViewById(R.id.coupon_back_button);
|
||||
this.backButton.setOnClickListener(v -> {
|
||||
StatisticFragment statisticFragment = new StatisticFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.couponRecyclerView.setLayoutManager(this.layoutManager);
|
||||
@@ -58,6 +62,11 @@ public class CouponFragment extends Fragment {
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
* shows the popup of a coupon
|
||||
*
|
||||
* @param coupon the coupon that will be displayed
|
||||
*/
|
||||
private void showPopup(Coupon coupon) {
|
||||
AlertDialog.Builder activateBuilder = new AlertDialog.Builder(getContext());
|
||||
AlertDialog.Builder couponCodeBuilder = new AlertDialog.Builder(getContext());
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
@@ -15,6 +16,8 @@ public class HelpPopup extends DialogFragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.help_popup, container, false);
|
||||
getDialog().setTitle("Simple Dialog");
|
||||
Button okButton = rootView.findViewById(R.id.help_ok_button);
|
||||
okButton.setOnClickListener(v -> dismiss());
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.a1.nextlocation.fragments;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -19,16 +21,16 @@ import android.widget.Toast;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.data.RouteHandler;
|
||||
import com.a1.nextlocation.data.StaticData;
|
||||
import com.a1.nextlocation.geofencing.GeofenceInitalizer;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
import com.a1.nextlocation.network.ApiHandler;
|
||||
import com.a1.nextlocation.network.DirectionsListener;
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
|
||||
import org.osmdroid.api.IMapController;
|
||||
@@ -49,17 +51,20 @@ import java.util.List;
|
||||
|
||||
public class HomeFragment extends Fragment implements LocationListener {
|
||||
private final String userAgent = "com.ai.nextlocation.fragments";
|
||||
public final static String MAPQUEST_API_KEY = "vuyXjqnAADpjeL9QwtgWGleIk95e36My";
|
||||
|
||||
private ImageButton imageButton;
|
||||
private ImageButton stopButton;
|
||||
private MapView mapView;
|
||||
|
||||
private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
|
||||
private final String TAG = HomeFragment.class.getCanonicalName();
|
||||
// private RoadManager roadManager;
|
||||
|
||||
private Polyline roadOverlay;
|
||||
private int color;
|
||||
private Location currentLocation;
|
||||
private Overlay allLocationsOverlay;
|
||||
private GeofenceInitalizer initializer;
|
||||
private final static String CHANNEL_ID = "next_location01";
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -71,6 +76,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
|
||||
color = requireContext().getColor(R.color.red);
|
||||
Data.INSTANCE.setLocationProximityListener(this::onLocationVisited);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,31 +89,43 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
this.imageButton = view.findViewById(R.id.location_list_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
LocationFragment locationFragment = new LocationFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
// set up the route stop button
|
||||
stopButton = view.findViewById(R.id.home_stop_route_button);
|
||||
stopButton.setOnClickListener(v -> {
|
||||
RouteHandler.INSTANCE.finishRoute();
|
||||
stopButton.setVisibility(View.GONE);
|
||||
Toast.makeText(requireContext(), getResources().getString(R.string.route_stop_toast), Toast.LENGTH_SHORT).show();
|
||||
mapView.getOverlays().remove(roadOverlay);
|
||||
mapView.getOverlays().remove(allLocationsOverlay);
|
||||
addLocations();
|
||||
mapView.invalidate();
|
||||
roadOverlay = null;
|
||||
stopRoute();
|
||||
});
|
||||
|
||||
// show or hide the stop route button based on if we are following a route
|
||||
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||
stopButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
stopButton.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
//register as a listener for a result of the API
|
||||
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
* stops the current route
|
||||
*/
|
||||
private void stopRoute() {
|
||||
Log.d(TAG, "stopRoute: STOPPING ROUTE");
|
||||
RouteHandler.INSTANCE.finishRoute();
|
||||
stopButton.setVisibility(View.GONE);
|
||||
Toast.makeText(requireContext(), getResources().getString(R.string.route_stop_toast), Toast.LENGTH_SHORT).show();
|
||||
mapView.getOverlays().remove(roadOverlay);
|
||||
mapView.getOverlays().remove(allLocationsOverlay);
|
||||
addLocations();
|
||||
mapView.invalidate();
|
||||
roadOverlay = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* callback method that gets called when there are new directions available in the form of a {@link DirectionsResult} object.
|
||||
*
|
||||
@@ -120,7 +138,8 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
roadOverlay.setPoints(geoPoints);
|
||||
roadOverlay.setColor(color);
|
||||
|
||||
|
||||
// pass the line to the route handler
|
||||
RouteHandler.INSTANCE.setCurrentRouteDuration(directionsResult.getDuration());
|
||||
RouteHandler.INSTANCE.setCurrentRouteLine(roadOverlay);
|
||||
Log.d(TAG, "onDirectionsAvailable: successfully added road!");
|
||||
|
||||
@@ -130,6 +149,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
initializer = new GeofenceInitalizer(requireContext(), requireActivity());
|
||||
initMap(view);
|
||||
}
|
||||
|
||||
@@ -166,7 +186,10 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
|
||||
// add the zoom controller
|
||||
IMapController mapController = mapView.getController();
|
||||
mapController.setZoom(15.0);
|
||||
if (Data.INSTANCE.getZoom() == 0) {
|
||||
Data.INSTANCE.setZoom(15.0);
|
||||
}
|
||||
mapController.setZoom(Data.INSTANCE.getZoom());
|
||||
|
||||
// add location manager and set the start point
|
||||
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
||||
@@ -183,7 +206,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
if (currentLocation == null) currentLocation = location;
|
||||
|
||||
if (location != null) {
|
||||
GeoPoint start = new GeoPoint(location.getLatitude(), location.getLongitude());
|
||||
GeoPoint start = new GeoPoint(currentLocation.getLatitude(), currentLocation.getLongitude());
|
||||
mapController.setCenter(start);
|
||||
}
|
||||
|
||||
@@ -203,6 +226,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* displays the route that is currently being followed as a red line
|
||||
*/
|
||||
@@ -231,15 +255,25 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
private void addLocations() {
|
||||
// get the locations of the current route or all locations
|
||||
List<com.a1.nextlocation.data.Location> locations = RouteHandler.INSTANCE.isFollowingRoute() ? RouteHandler.INSTANCE.getCurrentRoute().getLocations() : LocationListManager.INSTANCE.getLocationList();
|
||||
initializer.removeGeoFences();
|
||||
final ArrayList<OverlayItem> items = new ArrayList<>(locations.size());
|
||||
// marker icon
|
||||
Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24);
|
||||
marker.setAlpha(255);
|
||||
marker.setTint(getResources().getColor(R.color.primaryColour));
|
||||
|
||||
// add all locations to the overlay itemss
|
||||
for (com.a1.nextlocation.data.Location location : locations) {
|
||||
OverlayItem item = new OverlayItem(location.getName(), location.getDescription(), location.convertToGeoPoint());
|
||||
Drawable marker = null;
|
||||
if (location.isVisited()) {
|
||||
Log.d(TAG, "addLocations: location " + location.getName() + " is visited");
|
||||
marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24);
|
||||
marker.setAlpha(255);
|
||||
marker.setTint(getResources().getColor(R.color.red));
|
||||
} else {
|
||||
Log.d(TAG, "addLocations: location " + location.getName() + " is not visited");
|
||||
marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24_2);
|
||||
marker.setAlpha(255);
|
||||
marker.setTint(getResources().getColor(R.color.secondaryColour));
|
||||
}
|
||||
item.setMarker(marker);
|
||||
items.add(item);
|
||||
}
|
||||
@@ -285,6 +319,21 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
mapView.getOverlays().add(allLocationsOverlay);
|
||||
Log.d(TAG, "addLocations: successfully added locations");
|
||||
|
||||
mapView.invalidate();
|
||||
addGeofences(locations);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* adds the geofences for the currently active locations
|
||||
*
|
||||
* @param locations the locations to add geofences for
|
||||
*/
|
||||
private void addGeofences(List<com.a1.nextlocation.data.Location> locations) {
|
||||
|
||||
Log.d(TAG, "addGeofences: adding geofences!");
|
||||
|
||||
initializer.init(locations);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -322,22 +371,62 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
if (currentLocation != null) {
|
||||
double distance = currentLocation.distanceTo(location); // in meters
|
||||
// can't walk 100 meters in a few seconds
|
||||
if (distance < 100)
|
||||
StaticData.INSTANCE.addDistance(distance);
|
||||
}
|
||||
currentLocation = location;
|
||||
|
||||
|
||||
//new thread because we don't want the main thread to hang, this method gets called a lot
|
||||
Thread t = new Thread(() -> {
|
||||
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 10) {
|
||||
StaticData.INSTANCE.visitLocation(l);
|
||||
}
|
||||
if (distance < 100 && distance > 0.1) {
|
||||
Data.INSTANCE.addDistance(distance);
|
||||
Data.INSTANCE.setLocation(location);
|
||||
}
|
||||
});
|
||||
currentLocation = location;
|
||||
|
||||
t.start();
|
||||
|
||||
//new thread because we don't want the main thread to hang, this method gets called a lot
|
||||
Thread t = new Thread(() -> {
|
||||
com.a1.nextlocation.data.Location last = null;
|
||||
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||
List<com.a1.nextlocation.data.Location> locs = RouteHandler.INSTANCE.getCurrentRoute().getLocations();
|
||||
last = locs.get(locs.size() - 1);
|
||||
}
|
||||
|
||||
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
// mark the location visited if we are less than 20 meters away
|
||||
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 20) {
|
||||
Data.INSTANCE.visitLocation(l);
|
||||
if (l.equals(last)) stopRoute();
|
||||
}
|
||||
}
|
||||
|
||||
Data.INSTANCE.setZoom(mapView.getZoomLevelDouble());
|
||||
});
|
||||
|
||||
t.start();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void onLocationVisited(com.a1.nextlocation.data.Location location) {
|
||||
location.setVisited(true);
|
||||
Data.INSTANCE.visitLocation(location);
|
||||
showNotification(location);
|
||||
}
|
||||
|
||||
private void showNotification(com.a1.nextlocation.data.Location location) {
|
||||
|
||||
NotificationManager mNotificationManager = (NotificationManager) requireActivity().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
int importance = NotificationManager.IMPORTANCE_LOW;
|
||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, "next_location", importance);
|
||||
notificationChannel.enableLights(true);
|
||||
notificationChannel.enableVibration(true);
|
||||
notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
|
||||
mNotificationManager.createNotificationChannel(notificationChannel);
|
||||
}
|
||||
|
||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(requireContext(), CHANNEL_ID)
|
||||
.setSmallIcon(R.drawable.ic_launcher_foreground)
|
||||
.setContentTitle(getString(R.string.notification_title))
|
||||
.setContentText(getString(R.string.notification_text, location.getName()))
|
||||
.setAutoCancel(true);
|
||||
|
||||
mNotificationManager.notify(0, mBuilder.build());
|
||||
}
|
||||
|
||||
// empty override methods for the LocationListener
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -15,20 +11,23 @@ import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
|
||||
public class LocationDetailFragment extends Fragment {
|
||||
private static final String TAG = LocationDetailFragment.class.getCanonicalName();
|
||||
|
||||
private ImageButton imageButton;
|
||||
private ImageButton backButton;
|
||||
private Location location;
|
||||
private TextView titelText;
|
||||
private TextView detailText;
|
||||
private ImageView locationImage;
|
||||
|
||||
public LocationDetailFragment() {
|
||||
|
||||
}
|
||||
|
||||
public LocationDetailFragment(Location location) {
|
||||
@@ -40,6 +39,7 @@ public class LocationDetailFragment extends Fragment {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
@@ -48,28 +48,50 @@ public class LocationDetailFragment extends Fragment {
|
||||
this.titelText = view.findViewById(R.id.detail_location_name);
|
||||
this.titelText.setText(location.getName());
|
||||
|
||||
this.detailText = view.findViewById(R.id.detail_location_text);
|
||||
this.detailText.setText(location.getDescription());
|
||||
double currentDistanceToLocation = 0.0;
|
||||
if (Data.INSTANCE.getLocation() != null) {
|
||||
currentDistanceToLocation = Location.getDistance(Data.INSTANCE.getLocation().getLatitude(), Data.INSTANCE.getLocation().getLongitude(), this.location.getLat(), this.location.getLong());
|
||||
}
|
||||
|
||||
this.imageButton = view.findViewById(R.id.detail_location_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
//Adds distance text from the current distance of the user to the opened location
|
||||
String detailText;
|
||||
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)) {
|
||||
if (currentDistanceToLocation > 1609)
|
||||
detailText = location.getDescription() + String.format("%.3f", currentDistanceToLocation * 0.000621371192) + "mi";
|
||||
else
|
||||
detailText = location.getDescription() + String.format("%.2f", currentDistanceToLocation * 1.0936133) + "yd";
|
||||
} else {
|
||||
if (currentDistanceToLocation > 1000)
|
||||
detailText = location.getDescription() + String.format("%.3f", currentDistanceToLocation / 1000) + "km";
|
||||
else
|
||||
detailText = location.getDescription() + currentDistanceToLocation + "m";
|
||||
}
|
||||
this.detailText = view.findViewById(R.id.detail_location_text);
|
||||
this.detailText.setText(detailText);
|
||||
|
||||
//Initialises the back button
|
||||
this.backButton = view.findViewById(R.id.detail_location_back_button);
|
||||
this.backButton.setOnClickListener(v -> {
|
||||
LocationFragment locationFragment = new LocationFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
//Logs the location
|
||||
if (location != null) {
|
||||
Log.d(TAG, "onCreateView: the location has a name of: " + location.getName());
|
||||
}
|
||||
|
||||
this.locationImage = view.findViewById(R.id.detail_location_image);
|
||||
Context context = this.locationImage.getContext();
|
||||
int id = context.getResources().getIdentifier(this.location.getImageUrl(), "drawable", context.getPackageName());
|
||||
int id;
|
||||
if (this.location.getImageUrl() == null) {
|
||||
String newUrl = LocationListManager.INSTANCE.findByName(this.location.getName()).getImageUrl();
|
||||
id = requireContext().getResources().getIdentifier(newUrl, "drawable", requireContext().getPackageName());
|
||||
} else {
|
||||
id = requireContext().getResources().getIdentifier(this.location.getImageUrl(), "drawable", requireContext().getPackageName());
|
||||
}
|
||||
this.locationImage.setImageResource(id);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
public void setLocation(Location location) {
|
||||
this.location = location;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.media.Image;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.recyclerview.LocationAdapter;
|
||||
@@ -25,7 +23,7 @@ public class LocationFragment extends Fragment {
|
||||
private LocationAdapter locationAdapter;
|
||||
private RecyclerView.LayoutManager layoutManager;
|
||||
private List<Location> locationList;
|
||||
private ImageButton imageButton;
|
||||
private ImageButton backButton;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -41,24 +39,28 @@ public class LocationFragment extends Fragment {
|
||||
this.locationRecyclerView.setHasFixedSize(true);
|
||||
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||
|
||||
this.imageButton = view.findViewById(R.id.location_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
//Initialised the back button
|
||||
this.backButton = view.findViewById(R.id.location_back_button);
|
||||
this.backButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
//Loads the location list
|
||||
LocationListManager.INSTANCE.setContext(this.getContext());
|
||||
LocationListManager.INSTANCE.load();
|
||||
this.locationList = LocationListManager.INSTANCE.getLocationList();
|
||||
|
||||
//Initialises the adapter
|
||||
this.locationAdapter = new LocationAdapter(this.getContext(), this.locationList, clickedPosition -> {
|
||||
LocationDetailFragment locationDetailFragment = new LocationDetailFragment();
|
||||
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
|
||||
LocationDetailFragment locationDetailFragment = new LocationDetailFragment(this.locationList.get(clickedPosition));
|
||||
Bundle locationBundle = new Bundle();
|
||||
//Gives the clicked location to the adapter
|
||||
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
|
||||
locationDetailFragment.setLocation(this.locationList.get(clickedPosition));
|
||||
locationDetailFragment.setArguments(locationBundle);
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.locationRecyclerView.setLayoutManager(this.layoutManager);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
public interface Refreshable {
|
||||
void refresh();
|
||||
void refreshAndNavigateTo(int id);
|
||||
}
|
||||
|
||||
@@ -1,29 +1,43 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.data.RouteHandler;
|
||||
import com.a1.nextlocation.network.ApiHandler;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RouteDetailFragment extends Fragment {
|
||||
|
||||
private Route route;
|
||||
private TextView routeDetailText;
|
||||
private TextView routeName;
|
||||
private ImageButton imageButton;
|
||||
private Refreshable refreshable;
|
||||
private String time;
|
||||
|
||||
@Override
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
if (context instanceof Refreshable)
|
||||
this.refreshable = (Refreshable) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -31,41 +45,103 @@ public class RouteDetailFragment extends Fragment {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint({"SetTextI18n", "DefaultLocale"})
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||
if(getArguments().getParcelable("route") != null) {
|
||||
if (getArguments().getParcelable("route") != null) {
|
||||
this.route = getArguments().getParcelable("route");
|
||||
}
|
||||
|
||||
this.routeName = view.findViewById(R.id.route_title);
|
||||
this.routeName.setText(this.route.getName());
|
||||
//Sets the image of the RouteDetail
|
||||
ImageView imageView = view.findViewById(R.id.route_detail_image);
|
||||
int id = requireContext().getResources().getIdentifier(this.route.getImageURL(), "drawable", requireContext().getPackageName());
|
||||
imageView.setImageResource(id);
|
||||
|
||||
this.routeDetailText = view.findViewById(R.id.reoute_detail_tekst);
|
||||
this.routeDetailText.setText(this.route.getDescription());
|
||||
TextView routeName = view.findViewById(R.id.route_title);
|
||||
routeName.setText(this.route.getName());
|
||||
|
||||
this.imageButton = view.findViewById(R.id.route_detail_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
TextView routeDetailText = view.findViewById(R.id.route_detail_tekst);
|
||||
StringBuilder locations = new StringBuilder();
|
||||
for (Location location : this.route.getLocations()) {
|
||||
locations.append("<br>•").append(location.getName());
|
||||
}
|
||||
String detailText = this.route.getDescription() + "<br><br><b>" + getResources().getString(R.string.following_locations) + "</b>" + locations + "<br><br><b>" + getResources().getString(R.string.start_location) + ": </b>" + route.getLocations().get(0).getName() + "<br>" + "<b>" + getResources().getString(R.string.end_location) + ": </b>" + route.getLocations().get(route.getLocations().size() - 1).getName();
|
||||
routeDetailText.setText(Html.fromHtml(detailText));
|
||||
|
||||
//sets the text of the totaldistance
|
||||
TextView totalDistance = view.findViewById(R.id.total_distance);
|
||||
//looks if imperial units or metric
|
||||
boolean imperialChecked = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false);
|
||||
totalDistance.setText(getResources().getString(R.string.total_distance_route) + " " + String.format("%.1f", calculateRoute(this.route.getLocations())) + (imperialChecked ? "yd" : "m") + "\n" + getResources().getString(R.string.total_time) + " " + this.time);
|
||||
|
||||
//Initialises the back button
|
||||
ImageButton backButton = view.findViewById(R.id.route_detail_back_button);
|
||||
backButton.setOnClickListener(v -> {
|
||||
RouteFragment routeFragment = new RouteFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
Button startButton = view.findViewById(R.id.start_route_button);
|
||||
startButton.setOnClickListener(this::startRoute);
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Button onclick method that starts the route that is being viewed.
|
||||
*
|
||||
* @param view the button
|
||||
*/
|
||||
public void startRoute(View view) {
|
||||
ApiHandler.INSTANCE.getDirections(route);
|
||||
RouteHandler.INSTANCE.followRoute(route);
|
||||
Toast.makeText(requireContext(),"Route started!",Toast.LENGTH_SHORT).show();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).addToBackStack(null).commit();
|
||||
|
||||
Toast.makeText(requireContext(), R.string.route_started_toast, Toast.LENGTH_SHORT).show();
|
||||
// navigates to the HomeFragment and refreshes the BottomNavigation
|
||||
refreshable.refreshAndNavigateTo(R.id.locations);
|
||||
requireActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the distance between points
|
||||
*
|
||||
* @param route the route that is calculated
|
||||
* @return the total distance of a route
|
||||
*/
|
||||
public double calculateRoute(List<Location> route) {
|
||||
ArrayList<Location> routeArraylist = new ArrayList<>(route);
|
||||
double totalDistance = 0;
|
||||
Location firstLocation;
|
||||
Location secondLocation;
|
||||
System.out.println("Total locations: " + routeArraylist.size());
|
||||
//Cycles through the arraylist
|
||||
for (int i = 0; i < routeArraylist.size() - 1; i++) {
|
||||
firstLocation = routeArraylist.get(i);
|
||||
secondLocation = routeArraylist.get(i + 1);
|
||||
System.out.println("locations distance calculated: " + (i + 1) + " and " + (i + 2) + "\nThe added distance is: " + Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong()));
|
||||
//Calculates the distance between points
|
||||
totalDistance += Location.getDistance(firstLocation.getLat(), firstLocation.getLong(), secondLocation.getLat(), secondLocation.getLong());
|
||||
}
|
||||
System.out.println("Total Distance: " + totalDistance);
|
||||
|
||||
calculateTime(totalDistance);
|
||||
// if the imperialSwitch is checked, return feet, if not, return meters
|
||||
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
|
||||
return totalDistance * 1.0936133;
|
||||
else
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
public void calculateTime(double totalDistance){
|
||||
double totalTimeInMinutes = ((totalDistance / 1000) / 5) * 60;
|
||||
if(totalTimeInMinutes > 60) {
|
||||
int hours = (int)(totalTimeInMinutes / 60);
|
||||
int minutes = (int)(totalTimeInMinutes % 60);
|
||||
this.time = hours + " " + getResources().getString(R.string.hour) + " " + minutes + " " + getResources().getString(R.string.minutes);
|
||||
}
|
||||
else this.time = (int)(((totalDistance / 1000) / 5) * 60) + " " + getResources().getString(R.string.minutes);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +1,38 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.recyclerview.RouteAdapter;
|
||||
import com.a1.nextlocation.recyclerview.RouteListManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
import com.a1.nextlocation.network.ApiHandler;
|
||||
import com.a1.nextlocation.network.DirectionsListener;
|
||||
|
||||
public class RouteFragment extends Fragment {
|
||||
private static final String TAG = RouteFragment.class.getCanonicalName();
|
||||
|
||||
private RecyclerView routeRecyclerView;
|
||||
private RecyclerView.LayoutManager layoutManager;
|
||||
private List<Route> routeList;
|
||||
private RouteAdapter routeAdapter;
|
||||
private ImageButton imageButton;
|
||||
private Refreshable refreshable;
|
||||
|
||||
@Override
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
refreshable = (Refreshable) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
@@ -46,47 +44,40 @@ public class RouteFragment extends Fragment {
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_route, container, false);
|
||||
|
||||
this.routeRecyclerView = view.findViewById(R.id.route_recyclerview);
|
||||
this.routeRecyclerView.setHasFixedSize(true);
|
||||
this.layoutManager = new LinearLayoutManager(this.getContext());
|
||||
RecyclerView routeRecyclerView = view.findViewById(R.id.route_recyclerview);
|
||||
routeRecyclerView.setHasFixedSize(true);
|
||||
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this.getContext());
|
||||
|
||||
RouteListManager.INSTANCE.setContext(this.getContext());
|
||||
RouteListManager.INSTANCE.load();
|
||||
this.routeList = RouteListManager.INSTANCE.getRouteList();
|
||||
|
||||
this.routeAdapter = new RouteAdapter(this.getContext(), this.routeList, clickedPosition -> {
|
||||
//Sets the adapter for the route
|
||||
RouteAdapter routeAdapter = new RouteAdapter(this.getContext(), this.routeList, clickedPosition -> {
|
||||
RouteDetailFragment routeDetailFragment = new RouteDetailFragment();
|
||||
Bundle routeBundle = new Bundle();
|
||||
routeBundle.putParcelable("route", this.routeList.get(clickedPosition));
|
||||
routeDetailFragment.setArguments(routeBundle);
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
this.imageButton = view.findViewById(R.id.route_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
ImageButton backButton = view.findViewById(R.id.route_back_button);
|
||||
backButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null) {
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
refreshable.refreshAndNavigateTo(R.id.map_view);
|
||||
}
|
||||
});
|
||||
|
||||
this.routeRecyclerView.setLayoutManager(this.layoutManager);
|
||||
this.routeRecyclerView.setAdapter(this.routeAdapter);
|
||||
routeRecyclerView.setLayoutManager(layoutManager);
|
||||
routeRecyclerView.setAdapter(routeAdapter);
|
||||
return view;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
// ApiHandler.INSTANCE.getDirections(51.49017262451581, 4.289038164073164,51.47337383133509, 4.303535222390562);
|
||||
// Route r = new Route("test");
|
||||
// r.addLocation(new Location("test",51.574473766034046, 4.7628379328055175,"route",null));
|
||||
// r.addLocation(new Location("test",51.577354223919876, 4.771120593941968,"route",null));
|
||||
// r.addLocation(new Location("test",51.573033468635174, 4.782750651807139,"route",null));
|
||||
// r.addLocation(new Location("test",51.56519104881196, 4.748246716295709,"route",null));
|
||||
// r.addLocation(new Location("test",51.57367360644676, 4.74404101271347,"route",null));
|
||||
// r.addLocation(new Location("test",51.57852769146427, 4.739878224473907,"route",null));
|
||||
//// r.addLocation(new Location("test",51.489063681658145, 4.289596063527951,"route",null));
|
||||
//// r.addLocation(new Location("test",51.483012677667766, 4.28003245468457,"route",null));
|
||||
// ApiHandler.INSTANCE.getDirections(r);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,11 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -18,7 +14,13 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import androidx.appcompat.app.AppCompatDelegate;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Data;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -27,8 +29,9 @@ import java.util.Locale;
|
||||
public class SettingsFragment extends Fragment {
|
||||
|
||||
private SharedPreferences.Editor editor;
|
||||
private ImageView imageButton;
|
||||
SwitchCompat fontChanger;
|
||||
private SwitchCompat fontSwitch;
|
||||
private SwitchCompat imperialSwitch;
|
||||
private SwitchCompat colorBlindMode;
|
||||
private Refreshable refreshable;
|
||||
|
||||
@Override
|
||||
@@ -37,10 +40,12 @@ public class SettingsFragment extends Fragment {
|
||||
refreshable = (Refreshable) context;
|
||||
}
|
||||
|
||||
@SuppressLint("CommitPrefEdits")
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
editor = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).edit();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,53 +55,93 @@ public class SettingsFragment extends Fragment {
|
||||
View view = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
|
||||
initializeLanguageDropdown(view);
|
||||
|
||||
this.imageButton = view.findViewById(R.id.settings_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
|
||||
fontChanger = view.findViewById(R.id.BigFont);
|
||||
|
||||
SharedPreferences sharedPreferences = requireActivity().getSharedPreferences("com.a1.nextlocation",0);
|
||||
SharedPreferences.Editor editor = sharedPreferences.edit();
|
||||
fontChanger.setChecked(sharedPreferences.getBoolean("switch", false));
|
||||
|
||||
if (fontChanger.isChecked()){
|
||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||
}else if (!fontChanger.isChecked()){
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
}
|
||||
|
||||
fontChanger.setOnClickListener(view1 -> {
|
||||
if(fontChanger.isChecked())
|
||||
{
|
||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||
editor.putBoolean("switch",true);
|
||||
editor.apply();
|
||||
}
|
||||
if(!fontChanger.isChecked())
|
||||
{
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
editor.putBoolean("switch",false);
|
||||
editor.apply();
|
||||
}
|
||||
editor.commit();
|
||||
});
|
||||
initializeButtons(view);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initializeButtons(View view) {
|
||||
//Initialises back button
|
||||
ImageView backButton = view.findViewById(R.id.settings_back_button);
|
||||
backButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
if (getActivity() != null) {
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
refreshable.refreshAndNavigateTo(R.id.map_view);
|
||||
}});
|
||||
|
||||
SharedPreferences sharedPreferences = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE);
|
||||
|
||||
//Initialises imperial switchCompat
|
||||
this.imperialSwitch = view.findViewById(R.id.imperial_button);
|
||||
this.imperialSwitch.setChecked(sharedPreferences.getBoolean("imperialSwitch", false));
|
||||
|
||||
this.imperialSwitch.setOnClickListener(view1 -> {
|
||||
editor.putBoolean("imperialSwitch", imperialSwitch.isChecked());
|
||||
editor.apply();
|
||||
editor.commit();
|
||||
});
|
||||
|
||||
//Initialises 65+ switchCompat
|
||||
this.fontSwitch = view.findViewById(R.id.font_changer);
|
||||
|
||||
fontSwitch.setChecked(sharedPreferences.getBoolean("fontSwitch", false));
|
||||
|
||||
//Initial check to see what setting was last chosen
|
||||
if (fontSwitch.isChecked()) {
|
||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||
} else if (!fontSwitch.isChecked()) {
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
}
|
||||
|
||||
//Changes the font settings depending on the state of the toggle
|
||||
|
||||
fontSwitch.setOnClickListener(view1 -> {
|
||||
if (fontSwitch.isChecked()) {
|
||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||
getActivity().recreate();
|
||||
}
|
||||
if(!fontSwitch.isChecked())
|
||||
{
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
getActivity().recreate();
|
||||
}
|
||||
editor.putBoolean("fontSwitch", fontSwitch.isChecked());
|
||||
editor.apply();
|
||||
editor.commit();
|
||||
});
|
||||
|
||||
this.colorBlindMode = view.findViewById(R.id.colourblindSwitch);
|
||||
this.colorBlindMode.setChecked(sharedPreferences.getBoolean("colorBlindModeSwitch", false));
|
||||
|
||||
this.colorBlindMode.setOnClickListener(view1 -> {
|
||||
editor.putBoolean("colorBlindModeSwitch", colorBlindMode.isChecked());
|
||||
editor.apply();
|
||||
editor.commit();
|
||||
|
||||
if (colorBlindMode.isChecked()) {
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||
getActivity().recreate();
|
||||
System.out.println("AAN");
|
||||
} else if (!colorBlindMode.isChecked()) {
|
||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||
getActivity().recreate();
|
||||
System.out.println("UIT");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void initializeLanguageDropdown(View view) {
|
||||
Spinner languageDropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
||||
String[] items = new String[]{getResources().getString(R.string.Dutch), getResources().getString(R.string.English), getResources().getString(R.string.Chinese)};
|
||||
String[] items = new String[]{getResources().getString(R.string.Dutch), getResources().getString(R.string.English)};
|
||||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||
languageDropdown.setAdapter(arrayAdapter);
|
||||
|
||||
// set the language dropdown on the currently selected language stored in the sharedPreferences
|
||||
languageDropdown.setSelection(languageToDropdownPosition(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "")));
|
||||
languageDropdown.setSelection(languageToDropdownPosition(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl")));
|
||||
|
||||
long previousID = languageDropdown.getSelectedItemId();
|
||||
languageDropdown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@@ -108,6 +153,7 @@ public class SettingsFragment extends Fragment {
|
||||
refresh();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
}
|
||||
@@ -158,7 +204,7 @@ public class SettingsFragment extends Fragment {
|
||||
fragmentTransaction.attach(currentFragment);
|
||||
fragmentTransaction.commit();
|
||||
|
||||
refreshable.refresh();
|
||||
refreshable.refreshAndNavigateTo(R.id.settings);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,75 +1,101 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Coupon;
|
||||
import com.a1.nextlocation.data.StaticData;
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.recyclerview.CouponAdapter;
|
||||
import com.a1.nextlocation.recyclerview.CouponListManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class StatisticFragment extends Fragment {
|
||||
private TextView distance;
|
||||
private Refreshable refreshable;
|
||||
|
||||
private List<Coupon> couponList;
|
||||
private ImageView imageButton;
|
||||
private ImageView couponButton;
|
||||
|
||||
@Override
|
||||
public void onAttach(@NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
refreshable = (Refreshable) context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@SuppressLint({"DefaultLocale", "SetTextI18n"})
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_statistic, container, false);
|
||||
|
||||
TextView distance = view.findViewById(R.id.statistics_km);
|
||||
initializeDistanceTextView(view);
|
||||
TextView locs = view.findViewById(R.id.statistics_locations_visited);
|
||||
TextView timeText = view.findViewById(R.id.statistics_time_value);
|
||||
double dist = StaticData.INSTANCE.getDistanceTraveled()/1000;
|
||||
distance.setText("" + String.format("%.1f",dist) + " km");
|
||||
locs.setText("" + StaticData.INSTANCE.getLocationsVisited());
|
||||
timeText.setText("" + StaticData.INSTANCE.getTimeWalkedRoute());
|
||||
|
||||
locs.setText("" + Data.INSTANCE.getLocationsVisited());
|
||||
|
||||
long seconds = Data.INSTANCE.getTotalTime() / 1000;
|
||||
long p1 = seconds % 60;
|
||||
long p2 = seconds / 60;
|
||||
long p3 = p2 % 60;
|
||||
p2 = p2 / 60;
|
||||
timeText.setText(p2 + "u, " + p3 + "m, " + p1 + "s");
|
||||
|
||||
|
||||
this.couponList = CouponListManager.INSTANCE.getCouponList();
|
||||
CouponAdapter adapter = new CouponAdapter(this.getContext(), this.couponList);
|
||||
//loads the couponList
|
||||
List<Coupon> couponList = CouponListManager.INSTANCE.getCouponList();
|
||||
CouponAdapter adapter = new CouponAdapter(this.getContext(), couponList);
|
||||
TextView couponNumber = view.findViewById(R.id.couponAmount);
|
||||
couponNumber.setText(String.valueOf(adapter.getItemCount()));
|
||||
|
||||
|
||||
this.imageButton = view.findViewById(R.id.statistics_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
//Initialises the back button
|
||||
ImageView backButton = view.findViewById(R.id.statistics_back_button);
|
||||
backButton.setOnClickListener(v -> {
|
||||
HomeFragment homeFragment = new HomeFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||
refreshable.refreshAndNavigateTo(R.id.map_view);
|
||||
});
|
||||
|
||||
this.couponButton = view.findViewById(R.id.coupon_button);
|
||||
this.couponButton.setOnClickListener(v -> {
|
||||
//Initialises the coupon button
|
||||
ImageView couponButton = view.findViewById(R.id.coupon_button);
|
||||
couponButton.setOnClickListener(v -> {
|
||||
CouponFragment couponFragment = new CouponFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||
});
|
||||
|
||||
//Makes the constraintlayout clickable and opens the same layout as the coupon button
|
||||
ConstraintLayout constraintLayout = view.findViewById(R.id.Box4);
|
||||
constraintLayout.setOnClickListener(v -> {
|
||||
CouponFragment couponFragment = new CouponFragment();
|
||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||
if (getActivity() != null)
|
||||
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initializeDistanceTextView(View view){
|
||||
distance = view.findViewById(R.id.statistics_km);
|
||||
double dist = Data.INSTANCE.getDistanceTraveled() / 1000;
|
||||
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
|
||||
distance.setText("" + String.format("%.1f",dist * 0.621371) + " mi");
|
||||
else
|
||||
distance.setText("" + String.format("%.1f",dist) + " km");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.a1.nextlocation.geofencing;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
import com.google.android.gms.location.Geofence;
|
||||
import com.google.android.gms.location.GeofenceStatusCodes;
|
||||
import com.google.android.gms.location.GeofencingEvent;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* broadcast receiver for geofence events
|
||||
*/
|
||||
public class GeoFenceBroadcastReceiver extends BroadcastReceiver {
|
||||
private final String TAG = GeoFenceBroadcastReceiver.class.getCanonicalName();
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
|
||||
Log.i(TAG, "onReceive: RECEIVED GEOFENCE STUFF");
|
||||
|
||||
if (geofencingEvent.hasError()) {
|
||||
String errorMessage = GeofenceStatusCodes
|
||||
.getStatusCodeString(geofencingEvent.getErrorCode());
|
||||
Log.e(TAG, errorMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the transition type.
|
||||
int geofenceTransition = geofencingEvent.getGeofenceTransition();
|
||||
|
||||
switch (geofenceTransition) {
|
||||
case Geofence.GEOFENCE_TRANSITION_ENTER:
|
||||
List<Geofence> geofenceList = geofencingEvent.getTriggeringGeofences();
|
||||
// loop through list of geofences
|
||||
for (Geofence geofence : geofenceList) {
|
||||
for (Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
if (geofence.getRequestId().equals(l.getName())) {
|
||||
l.setVisited(true);
|
||||
// let the homefragment know that we are close to a location
|
||||
Data.INSTANCE.getLocationProximityListener().onLocationVisited(l);
|
||||
Log.d(TAG, "onReceive: VISITED LOCATION " + l.getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case Geofence.GEOFENCE_TRANSITION_EXIT:
|
||||
Log.d(TAG, "onReceive: exiting geofence...");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.a1.nextlocation.geofencing;
|
||||
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.content.Intent;
|
||||
import android.provider.SyncStateContract;
|
||||
|
||||
import com.google.android.gms.location.Geofence;
|
||||
import com.google.android.gms.location.GeofencingRequest;
|
||||
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
public class GeoFencingHelper extends ContextWrapper {
|
||||
private PendingIntent pendingIntent;
|
||||
|
||||
public GeoFencingHelper(Context base) {
|
||||
super(base);
|
||||
}
|
||||
|
||||
public GeofencingRequest getGeoFencingRequest(Geofence geofence) {
|
||||
GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
|
||||
builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
|
||||
builder.addGeofence(geofence);
|
||||
return builder.build();
|
||||
|
||||
}
|
||||
|
||||
public Geofence getGeofence(String ID, GeoPoint point, float radius) {
|
||||
|
||||
return new Geofence.Builder()
|
||||
.setCircularRegion(point.getLatitude(), point.getLongitude(), radius)
|
||||
.setRequestId(ID)
|
||||
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER |
|
||||
Geofence.GEOFENCE_TRANSITION_EXIT)
|
||||
.setLoiteringDelay(5000)
|
||||
.setExpirationDuration(Geofence.NEVER_EXPIRE)
|
||||
.build();
|
||||
}
|
||||
|
||||
public PendingIntent getPendingIntent() {
|
||||
if (pendingIntent != null) {
|
||||
return pendingIntent;
|
||||
}
|
||||
|
||||
Intent intent = new Intent(this, GeoFenceBroadcastReceiver.class);
|
||||
pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
|
||||
return pendingIntent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.a1.nextlocation.geofencing;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.a1.nextlocation.data.Data;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
import com.google.android.gms.location.Geofence;
|
||||
import com.google.android.gms.location.GeofencingClient;
|
||||
import com.google.android.gms.location.GeofencingRequest;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static android.content.ContentValues.TAG;
|
||||
|
||||
public class GeofenceInitalizer {
|
||||
private final Activity activity;
|
||||
private GeofencingClient geofencingClient;
|
||||
private GeoFencingHelper geoFencingHelper;
|
||||
private final Context context;
|
||||
private final String TAG = GeofenceInitalizer.class.getCanonicalName();
|
||||
private List<Location> locations;
|
||||
private int BACKGROUND_LOCATION_ACCESS_REQUEST_CODE = 10002;
|
||||
|
||||
public GeofenceInitalizer(Context context, Activity activity) {
|
||||
this.context = context;
|
||||
this.activity = activity;
|
||||
}
|
||||
|
||||
public void init(List<Location> locations) {
|
||||
if (!checkFineLocationPermission()) return;
|
||||
|
||||
geofencingClient = LocationServices.getGeofencingClient(context);
|
||||
geoFencingHelper = new GeoFencingHelper(context);
|
||||
this.locations = locations;
|
||||
if (Build.VERSION.SDK_INT >= 29) {
|
||||
//If API is higher then 29 we need background permission
|
||||
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
addFences();
|
||||
} else {
|
||||
//Permission is not granted!! Need to request it..
|
||||
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_BACKGROUND_LOCATION)) {
|
||||
//We show a dialog and ask for permission
|
||||
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE);
|
||||
} else {
|
||||
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE);
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
addFences();
|
||||
}
|
||||
}
|
||||
|
||||
private void addFences() {
|
||||
for (Location location : locations) {
|
||||
GeoPoint t = new GeoPoint(location.getLat(), location.getLong());
|
||||
addGeofence(t, location.getName());
|
||||
}
|
||||
}
|
||||
|
||||
public void removeGeoFences() {
|
||||
geofencingClient = LocationServices.getGeofencingClient(context);
|
||||
geoFencingHelper = new GeoFencingHelper(context);
|
||||
|
||||
PendingIntent pendingIntent = geoFencingHelper.getPendingIntent();
|
||||
|
||||
geofencingClient.removeGeofences(pendingIntent)
|
||||
.addOnSuccessListener(aVoid -> Log.d(TAG, "Geofence is removed... "))
|
||||
.addOnFailureListener(e -> Log.d(TAG, e.getLocalizedMessage()));
|
||||
if (this.locations != null) this.locations.clear();
|
||||
|
||||
}
|
||||
|
||||
private void addGeofence(GeoPoint p, String name) {
|
||||
if (!checkFineLocationPermission()) return;
|
||||
|
||||
Geofence geofence = geoFencingHelper.getGeofence(name, p, 60);
|
||||
GeofencingRequest geofencingRequest = geoFencingHelper.getGeoFencingRequest(geofence);
|
||||
PendingIntent pendingIntent = geoFencingHelper.getPendingIntent();
|
||||
|
||||
geofencingClient.addGeofences(geofencingRequest, pendingIntent).addOnSuccessListener(v -> {
|
||||
Log.i(TAG, "addGeofence: added geofence");
|
||||
}).addOnFailureListener(v -> {
|
||||
Log.e(TAG, "addGeofence: failure adding geofence " + v.getMessage());
|
||||
});
|
||||
Log.i(TAG, "addGeofence: added geofence to client");
|
||||
}
|
||||
|
||||
private boolean checkFineLocationPermission() {
|
||||
return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,8 @@ import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -24,7 +22,7 @@ public class DirectionsResult {
|
||||
private double distance;
|
||||
private double duration;
|
||||
private double[][] wayPointCoordinates;
|
||||
private GeoPoint[] startAndEndPoint = new GeoPoint[2];
|
||||
private final GeoPoint[] startAndEndPoint = new GeoPoint[2];
|
||||
|
||||
public List<DirectionsStep> getSteps() {
|
||||
return steps;
|
||||
@@ -60,6 +58,7 @@ public class DirectionsResult {
|
||||
|
||||
/**
|
||||
* converts all the geopoints in all the steps into an arraylist to display it on the map
|
||||
*
|
||||
* @return the list of geopoints
|
||||
*/
|
||||
public ArrayList<GeoPoint> getGeoPoints() {
|
||||
@@ -101,40 +100,17 @@ public class DirectionsResult {
|
||||
|
||||
JsonArray segments = properties.getAsJsonArray("segments");
|
||||
|
||||
for (JsonElement element : segments) {
|
||||
JsonObject segment = element.getAsJsonObject();
|
||||
|
||||
setDistance(segment.get("distance").getAsDouble());
|
||||
setDuration(segment.get("duration").getAsDouble());
|
||||
|
||||
JsonArray steps = segment.getAsJsonArray("steps");
|
||||
|
||||
for (JsonElement j : steps) {
|
||||
|
||||
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
|
||||
double lat;
|
||||
double longl;
|
||||
|
||||
// kinda stinky but it works
|
||||
for (int i = 0; i < 2; i++) {
|
||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
||||
step.getWaypoints()[i] = new GeoPoint(lat, longl);
|
||||
}
|
||||
|
||||
addStep(step);
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
parseSegments(segments, gson);
|
||||
|
||||
startAndEndPoint[0] = this.getSteps().get(0).getWaypoints()[0];
|
||||
startAndEndPoint[1] = this.getSteps().get(this.getSteps().size()-1).getWaypoints()[1];
|
||||
startAndEndPoint[1] = this.getSteps().get(this.getSteps().size() - 1).getWaypoints()[1];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* parses the given json string into this object. This method is used for when you want to
|
||||
* @param json
|
||||
* parses the given json string into this object. This method is used for when you have requested directions from the API for a {@link com.a1.nextlocation.data.Route route object}
|
||||
*
|
||||
* @param json the json string
|
||||
*/
|
||||
public void parseRoute(String json) {
|
||||
|
||||
@@ -162,33 +138,56 @@ public class DirectionsResult {
|
||||
|
||||
JsonArray segments = route.getAsJsonArray("segments");
|
||||
|
||||
for (JsonElement e : segments) {
|
||||
JsonObject segment = e.getAsJsonObject();
|
||||
parseSegments(segments, gson);
|
||||
|
||||
setDistance(segment.get("distance").getAsDouble());
|
||||
setDuration(segment.get("duration").getAsDouble());
|
||||
|
||||
JsonArray steps = segment.getAsJsonArray("steps");
|
||||
|
||||
for (JsonElement j : steps) {
|
||||
|
||||
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
|
||||
double lat;
|
||||
double longl;
|
||||
|
||||
// kinda stinky but it works
|
||||
for (int i = 0; i < 2; i++) {
|
||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
||||
step.getWaypoints()[i] = new GeoPoint(lat, longl);
|
||||
}
|
||||
|
||||
addStep(step);
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* parses different segments, and the steps in it using {@link DirectionsResult#parseSteps(JsonArray, Gson) the method for parsing steps}
|
||||
*
|
||||
* @param segments the segments to parse
|
||||
* @param gson the gson object to use
|
||||
*/
|
||||
private void parseSegments(JsonArray segments, Gson gson) {
|
||||
//unfold the individual segments
|
||||
for (JsonElement e : segments) {
|
||||
JsonObject segment = e.getAsJsonObject();
|
||||
|
||||
setDistance(segment.get("distance").getAsDouble());
|
||||
setDuration(segment.get("duration").getAsDouble());
|
||||
|
||||
JsonArray steps = segment.getAsJsonArray("steps");
|
||||
|
||||
parseSteps(steps, gson);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* parses the given steps into this object, transforms them into a {@link DirectionsStep} object.
|
||||
*
|
||||
* @param steps the steps to parse
|
||||
* @param gson the gson object to use
|
||||
*/
|
||||
private void parseSteps(JsonArray steps, Gson gson) {
|
||||
for (JsonElement j : steps) {
|
||||
|
||||
// parse everything into a directionsstep
|
||||
DirectionsStep step = gson.fromJson(j, DirectionsStep.class);
|
||||
double lat;
|
||||
double longl;
|
||||
|
||||
// kinda stinky but it works
|
||||
for (int i = 0; i < 2; i++) {
|
||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
||||
step.getWaypoints()[i] = new GeoPoint(lat, longl);
|
||||
}
|
||||
|
||||
addStep(step);
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.a1.nextlocation.json;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
/**
|
||||
* source: https://github.com/GIScience/openrouteservice-docs#geometry-decoding
|
||||
*/
|
||||
@@ -39,7 +36,7 @@ public class GeometryDecoder {
|
||||
lng += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);
|
||||
|
||||
|
||||
if(inclElevation){
|
||||
if (inclElevation) {
|
||||
result = 1;
|
||||
shift = 0;
|
||||
do {
|
||||
@@ -53,7 +50,7 @@ public class GeometryDecoder {
|
||||
JsonArray location = new JsonArray();
|
||||
location.add(lat / 1E5);
|
||||
location.add(lng / 1E5);
|
||||
if(inclElevation){
|
||||
if (inclElevation) {
|
||||
location.add((float) (ele / 100));
|
||||
}
|
||||
geometry.add(location);
|
||||
|
||||
@@ -6,13 +6,11 @@ import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
@@ -27,32 +25,34 @@ public enum ApiHandler {
|
||||
INSTANCE;
|
||||
|
||||
|
||||
private static String TAG = ApiHandler.class.getCanonicalName();
|
||||
private static final String TAG = ApiHandler.class.getCanonicalName();
|
||||
|
||||
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
||||
private final String BASE_URL = "https://api.openrouteservice.org/v2/directions/";
|
||||
private final String API_KEY = "5b3ce3597851110001cf6248d4eee2099f724255918adc71cc502b2a";
|
||||
private final String DIRECTIONS_MODE = "foot-walking";
|
||||
|
||||
private List<DirectionsListener> listeners = new ArrayList<>();
|
||||
private final List<DirectionsListener> listeners = new ArrayList<>();
|
||||
|
||||
private OkHttpClient client = new OkHttpClient();
|
||||
private final OkHttpClient client = new OkHttpClient();
|
||||
|
||||
/**
|
||||
* gets directions from the start location to the end location
|
||||
*
|
||||
* @param startLocation the start location
|
||||
* @param endLocation the end location
|
||||
* @param endLocation the end location
|
||||
*/
|
||||
public void getDirections(Location startLocation, Location endLocation) {
|
||||
getDirections(startLocation.getCoordinates(),endLocation.getCoordinates());
|
||||
getDirections(startLocation.getCoordinates(), endLocation.getCoordinates());
|
||||
}
|
||||
|
||||
/**
|
||||
* gets directions from the start location latitude and longitude and the end location latitude and longitude
|
||||
* @param startLat the start latitude
|
||||
*
|
||||
* @param startLat the start latitude
|
||||
* @param startLong the start longitude
|
||||
* @param endLat the end latitude
|
||||
* @param endLong the end longitude
|
||||
* @param endLat the end latitude
|
||||
* @param endLong the end longitude
|
||||
*/
|
||||
public void getDirections(double startLat, double startLong, double endLat, double endLong) {
|
||||
getDirections(startLong + "," + startLat, endLong + "," + endLat);
|
||||
@@ -60,13 +60,14 @@ public enum ApiHandler {
|
||||
|
||||
/**
|
||||
* Gets the directions from the start location to the end location. An example location would be "3.543543,5.7675765"
|
||||
*
|
||||
* @param startLocation the start location represented as <i>startlat,startlong</i>
|
||||
* @param endLocation the end location represented as <i>endlat,endlong</i>
|
||||
* @param endLocation the end location represented as <i>endlat,endlong</i>
|
||||
*/
|
||||
public void getDirections(String startLocation, String endLocation) {
|
||||
|
||||
// build the url
|
||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" +startLocation + "&end=" + endLocation;
|
||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" + startLocation + "&end=" + endLocation;
|
||||
|
||||
// start a new thread to do the request, because we don't want to be networking on our main thread
|
||||
Thread t = new Thread(() -> {
|
||||
@@ -108,6 +109,7 @@ public enum ApiHandler {
|
||||
|
||||
/**
|
||||
* adds a listener for when a result of an api call is available
|
||||
*
|
||||
* @param listener the new listener
|
||||
*/
|
||||
public void addListener(DirectionsListener listener) {
|
||||
@@ -116,6 +118,7 @@ public enum ApiHandler {
|
||||
|
||||
/**
|
||||
* gets directions for the given {@link Route}
|
||||
*
|
||||
* @param route the route to get directions for
|
||||
*/
|
||||
public void getDirections(Route route) {
|
||||
@@ -135,7 +138,7 @@ public enum ApiHandler {
|
||||
Thread t = new Thread(() -> {
|
||||
|
||||
// add the body to the request
|
||||
RequestBody requestBody = RequestBody.create(body,JSON);
|
||||
RequestBody requestBody = RequestBody.create(body, JSON);
|
||||
Request request = new Request.Builder()
|
||||
.url(requestUrl)
|
||||
.post(requestBody)
|
||||
@@ -182,6 +185,4 @@ public enum ApiHandler {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.a1.nextlocation.network;
|
||||
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
|
||||
public interface DirectionsListener {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -16,8 +16,8 @@ import java.util.List;
|
||||
|
||||
public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponViewHolder> {
|
||||
|
||||
private Context appContext;
|
||||
private List<Coupon> couponList;
|
||||
private final Context appContext;
|
||||
private final List<Coupon> couponList;
|
||||
private OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
@@ -27,17 +27,20 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
|
||||
class CouponViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
|
||||
private TextView couponCode;
|
||||
private TextView couponReward;
|
||||
|
||||
public CouponViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
itemView.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
public void setTextViewName(String text){
|
||||
this.couponReward = itemView.findViewById(R.id.coupon_name);
|
||||
this.couponReward.setText(text);
|
||||
/**
|
||||
* Sets the text of the coupon
|
||||
*
|
||||
* @param text the text that will be set
|
||||
*/
|
||||
public void setTextViewName(String text) {
|
||||
TextView couponReward = itemView.findViewById(R.id.coupon_name);
|
||||
couponReward.setText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,7 +49,7 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
|
||||
}
|
||||
}
|
||||
|
||||
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener){
|
||||
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener) {
|
||||
this.appContext = context;
|
||||
this.couponList = coupon;
|
||||
this.clickListener = listener;
|
||||
|
||||
@@ -22,11 +22,10 @@ public enum CouponListManager {
|
||||
return couponList;
|
||||
}
|
||||
|
||||
public Coupon getCoupon(int place) {
|
||||
return couponList.get(place);
|
||||
}
|
||||
|
||||
public void load(){
|
||||
/**
|
||||
* prepares the list for the adapter
|
||||
*/
|
||||
public void load() {
|
||||
CouponLoader couponLoader = new CouponLoader(this.context);
|
||||
this.couponList = couponLoader.load();
|
||||
}
|
||||
|
||||
@@ -18,10 +18,23 @@ public class CouponLoader implements Loader<List<Coupon>> {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the Arraylist of coupons out of the JSON
|
||||
*
|
||||
* @return Arraylist of coupons
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Coupon> load() {
|
||||
FileIO<ArrayList<Coupon>> fileIO = new FileIO<>();
|
||||
ArrayList<Coupon> res = fileIO.readFileData(context, "coupons.json",new TypeToken<ArrayList<Coupon>>(){}.getType());
|
||||
|
||||
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
|
||||
String fileName = "coupons";
|
||||
// choose the coupons.json based of the selected language
|
||||
if (!selectedLanguage.equals("en")) {
|
||||
fileName += "-" + selectedLanguage;
|
||||
}
|
||||
ArrayList<Coupon> res = fileIO.readFileData(context, fileName + ".json", new TypeToken<ArrayList<Coupon>>() {
|
||||
}.getType());
|
||||
Log.d(TAG, "load: " + res);
|
||||
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import org.osmdroid.api.IMapView;
|
||||
import org.osmdroid.views.MapView;
|
||||
import org.osmdroid.views.overlay.ItemizedOverlay;
|
||||
import org.osmdroid.views.overlay.OverlayItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CustomOverlay extends ItemizedOverlay<OverlayItem> {
|
||||
private final MapView mapView;
|
||||
private ArrayList<OverlayItem> overlayItems = new ArrayList<>();
|
||||
|
||||
public CustomOverlay(Drawable pDefaultMarker, MapView mapView) {
|
||||
super(pDefaultMarker);
|
||||
this.mapView = mapView;
|
||||
|
||||
}
|
||||
|
||||
public void addOverlayItem(OverlayItem item) {
|
||||
overlayItems.add(item);
|
||||
populate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OverlayItem createItem(int i) {
|
||||
return overlayItems.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return overlayItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSnapToItem(int x, int y, Point snapPoint, IMapView mapView) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -17,9 +17,9 @@ import java.util.List;
|
||||
|
||||
public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.LocationViewHolder> {
|
||||
|
||||
private Context appContext;
|
||||
private List<Location> locationList;
|
||||
private OnItemClickListener clickListener;
|
||||
private final Context appContext;
|
||||
private final List<Location> locationList;
|
||||
private final OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int clickedPosition);
|
||||
@@ -42,12 +42,22 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
||||
clickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
|
||||
public void setTextViewText(String text){
|
||||
/**
|
||||
* Sets the text of the location name
|
||||
*
|
||||
* @param text the text that will be set
|
||||
*/
|
||||
public void setTextViewText(String text) {
|
||||
this.locationName = itemView.findViewById(R.id.location_name);
|
||||
locationName.setText(text);
|
||||
this.locationName.setText(text);
|
||||
}
|
||||
|
||||
public void setImageViewImage(String text){
|
||||
/**
|
||||
* Sets the image of the locatoin
|
||||
*
|
||||
* @param text the text of the image filename
|
||||
*/
|
||||
public void setImageViewImage(String text) {
|
||||
this.locationImage = itemView.findViewById(R.id.location_image);
|
||||
Context context = locationImage.getContext();
|
||||
int id = context.getResources().getIdentifier(text, "drawable", context.getPackageName());
|
||||
@@ -55,7 +65,7 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
||||
}
|
||||
}
|
||||
|
||||
public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener){
|
||||
public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener) {
|
||||
this.appContext = context;
|
||||
this.locationList = location;
|
||||
this.clickListener = listener;
|
||||
@@ -72,7 +82,7 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
|
||||
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
|
||||
Location location = locationList.get(position);
|
||||
holder.setTextViewText(location.getName());
|
||||
holder.setImageViewImage(location.getImageUrl());
|
||||
holder.setImageViewImage(location.getIconUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,6 @@ import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.Location;
|
||||
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -24,13 +22,21 @@ public enum LocationListManager {
|
||||
return locationList;
|
||||
}
|
||||
|
||||
public Location getLocation(int place) {
|
||||
return locationList.get(place);
|
||||
}
|
||||
|
||||
/**
|
||||
* prepares the array list for the adapter
|
||||
*/
|
||||
public void load() {
|
||||
LocationLoader locationLoader = new LocationLoader(this.context);
|
||||
this.locationList = locationLoader.load();
|
||||
}
|
||||
|
||||
public Location findByName(String name) {
|
||||
Location res = null;
|
||||
for (Location location : this.locationList) {
|
||||
if (location.getName().equals(name)) res = location;
|
||||
break;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.a1.nextlocation.data.Location;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LocationLoader implements Loader<List<Location>> {
|
||||
@@ -17,11 +16,24 @@ public class LocationLoader implements Loader<List<Location>> {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* loads the array list from a JSON file
|
||||
*
|
||||
* @return array list with locations
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Location> load() {
|
||||
FileIO<ArrayList<Location>> fileIO = new FileIO<>();
|
||||
|
||||
ArrayList<Location> res = fileIO.readFileData(context,"locations.json",new TypeToken<ArrayList<Location>>(){}.getType());
|
||||
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
|
||||
String fileName = "locations";
|
||||
// choose the locations.json based of the selected language
|
||||
if (!selectedLanguage.equals("en")) {
|
||||
fileName += "-" + selectedLanguage;
|
||||
}
|
||||
|
||||
ArrayList<Location> res = fileIO.readFileData(context, fileName + ".json", new TypeToken<ArrayList<Location>>() {
|
||||
}.getType());
|
||||
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -11,16 +10,15 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHolder>{
|
||||
public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHolder> {
|
||||
|
||||
private Context appContext;
|
||||
private List<Route> routeList;
|
||||
private CouponAdapter.OnItemClickListener clickListener;
|
||||
private final Context appContext;
|
||||
private final List<Route> routeList;
|
||||
private final CouponAdapter.OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int clickedPosition);
|
||||
@@ -41,13 +39,18 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
|
||||
clickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
|
||||
public void setTextViewText(String text){
|
||||
/**
|
||||
* sets the text of the route name
|
||||
*
|
||||
* @param text the text that will be set
|
||||
*/
|
||||
public void setTextViewText(String text) {
|
||||
this.routeName = itemView.findViewById(R.id.route_name);
|
||||
this.routeName.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
public RouteAdapter(Context context, List<Route> route, CouponAdapter.OnItemClickListener listener){
|
||||
public RouteAdapter(Context context, List<Route> route, CouponAdapter.OnItemClickListener listener) {
|
||||
appContext = context;
|
||||
routeList = route;
|
||||
clickListener = listener;
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.a1.nextlocation.data.Route;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum RouteListManager{
|
||||
public enum RouteListManager {
|
||||
INSTANCE;
|
||||
|
||||
private List<Route> routeList;
|
||||
@@ -18,15 +18,13 @@ public enum RouteListManager{
|
||||
this.routeList = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public List<Route> getRouteList() {
|
||||
return routeList;
|
||||
}
|
||||
|
||||
public Route getRoute(int place) {
|
||||
return routeList.get(place);
|
||||
}
|
||||
|
||||
/**
|
||||
* prepares the array list for the adapter
|
||||
*/
|
||||
public void load() {
|
||||
RouteLoader routeLoader = new RouteLoader(this.context);
|
||||
this.routeList = routeLoader.load();
|
||||
|
||||
@@ -3,12 +3,10 @@ package com.a1.nextlocation.recyclerview;
|
||||
import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.FileIO;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class RouteLoader implements Loader<List<Route>> {
|
||||
@@ -18,11 +16,25 @@ public class RouteLoader implements Loader<List<Route>> {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* loads an array list from a JSON
|
||||
*
|
||||
* @return an array list with routes
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<Route> load() {
|
||||
|
||||
FileIO<ArrayList<Route>> fileIO = new FileIO<>();
|
||||
ArrayList<Route> res = fileIO.readFileData(context, "routes.json",new TypeToken<ArrayList<Route>>(){}.getType());
|
||||
|
||||
String selectedLanguage = context.getSharedPreferences("Settings", Context.MODE_PRIVATE).getString("Language", "nl");
|
||||
String fileName = "routes";
|
||||
// choose the routes.json based of the selected language
|
||||
if (!selectedLanguage.equals("en")) {
|
||||
fileName += "-" + selectedLanguage;
|
||||
}
|
||||
|
||||
ArrayList<Route> res = fileIO.readFileData(context, fileName + ".json", new TypeToken<ArrayList<Route>>() {
|
||||
}.getType());
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
android:tint="#333333"
|
||||
android:alpha="0.6">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:fillColor="@color/primaryColour"
|
||||
android:pathData="M8,16h8V8H8V16zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2L12,2z"
|
||||
android:fillType="evenOdd"/>
|
||||
</vector>
|
||||
|
||||
BIN
app/src/main/res/drawable-hdpi/beach_icon.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
app/src/main/res/drawable-hdpi/building_icon.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
app/src/main/res/drawable-hdpi/coffee_icon.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-hdpi/escape_icon.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
app/src/main/res/drawable-hdpi/mcdonalds_icon.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-hdpi/mezz_icon.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-hdpi/restaurant_icon.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
app/src/main/res/drawable-hdpi/statue_icon.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable-hdpi/subway_icon.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
app/src/main/res/drawable-hdpi/vr_icon.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
app/src/main/res/drawable-hdpi/wok_icon.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
@@ -1,10 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@color/primaryColour"
|
||||
android:fillColor="@color/secondaryColour"
|
||||
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||
</vector>
|
||||
|
||||
10
app/src/main/res/drawable/ic_baseline_location_on_24_2.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="32dp"
|
||||
android:height="32dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@color/secondaryColour"
|
||||
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||
</vector>
|
||||
74
app/src/main/res/drawable/icon_background.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector
|
||||
android:height="108dp"
|
||||
android:width="108dp"
|
||||
android:viewportHeight="108"
|
||||
android:viewportWidth="108"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#3DDC84"
|
||||
android:pathData="M0,0h108v108h-108z"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M9,0L9,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,0L19,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,0L29,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,0L39,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,0L49,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,0L59,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,0L69,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,0L79,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M89,0L89,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M99,0L99,108"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,9L108,9"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,19L108,19"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,29L108,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,39L108,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,49L108,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,59L108,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,69L108,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,79L108,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,89L108,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M0,99L108,99"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,29L89,29"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,39L89,39"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,49L89,49"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,59L89,59"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,69L89,69"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M19,79L89,79"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M29,19L29,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M39,19L39,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M49,19L49,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M59,19L59,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M69,19L69,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
<path android:fillColor="#00000000" android:pathData="M79,19L79,89"
|
||||
android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
|
||||
</vector>
|
||||
BIN
app/src/main/res/drawable/next_location_icon.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
@@ -1,55 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.LocationDetailFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_location_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/detail_location_image"
|
||||
android:layout_width="309dp"
|
||||
android:layout_height="283dp"
|
||||
android:layout_marginStart="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_location_text"
|
||||
android:layout_width="309dp"
|
||||
android:layout_height="283dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/detail_location_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/detail_location_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/detail_location_name"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,71 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.RouteDetailFragment">
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_route_button2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:text="@string/start_route"
|
||||
android:textColor="@color/buttonColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintStart_toStartOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintVertical_bias="0.873" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/routeDetailBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/route_title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/route_title"
|
||||
app:layout_constraintEnd_toStartOf="@id/route_title"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/route_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="250dp"
|
||||
android:text="titel"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
|
||||
app:layout_constraintEnd_toStartOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintStart_toEndOf="@id/routeDetailBackButton"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/route_detail_image"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_marginEnd="350dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reoute_detail_tekst"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/route_detail_image"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -22,9 +22,9 @@
|
||||
android:id="@+id/navigation_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:background="@color/primaryColour"
|
||||
app:itemIconTint="@color/secondaryColour"
|
||||
app:itemTextColor="@color/primaryColour"
|
||||
app:itemTextColor="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
android:id="@+id/couponItem"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@+id/name_box"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/name_box"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/name_box"
|
||||
app:layout_constraintRight_toRightOf="@+id/name_box"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/name_box"
|
||||
android:layout_width="match_parent"
|
||||
@@ -13,7 +22,7 @@
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.4"
|
||||
@@ -26,7 +35,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -14,10 +14,13 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/statistics"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/coupon_back_button"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:text="@string/coupons"
|
||||
android:textSize="30sp"
|
||||
android:textColor="@color/secondaryColour"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/coupon_back_button"
|
||||
app:layout_constraintBottom_toBottomOf="@id/coupon_back_button"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/coupon_back_button"
|
||||
@@ -26,7 +29,6 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_baseline_outlined_flag_24"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -37,7 +37,7 @@
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/location_list_button"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_stop_icon"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@
|
||||
android:layout_margin="9dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/locations"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/location_back_button"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
@@ -26,7 +27,6 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text=""
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="30sp"
|
||||
android:gravity="center"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -35,7 +35,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="200dp"
|
||||
android:layout_margin="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:text=""
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -45,13 +45,12 @@
|
||||
android:id="@+id/detail_location_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/primaryColour"
|
||||
android:text=""
|
||||
/>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/detail_location_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
@@ -19,13 +19,16 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/route_title"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:text="@string/routes"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/route_back_button"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/route_back_button"
|
||||
app:layout_constraintBottom_toBottomOf="@id/route_back_button"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/route_recyclerview"
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -22,7 +21,7 @@
|
||||
android:id="@+id/route_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/route_detail_image"
|
||||
android:text=""
|
||||
@@ -31,40 +30,57 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_margin="40dp"
|
||||
android:id="@+id/route_detail_image"
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_width="228dp"
|
||||
android:layout_height="208dp"
|
||||
android:layout_margin="40dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button" />
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reoute_detail_tekst"
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="56dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.6"
|
||||
android:layout_height="200dp"
|
||||
android:layout_margin="20dp"
|
||||
android:background="@color/primaryColour"
|
||||
android:id="@+id/route_scroll_view"
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_image" />
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/total_distance">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/route_detail_tekst"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp" />
|
||||
</ScrollView>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/start_route_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/start_route"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:textColor="@color/buttonColour"
|
||||
android:text="@string/start_route"
|
||||
android:textColor="@color/primaryColour"
|
||||
android:layout_marginBottom="50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/total_distance" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/total_distance"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/primaryColour"
|
||||
android:text="@string/total_distance"
|
||||
android:textColor="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintVertical_bias="0.671" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/route_scroll_view" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -6,7 +6,8 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
android:id="@+id/settingFragment"
|
||||
tools:context=".fragments.SettingsFragment">
|
||||
tools:context=".fragments.SettingsFragment"
|
||||
android:theme="@style/Theme.Switches">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/settings_back_button"
|
||||
@@ -14,8 +15,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -25,12 +25,22 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/settings"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/name_box"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name_box"
|
||||
app:layout_constraintLeft_toLeftOf="@id/name_box"
|
||||
app:layout_constraintRight_toRightOf="@id/name_box"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/name_box"
|
||||
android:layout_width="match_parent"
|
||||
@@ -39,16 +49,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/language"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
@@ -57,9 +66,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -79,12 +88,22 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box2"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box2"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box2"
|
||||
app:layout_constraintRight_toRightOf="@id/Box2"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -96,7 +115,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/imperial_system"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
@@ -105,9 +124,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -115,7 +134,7 @@
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/settingsImperialButton"
|
||||
android:id="@+id/imperial_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -126,12 +145,21 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box3"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box3"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box3"
|
||||
app:layout_constraintRight_toRightOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -142,7 +170,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/_65_mode"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
@@ -151,9 +179,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -162,15 +190,23 @@
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/BigFont"
|
||||
android:id="@+id/font_changer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box4"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box4"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box4"
|
||||
app:layout_constraintRight_toRightOf="@id/Box4"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
@@ -179,16 +215,15 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/colorblind"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
@@ -197,9 +232,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -207,7 +242,7 @@
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/settingsEyesButton"
|
||||
android:id="@+id/colourblindSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -14,18 +14,27 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/statistics"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/name_box"
|
||||
app:layout_constraintBottom_toBottomOf="@id/name_box"
|
||||
app:layout_constraintLeft_toLeftOf="@id/name_box"
|
||||
app:layout_constraintRight_toRightOf="@id/name_box"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/name_box"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -37,7 +46,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/total_distance"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
@@ -46,9 +55,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -59,7 +68,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -69,12 +78,21 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box2"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box2"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box2"
|
||||
app:layout_constraintRight_toRightOf="@id/Box2"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -86,7 +104,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/visited_locations"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
@@ -95,9 +113,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -108,7 +126,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -118,12 +136,21 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box3"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box3"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box3"
|
||||
app:layout_constraintRight_toRightOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -133,7 +160,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/total_time"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
@@ -142,9 +169,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -155,7 +182,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -165,12 +192,21 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="74dp"
|
||||
app:layout_constraintTop_toTopOf="@id/Box4"
|
||||
app:layout_constraintBottom_toBottomOf="@id/Box4"
|
||||
app:layout_constraintLeft_toLeftOf="@id/Box4"
|
||||
app:layout_constraintRight_toRightOf="@id/Box4"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.85"
|
||||
@@ -182,7 +218,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/coupons_collected"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
@@ -191,9 +227,9 @@
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -204,7 +240,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=""
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -231,8 +267,6 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
@@ -1,27 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--<androidx.appcompat.widget.LinearLayoutCompat-->
|
||||
<!-- xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:layout_gravity="center"-->
|
||||
<!-- android:orientation="vertical">-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:text="@string/help"-->
|
||||
<!-- android:textAlignment="center"-->
|
||||
<!-- android:background="@color/secondaryColour"-->
|
||||
<!-- android:paddingVertical="10dp"/>-->
|
||||
<!-- -->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="400dp"-->
|
||||
<!-- android:text="@string/help_discription"-->
|
||||
<!-- android:background="@color/primaryColour"/>-->
|
||||
<!-- -->
|
||||
|
||||
|
||||
<!--</androidx.appcompat.widget.LinearLayoutCompat>-->
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/helpPopConst"
|
||||
@@ -39,25 +16,51 @@
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="@string/help"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:textAlignment="center"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:paddingVertical="10dp"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
<ScrollView
|
||||
android:id="@+id/scrollView2"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="400dp"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/helpPopTitle"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="380dp"
|
||||
android:text="@string/help_discription"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"/>
|
||||
app:layout_constraintBottom_toTopOf="@id/help_ok_button"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="430dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/help_discription"
|
||||
android:textColor="@color/secondaryColour"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/helpPopTitle" />
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<Button
|
||||
android:id="@+id/help_ok_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:textColor="@color/primaryColour"
|
||||
android:text="ok"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/scrollView2"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4,30 +4,51 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:id="@+id/locationItem"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="54dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@color/primaryColour"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/location_image"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/location_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_name"
|
||||
android:layout_width="321dp"
|
||||
android:layout_width="292dp"
|
||||
android:layout_height="47dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:gravity="left"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:text=""
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="1.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/location_image"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
|
||||
@@ -4,10 +4,28 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/secondaryColour"
|
||||
android:background="@color/primaryColour"
|
||||
android:id="@+id/routeItem"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="54dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@color/secondaryColour"/>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="46dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:background="@color/primaryColour"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
@@ -21,6 +39,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/secondaryColour"
|
||||
android:text=""
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
5
app/src/main/res/mipmap-anydpi-v26/icon.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/icon_background"/>
|
||||
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||
</adaptive-icon>
|
||||
5
app/src/main/res/mipmap-anydpi-v26/icon_round.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/icon_background"/>
|
||||
<foreground android:drawable="@mipmap/icon_foreground"/>
|
||||
</adaptive-icon>
|
||||
BIN
app/src/main/res/mipmap-hdpi/icon.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/mipmap-hdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
app/src/main/res/mipmap-mdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
app/src/main/res/mipmap-xhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_foreground.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_round.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
14
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="purple_200">#FFBB86FC</color>
|
||||
<color name="purple_500">#FF6200EE</color>
|
||||
<color name="purple_700">#FF3700B3</color>
|
||||
<color name="teal_200">#FF03DAC5</color>
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="primaryColour">#FF115571</color>
|
||||
<color name="secondaryColour">#FF31AFB4</color>
|
||||
<color name="buttonColour">#FF14212D</color>
|
||||
<color name="red">#FF0000</color>
|
||||
</resources>
|
||||
@@ -2,15 +2,28 @@
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
<item name="colorOnPrimary">@color/black</item>
|
||||
<item name="colorPrimary">@color/white</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/teal_200</item>
|
||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
||||
<item name="colorOnSecondary">@color/black</item>
|
||||
<!-- Status bar color. -->
|
||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||
<item name="colorSecondary">@color/secondaryColour</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||
<item name="android:textSize">16sp</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Switches" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorControlActivated">@color/secondaryColour</item>
|
||||
<item name="colorSwitchThumbNormal">@color/buttonColourCB</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primaryColour</item>
|
||||
<!-- Secondary brand color. -->
|
||||
<item name="colorSecondary">@color/secondaryColour</item>
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||
<item name="android:textSize">24sp</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -12,17 +12,27 @@
|
||||
<string name="colorblind">Kleurenblind</string>
|
||||
<string name="total_distance">Totale afstand:</string>
|
||||
<string name="visited_locations">Bezochte locaties:</string>
|
||||
<string name="total_time">Totale tijd:</string>
|
||||
<string name="total_time">Totale route tijd:</string>
|
||||
<string name="coupons_collected">Coupons gespaard:</string>
|
||||
<string name="coupons">Coupons</string>
|
||||
<string name="start_route">Start Route</string>
|
||||
<string name="activate_question">Weet je zeker dat je deze coupon wilt activeren?</string>
|
||||
<string name="activate">activeren</string>
|
||||
<string name="done">Klaar</string>
|
||||
<string name="total_distance_route">De totale afstand van de route is: </string>
|
||||
<string name="route_stop_toast">Route is gestopt!</string>
|
||||
<string name="cancel">annuleren</string>
|
||||
<string name="English">Engels</string>
|
||||
<string name="Dutch">Nederlands</string>
|
||||
<string name="Chinese">Chinees</string>
|
||||
<string name="help">HELP</string>
|
||||
<string name="help_discription">Onderaan het scherm zijn verschillende knoppen te zien. Deze knoppen hebben de volgende functies: \nLocaties: toont een lijst met alle locaties die bezocht kunnen worden. Elke locatie wordt kort beschreven. \nRoutes: Toont een lijst met alle routes die gelopen kunnen worden. Van elke route wordt een omschrijving gegeven. \nStatistieken: Toont persoonlijke statistieken. \nInstellingen: Hier kunnen app-instellingen worden aangepast naar eigen voorkeur. \n\nEen locatie ingedrukt houden laat extra informatie zien over de gekozen locatie</string>
|
||||
<string name="help_discription">Onderaan het scherm zijn verschillende knoppen te zien. Deze knoppen hebben de volgende functies: \n\nLocaties: toont een lijst met alle locaties die bezocht kunnen worden. Elke locatie wordt kort beschreven. \n\nRoutes: Toont een lijst met alle routes die gelopen kunnen worden. Van elke route wordt een omschrijving gegeven. \n\nStatistieken: Toont persoonlijke statistieken. \n\nInstellingen: Hier kunnen app-instellingen worden aangepast naar eigen voorkeur. \n\nEen locatie ingedrukt houden laat extra informatie zien over de gekozen locatie. \n\n\n</string>
|
||||
<string name="end_location">Eind locatie</string>
|
||||
<string name="start_location">Start locatie</string>
|
||||
<string name="following_locations">"Deze route bevat de volgende locaties: "</string>
|
||||
<string name="notification_title">Je bent dicht bij een locatie!</string>
|
||||
<string name="notification_text">Je bent bijna bij %1$s</string>
|
||||
<string name="hour">uur</string>
|
||||
<string name="minutes">minuten</string>
|
||||
<string name="route_started_toast">Route is gestart!</string>
|
||||
</resources>
|
||||
@@ -7,8 +7,11 @@
|
||||
<color name="teal_700">#FF018786</color>
|
||||
<color name="black">#FF000000</color>
|
||||
<color name="white">#FFFFFFFF</color>
|
||||
<color name="primaryColour">#FF115571</color>
|
||||
<color name="secondaryColour">#FF31AFB4</color>
|
||||
<color name="buttonColour">#FF14212D</color>
|
||||
<color name="primaryColour">#FFFFFFFF</color>
|
||||
<color name="secondaryColour">#FF000000</color>
|
||||
<color name="buttonColour">#FF000000</color>
|
||||
<color name="red">#FF0000</color>
|
||||
<color name="primaryColourCB">#FF115571</color>
|
||||
<color name="secondaryColourCB">#FF31AFB4</color>
|
||||
<color name="buttonColourCB">#FF14212D</color>
|
||||
</resources>
|
||||
@@ -10,7 +10,7 @@
|
||||
<string name="colorblind">Colorblind</string>
|
||||
<string name="total_distance">Total distance:</string>
|
||||
<string name="visited_locations">Visited locations:</string>
|
||||
<string name="total_time">Total time:</string>
|
||||
<string name="total_time">Total route time:</string>
|
||||
<string name="coupons_collected">Coupons collected:</string>
|
||||
<string name="coupons">Coupons</string>
|
||||
<string name="start_route">Start Route</string>
|
||||
@@ -18,10 +18,19 @@
|
||||
<string name="activate">activate</string>
|
||||
<string name="done">Done</string>
|
||||
<string name="cancel">cancel</string>
|
||||
<string name="total_distance_route">The total distance of the route is:</string>
|
||||
<string name="route_stop_toast">Route stopped!</string>
|
||||
<string name="Dutch">Dutch</string>
|
||||
<string name="English">English</string>
|
||||
<string name="Chinese">Chinese</string>
|
||||
<string name="help">HELP</string>
|
||||
<string name="help_discription">Hasn\'t been translated yet</string>
|
||||
<string name="help_discription">Various buttons can be seen at the bottom of the screen. These buttons have the following functions: \n\nLocations: displays a list of all locations that can be visited. Each location is briefly described. \n\nRoutes: Displays a list of all routes that can be walked. A description is given of each route. \n\nStats: Displays personal statistics. \n\nSettings: This is where app settings can be adjusted according to your preferences. \n\nHold down on a location to display additional information about the chosen location. \n\n\n</string>
|
||||
<string name="notification_title">You\'re close to a location!</string>
|
||||
<string name="notification_text">You\'re almost at %1$s</string>
|
||||
<string name="following_locations">This route contains the following locations: </string>
|
||||
<string name="end_location">End location</string>
|
||||
<string name="start_location">Start location</string>
|
||||
<string name="hour">hour</string>
|
||||
<string name="minutes">minutes</string>
|
||||
<string name="route_started_toast">Route started!</string>
|
||||
</resources>
|
||||