Compare commits
3 Commits
follow-rou
...
helpPopup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6a6724ba0 | ||
|
|
7dc5ce098c | ||
|
|
f5a2eabf61 |
@@ -11,9 +11,9 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/next_location_icon"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@drawable/next_location_icon"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.NextLocation"
|
||||
android:hardwareAccelerated="false">
|
||||
|
||||
@@ -1,110 +1,110 @@
|
||||
[
|
||||
{
|
||||
"name":"McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.586062613842245, 4.77579695141302",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.58604142340411, 4.7751359436675545",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Wok To Go Halstraat 40",
|
||||
"coordinates":"51.586464146477574, 4.777606887874218",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.58798747205394, 4.776265846483903",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Gauchos Grote Markt 33",
|
||||
"coordinates":"51.588449106286255, 4.77604936398091",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.588922458012384, 4.7804923888638",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||
"coordinates":"51.587223367256605, 4.779547820326475",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"t Zusje Breda Vismarktstraat 28",
|
||||
"coordinates":"51.589820093624986, 4.773333478675191",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"VR-World Nassaustraat 2",
|
||||
"coordinates":"51.5915020518371, 4.786101713659277",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58628401688983, 4.776977039420005",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59062116889821, 4.784611234825872",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.59010624820322, 4.788301630342321",
|
||||
"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"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":"51.59096347875923, 4.783722665161644",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.58361639477683, 4.778550518987883",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.587727575660196, 4.7649956643240525",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||
"coordinates":"51.59138317151629, 4.771525073666575",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen, Kraanstraat 4b, Breda",
|
||||
"coordinates":"51.590380346954696, 4.775770191566508",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.591204052421965, 4.777900596046037",
|
||||
"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"
|
||||
},
|
||||
@@ -116,19 +116,19 @@
|
||||
},
|
||||
{
|
||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||
"coordinates":"51.5924883160154, 4.779744240625213",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"Belcrum Beach Veilingkade 12a",
|
||||
"coordinates":"51.59960126665085, 4.765433657156298",
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60051284129074, 4.7689723624007",
|
||||
"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"
|
||||
}
|
||||
|
||||
@@ -2,75 +2,39 @@
|
||||
{
|
||||
"name": "rondje stad",
|
||||
"locations": [
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":"51.59096518753322, 4.783727736123234",
|
||||
"description":"4811GK Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59058740778487, 4.784723144974098",
|
||||
"coordinates":"51.59073795635181,4.784917104321059",
|
||||
"description":"4811EE Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.59025697138579, 4.787354025225596",
|
||||
"coordinates":"51.590431588532105,4.786756741648511",
|
||||
"description":"4811HP Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"4811GK Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.5837840024532, 4.779037836841554",
|
||||
"coordinates":"51.58394697737321,4.779757901349616",
|
||||
"description":"4811HL Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58765659148822, 4.764801414019652",
|
||||
"coordinates":"51.58775443759389,4.765568874365066",
|
||||
"description":"4811VN Breda",
|
||||
"imageUrl":"NULL"
|
||||
}
|
||||
],
|
||||
"totalDistance": 1073.0,
|
||||
"totalTime": 342342
|
||||
},
|
||||
{
|
||||
"name": "Obesi Route",
|
||||
"locations": [
|
||||
{
|
||||
"name": "McDonald's Breda Karnemelkstraat",
|
||||
"coordinates": "51.586062613842245, 4.777606887874218",
|
||||
"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!"
|
||||
},
|
||||
{
|
||||
"name": "Kees Kroket Houtmarkt 9",
|
||||
"coordinates": "51.58628401688983, 4.77579695141302",
|
||||
"description": "lekkere patatjes"
|
||||
},
|
||||
{
|
||||
"name": "Wok To Go Halstraat 40",
|
||||
"coordinates": "51.586464146477574, 4.777606887874218",
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates": "51.588922458012384, 4.7804923888638",
|
||||
"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?"
|
||||
},
|
||||
{
|
||||
"name": "Gauchos Grote Markt 33",
|
||||
"coordinates": "51.588449106286255, 4.77604936398091",
|
||||
"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."
|
||||
},
|
||||
{
|
||||
"name": "De Boterhal Grote Markt 19",
|
||||
"coordinates": "51.58798747205394, 4.776265846483903",
|
||||
"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."
|
||||
}
|
||||
],
|
||||
"totalDistance": 955.0,
|
||||
"totalDistance": 2.3434,
|
||||
"totalTime": 342342
|
||||
}
|
||||
]
|
||||
|
Before Width: | Height: | Size: 92 KiB |
@@ -1,13 +1,19 @@
|
||||
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.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.a1.nextlocation.fragments.HelpPopup;
|
||||
import com.a1.nextlocation.fragments.HomeFragment;
|
||||
import com.a1.nextlocation.fragments.Refreshable;
|
||||
import com.a1.nextlocation.fragments.RouteFragment;
|
||||
@@ -23,6 +29,7 @@ import java.util.Locale;
|
||||
public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
private static final String TAG = MainActivity.class.getName();
|
||||
private BottomNavigationView bottomNav;
|
||||
private ImageButton infoButton;
|
||||
|
||||
/**
|
||||
* onCreate method that creates the main activity
|
||||
@@ -38,6 +45,8 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
setContentView(R.layout.activity_main);
|
||||
bottomNav = findViewById(R.id.navigation_bar);
|
||||
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
||||
infoButton = findViewById(R.id.info_button);
|
||||
infoButton.setOnClickListener(onInfoClickListener);
|
||||
|
||||
/*System.out.println(Arrays.toString(getFilesDir().listFiles()));
|
||||
FileIO<Route> fileIO = new FileIO<>();
|
||||
@@ -109,4 +118,23 @@ public class MainActivity extends AppCompatActivity implements Refreshable {
|
||||
bottomNav.inflateMenu(R.menu.navmenu);
|
||||
bottomNav.setSelectedItemId(R.id.settings);
|
||||
}
|
||||
|
||||
private View.OnClickListener onInfoClickListener = new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
// AlertDialog.Builder infoBuilder = new AlertDialog.Builder(getBaseContext());
|
||||
// infoBuilder.setCancelable(true);
|
||||
//// infoBuilder.setPositiveButton(R.string.activate, (dialog, which) -> {
|
||||
//// dialog.cancel();
|
||||
//// });
|
||||
// infoBuilder.setView(getLayoutInflater().inflate(R.layout.help_popup, null));
|
||||
// AlertDialog infoPopup = infoBuilder.create();
|
||||
// infoPopup.show();
|
||||
|
||||
FragmentManager fragment = getSupportFragmentManager();
|
||||
DialogFragment helpPopupFragment = new HelpPopup();
|
||||
helpPopupFragment.show(fragment, "YEET");
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -112,6 +112,15 @@ 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
|
||||
@@ -121,11 +130,6 @@ 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)
|
||||
@@ -136,16 +140,11 @@ public class Location implements Parcelable {
|
||||
|
||||
// Radius of earth in kilometers. Use 3956
|
||||
// for miles
|
||||
// if(miles) {
|
||||
// double r = 3956;
|
||||
// }
|
||||
// else {
|
||||
double r = 6371;
|
||||
// }
|
||||
|
||||
// calculate the result
|
||||
double distance = c * r;
|
||||
|
||||
distance *= 1000;
|
||||
return Math.floor(distance);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ public class Route implements Parcelable {
|
||||
}
|
||||
|
||||
public float getTotalDistance() {
|
||||
//TODO calculate total distance according to all locations in list
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,6 @@ public enum RouteHandler {
|
||||
this.routeFinishedListener = routeFinishedListener;
|
||||
}
|
||||
|
||||
public RouteFinishedListener getRouteFinishedListener() {
|
||||
return routeFinishedListener;
|
||||
}
|
||||
|
||||
public int getStepCount() {
|
||||
return stepCount;
|
||||
}
|
||||
@@ -50,9 +46,6 @@ public enum RouteHandler {
|
||||
}
|
||||
|
||||
public void followRoute(Route route) {
|
||||
if (isFollowingRoute) {
|
||||
StaticData.INSTANCE.addTimeWalked(System.currentTimeMillis()-startedTime);
|
||||
}
|
||||
this.currentRoute = route;
|
||||
setFollowingRoute(true);
|
||||
startedTime = System.currentTimeMillis();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import org.osmdroid.views.overlay.Polyline;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -9,16 +11,7 @@ public enum StaticData {
|
||||
INSTANCE;
|
||||
private double distanceTraveled = 0;
|
||||
private int locationsVisited = 0;
|
||||
private long timeWalked = 0;
|
||||
private double zoom = 0;
|
||||
|
||||
public double getZoom() {
|
||||
return zoom;
|
||||
}
|
||||
|
||||
public void setZoom(double zoom) {
|
||||
this.zoom = zoom;
|
||||
}
|
||||
private long timeWalkedRoute = 0;
|
||||
|
||||
private ArrayList<String> visitedNames = new ArrayList<>();
|
||||
|
||||
@@ -26,12 +19,12 @@ public enum StaticData {
|
||||
distanceTraveled += d;
|
||||
}
|
||||
|
||||
public long getTimeWalked() {
|
||||
return timeWalked;
|
||||
public long getTimeWalkedRoute() {
|
||||
return timeWalkedRoute;
|
||||
}
|
||||
|
||||
public void addTimeWalked(long time) {
|
||||
timeWalked += time;
|
||||
timeWalkedRoute += time;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
public class HelpPopup {
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
|
||||
public class HelpPopup extends DialogFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View rootView = inflater.inflate(R.layout.help_popup, container, false);
|
||||
getDialog().setTitle("Simple Dialog");
|
||||
return rootView;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.a1.nextlocation.fragments;
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -12,7 +11,6 @@ import android.location.LocationManager;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageButton;
|
||||
@@ -36,7 +34,6 @@ import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
import org.osmdroid.api.IMapController;
|
||||
import org.osmdroid.config.Configuration;
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
import org.osmdroid.views.CustomZoomButtonsController;
|
||||
import org.osmdroid.views.MapView;
|
||||
import org.osmdroid.views.overlay.ItemizedIconOverlay;
|
||||
import org.osmdroid.views.overlay.Overlay;
|
||||
@@ -52,14 +49,13 @@ 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;
|
||||
@@ -93,26 +89,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
// set up the route stop button
|
||||
stopButton = view.findViewById(R.id.home_stop_route_button);
|
||||
stopButton.setOnClickListener(v -> {
|
||||
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();
|
||||
@@ -121,6 +97,15 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
addLocations();
|
||||
mapView.invalidate();
|
||||
roadOverlay = null;
|
||||
});
|
||||
|
||||
if (RouteHandler.INSTANCE.isFollowingRoute()) {
|
||||
stopButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
stopButton.setVisibility(View.GONE);
|
||||
}
|
||||
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
|
||||
return view;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,7 +120,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
roadOverlay.setPoints(geoPoints);
|
||||
roadOverlay.setColor(color);
|
||||
|
||||
// pass the line to the route handler
|
||||
|
||||
RouteHandler.INSTANCE.setCurrentRouteLine(roadOverlay);
|
||||
Log.d(TAG, "onDirectionsAvailable: successfully added road!");
|
||||
|
||||
@@ -181,10 +166,7 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
|
||||
// add the zoom controller
|
||||
IMapController mapController = mapView.getController();
|
||||
if (StaticData.INSTANCE.getZoom() == 0) {
|
||||
StaticData.INSTANCE.setZoom(15.0);
|
||||
}
|
||||
mapController.setZoom(StaticData.INSTANCE.getZoom());
|
||||
mapController.setZoom(15.0);
|
||||
|
||||
// add location manager and set the start point
|
||||
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
||||
@@ -348,25 +330,14 @@ public class HomeFragment extends Fragment implements LocationListener {
|
||||
|
||||
//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) {
|
||||
if (com.a1.nextlocation.data.Location.getDistance(currentLocation.getLatitude(), currentLocation.getLongitude(), l.getLat(), l.getLong()) < 10) {
|
||||
StaticData.INSTANCE.visitLocation(l);
|
||||
if (l.equals(last)) stopRoute();
|
||||
}
|
||||
}
|
||||
|
||||
StaticData.INSTANCE.setZoom(mapView.getZoomLevelDouble());
|
||||
});
|
||||
|
||||
t.start();
|
||||
|
||||
}
|
||||
|
||||
// empty override methods for the LocationListener
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
@@ -15,20 +14,15 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RouteDetailFragment extends Fragment {
|
||||
|
||||
private Route route;
|
||||
private TextView routeDetailText;
|
||||
private TextView routeName;
|
||||
private TextView totalDistance;
|
||||
private ImageButton imageButton;
|
||||
|
||||
@Override
|
||||
@@ -37,7 +31,6 @@ public class RouteDetailFragment extends Fragment {
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_route_detail, container, false);
|
||||
@@ -51,10 +44,6 @@ public class RouteDetailFragment extends Fragment {
|
||||
this.routeDetailText = view.findViewById(R.id.reoute_detail_tekst);
|
||||
this.routeDetailText.setText(this.route.getDescription());
|
||||
|
||||
this.totalDistance = view.findViewById(R.id.total_distance);
|
||||
String distance_tekst = getResources().getString(R.string.total_distance_route);
|
||||
this.totalDistance.setText(distance_tekst + " " + calculateRoute(this.route.getLocations()) + "m");
|
||||
|
||||
this.imageButton = view.findViewById(R.id.route_detail_back_button);
|
||||
this.imageButton.setOnClickListener(v -> {
|
||||
RouteFragment routeFragment = new RouteFragment();
|
||||
@@ -64,6 +53,7 @@ public class RouteDetailFragment extends Fragment {
|
||||
Button startButton = view.findViewById(R.id.start_route_button);
|
||||
startButton.setOnClickListener(this::startRoute);
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -76,29 +66,6 @@ public class RouteDetailFragment extends Fragment {
|
||||
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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,12 +5,14 @@ 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 com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Coupon;
|
||||
@@ -42,13 +44,7 @@ public class StatisticFragment extends Fragment {
|
||||
double dist = StaticData.INSTANCE.getDistanceTraveled()/1000;
|
||||
distance.setText("" + String.format("%.1f",dist) + " km");
|
||||
locs.setText("" + StaticData.INSTANCE.getLocationsVisited());
|
||||
|
||||
long seconds = StaticData.INSTANCE.getTimeWalked() / 1000;
|
||||
long p1 = seconds % 60;
|
||||
long p2 = seconds / 60;
|
||||
long p3 = p2 % 60;
|
||||
p2 = p2 / 60;
|
||||
timeText.setText(p2 + ":" + p3 + ":" + p1);
|
||||
timeText.setText("" + StaticData.INSTANCE.getTimeWalkedRoute());
|
||||
|
||||
|
||||
this.couponList = CouponListManager.INSTANCE.getCouponList();
|
||||
|
||||
@@ -101,7 +101,31 @@ public class DirectionsResult {
|
||||
|
||||
JsonArray segments = properties.getAsJsonArray("segments");
|
||||
|
||||
parseSegments(segments,gson);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
startAndEndPoint[0] = this.getSteps().get(0).getWaypoints()[0];
|
||||
startAndEndPoint[1] = this.getSteps().get(this.getSteps().size()-1).getWaypoints()[1];
|
||||
@@ -109,8 +133,8 @@ public class DirectionsResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* parses the given json string into this object. This method is used for when you want to
|
||||
* @param json
|
||||
*/
|
||||
public void parseRoute(String json) {
|
||||
|
||||
@@ -138,20 +162,6 @@ public class DirectionsResult {
|
||||
|
||||
JsonArray segments = route.getAsJsonArray("segments");
|
||||
|
||||
parseSegments(segments,gson);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
|
||||
@@ -160,19 +170,8 @@ public class DirectionsResult {
|
||||
|
||||
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;
|
||||
@@ -188,4 +187,8 @@ public class DirectionsResult {
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 32 KiB |
@@ -38,7 +38,9 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/route_detail_back_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst" />
|
||||
app:layout_constraintBottom_toTopOf="@id/reoute_detail_tekst"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/reoute_detail_tekst"
|
||||
@@ -55,29 +57,14 @@
|
||||
android:id="@+id/start_route_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:text="@string/start_route"
|
||||
android:backgroundTint="@color/secondaryColour"
|
||||
android:textColor="@color/buttonColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
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:layout_marginTop="141dp"
|
||||
android:layout_marginBottom="19dp"
|
||||
android:text="@string/total_distance"
|
||||
android:background="@color/secondaryColour"
|
||||
android:textColor="@color/buttonColour"
|
||||
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
|
||||
app:layout_constraintTop_toBottomOf="@+id/reoute_detail_tekst"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:layout_editor_absoluteX="169dp" />
|
||||
app:layout_constraintVertical_bias="0.671" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
64
app/src/main/res/layout/help_popup.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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"
|
||||
android:layout_height="500dp"
|
||||
android:layout_width="300dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_gravity="center"
|
||||
android:background="@color/primaryColour">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/helpPopTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="50dp"
|
||||
android:text="@string/help"
|
||||
android:textColor="@color/black"
|
||||
android:textAlignment="center"
|
||||
android:background="@color/secondaryColour"
|
||||
android:paddingVertical="10dp"/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="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"/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?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>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 21 KiB |
@@ -19,9 +19,10 @@
|
||||
<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="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>
|
||||
</resources>
|
||||
@@ -18,9 +18,10 @@
|
||||
<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>
|
||||
</resources>
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.a1.nextlocation;
|
||||
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.a1.nextlocation.data.Location;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -68,8 +66,8 @@ public class LocationTest {
|
||||
@Test
|
||||
public void coordinateDoublesTest(){
|
||||
double[] testDoubles = new double[2];
|
||||
testDoubles[0] = 27.5;
|
||||
testDoubles[1] = 15.4;
|
||||
testDoubles[0] = 15.4;
|
||||
testDoubles[1] = 27.5;
|
||||
|
||||
double [] expectedCoordAsDouble = testDoubles;
|
||||
String expectedStringFromDouble = "15.4,27.5";
|
||||
@@ -96,13 +94,4 @@ public class LocationTest {
|
||||
|
||||
assertNotNull(alternateTestLocation);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void calculatingDistance(){
|
||||
|
||||
double expected2 = 1054.66;
|
||||
assertEquals(expected2, Location.getDistance(51.578810244278344, 4.804990650154528, 51.57696163247576, 4.789331956851824), 100);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.a1.nextlocation;
|
||||
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.data.RouteHandler;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.osmdroid.views.overlay.Polyline;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
||||
public class RouteHandlerTest {
|
||||
private RouteHandler routeHandler;
|
||||
|
||||
@Before
|
||||
public void init(){
|
||||
routeHandler = RouteHandler.INSTANCE;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRouteLine(){
|
||||
Polyline mPol = mock(Polyline.class);
|
||||
routeHandler.setCurrentRouteLine(mPol);
|
||||
assertEquals(mPol, routeHandler.getCurrentRouteLine());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStepCount(){
|
||||
int expected = 0;
|
||||
for (int i = 0; i < 100; i++) {
|
||||
routeHandler.addStep();
|
||||
expected++;
|
||||
}
|
||||
assertEquals(expected, routeHandler.getStepCount());
|
||||
expected += 10;
|
||||
assertNotEquals(expected, routeHandler.getStepCount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRouteFollowing(){
|
||||
Route testRoute = new Route("");
|
||||
routeHandler.followRoute(testRoute);
|
||||
boolean expected = true;
|
||||
assertEquals(expected, routeHandler.isFollowingRoute(testRoute));
|
||||
assertEquals(expected, routeHandler.isFollowingRoute());
|
||||
assertEquals(testRoute, routeHandler.getCurrentRoute());
|
||||
|
||||
routeHandler.finishRoute();
|
||||
assertNull(routeHandler.getCurrentRoute());
|
||||
|
||||
routeHandler.followRoute(new Route("FALSEROUTENAME"));
|
||||
assertNotEquals(expected, routeHandler.isFollowingRoute(testRoute));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
routeHandler.setRouteFinishedListener(() -> {
|
||||
System.out.println("TEST");
|
||||
});
|
||||
assertNotNull(routeHandler.getRouteFinishedListener());
|
||||
}
|
||||
}
|
||||
@@ -90,13 +90,4 @@ public class RouteTest {
|
||||
assertEquals(expectedAfter, route.getTotalTime());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDescription(){
|
||||
route.setDescription("TEST");
|
||||
String expected = "TEST";
|
||||
assertEquals(expected, route.getDescription());
|
||||
route.setDescription("FALSETEST");
|
||||
assertNotEquals(expected, route.getDescription());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
package com.a1.nextlocation;
|
||||
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.StaticData;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
|
||||
public class StaticDataTest {
|
||||
private StaticData staticData;
|
||||
|
||||
@Before
|
||||
public void init(){
|
||||
staticData = StaticData.INSTANCE;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDistance(){
|
||||
staticData.addDistance(2356.234);
|
||||
double expected = 2356.234;
|
||||
assertEquals(expected, staticData.getDistanceTraveled(), 0.01);
|
||||
staticData.addDistance(234342.1);
|
||||
assertNotEquals(expected, staticData.getDistanceTraveled());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTimeWalked(){
|
||||
staticData.addTimeWalked(3456);
|
||||
long expected = 3456;
|
||||
assertEquals(expected, staticData.getTimeWalked());
|
||||
staticData.addTimeWalked(3445);
|
||||
assertNotEquals(expected, staticData.getTimeWalked());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testVisitedLocation(){
|
||||
Location testLocation = new Location("test", "test", "test", "test");
|
||||
staticData.visitLocation(testLocation);
|
||||
int expected = 1;
|
||||
assertEquals(expected, staticData.getLocationsVisited());
|
||||
staticData.visitLocation(new Location("TESTFORFALSE", "TESTFORFALSE", "TESTFORFALSE", "TESTFORFALSE"));
|
||||
assertNotEquals(expected, staticData.getLocationsVisited());
|
||||
}
|
||||
|
||||
}
|
||||