296 Commits

Author SHA1 Message Date
SemvdH
04552932d9 Merge pull request #5 from SemvdH/develop
Develop
2021-01-14 11:55:22 +01:00
Sem van der Hoeven
7c0b57aa01 hehe 2021-01-14 11:13:23 +01:00
Robin Koedood
eae347844a Totale route tijd 2021-01-14 11:03:54 +01:00
Robin Koedood
9a746a1351 Radius big 2021-01-14 11:00:50 +01:00
Sem van der Hoeven
ad4583640c fixie 2021-01-14 10:52:39 +01:00
Sem van der Hoeven
d0ce399627 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-14 10:49:04 +01:00
Sem van der Hoeven
f7691d62fe added visited locations in route 2021-01-14 10:48:52 +01:00
Robin Koedood
55b5b058f1 Icon bigger 2021-01-14 10:39:24 +01:00
Robin Koedood
e8ea9f7982 Toast vertaald 2021-01-14 10:36:49 +01:00
Sem van der Hoeven
018de5688e Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-14 10:28:19 +01:00
Sem van der Hoeven
53ea394ef5 fixed locatiooooons 2021-01-14 10:28:11 +01:00
Bart
9dbbb80594 fixed navbar update on backbutton clicked 2021-01-14 10:23:20 +01:00
Sem van der Hoeven
391c0729e4 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-14 10:16:25 +01:00
Sem van der Hoeven
24a4d344d7 added location marker for visited 2021-01-14 10:16:09 +01:00
Bart
e19c15428d Edited refresh, no more visible reloading navbar 2021-01-14 10:03:47 +01:00
Sem van der Hoeven
158ddac964 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-12 16:40:31 +01:00
Sem van der Hoeven
43c3060f1e color change 2021-01-12 16:40:24 +01:00
RemoMeijer
de11e59db1 Fixed total distance bug 2021-01-12 16:34:27 +01:00
Robin Koedood
036278f829 Merge remote-tracking branch 'origin/develop' into develop 2021-01-12 15:30:42 +01:00
Robin Koedood
8dc6414464 Merge remote-tracking branch 'origin/develop' into develop 2021-01-12 15:30:37 +01:00
Robin Koedood
231bef098d added extra route 2021-01-12 15:30:33 +01:00
Sem van der Hoeven
638198450e add extra distance check 2021-01-12 15:30:30 +01:00
Sem van der Hoeven
57edff604e Merge branch 'develop' into ButtonFix 2021-01-12 15:28:49 +01:00
Sem van der Hoeven
04defe4643 0,0 fix 2021-01-12 15:28:26 +01:00
RemoMeijer
02c2981d58 Fixed button 2021-01-12 15:27:46 +01:00
Bipin
209e3f3681 Merge branch 'CosmeticFixes' into develop 2021-01-12 15:11:18 +01:00
Bipin
d87adeec8d text sizes and colours 2021-01-12 15:10:54 +01:00
Bart
27a7feb05a Merge branch 'saveTimeMA8' into develop 2021-01-12 15:04:05 +01:00
Bart
6edcd7b74f Total time walked gets saved and loaded 2021-01-12 15:03:46 +01:00
RemoMeijer
5587c318d0 Fixed start route button 2021-01-12 15:02:12 +01:00
Sem van der Hoeven
9e2144bd08 Merge branch 'develop' into routeFragmentDetail 2021-01-12 14:57:28 +01:00
RemoMeijer
d80f23ff82 fixed colours 2021-01-12 14:55:59 +01:00
Robin Koedood
e57e6cdcda Merge remote-tracking branch 'origin/develop' into develop 2021-01-12 14:54:56 +01:00
Robin Koedood
37a803b3a6 HELP popup en setting recreate nu na een switch ding switchen q8) 2021-01-12 14:54:31 +01:00
Sem van der Hoeven
65e7b99c86 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-12 14:47:18 +01:00
Sem van der Hoeven
5e2d49ac08 add getactivity 2021-01-12 14:47:09 +01:00
RemoMeijer
a7495d24ad Route displays expected time 2021-01-12 14:43:07 +01:00
Bart
428fa10433 Merge branch 'AAAAAAAAAAAAAAAAAAAAAAAAAAAA' into develop 2021-01-12 14:39:51 +01:00
Bipin
6d21ca16b8 last visual fixes for real this time promise 2021-01-12 14:35:18 +01:00
Bart
363899811a Added English help translation, ok-button moved to the bottom 2021-01-12 14:30:14 +01:00
Bipin
3880d7b4a2 Fixed last colour problems 2021-01-12 14:28:22 +01:00
RemoMeijer
5162dab0ff Fixed colors 2021-01-12 14:18:17 +01:00
Bipin
baf30b5dda smol colour edit 2021-01-12 14:16:52 +01:00
Bipin
70efd6b97c Merge branch 'fuckcolours' into develop 2021-01-12 14:05:10 +01:00
Sem van der Hoeven
4cc49c77f6 yeet 2021-01-12 14:04:25 +01:00
Bipin
7f56cbe30a Button be working now 2021-01-12 13:58:41 +01:00
Sem van der Hoeven
171c75c645 merge with develop 2021-01-12 13:56:46 +01:00
RemoMeijer
efbbe7124b Route detail added 2021-01-12 13:52:02 +01:00
Sem van der Hoeven
39ff2684cb added saving route duration 2021-01-12 13:51:50 +01:00
Bart
b010de709f Saves distance, visitedNames list and displays saved info in statistics. 2021-01-12 13:30:35 +01:00
Sem van der Hoeven
5544da5d2e add geofencing 2021-01-12 13:22:00 +01:00
Robin Koedood
b110d25549 KAN NIET MEER OPNIEUW MAP OPENEN ALS TIE AL OPEN IS 2021-01-12 12:48:25 +01:00
RemoMeijer
0f17e8d1e5 Added distance from current location to opend location 2021-01-12 12:18:21 +01:00
Bipin
2f5b53e2b4 barFix 2021-01-12 12:13:29 +01:00
Robin Koedood
4c09192f9a YEP 2021-01-12 12:09:30 +01:00
Robin Koedood
8740362553 Auto stash before merge of "fuckcolours" and "origin/fuckcolours" 2021-01-12 12:05:27 +01:00
Bipin
0663dabca5 Some non-functional changes 2021-01-12 11:54:33 +01:00
RemoMeijer
d4abd7a566 Added details to locatoins. ex. tel nummer, opening hours 2021-01-12 11:42:58 +01:00
Sem van der Hoeven
e286929b77 added geofencing stuff 2021-01-12 11:12:28 +01:00
Bipin
e7f152bc00 WAT MOOOOOOI 2021-01-12 11:00:44 +01:00
Bipin
f3dbb2b1d1 big bordfer 2021-01-12 10:44:59 +01:00
Bipin
cf650f6cf4 colourFix 2021-01-12 10:18:04 +01:00
Bipin
c15125d0c2 Removed all soul from application :) 2021-01-12 10:12:17 +01:00
SemvdH
1a6fc6a7f0 Merge pull request #4 from SemvdH/develop
Develop
2021-01-07 11:44:22 +01:00
Sem van der Hoeven
38dbbfc534 fiiiix 2021-01-07 11:43:40 +01:00
Sem van der Hoeven
8169e8c680 added back diff line 2021-01-07 11:35:44 +01:00
SemvdH
6eeb0870fc Merge pull request #3 from SemvdH/develop
Develop
2021-01-07 11:21:59 +01:00
Sem van der Hoeven
20431d019b Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-07 11:20:58 +01:00
Sem van der Hoeven
7e99070002 added ok button to help popup 2021-01-07 11:20:48 +01:00
SemvdH
452bc00848 Merge pull request #1 from SemvdH/develop
Merge develop into master
2021-01-06 23:20:50 +01:00
SemvdH
056c679442 Merge pull request #2 from SemvdH/imperial-system
merge imperial into dev
2021-01-06 23:20:26 +01:00
SemvdH
01e7cb5fdf Merge branch 'develop' into imperial-system 2021-01-06 23:20:13 +01:00
Bart
c98acaf7c0 Added support for imperial units 2021-01-06 22:27:59 +01:00
Sem van der Hoeven
c68bbd4062 ctrl alt L 2021-01-06 21:19:06 +01:00
Sem van der Hoeven
c778ab2de8 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 21:04:28 +01:00
Sem van der Hoeven
7d833c8ec5 fix 2.0 2021-01-06 21:04:21 +01:00
RemoMeijer
b3f0497fba Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 21:04:06 +01:00
RemoMeijer
9da1078998 updated distance calculations 2021-01-06 21:04:03 +01:00
Robin Koedood
f552afb49e [ADD] ROUTE TEST NIEUWE METHODE 2021-01-06 21:01:20 +01:00
Sem van der Hoeven
2c7db11917 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 20:59:57 +01:00
Sem van der Hoeven
f062b1915c fix? 2021-01-06 20:59:48 +01:00
RemoMeijer
bbab7b2bb1 improved icons 2021-01-06 20:59:27 +01:00
RemoMeijer
bbdf9a7d29 Replaced images with icons 2021-01-06 20:51:16 +01:00
Sem van der Hoeven
23beac0cf0 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 20:48:55 +01:00
Sem van der Hoeven
f3e636f586 added route calculating time 2021-01-06 20:48:45 +01:00
Bart
5f11d58300 Updated default language dropdown position (en -> nl) 2021-01-06 20:46:21 +01:00
sebas
12a4737567 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop
# Conflicts:
#	app/src/main/assets/routes.json
2021-01-06 20:43:34 +01:00
sebas
bd58927573 Finished the final translation 2021-01-06 20:42:03 +01:00
Sem van der Hoeven
023647d418 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 20:37:43 +01:00
Bipin
5cc559d7ef HelpPopup goed genoeg 2021-01-06 20:26:48 +01:00
Sem van der Hoeven
bf55bcef3d Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 20:20:19 +01:00
Sem van der Hoeven
76832f5a54 centercrop 2021-01-06 20:20:07 +01:00
Bipin
7da259a179 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 20:17:01 +01:00
Bipin
115c064f11 Scrollable help 2021-01-06 20:16:48 +01:00
RemoMeijer
9a05e486c1 Removed landscape mode, since it wont be used 2021-01-06 20:12:25 +01:00
Bart
22d760bbda Updated language, removed chinese from language dropdown 2021-01-06 20:10:27 +01:00
RemoMeijer
7f9783aeb1 Text on 65+ mode not in total distance anymore 2021-01-06 20:09:11 +01:00
RemoMeijer
91db76c6d5 Start route button not in nav bar anymore 2021-01-06 20:06:46 +01:00
RemoMeijer
cb2800977e fixed route 2021-01-06 20:00:18 +01:00
RemoMeijer
352e6ef5a7 fixed nl route 2021-01-06 19:55:30 +01:00
Bart
195377fada Fixed coupons
Locating wrong json
2021-01-06 19:52:42 +01:00
RemoMeijer
da0a919ca1 Updated the routes coordinates 2021-01-06 19:52:06 +01:00
Robin Koedood
17c39ab63e Merge remote-tracking branch 'origin/develop' into develop 2021-01-06 19:51:49 +01:00
Robin Koedood
aa6114e257 [FIXED] tests things 2021-01-06 19:51:42 +01:00
Sem van der Hoeven
13cc7be1d2 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 19:49:19 +01:00
Sem van der Hoeven
611427b0d2 more coupons 2021-01-06 19:49:12 +01:00
RemoMeijer
e3fc976f5f Updated the nl locations coordinates 2021-01-06 19:46:05 +01:00
Robin Koedood
f01f4fbdfa [FIXED] CouponFragment test with string resource 2021-01-06 19:43:21 +01:00
Sem van der Hoeven
16bb984deb Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 19:42:07 +01:00
Sem van der Hoeven
9828595e8b proper context 2021-01-06 19:42:04 +01:00
RemoMeijer
5062a9fa67 Updated coordinates again 2021-01-06 19:40:38 +01:00
Bart
033052f480 Merge branch 'languages' into develop 2021-01-06 19:35:04 +01:00
Sem van der Hoeven
564eb597c6 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 19:34:29 +01:00
Sem van der Hoeven
6fed07ca41 update routes with locations and imageurls 2021-01-06 19:34:22 +01:00
Bart
8a453f298a Fixed file locating problem 2021-01-06 19:34:03 +01:00
sebas
615401c0d3 Commented settingsFragment 2021-01-06 19:31:01 +01:00
RemoMeijer
a4413ca42c Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 19:29:03 +01:00
RemoMeijer
c3d317baea Added even more comments 2021-01-06 19:29:00 +01:00
Sem van der Hoeven
4d00735f24 Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop 2021-01-06 19:25:15 +01:00
Sem van der Hoeven
c2bf1d762a added findbyname in locationlistmanager 2021-01-06 19:25:10 +01:00
RemoMeijer
5f3fcf2889 Added comments 2021-01-06 19:25:04 +01:00
RemoMeijer
4021f9903d Removed custOverlay, Added comments 2021-01-06 19:24:51 +01:00
Robin Koedood
e9a889fe6d Merge remote-tracking branch 'origin/develop' into develop 2021-01-06 19:19:58 +01:00
Robin Koedood
5f927a5550 [FIXED] Test works again 2021-01-06 19:19:54 +01:00
RemoMeijer
ae2aab7275 Added comments 2021-01-06 19:18:23 +01:00
Robin Koedood
0d94d17b2f [REMOVED] Color blind 2021-01-06 19:17:21 +01:00
Bart
56a14c2482 Fixed the bottomNavigation refresh when a route is started 2021-01-06 18:31:55 +01:00
Bart
7089524be6 Added support for different language routes and coupons 2021-01-06 17:41:57 +01:00
Robin Koedood
f868302d30 [UPDATED] CouponFragment test with string values 2021-01-06 17:41:37 +01:00
Robin Koedood
08b0ca191b [UPDATED] Name of button 2021-01-06 17:39:16 +01:00
Robin Koedood
ebde0c5815 [UPDATED] DataTest 2021-01-06 17:34:32 +01:00
Sem van der Hoeven
aeb676e594 Merge branch 'helpPopup' into develop 2021-01-06 17:21:44 +01:00
Sem van der Hoeven
cfeb2bc64e merge languages 2021-01-06 17:20:38 +01:00
Sem van der Hoeven
3df8d36e89 Merge branch 'route_detail' into develop 2021-01-06 17:18:02 +01:00
Sem van der Hoeven
93ededb3d1 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 17:16:33 +01:00
Sem van der Hoeven
91670fb6f3 rename staticdata to data 2021-01-06 17:16:19 +01:00
Robin Koedood
b2c320dd14 [UPDATED] Route Test 2021-01-06 17:12:52 +01:00
Sem van der Hoeven
ce264d78bc rename 2021-01-06 17:09:11 +01:00
Robin Koedood
f8acc35c5b Merge remote-tracking branch 'origin/follow-route' into follow-route 2021-01-06 17:07:47 +01:00
Robin Koedood
e5e0916555 [ADD] Static Data Test 2021-01-06 17:07:26 +01:00
Sem van der Hoeven
c738deab23 commentssssssssssssssssssssss 2021-01-06 17:06:27 +01:00
Sem van der Hoeven
223e77cdc8 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 16:57:08 +01:00
Sem van der Hoeven
7c9dc07c3d added keeping zoom level 2021-01-06 16:56:57 +01:00
Robin Koedood
187f45b770 Merge remote-tracking branch 'origin/follow-route' into follow-route 2021-01-06 16:56:21 +01:00
Robin Koedood
04487b77a7 [ADD] RouteHandler Test 2021-01-06 16:56:16 +01:00
RemoMeijer
c921a76dc4 Added route picture, text and total distance in routeDetail 2021-01-06 16:54:15 +01:00
Bart
5844445555 Updated English location.json 2021-01-06 16:53:17 +01:00
RemoMeijer
d67d78b385 Added total distance in route detail 2021-01-06 16:27:28 +01:00
Bart
0ea7ee6c31 locations.json is now English 2021-01-06 16:21:01 +01:00
Bipin
d6a6724ba0 HelpPopup klaar. Tekst veranderd naar wit en extra zin toegevoegd over locaties ingedrukt houden. Layout is veranderd naar constraintlayout 2021-01-06 16:20:10 +01:00
Sem van der Hoeven
fb2f7e8a66 added updating time when you start a route but are already following another one 2021-01-06 16:20:03 +01:00
Sem van der Hoeven
c412f36e6c moved sections into own methods 2021-01-06 16:09:00 +01:00
Bipin
7dc5ce098c Layout fix 2021-01-06 16:07:45 +01:00
Bart
98a1ad799c Location loader now loads the correct location.json according to the selected language 2021-01-06 16:03:59 +01:00
RemoMeijer
2d9dfe9c0e updated coords 2021-01-06 15:53:02 +01:00
RemoMeijer
b31ba7023e Updated coordinates 2021-01-06 15:50:43 +01:00
Sem van der Hoeven
7ba87b71b0 added time 2021-01-06 15:44:14 +01:00
Sem van der Hoeven
edfc125427 added icon 2021-01-06 15:37:10 +01:00
Bart
f5a2eabf61 Added popup functionality 2021-01-06 15:35:16 +01:00
Sem van der Hoeven
6d3a092298 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 15:32:35 +01:00
Sem van der Hoeven
15608bed2b added icon to drawable 2021-01-06 15:32:25 +01:00
RemoMeijer
deb4bd5a19 Distance Calculation works, added distance test 2021-01-06 15:26:07 +01:00
Sem van der Hoeven
05c8951f2c Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 15:25:36 +01:00
Sem van der Hoeven
a27ebfc0c3 added stopping route if last location has been reached 2021-01-06 14:40:30 +01:00
Bart
dabe3cfb99 moved Refreshable to package Fragment 2021-01-06 14:35:54 +01:00
Sem van der Hoeven
f806015963 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 14:33:38 +01:00
Sem van der Hoeven
fcec6e1ecd stuffff 2021-01-06 14:33:25 +01:00
Bart
7284b66c13 Merge branch 'languages' into follow-route 2021-01-06 14:26:39 +01:00
Sem van der Hoeven
6266705c3e fix clusterfuck? 2021-01-06 14:18:37 +01:00
Sem van der Hoeven
e90582b539 stuff merge iewl 2021-01-06 14:12:59 +01:00
Sem van der Hoeven
68f2855a66 added locations back 2021-01-06 14:07:19 +01:00
Bart
d018b83490 added strings 2021-01-06 14:04:37 +01:00
Sem van der Hoeven
1aee93cd0c mergeeee 2021-01-06 13:59:59 +01:00
Sem van der Hoeven
216f48cc0f fixed distance 2021-01-06 13:57:00 +01:00
Robin Koedood
8a758f1d8d [ADD] Start Route button from other branch 2021-01-06 13:55:20 +01:00
Sem van der Hoeven
bd623a3f1d stuff 2021-01-06 13:54:30 +01:00
Sem van der Hoeven
1760f510c6 comment location 2021-01-06 13:46:08 +01:00
Sem van der Hoeven
ba9569b5a8 Merge branch 'follow-route' of https://github.com/SemvdH/Next-Location into follow-route 2021-01-06 13:45:53 +01:00
Robin Koedood
ca8d291262 [CHANGED] String values 2021-01-06 13:44:17 +01:00
Sem van der Hoeven
98eeba4de1 comments 2021-01-06 13:42:26 +01:00
Robin Koedood
f0ef9512a0 Merge remote-tracking branch 'origin/RecyclerView' into Tests 2021-01-06 13:32:22 +01:00
sebas
f0f87af42b Merge branch 'follow-route' into RecyclerView
# Conflicts:
#	app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java
2021-01-06 13:23:58 +01:00
sebas
192f1a4c64 Route detail fragment now fills in the right name and text 2021-01-06 13:22:37 +01:00
RemoMeijer
391792a5e2 Merge branch 'RecyclerView' into follow-route
# Conflicts:
#	app/src/main/assets/locations.json
#	app/src/main/assets/routes.json
#	app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java
#	app/src/main/java/com/a1/nextlocation/fragments/RouteDetailFragment.java
#	app/src/main/res/values/strings.xml
2021-01-06 13:20:52 +01:00
Bart
1cf973da9b bottom navigation sets locale on startup and language change. Fixed a bug where the selected fragment changes when rotated. 2021-01-06 12:21:31 +01:00
Robin Koedood
21c479076d Merge remote-tracking branch 'origin/follow-route' into Tests 2021-01-06 12:10:05 +01:00
Robin Koedood
0ed16ee069 [CHANGED] String values 2021-01-06 12:08:25 +01:00
Sem van der Hoeven
1f53890a4b added comments 2021-01-06 12:08:18 +01:00
RemoMeijer
09ced99654 Added route 2021-01-06 11:59:45 +01:00
sebas
86bc0f0c19 Merge branch 'RecyclerView' of https://github.com/SemvdH/Next-Location into RecyclerView
# Conflicts:
#	app/src/main/assets/locations.json
2021-01-06 11:56:14 +01:00
sebas
deb599db25 Font now changes according to last change when starting application, added scrollView to location detail, location detail now takes location name and description and added 2 discriptions to location.json 2021-01-06 11:54:39 +01:00
RemoMeijer
9be5ba27ab Added descriptions on all locations 2021-01-06 11:47:14 +01:00
Sem van der Hoeven
926a984c71 stop icon 2021-01-06 11:33:35 +01:00
Sem van der Hoeven
f5da1c8a83 added displaying all locations upon stopping the route 2021-01-06 11:33:15 +01:00
Robin Koedood
525d4b776d Merge remote-tracking branch 'origin/develop' into Tests 2021-01-06 11:14:19 +01:00
sebas
0e63bff0f1 Merge branch 'RecyclerView' of https://github.com/SemvdH/Next-Location into RecyclerView
# Conflicts:
#	app/src/main/java/com/a1/nextlocation/fragments/LocationDetailFragment.java
2021-01-06 11:13:16 +01:00
sebas
5e76ced998 Location detail now displays images 2021-01-06 11:12:33 +01:00
Robin Koedood
da2a9e43bc Merge remote-tracking branch 'origin/Tests' into Tests 2021-01-06 10:50:18 +01:00
Robin Koedood
3d1cfd244b [ADD] Main Activity Test 2021-01-06 10:50:14 +01:00
Bart
40e3ca3d51 Merge branch 'languages' into develop 2021-01-06 10:49:35 +01:00
Bart
6dd2f5de40 default strings.xml is now English, added more string resources 2021-01-06 10:48:23 +01:00
Sem van der Hoeven
f6af7ae80b added route singleton 2021-01-06 10:48:03 +01:00
RemoMeijer
d4cfa17fda Tried to add pictures in location detail 2021-01-06 10:45:00 +01:00
Sem van der Hoeven
abc58d3606 following route stuff 2021-01-06 10:41:56 +01:00
Bipin
399652c2ce Merge branch 'Tests' of https://github.com/SemvdH/Next-Location into Tests 2021-01-06 10:41:10 +01:00
Bipin
d9a6e1eff0 GeometryStart 2021-01-06 10:41:07 +01:00
Sem van der Hoeven
1877a693d0 added boolean to singleton 2021-01-06 10:40:20 +01:00
Sem van der Hoeven
80764591ad comment 2021-01-06 10:36:37 +01:00
sebas
738a733b72 Location adapter also now implements images into to location items 2021-01-06 10:20:55 +01:00
Bart
00d306631b Finished language functionality 2021-01-05 17:19:09 +01:00
Robin Koedood
20c09c3458 [TRIED] MainActivity Test 2021-01-05 16:52:48 +01:00
Sem van der Hoeven
587380fd89 added updating location when you're close to it 2021-01-05 16:39:12 +01:00
Bart
f7a2a79d00 Language can be changed, doesn't refresh automatically yet 2021-01-05 16:20:43 +01:00
RemoMeijer
faa79b5553 Added all pictures 2021-01-05 16:18:46 +01:00
Robin Koedood
e71c195573 [ADD] DirectionResultTest 2021-01-05 16:11:19 +01:00
RemoMeijer
1834aec01b Updated buttons 2021-01-05 16:10:06 +01:00
Robin Koedood
d4d452e723 Merge remote-tracking branch 'origin/Tests' into Tests 2021-01-05 16:04:32 +01:00
Robin Koedood
f381a29274 [ADD] DirectionsStep test 2021-01-05 16:04:25 +01:00
Sem van der Hoeven
062739ac7b added navigation to location from map 2021-01-05 16:02:48 +01:00
sebas
360198e784 65+ stand remember position and changes the theme. 2021-01-05 15:50:29 +01:00
Sem van der Hoeven
16bd30f785 added locations to map 2021-01-05 13:43:10 +01:00
Bart
fe5a5b6dfd Added functionality to the dropdown in settings. Language preference is stored in the sharedPreferences 2021-01-05 13:38:21 +01:00
Bipin
7e0b888974 Merge branch 'Tests' of https://github.com/SemvdH/Next-Location into Tests 2021-01-05 13:36:43 +01:00
Bipin
804bdddbef Remove detail 2021-01-05 13:36:14 +01:00
Robin Koedood
e1636c6bec Merge remote-tracking branch 'origin/Tests' into Tests 2021-01-05 13:32:50 +01:00
Robin Koedood
77a6226c1d [ADD] Comments 2021-01-05 13:32:44 +01:00
RemoMeijer
2e5f57aa23 Added coupon arrow 2021-01-05 13:32:28 +01:00
Bipin
c6b33f2663 fixie 2021-01-05 13:29:33 +01:00
Bipin
ba83d69c9f Merge branch 'Tests' of https://github.com/SemvdH/Next-Location into Tests
# Conflicts:
#	app/src/main/res/layout/fragment_settings.xml
2021-01-05 13:27:46 +01:00
Bipin
08902472a3 Added Settings and Statistics, started detail 2021-01-05 13:27:25 +01:00
RemoMeijer
fbf8cbe1c5 Small fix 2021-01-05 13:23:48 +01:00
Robin Koedood
e36e853875 [ADD] Route Fragment test 2021-01-05 13:19:27 +01:00
RemoMeijer
aae67f53ec Statistics button works 2021-01-05 13:18:25 +01:00
Robin Koedood
356ee55375 Merge remote-tracking branch 'origin/RecyclerView' into Tests 2021-01-05 13:16:30 +01:00
RemoMeijer
bc8b83e4f6 Updated strings and values to @string/ 2021-01-05 13:15:25 +01:00
Sem van der Hoeven
65d2f31e3f stuff 2021-01-05 13:03:42 +01:00
Sem van der Hoeven
40331f3135 removed test route 2021-01-05 12:59:35 +01:00
Sem van der Hoeven
f5f077db0f location stuff 2021-01-05 12:13:42 +01:00
Robin Koedood
3b363b3f33 [ADD] Location Detail Fragment Test 2021-01-05 12:07:15 +01:00
Robin Koedood
89902a5962 Merge remote-tracking branch 'origin/RecyclerView' into Tests 2021-01-05 12:03:36 +01:00
RemoMeijer
d53f63a6d7 Updated values 2021-01-05 12:02:20 +01:00
Robin Koedood
a0d35caeb5 [ADD] Coupon test 2021-01-05 11:44:25 +01:00
Sem van der Hoeven
e8af38981f added visualizing route 2021-01-05 11:25:13 +01:00
Robin Koedood
d3cab8c70d [ADD] Location Tests + ID at every XML file 2021-01-05 10:58:33 +01:00
RemoMeijer
d63b150275 Improved fragments 2021-01-05 10:47:35 +01:00
Bart
f236067706 Added English string.xml 2021-01-05 10:45:32 +01:00
RemoMeijer
a75b81033f Fixed locationList 2021-01-05 10:09:24 +01:00
Sem van der Hoeven
bcd9eb6378 merge 2021-01-04 15:49:42 +01:00
Sem van der Hoeven
a12493972a Merge branch 'directions-api' into develop 2021-01-04 15:47:31 +01:00
RemoMeijer
678b179e04 added backbutton 2021-01-04 15:46:18 +01:00
Sem van der Hoeven
9b93ddaec5 stuff 2021-01-04 15:44:47 +01:00
RemoMeijer
1b770020ed Added List button on Home 2021-01-04 15:37:09 +01:00
Robin Koedood
29b3623ab5 Merge remote-tracking branch 'origin/Tests' into Tests 2021-01-04 15:27:58 +01:00
Robin Koedood
da45a0a40e [TRIED] Test FileIO class
No luck so far
2021-01-04 15:27:52 +01:00
Sem van der Hoeven
5e218f3b99 added getting directions for whole route 2021-01-04 15:20:24 +01:00
sebas
e761dd80e5 Adjusted frame layout in main fragment so that topbar now longer displays over the top part of fragments, but instead above it. 2021-01-04 14:46:15 +01:00
sebas
79e24621e2 Statistics now shows amount of coupons 2021-01-04 14:38:39 +01:00
RemoMeijer
1549fc7a59 Coupon layout updated 2021-01-04 14:35:50 +01:00
Bart
edcfd2ff0a Added popups for coupons 2021-01-04 14:31:16 +01:00
Sem van der Hoeven
96f32ccdbc added deserialization of the api response 2021-01-04 13:50:50 +01:00
Bart
547d676a68 Coupon onClick unfinished code 2021-01-04 13:44:09 +01:00
RemoMeijer
d96a54863c coupons working 2021-01-04 13:04:02 +01:00
Bipin
7b9ca656aa Improved RouteTest, made LocationTest 2021-01-04 11:49:14 +01:00
Sem van der Hoeven
d433565fef added parsing of directions response 2021-01-04 11:42:34 +01:00
RemoMeijer
2118336815 Switching fragment from statistics to coupon works 2021-01-04 11:40:06 +01:00
Robin Koedood
36eb28ce07 Merge remote-tracking branch 'origin/Tests' into Tests 2021-01-04 11:39:08 +01:00
Robin Koedood
eea66fd153 [ADD] Data and Coupon Tests 2021-01-04 11:38:54 +01:00
RemoMeijer
ff32eefab0 Added coupon item 2021-01-04 11:27:49 +01:00
sebas
e2bccb6e76 Changed couponfragment layout 2021-01-04 11:23:16 +01:00
RemoMeijer
c355f64d38 Added couponadapter 2021-01-04 11:08:49 +01:00
sebas
91c0435e55 Merge branch 'RecyclerView' of https://github.com/SemvdH/Next-Location into RecyclerView 2021-01-04 11:06:38 +01:00
sebas
9ca3b12d71 Added code to CouponFragment 2021-01-04 11:06:04 +01:00
Bipin
08d9543e3b RouteTest made 2021-01-04 11:01:23 +01:00
Bart
70a9878b06 Merge branch 'statisticsFragment' into RecyclerView 2021-01-04 11:00:00 +01:00
Bart
294814dea8 StatisticFragment navigation to CouponFragment 2021-01-04 10:59:43 +01:00
RemoMeijer
6b197c4742 Location implements parcable 2020-12-17 14:57:04 +01:00
RemoMeijer
a3d8bdfd77 Merge branch 'develop' into RecyclerView
# Conflicts:
#	app/src/main/java/com/a1/nextlocation/data/Location.java
2020-12-17 14:56:15 +01:00
RemoMeijer
6f10444126 Route displays name 2020-12-17 14:48:15 +01:00
Robin Koedood
1ca13e3a6b [ADD]Locations from JSON now in app. Markers good color. No action bar. 2020-12-17 14:45:58 +01:00
RemoMeijer
1f7cd49a90 Route works and is clickable 2020-12-17 14:35:05 +01:00
Bipin
9c4eb98fb4 Added real locations to JSON 2020-12-17 14:24:06 +01:00
Sem van der Hoeven
610b23b056 added custom overlay 2020-12-17 14:22:20 +01:00
RemoMeijer
aba26f3211 Merge branch 'develop' into RecyclerView 2020-12-17 13:55:01 +01:00
Sem van der Hoeven
95a2e4e849 made list managers load on mainactivity oncreate 2020-12-17 13:53:00 +01:00
Sem van der Hoeven
74fb4440ed made listmanagers enums 2020-12-17 13:51:45 +01:00
Bart
6c923d27b2 Connected locationFragment with recyclerview and added functionality 2020-12-17 13:46:41 +01:00
Sem van der Hoeven
17d977bb17 fixed loading 2020-12-17 13:41:20 +01:00
Sem van der Hoeven
b52c5556d2 finished loading 2020-12-17 11:50:31 +01:00
Sem van der Hoeven
70342c6506 merge with recyclerview 2020-12-17 11:21:38 +01:00
Sem van der Hoeven
311a794a69 removed loader from route list manager 2020-12-17 11:18:23 +01:00
RemoMeijer
dbc10014f9 Merge branch 'develop' into RecyclerView 2020-12-17 11:16:36 +01:00
RemoMeijer
1f835a94b0 Updated managers so they can load 2020-12-17 11:16:03 +01:00
Sem van der Hoeven
12c8d6a62d [ADD] loaders and fileio read 2020-12-17 11:14:43 +01:00
Sem van der Hoeven
9e8e9f4cdd changed loader stuff 2020-12-17 11:00:14 +01:00
Sem van der Hoeven
1d48ada0ab changed loader stuff 2020-12-17 10:59:07 +01:00
Sem van der Hoeven
6a07ce77f0 remove room stuff 2020-12-17 10:32:28 +01:00
152 changed files with 4827 additions and 1602 deletions

View File

@@ -26,15 +26,13 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
def room_version = "2.2.5"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
//gson
implementation 'com.google.code.gson:gson:2.8.6'
@@ -42,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'
@@ -52,6 +52,17 @@ dependencies {
//osm
implementation 'org.osmdroid:osmdroid-android:6.1.8'
//osm bonus pack
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
//BeforeEach
testImplementation(platform('org.junit:junit-bom:5.7.0'))
testImplementation 'org.junit.jupiter:junit-jupiter'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
testImplementation 'org.mockito:mockito-core:2.7.22'
androidTestImplementation 'com.21buttons:fragment-test-rule:2.0.1'
androidTestImplementation 'androidx.test:rules:1.3.0-beta01'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.4.0-alpha02'
}

View File

@@ -0,0 +1,50 @@
package com.a1.nextlocation;
import androidx.test.espresso.Root;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.espresso.matcher.RootMatchers;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.CouponFragment;
import com.a1.nextlocation.fragments.LocationFragment;
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.isChecked;
import static androidx.test.espresso.matcher.ViewMatchers.isClickable;
import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;
import static androidx.test.espresso.matcher.ViewMatchers.withContentDescription;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
public class CouponFragmentTest {
@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 statisticsFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new CouponFragment()).commit();
onView(withId(R.id.coupon_back_button)).perform(click());
onView(withId(R.id.statisticsFragment)).check(matches(isDisplayed()));
}
@Test
public void clickDetailButton() throws Exception{
//Here we click a coupon and then a popup dialog shows, we press the "activeren" button in it and if the next dialog with the code and with
//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(R.string.activate)).inRoot(RootMatchers.isDialog()).perform(click());
onView(withText(R.string.done)).inRoot(RootMatchers.isDialog()).check(matches(isDisplayed()));
}
}

View File

@@ -0,0 +1,42 @@
package com.a1.nextlocation;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.LocationFragment;
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.*;
import static androidx.test.espresso.assertion.ViewAssertions.*;
import static androidx.test.espresso.matcher.ViewMatchers.*;
public class LocationFragmentTest {
@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 homeFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new LocationFragment()).commit();
onView(withId(R.id.location_back_button)).perform(click());
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 LocationFragment()).commit();
onView(withId(R.id.location_recyclerview)).perform(RecyclerViewActions.actionOnItemAtPosition(1, click()));
onView(withId(R.id.locationDetailFragment)).check(matches(isDisplayed()));
}
}

View File

@@ -0,0 +1,64 @@
package com.a1.nextlocation;
import android.app.LauncherActivity;
import android.widget.Button;
import androidx.test.espresso.contrib.NavigationViewActions;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.espresso.matcher.RootMatchers;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.CouponFragment;
import com.google.android.material.bottomnavigation.BottomNavigationItemView;
import org.junit.Before;
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;
import static androidx.test.espresso.matcher.ViewMatchers.withText;
public class MainActivityTest {
@Rule
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
@Test
public void clickLocationsNavBar() throws Exception{
//Here we click the back button and then we check if the statisticsFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
onView(withId(R.id.locations)).perform(click());
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
}
@Test
public void clickRouteNavBar() throws Exception{
//Here we click the back button and then we check if the statisticsFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
onView(withId(R.id.routes)).perform((click()));
onView(withId(R.id.routeFragment)).check(matches(isDisplayed()));
}
@Test
public void clickStatisticsNavBar() throws Exception{
//Here we click the back button and then we check if the statisticsFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
onView(withId(R.id.statistics)).perform(click());
onView(withId(R.id.statisticsFragment)).check(matches(isDisplayed()));
}
@Test
public void clickSettingNavBar() throws Exception{
//Here we click the back button and then we check if the statisticsFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().commit();
onView(withId(R.id.settings)).perform(click());
onView(withId(R.id.settingFragment)).check(matches(isDisplayed()));
}
}

View File

@@ -0,0 +1,30 @@
package com.a1.nextlocation;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.LocationFragment;
import com.a1.nextlocation.fragments.RouteFragment;
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 RouteFragmentTest {
@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 homeFragment is shown
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new RouteFragment()).commit();
onView(withId(R.id.route_back_button)).perform(click());
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
}
}

View File

@@ -0,0 +1,58 @@
package com.a1.nextlocation;
import androidx.test.espresso.action.ViewActions;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.espresso.matcher.RootMatchers;
import androidx.test.espresso.matcher.ViewMatchers;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.SettingsFragment;
import org.junit.Rule;
import org.junit.Test;
import static androidx.test.espresso.Espresso.*;
import static androidx.test.espresso.action.ViewActions.*;
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.is;
public class SettingsFragmentTest {
@Rule
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
//Tests if the back button sends you back home
@Test
public void clickBackButton() throws Exception{
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
onView(withId(R.id.settings_back_button)).perform(click());
onView(withId(R.id.homeFragment)).check(matches(isDisplayed()));
}
//Checks if the dropdown is clickable, and checks if it has children
@Test
public void dropdownTest(){
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
onView(withId(R.id.dropdown_menu_Settings)).check(matches(isClickable()));
onView(withId(R.id.dropdown_menu_Settings)).check(matches(hasMinimumChildCount(1)));
}
//Tests if all buttons are clickable, and if they get checked after being clicked.
@Test
public void buttonTest(){
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new SettingsFragment()).commit();
onView(withId(R.id.imperial_button)).check(matches(isClickable()));
onView(withId(R.id.font_changer)).check(matches(isClickable()));
onView(withId(R.id.imperial_button)).perform(click());
onView(withId(R.id.imperial_button)).check(matches(isChecked()));
onView(withId(R.id.font_changer)).perform(click());
onView(withId(R.id.font_changer)).check(matches(isChecked()));
}
}

View File

@@ -0,0 +1,38 @@
package com.a1.nextlocation;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.rule.ActivityTestRule;
import com.a1.nextlocation.fragments.LocationFragment;
import com.a1.nextlocation.fragments.StatisticFragment;
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.*;
import static androidx.test.espresso.assertion.ViewAssertions.*;
import static androidx.test.espresso.matcher.ViewMatchers.*;
public class StatisticFragmentTest {
@Rule
public ActivityTestRule<MainActivity> mActivityTestRule = new ActivityTestRule<>(MainActivity.class);
//Tests to see if all boxes get created
@Test
public void checkText() throws Exception{
mActivityTestRule.getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.mainActivity, new StatisticFragment()).commit();
onView(withId(R.id.textView)).check(matches(isDisplayed()));
onView(withId(R.id.name_box)).check(matches(isDisplayed()));
onView(withId(R.id.Box2)).check(matches(isDisplayed()));
onView(withId(R.id.Box3)).check(matches(isDisplayed()));
onView(withId(R.id.Box4)).check(matches(isDisplayed()));
}
}

View File

@@ -6,21 +6,30 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<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">
<activity android:name=".MainActivity">
android:theme="@style/Theme.NextLocation"
android:hardwareAccelerated="false">
<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>

View 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!"
}
]

View File

@@ -0,0 +1,22 @@
[
{
"code": "KROKETMEUP",
"reward": "Free kroket at Kees Kroket™"
},
{
"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!"
}
]

View File

@@ -0,0 +1,157 @@
[
{
"name":"McDonald's Breda Karnemelkstraat",
"coordinates":"51.586058044064735, 4.775804729737406",
"description":"Wist je dat McDonalds 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, granolas / 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 Lets 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 collegas.\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"
}
]

View File

@@ -0,0 +1,157 @@
[
{
"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.\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.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.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.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.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.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.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.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.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.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.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.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 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.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.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.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.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":"Station Breda Gravinnen van Nassauboulevard 43",
"coordinates":"51.59569850758307,4.780295549958155",
"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.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.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"
}
]

View 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 McDonalds 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, granolas / 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"
}
]

View File

@@ -0,0 +1,122 @@
[
{
"name": "Event Route",
"locations": [
{
"name": "Escaping Breda: Escape Room Games Boschstraat 114",
"coordinates":" 51.59110835530862,4.784147222780912",
"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": "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": "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"
}
],
"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"
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

View File

@@ -1,56 +1,157 @@
package com.a1.nextlocation;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageButton;
import com.a1.nextlocation.R;
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;
import com.a1.nextlocation.fragments.StatisticFragment;
import com.a1.nextlocation.recyclerview.CouponListManager;
import com.a1.nextlocation.recyclerview.LocationListManager;
import com.a1.nextlocation.recyclerview.RouteListManager;
import com.google.android.material.bottomnavigation.BottomNavigationView;
public class MainActivity extends AppCompatActivity {
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;
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
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// initialize saved language from sharedPreferences
setLocale(loadLocale());
setContentView(R.layout.activity_main);
BottomNavigationView bottomNav = findViewById(R.id.navbar);
bottomNav = findViewById(R.id.navigation_bar);
bottomNav.setOnNavigationItemSelectedListener(navListener);
infoButton = findViewById(R.id.info_button);
infoButton.setOnClickListener(onInfoClickListener);
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
/*System.out.println(Arrays.toString(getFilesDir().listFiles()));
FileIO<Route> fileIO = new FileIO<>();
fileIO.writeFileData(new Route("TERSTSET"), getApplicationContext());
Log.d(TAG, "onCreate: " + "FILE GESCHREVENN!!!!!");*/
LocationListManager.INSTANCE.setContext(this);
LocationListManager.INSTANCE.load();
CouponListManager.INSTANCE.setContext(this);
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, homeFragment).commit();
}
}
/**
* loads the saved language from SharedPreferences
*
* @return the language as string
*/
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) {
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration configuration = new Configuration();
configuration.setLocale(locale);
getBaseContext().getResources().updateConfiguration(configuration, getBaseContext().getResources().getDisplayMetrics());
}
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 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 final 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, "");
}
};
}

View File

@@ -1,24 +1,18 @@
package com.a1.nextlocation.data;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import org.jetbrains.annotations.NotNull;
@Entity(tableName = "coupon")
public class Coupon {
/**
* fields need to be public for the database to be able to use them
*/
@PrimaryKey
@NonNull
@ColumnInfo(name = "code")
private String code;
@ColumnInfo(name = "reward")
@NonNull
private String reward;

View File

@@ -1,107 +1,156 @@
package com.a1.nextlocation.data;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.a1.nextlocation.data.db.CouponListTypeConverter;
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;
@Entity(tableName = "userdata")
public class Data {
/**
* singleton to keep track of different global data
*/
public enum Data {
INSTANCE;
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;
@PrimaryKey
@NonNull
@ColumnInfo(name = "distance_traveled")
private float distanceTraveled;
@ColumnInfo(name = "locations_visited")
private int locationsVisited;
@ColumnInfo(name = "total_time")
private int totalTime;
@TypeConverters(CouponListTypeConverter.class)
private List<Coupon> couponList;
@Ignore
private Location nextLocation;
@Ignore
private Location lastLocation;
@Ignore
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;
}
}

View File

@@ -1,12 +1,55 @@
package com.a1.nextlocation.data;
public class FileIO {
import android.content.Context;
import android.content.res.AssetManager;
import android.util.Log;
public static void readFileData() {
import com.google.gson.Gson;
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.Arrays;
public static void writeFileData() {
public class FileIO<T> {
private final String TAG = FileIO.class.getCanonicalName();
public T readFileData(Context context, String fileName, Type typeOf) {
Gson gson = new Gson();
AssetManager am = context.getAssets();
T res = null;
StringBuilder sb = new StringBuilder();
InputStream is = null;
try {
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) {
sb.append(line);
}
Log.d(TAG, "readFileData: got string: " + sb.toString());
res = gson.fromJson(sb.toString(), typeOf);
Log.d(TAG, "readFileData: got object: " + res);
reader.close();
inputStreamReader.close();
is.close();
} catch (IOException e) {
Log.d(TAG, "readFileData: exception! " + e.getLocalizedMessage());
e.printStackTrace();
}
return res;
}
}

View File

@@ -1,17 +1,16 @@
package com.a1.nextlocation.data;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import org.jetbrains.annotations.NotNull;
import org.osmdroid.util.GeoPoint;
@Entity(tableName = "location")
public class Location {
public class Location implements Parcelable {
@PrimaryKey
@NonNull
private String name;
@@ -22,9 +21,11 @@ public class Location {
private String coordinates;
private String description;
@ColumnInfo(name = "image_url")
@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;
@@ -34,9 +35,32 @@ public class Location {
}
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);
}
protected Location(Parcel in) {
name = in.readString();
coordinates = in.readString();
description = in.readString();
imageUrl = in.readString();
}
public static final Creator<Location> CREATOR = new Creator<Location>() {
@Override
public Location createFromParcel(Parcel in) {
return new Location(in);
}
@Override
public Location[] newArray(int size) {
return new Location[size];
}
};
@NotNull
public String getName() {
return name;
@@ -67,14 +91,18 @@ public class Location {
return imageUrl;
}
public String getIconUrl() {
return iconUrl;
}
public void setImageUrl(@Nullable String imageUrl) {
this.imageUrl = imageUrl;
}
public double[] getCoordinatesAsDoubles() {
double[] res = new double[2];
res[0] = getLat();
res[1] = getLong();
res[1] = getLat();
res[0] = getLong();
return res;
}
@@ -88,7 +116,69 @@ public class Location {
}
public static String getStringFromCoordinates(double lat1, double long1) {
return lat1 + "," + long1;
return long1 + "," + lat1;
}
/**
* calculates the distance between two coordinates
*
* @param lat1 the first latitude
* @param lon1 the first longitude
* @param lat2 the second latitude
* @param lon2 the second longitude
* @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);
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;
distance = c * r;
distance *= 1000;
// }
return Math.floor(distance);
}
public GeoPoint convertToGeoPoint() {
return new GeoPoint(this.getLat(), this.getLong());
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(name);
parcel.writeString(coordinates);
parcel.writeString(description);
parcel.writeString(imageUrl);
}
public boolean isVisited() {
return visited;
}
public void setVisited(boolean visited) {
this.visited = visited;
}
}

View File

@@ -1,41 +1,50 @@
package com.a1.nextlocation.data;
import androidx.annotation.NonNull;
import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;
import android.os.Parcel;
import android.os.Parcelable;
import com.a1.nextlocation.data.db.LocationListTypeConverter;
import androidx.annotation.NonNull;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
@Entity(tableName = "route")
public class Route {
public class Route implements Parcelable {
@PrimaryKey
@NonNull
private String name;
@TypeConverters(LocationListTypeConverter.class)
private String description;
private List<Location> locations;
@ColumnInfo(name = "total_distance")
private float totalDistance;
@ColumnInfo(name = "total_time")
private String imageURL;
private int totalTime;
public Route(@NotNull String name) {
this.name = name;
this.locations = new ArrayList<>();
}
protected Route(Parcel in) {
this.name = in.readString();
this.locations = in.createTypedArrayList(Location.CREATOR);
this.totalDistance = in.readFloat();
this.totalTime = in.readInt();
}
public static final Creator<Route> CREATOR = new Creator<Route>() {
@Override
public Route createFromParcel(Parcel in) {
return new Route(in);
}
@Override
public Route[] newArray(int size) {
return new Route[size];
}
};
public void addLocation(Location location) {
this.locations.add(location);
}
@@ -58,13 +67,20 @@ public class Route {
}
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;
}
@@ -76,4 +92,33 @@ public class Route {
this.totalTime = totalTime;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(name);
parcel.writeTypedList(locations);
parcel.writeFloat(totalDistance);
parcel.writeInt(totalTime);
}
public String getDescription() {
return description;
}
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;
}
}
}
}

View File

@@ -0,0 +1,99 @@
package com.a1.nextlocation.data;
import org.osmdroid.views.overlay.Polyline;
/**
* singleton to track the current route that is being followed
*/
public enum RouteHandler {
INSTANCE;
private boolean isFollowingRoute = false;
private Route currentRoute;
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;
public void setCurrentRouteLine(Polyline currentRouteLine) {
this.currentRouteLine = currentRouteLine;
}
public Polyline getCurrentRouteLine() {
return currentRouteLine;
}
public void setRouteFinishedListener(RouteFinishedListener routeFinishedListener) {
this.routeFinishedListener = routeFinishedListener;
}
public RouteFinishedListener getRouteFinishedListener() {
return routeFinishedListener;
}
public int getStepCount() {
return stepCount;
}
public void addStep() {
stepCount++;
}
public void finishRoute() {
stepCount = 0;
isFollowingRoute = false;
currentRoute = null;
currentRouteLine = null;
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();
}
public boolean isFollowingRoute(Route route) {
return isFollowingRoute && route.equals(currentRoute);
}
public void setFollowingRoute(boolean followingRoute) {
isFollowingRoute = followingRoute;
}
public boolean isFollowingRoute() {
return isFollowingRoute;
}
public Route getCurrentRoute() {
return currentRoute;
}
@FunctionalInterface
public interface RouteFinishedListener {
void onRouteFinish();
}
}

View File

@@ -1,33 +0,0 @@
package com.a1.nextlocation.data.db;
import androidx.room.TypeConverter;
import com.a1.nextlocation.data.Coupon;
import com.a1.nextlocation.data.Route;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
public class CouponListTypeConverter {
private static Gson gson = new Gson();
@TypeConverter
public static List<Coupon> toRoutesList(String data) {
if (data == null) {
return Collections.emptyList();
}
Type listType = new TypeToken<List<Coupon>>() {}.getType();
return gson.fromJson(data,listType);
}
@TypeConverter
public static String fromRoutesList(List<Coupon> list) {
return gson.toJson(list);
}
}

View File

@@ -1,62 +0,0 @@
package com.a1.nextlocation.data.db;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.sqlite.db.SupportSQLiteDatabase;
import com.a1.nextlocation.data.Coupon;
import com.a1.nextlocation.data.Data;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.db.dao.CouponDao;
import com.a1.nextlocation.data.db.dao.DataDao;
import com.a1.nextlocation.data.db.dao.LocationDao;
import com.a1.nextlocation.data.db.dao.RouteDao;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author Sem
*/
@androidx.room.Database(entities = {Coupon.class,Route.class, Location.class, Data.class},version = 1,exportSchema = false)
public abstract class Database extends RoomDatabase {
public abstract RouteDao routeDao();
public abstract CouponDao couponDao();
public abstract LocationDao locationDao();
public abstract DataDao dataDao();
private static volatile Database INSTANCE;
private static final int NUMBER_OF_THREADS = 4;
static final ExecutorService databaseWriterExecutor = Executors.newFixedThreadPool(NUMBER_OF_THREADS);
public static Database getDatabase(final Context context) {
if (INSTANCE == null){
synchronized (Database.class) {
if (INSTANCE == null) {
INSTANCE = Room.databaseBuilder(context.getApplicationContext(),
Database.class,"next_location_db").addCallback(callback).build();
}
}
}
return INSTANCE;
}
private static RoomDatabase.Callback callback = new RoomDatabase.Callback() {
@Override
public void onCreate(@NonNull SupportSQLiteDatabase db) {
super.onCreate(db);
databaseWriterExecutor.execute(() -> {
// TODO populate our database here
});
}
};
}

View File

@@ -1,31 +0,0 @@
package com.a1.nextlocation.data.db;
import androidx.room.TypeConverter;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.Route;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.lang.reflect.Type;
import java.util.Collections;
import java.util.List;
public class LocationListTypeConverter {
private static Gson gson = new Gson();
@TypeConverter
public static List<Location> toLocationList(String data) {
if (data == null) {
return Collections.emptyList();
}
Type listType = new TypeToken<List<Location>>() {}.getType();
return gson.fromJson(data,listType);
}
@TypeConverter
public static String fromLocationList(List<Location> list) {
return gson.toJson(list);
}
}

View File

@@ -1,34 +0,0 @@
package com.a1.nextlocation.data.db.dao;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
import com.a1.nextlocation.data.Coupon;
import java.util.List;
@Dao
public interface CouponDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertAll(Coupon... coupons);
@Query("DELETE FROM coupon")
void deleteAll();
@Query("SELECT * FROM coupon")
LiveData<List<Coupon>> selectAll();
@Update
public void update(Coupon coupon);
/*
to add an observer to the livedata, you can use the example from https://medium.com/mindorks/using-room-database-with-livedata-android-jetpack-cbf89b677b47
*/
@Query("SELECT * FROM coupon WHERE code = :code LIMIT 1")
Coupon selectCouponByCode(String code);
}

View File

@@ -1,31 +0,0 @@
package com.a1.nextlocation.data.db.dao;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;
import com.a1.nextlocation.data.Data;
@Dao
public interface DataDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertAll(Data... datas);
@Update
void update(Data data);
@Query("DELETE FROM userdata")
void delete();
@Query("SELECT * FROM userdata LIMIT 1")
Data getData();
@Query("SELECT * FROM userdata WHERE distance_traveled = :distance LIMIT 1")
Data getDataByDistance(float distance);
}

View File

@@ -1,27 +0,0 @@
package com.a1.nextlocation.data.db.dao;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import com.a1.nextlocation.data.Location;
import java.util.List;
@Dao
public interface LocationDao {
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertAll(Location... locations);
@Query("DELETE FROM location")
void deleteAll();
@Query("SELECT * FROM location")
LiveData<List<Location>> selectAll();
@Query("SELECT * FROM location WHERE name = :name LIMIT 1")
Location getLocationByName(String name);
}

View File

@@ -1,27 +0,0 @@
package com.a1.nextlocation.data.db.dao;
import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import com.a1.nextlocation.data.Route;
import java.util.List;
@Dao
public interface RouteDao {
@Insert
void insertAll(Route... routes);
@Query("DELETE FROM route")
void deleteAll();
@Query("SELECT * FROM route")
LiveData<List<Route>> getAll();
@Query("SELECT * FROM route where name = :name LIMIT 1")
Route getRouteByName(String name);
}

View File

@@ -1,42 +0,0 @@
package com.a1.nextlocation.data.db.repositories;
import android.content.Context;
import androidx.lifecycle.LiveData;
import com.a1.nextlocation.data.Coupon;
import com.a1.nextlocation.data.db.dao.CouponDao;
import com.a1.nextlocation.data.db.Database;
import java.util.List;
public class CouponRepository {
private CouponDao mCouponDao;
private LiveData<List<Coupon>> mAllCoupons;
public CouponRepository(Context context) {
Database db = Database.getDatabase(context);
mCouponDao = db.couponDao();
mAllCoupons = mCouponDao.selectAll();
}
public void insert(Coupon... coupons) {
mCouponDao.insertAll(coupons);
}
public void update(Coupon coupon) {
mCouponDao.update(coupon);
}
public LiveData<List<Coupon>> getAllCoupons() {
return mAllCoupons;
}
public Coupon getCoupon(String code) {
return mCouponDao.selectCouponByCode(code);
}
public void deleteAll() {
mCouponDao.deleteAll();
}
}

View File

@@ -1,40 +0,0 @@
package com.a1.nextlocation.data.db.repositories;
import android.content.Context;
import com.a1.nextlocation.data.Data;
import com.a1.nextlocation.data.db.Database;
import com.a1.nextlocation.data.db.dao.DataDao;
public class DataRepository {
private DataDao mDataDao;
private Data data;
public DataRepository(Context context) {
Database db = Database.getDatabase(context);
mDataDao = db.dataDao();
data = mDataDao.getData();
}
public Data getData() {
return data;
}
public Data getDataByDistance(float distance) {
return mDataDao.getDataByDistance(distance);
}
public void deleteAll() {
mDataDao.delete();
}
public void update(Data data) {
mDataDao.update(data);
}
public void insertAll(Data... datas) {
mDataDao.insertAll(datas);
}
}

View File

@@ -1,38 +0,0 @@
package com.a1.nextlocation.data.db.repositories;
import android.content.Context;
import androidx.lifecycle.LiveData;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.db.Database;
import com.a1.nextlocation.data.db.dao.LocationDao;
import java.util.List;
public class LocationRepository {
private LocationDao mLocationDao;
private LiveData<List<Location>> mAllLocations;
public LocationRepository(Context context) {
Database db = Database.getDatabase(context);
mLocationDao = db.locationDao();
mAllLocations = mLocationDao.selectAll();
}
public LiveData<List<Location>> getAllLocations() {
return mAllLocations;
}
public Location getLocationByName(String name) {
return mLocationDao.getLocationByName(name);
}
public void insertAll(Location... locations) {
mLocationDao.insertAll(locations);
}
public void deleteAll() {
mLocationDao.deleteAll();
}
}

View File

@@ -1,34 +0,0 @@
package com.a1.nextlocation.data.db.repositories;
import android.content.Context;
import androidx.lifecycle.LiveData;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.data.db.Database;
import com.a1.nextlocation.data.db.dao.RouteDao;
import java.util.List;
public class RouteRepository {
private RouteDao mRouteDao;
private LiveData<List<Route>> mAllRoutes;
public RouteRepository(Context context) {
Database db = Database.getDatabase(context);
mRouteDao = db.routeDao();
mAllRoutes = mRouteDao.getAll();
}
public LiveData<List<Route>> getAllRoutes() {
return mAllRoutes;
}
public Route getRouteByName(String name) {
return mRouteDao.getRouteByName(name);
}
public void deleteAll() {
mRouteDao.deleteAll();
}
}

View File

@@ -1,26 +1,89 @@
package com.a1.nextlocation.fragments;
import android.app.AlertDialog;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
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 com.a1.nextlocation.R;
import com.a1.nextlocation.data.Coupon;
import com.a1.nextlocation.recyclerview.CouponAdapter;
import com.a1.nextlocation.recyclerview.CouponListManager;
import java.util.List;
public class CouponFragment extends Fragment {
private RecyclerView couponRecyclerView;
private RecyclerView.LayoutManager layoutManager;
private List<Coupon> couponList;
private CouponAdapter couponAdapter;
private ImageButton backButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_coupon, container, false);
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)));
//Initialises the back button
this.backButton = view.findViewById(R.id.coupon_back_button);
this.backButton.setOnClickListener(v -> {
StatisticFragment statisticFragment = new StatisticFragment();
if (getActivity() != null)
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
});
this.couponRecyclerView.setLayoutManager(this.layoutManager);
this.couponRecyclerView.setAdapter(this.couponAdapter);
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());
activateBuilder.setMessage(getResources().getString(R.string.activate_question));
activateBuilder.setCancelable(true);
activateBuilder.setPositiveButton(R.string.activate, (dialog, which) -> {
dialog.cancel();
couponCodeBuilder.setMessage("Code: " + coupon.getCode());
couponCodeBuilder.setPositiveButton(R.string.done, (dialog1, which1) -> {
dialog.cancel();
});
AlertDialog couponCodePopup = couponCodeBuilder.create();
couponCodePopup.show();
});
activateBuilder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.cancel());
AlertDialog couponPopup = activateBuilder.create();
couponPopup.show();
}
}

View File

@@ -1,4 +1,23 @@
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 android.widget.Button;
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");
Button okButton = rootView.findViewById(R.id.help_ok_button);
okButton.setOnClickListener(v -> dismiss());
return rootView;
}
}

View File

@@ -1,43 +1,71 @@
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;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
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 com.a1.nextlocation.R;
import com.a1.nextlocation.data.Data;
import com.a1.nextlocation.data.RouteHandler;
import com.a1.nextlocation.geofencing.GeofenceInitalizer;
import com.a1.nextlocation.json.DirectionsResult;
import com.a1.nextlocation.network.ApiHandler;
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.MapView;
import org.osmdroid.views.overlay.ItemizedIconOverlay;
import org.osmdroid.views.overlay.Overlay;
import org.osmdroid.views.overlay.OverlayItem;
import org.osmdroid.views.overlay.Polyline;
import org.osmdroid.views.overlay.compass.CompassOverlay;
import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider;
import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider;
import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay;
import java.util.ArrayList;
import java.util.List;
public class HomeFragment extends Fragment {
public class HomeFragment extends Fragment implements LocationListener {
private final String userAgent = "com.ai.nextlocation.fragments";
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 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) {
super.onCreate(savedInstanceState);
@@ -47,14 +75,73 @@ public class HomeFragment extends Fragment {
// WRITE_EXTERNAL_STORAGE is required in order to show the map
Manifest.permission.WRITE_EXTERNAL_STORAGE);
color = requireContext().getColor(R.color.red);
Data.INSTANCE.setLocationProximityListener(this::onLocationVisited);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_home, container, false);
View view = inflater.inflate(R.layout.fragment_home, container, false);
// set up the location list button
this.imageButton = view.findViewById(R.id.location_list_button);
this.imageButton.setOnClickListener(v -> {
LocationFragment locationFragment = new LocationFragment();
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 -> {
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.
*
* @param directionsResult the directions received from the api
*/
private void onDirectionsAvailable(DirectionsResult directionsResult) {
Log.d(TAG, "onDirectionsAvailable: got result! " + directionsResult);
ArrayList<GeoPoint> geoPoints = directionsResult.getGeoPoints();
roadOverlay = new Polyline();
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!");
}
@@ -62,15 +149,21 @@ public class HomeFragment extends Fragment {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
initializer = new GeofenceInitalizer(requireContext(), requireActivity());
initMap(view);
}
/**
* This method initializes the map and all the things it needs
*
* @param view the view the map is on
*/
private void initMap(@NonNull View view) {
// set the user agent
Configuration.getInstance().setUserAgentValue(userAgent);
// create the map view
mapView = view.findViewById(R.id.mapView);
mapView = view.findViewById(R.id.map_view);
mapView.setDestroyMode(false);
mapView.setTag("mapView");
mapView.setMultiTouchControls(true);
@@ -79,10 +172,12 @@ public class HomeFragment extends Fragment {
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(this.requireContext());
// add the compass overlay
CompassOverlay compassOverlay = new CompassOverlay(requireContext(),new InternalCompassOrientationProvider(requireContext()),mapView);
CompassOverlay compassOverlay = new CompassOverlay(requireContext(), new InternalCompassOrientationProvider(requireContext()), mapView);
compassOverlay.enableCompass();
mapView.getOverlays().add(compassOverlay);
addLocations();
// add the location overlay
MyLocationNewOverlay mLocationOverlay = new MyLocationNewOverlay(gpsMyLocationProvider, mapView);
mLocationOverlay.enableFollowLocation();
@@ -91,15 +186,29 @@ public class HomeFragment extends Fragment {
// 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);
try {
// request location updates for the distance checking
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
// get the current location and set it as center
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
GeoPoint startPoint = new GeoPoint(location.getLatitude(), location.getLongitude());
mapController.setCenter(startPoint);
if (currentLocation == null) currentLocation = location;
if (location != null) {
GeoPoint start = new GeoPoint(currentLocation.getLatitude(), currentLocation.getLongitude());
mapController.setCenter(start);
}
} catch (SecurityException e) {
Log.d(TAG, "onViewCreated: exception while getting location: " + e.getLocalizedMessage());
@@ -112,7 +221,126 @@ public class HomeFragment extends Fragment {
}
displayRoute();
}
/**
* displays the route that is currently being followed as a red line
*/
private void displayRoute() {
if (RouteHandler.INSTANCE.isFollowingRoute()) {
Log.d(TAG, "displayRoute: WE ARE FOLLOWING A ROUTE");
if (roadOverlay == null) {
if (RouteHandler.INSTANCE.getCurrentRouteLine() != null) {
roadOverlay = RouteHandler.INSTANCE.getCurrentRouteLine();
mapView.getOverlays().add(roadOverlay);
mapView.invalidate();
Log.d(TAG, "initMap: successfully added road!");
}
} else {
mapView.getOverlays().add(roadOverlay);
mapView.invalidate();
Log.d(TAG, "initMap: successfully added road!");
}
}
}
/**
* adds the locations of the current route to the map. If there is no current route, show all locations
*/
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
// 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);
}
// create the overlay that will hold all locations and add listeners
allLocationsOverlay = new ItemizedIconOverlay<OverlayItem>(items,
new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
/**
* on sinlge click, navigate to that location's detail fragment
* @param index the index in the location list
* @param item the item that was clicked
* @return true
*/
@Override
public boolean onItemSingleTapUp(int index, OverlayItem item) {
com.a1.nextlocation.data.Location clicked = locations.get(index);
requireActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new LocationDetailFragment(clicked)).commit();
return true;
}
/**
* on item long press, show that location's name in a toast message
* @param index the index in the location list
* @param item the item that was clicked
* @return true
*/
@Override
public boolean onItemLongPress(int index, OverlayItem item) {
com.a1.nextlocation.data.Location clicked = locations.get(index);
Toast.makeText(requireContext(), clicked.getName(), Toast.LENGTH_SHORT).show();
// create a route to the clicked location, didn't work and didn't have enough time to make it work ¯\_(ツ)_/¯
// Route route = new Route("Route to " + clicked.getName());
// route.addLocation(new com.a1.nextlocation.data.Location("Current location",currentLocation.getLatitude(),currentLocation.getLongitude(),"your location",null));
// route.addLocation(clicked);
// ApiHandler.INSTANCE.getDirections(route);
return true;
}
}, requireContext());
// add the overlay to the map
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);
}
/**
* @param permissions tbe permissions we want to ask
* @author Ricky
* request the permissions needed for location and network, made by Ricky
*/
private void requestPermissionsIfNecessary(String... permissions) {
ArrayList<String> permissionsToRequest = new ArrayList<>();
if (this.getContext() != null)
@@ -130,4 +358,109 @@ public class HomeFragment extends Fragment {
REQUEST_PERMISSIONS_REQUEST_CODE);
}
}
/**
* location callback that gets called each time the location is updated. It is used for updating the distance walked and checking if there are locations you have visited
*
* @param location the new location
*/
@Override
public void onLocationChanged(@NonNull Location location) {
// calculate the distance walked
if (currentLocation != null) {
double distance = currentLocation.distanceTo(location); // in meters
// can't walk 100 meters in a few seconds
if (distance < 100 && distance > 0.1) {
Data.INSTANCE.addDistance(distance);
Data.INSTANCE.setLocation(location);
}
currentLocation = location;
//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
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(@NonNull String provider) {
}
@Override
public void onProviderDisabled(@NonNull String provider) {
}
/**
* method that gets called when the app gets paused
*/
@Override
public void onPause() {
super.onPause();
mapView.onPause();
}
/**
* method that gets called when the app gets resumed
*/
@Override
public void onResume() {
super.onResume();
mapView.onResume();
}
}

View File

@@ -1,27 +1,97 @@
package com.a1.nextlocation.fragments;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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 backButton;
private Location location;
private TextView titelText;
private TextView detailText;
private ImageView locationImage;
public LocationDetailFragment() {
}
public LocationDetailFragment(Location location) {
this.location = location;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@SuppressLint("DefaultLocale")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_location_detail, container, false);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_location_detail, container, false);
this.titelText = view.findViewById(R.id.detail_location_name);
this.titelText.setText(location.getName());
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());
}
//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();
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);
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;
}
}

View File

@@ -1,27 +1,70 @@
package com.a1.nextlocation.fragments;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
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 com.a1.nextlocation.R;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.recyclerview.LocationAdapter;
import com.a1.nextlocation.recyclerview.LocationListManager;
import java.util.List;
public class LocationFragment extends Fragment {
private RecyclerView locationRecyclerView;
private LocationAdapter locationAdapter;
private RecyclerView.LayoutManager layoutManager;
private List<Location> locationList;
private ImageButton backButton;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_location, container, false);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_location, container, false);
this.locationRecyclerView = view.findViewById(R.id.location_recyclerview);
this.locationRecyclerView.setHasFixedSize(true);
this.layoutManager = new LinearLayoutManager(this.getContext());
//Initialised the back button
this.backButton = view.findViewById(R.id.location_back_button);
this.backButton.setOnClickListener(v -> {
HomeFragment homeFragment = new HomeFragment();
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(this.locationList.get(clickedPosition));
Bundle locationBundle = new Bundle();
//Gives the clicked location to the adapter
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
locationDetailFragment.setArguments(locationBundle);
if (getActivity() != null)
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
});
this.locationRecyclerView.setLayoutManager(this.layoutManager);
this.locationRecyclerView.setAdapter(this.locationAdapter);
return view;
}
}

View File

@@ -0,0 +1,5 @@
package com.a1.nextlocation.fragments;
public interface Refreshable {
void refreshAndNavigateTo(int id);
}

View File

@@ -1,27 +1,147 @@
package com.a1.nextlocation.fragments;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
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 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) {
super.onCreate(savedInstanceState);
}
@SuppressLint({"SetTextI18n", "DefaultLocale"})
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_route_detail, container, false);
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) {
this.route = getArguments().getParcelable("route");
}
//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);
TextView routeName = view.findViewById(R.id.route_title);
routeName.setText(this.route.getName());
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();
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(), 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);
}
}

View File

@@ -1,16 +1,38 @@
package com.a1.nextlocation.fragments;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
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;
public class RouteFragment extends Fragment {
private static final String TAG = RouteFragment.class.getCanonicalName();
private List<Route> routeList;
private Refreshable refreshable;
@Override
public void onAttach(@NotNull Context context) {
super.onAttach(context);
refreshable = (Refreshable) context;
}
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -19,9 +41,43 @@ public class RouteFragment extends Fragment {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_route, container, false);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_route, container, false);
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();
//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);
if (getActivity() != null)
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
});
ImageButton backButton = view.findViewById(R.id.route_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);
}
});
routeRecyclerView.setLayoutManager(layoutManager);
routeRecyclerView.setAdapter(routeAdapter);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
}
}

View File

@@ -1,44 +1,224 @@
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.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.Spinner;
import com.a1.nextlocation.MainActivity;
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;
import java.util.Locale;
public class SettingsFragment extends Fragment {
private SharedPreferences.Editor editor;
private SwitchCompat fontSwitch;
private SwitchCompat imperialSwitch;
private SwitchCompat colorBlindMode;
private Refreshable refreshable;
@Override
public void onAttach(@NotNull Context context) {
super.onAttach(context);
refreshable = (Refreshable) context;
}
@SuppressLint("CommitPrefEdits")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
editor = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).edit();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_settings, container, false);
View view = inflater.inflate(R.layout.fragment_settings, container, false);
initializeLanguageDropdown(view);
initializeButtons(view);
return view;
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
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);
}});
// Inflate the layout for this fragment
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
SharedPreferences sharedPreferences = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE);
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
//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)};
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
languageDropdown.setAdapter(arrayAdapter);
dropdown.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", "nl")));
long previousID = languageDropdown.getSelectedItemId();
languageDropdown.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
setLocale(dropdownPositionToLanguage(id));
// refresh fragment on language change
if (id != previousID) {
refresh();
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
}
/**
* converts the languageDropdown position to the belonging language
*
* @param id desired position to convert
* @return the language belonging to the position of the languageDropdown
*/
private String dropdownPositionToLanguage(long id) {
switch ((int) id) {
case 0:
return "nl";
case 1:
return "en";
default:
return "";
}
}
/**
* converts language to the languageDropdown position
*
* @param language desired language to convert
* @return the position of the language in the languageDropdown
*/
private int languageToDropdownPosition(String language) {
switch (language) {
case "nl":
return 0;
case "en":
return 1;
default:
return 1;
}
}
/**
* reloads the fragment
*/
private void refresh() {
Fragment currentFragment = getActivity().getSupportFragmentManager().findFragmentById(R.id.fragment_layout);
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
fragmentTransaction.detach(currentFragment);
fragmentTransaction.attach(currentFragment);
fragmentTransaction.commit();
refreshable.refreshAndNavigateTo(R.id.settings);
}
/**
* changes the current language to the desired language and saves this setting in SharedPreferences
*
* @param language the desired language to translate to
*/
private void setLocale(String language) {
Locale locale = new Locale(language);
Locale.setDefault(locale);
Configuration config = new Configuration();
config.setLocale(locale);
getContext().getResources().updateConfiguration(config, getContext().getResources().getDisplayMetrics());
editor.putString("Language", language);
editor.apply();
}
}

View File

@@ -1,27 +1,101 @@
package com.a1.nextlocation.fragments;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
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.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;
@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) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_statistic, container, false);
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_statistic, container, false);
initializeDistanceTextView(view);
TextView locs = view.findViewById(R.id.statistics_locations_visited);
TextView timeText = view.findViewById(R.id.statistics_time_value);
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");
//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()));
//Initialises the back button
ImageView backButton = view.findViewById(R.id.statistics_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);
});
//Initialises the coupon button
ImageView couponButton = view.findViewById(R.id.coupon_button);
couponButton.setOnClickListener(v -> {
CouponFragment couponFragment = new CouponFragment();
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();
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");
}
}

View File

@@ -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;
}
}
}

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -0,0 +1,193 @@
package com.a1.nextlocation.json;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonPrimitive;
import org.osmdroid.util.GeoPoint;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class DirectionsResult {
private static final String TAG = DirectionsResult.class.getCanonicalName();
private List<DirectionsStep> steps = new ArrayList<>();
private double distance;
private double duration;
private double[][] wayPointCoordinates;
private final GeoPoint[] startAndEndPoint = new GeoPoint[2];
public List<DirectionsStep> getSteps() {
return steps;
}
public void setSteps(List<DirectionsStep> steps) {
this.steps = steps;
}
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public double getDuration() {
return duration;
}
public void setDuration(double duration) {
this.duration = duration;
}
public void addStep(DirectionsStep step) {
this.steps.add(step);
}
public GeoPoint[] getStartAndEndPoint() {
return startAndEndPoint;
}
/**
* 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() {
int size = 0;
// we'll have a lot of waypoints, so calculate the size first so that the list won't have to be extended (o p t i m i z e)
for (int i = 0; i < this.getSteps().size(); i++) {
size += this.getSteps().get(i).getWaypoints().length;
}
ArrayList<GeoPoint> res = new ArrayList<>(size);
for (DirectionsStep step : this.getSteps()) {
Collections.addAll(res, step.getWaypoints());
}
return res;
}
/**
* parses a given json string into this object. It gets all the waypoints and steps and combines them so that every step also has the correct coordinates associated with it
*
* @param json the json string to parse.
*/
public void parse(String json) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
JsonObject feature = JsonParser.parseString(json).getAsJsonObject().get("features").getAsJsonArray().get(0).getAsJsonObject();
JsonObject properties = feature.get("properties").getAsJsonObject();
JsonArray wayPointCoordinates = feature.get("geometry").getAsJsonObject().getAsJsonArray("coordinates");
this.wayPointCoordinates = new double[wayPointCoordinates.size()][2];
// fill the way point coordinates list for later use
for (int i = 0; i < wayPointCoordinates.size(); i++) {
JsonElement j = wayPointCoordinates.get(i);
JsonArray arr = j.getAsJsonArray();
this.wayPointCoordinates[i][0] = arr.get(0).getAsDouble();
this.wayPointCoordinates[i][1] = arr.get(1).getAsDouble();
}
JsonArray segments = properties.getAsJsonArray("segments");
parseSegments(segments, gson);
startAndEndPoint[0] = this.getSteps().get(0).getWaypoints()[0];
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 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) {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
JsonArray routes = JsonParser.parseString(json).getAsJsonObject().getAsJsonArray("routes");
for (JsonElement element : routes) {
JsonObject route = element.getAsJsonObject();
JsonObject summary = route.getAsJsonObject("summary");
this.distance = summary.get("distance").getAsDouble();
this.duration = summary.get("duration").getAsDouble();
JsonPrimitive geometry = route.getAsJsonPrimitive("geometry");
JsonArray wayPointCoordinates = GeometryDecoder.decodeGeometry(geometry.getAsString(), false);
this.wayPointCoordinates = new double[wayPointCoordinates.size()][2];
// fill the way point coordinates list for later use
for (int i = 0; i < wayPointCoordinates.size(); i++) {
JsonElement j = wayPointCoordinates.get(i);
JsonArray arr = j.getAsJsonArray();
this.wayPointCoordinates[i][0] = arr.get(0).getAsDouble();
this.wayPointCoordinates[i][1] = arr.get(1).getAsDouble();
}
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();
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);
}
}
}

View File

@@ -0,0 +1,72 @@
package com.a1.nextlocation.json;
import org.osmdroid.util.GeoPoint;
import java.util.ArrayList;
/**
* pojo class that holds the step object from the api response
*/
public class DirectionsStep {
private double distance;
private double duration;
private String instruction;
private String name;
/**
* these are the actual waypoints that the step refers to. The first is the beginning of the step, and the second is what it leads to.
* The second geopoint is always the first geopoint of the next step in the list of the {@link DirectionsResult} object.
*/
private GeoPoint[] waypoints = new GeoPoint[2];
/**
* this is a list of the waypoints that are in the response, it is called way_points so it can be automatically serialized with gson
*/
private ArrayList<Integer> way_points;
public double getDistance() {
return distance;
}
public void setDistance(double distance) {
this.distance = distance;
}
public double getDuration() {
return duration;
}
public void setDuration(double duration) {
this.duration = duration;
}
public String getInstruction() {
return instruction;
}
public void setInstruction(String instruction) {
this.instruction = instruction;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<Integer> getWay_points() {
return way_points;
}
public void setWay_points(ArrayList<Integer> way_points) {
this.way_points = way_points;
}
public GeoPoint[] getWaypoints() {
return waypoints;
}
public void setWaypoints(GeoPoint[] waypoints) {
this.waypoints = waypoints;
}
}

View File

@@ -0,0 +1,60 @@
package com.a1.nextlocation.json;
import com.google.gson.JsonArray;
/**
* source: https://github.com/GIScience/openrouteservice-docs#geometry-decoding
*/
public class GeometryDecoder {
public static JsonArray decodeGeometry(String encodedGeometry, boolean inclElevation) {
JsonArray geometry = new JsonArray();
int len = encodedGeometry.length();
int index = 0;
int lat = 0;
int lng = 0;
int ele = 0;
while (index < len) {
int result = 1;
int shift = 0;
int b;
do {
b = encodedGeometry.charAt(index++) - 63 - 1;
result += b << shift;
shift += 5;
} while (b >= 0x1f);
lat += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);
result = 1;
shift = 0;
do {
b = encodedGeometry.charAt(index++) - 63 - 1;
result += b << shift;
shift += 5;
} while (b >= 0x1f);
lng += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);
if (inclElevation) {
result = 1;
shift = 0;
do {
b = encodedGeometry.charAt(index++) - 63 - 1;
result += b << shift;
shift += 5;
} while (b >= 0x1f);
ele += (result & 1) != 0 ? ~(result >> 1) : (result >> 1);
}
JsonArray location = new JsonArray();
location.add(lat / 1E5);
location.add(lng / 1E5);
if (inclElevation) {
location.add((float) (ele / 100));
}
geometry.add(location);
}
return geometry;
}
}

View File

@@ -4,47 +4,92 @@ import android.util.Log;
import com.a1.nextlocation.data.Location;
import com.a1.nextlocation.data.Route;
import com.a1.nextlocation.json.DirectionsResult;
import com.google.gson.Gson;
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;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Singleton that handles all API calls
*/
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 final String DIRECTIONS_MODE = "foot-walking";
private OkHttpClient client = new OkHttpClient();
private final List<DirectionsListener> listeners = new ArrayList<>();
public Route getDirections(Location startLocation, Location endLocation) {
return getDirections(startLocation.getCoordinates(),endLocation.getCoordinates());
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
*/
public void getDirections(Location startLocation, Location endLocation) {
getDirections(startLocation.getCoordinates(), endLocation.getCoordinates());
}
public Route getDirections(double startLat, double startLong, double endLat, double endLong) {
return getDirections(startLat + "," + startLong, endLat + "," + endLong);
/**
* gets directions from the start location latitude and longitude and the end location latitude and longitude
*
* @param startLat the start latitude
* @param startLong the start 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);
}
public Route getDirections(String startLocation, String endLocation) {
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" +startLocation + "&end=" + endLocation;
AtomicReference<Route> res = null;
/**
* 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>
*/
public void getDirections(String startLocation, String endLocation) {
// build the url
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(() -> {
// build a request from the url
Request request = new Request.Builder().url(requestUrl).build();
// try to get the response
try (Response response = client.newCall(request).execute()) {
if (response.body() != null) {
String responseString = Objects.requireNonNull(response.body()).string();
Log.d(TAG, "getDirections: got response: " + responseString);
// convert the response into a result object
DirectionsResult result = new DirectionsResult();
result.parse(responseString);
Log.d(TAG, "getDirections: " + result.getSteps().size());
// notify the listeners
for (DirectionsListener listener : listeners) {
listener.onDirectionsAvailable(result);
}
}
} catch (IOException e) {
@@ -54,15 +99,90 @@ public enum ApiHandler {
t.start();
// try {
// t.join();
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
}
/**
* adds a listener for when a result of an api call is available
*
* @param listener the new listener
*/
public void addListener(DirectionsListener listener) {
this.listeners.add(listener);
}
/**
* gets directions for the given {@link Route}
*
* @param route the route to get directions for
*/
public void getDirections(Route route) {
// add the coordinates to the list
ArrayList<double[]> allCoords = new ArrayList<>();
for (Location location : route.getLocations()) {
allCoords.add(location.getCoordinatesAsDoubles());
}
// convert it to a json string
String body = "{\"coordinates\":" + new Gson().toJson(allCoords) + "}";
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY;
// new thread, because we don't want to be networking on our main thread
Thread t = new Thread(() -> {
// add the body to the request
RequestBody requestBody = RequestBody.create(body, JSON);
Request request = new Request.Builder()
.url(requestUrl)
.post(requestBody)
.build();
try (Response response = client.newCall(request).execute()) {
if (response.body() != null) {
String responseString = Objects.requireNonNull(response.body()).string();
Log.d(TAG, "getDirections: got response: " + responseString);
// kinda lazy, but we had time pressure
if (responseString.startsWith("{\"error")) {
Log.e(TAG, "getDirections: ERROR IN REQUEST!");
return;
}
// convert the result into a DirectionsResult
DirectionsResult result = new DirectionsResult();
result.parseRoute(responseString);
Log.d(TAG, "getDirections: " + result.getSteps().size());
//notify the listeners
for (DirectionsListener listener : listeners) {
listener.onDirectionsAvailable(result);
}
}
} catch (IOException e) {
Log.d(TAG, "getDirections: caught exception: " + e.getLocalizedMessage());
}
});
t.start();
// wait for when we have a result from the api until we can continue, otherwise the route will be drawn before we get the result
try {
t.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
return res.get();
}
}

View File

@@ -0,0 +1,7 @@
package com.a1.nextlocation.network;
import com.a1.nextlocation.json.DirectionsResult;
public interface DirectionsListener {
void onDirectionsAvailable(DirectionsResult result);
}

View File

@@ -1,20 +1,23 @@
package com.a1.nextlocation.recyclerview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.a1.nextlocation.R;
import com.a1.nextlocation.data.Coupon;
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 {
@@ -23,31 +26,52 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
class CouponViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private TextView couponCode;
public CouponViewHolder(@NonNull View itemView) {
super(itemView);
itemView.setOnClickListener(this);
}
/**
* 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
public void onClick(View view) {
public void onClick(View v) {
clickListener.onItemClick(getAdapterPosition());
}
}
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener){
appContext = context;
couponList = coupon;
clickListener = listener;
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener) {
this.appContext = context;
this.couponList = coupon;
this.clickListener = listener;
}
public CouponAdapter(Context context, List<Coupon> coupon) {
this.appContext = context;
this.couponList = coupon;
}
@NonNull
@Override
public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.coupon_item, parent, false);
return new CouponViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
Coupon coupon = couponList.get(position);
holder.setTextViewName(coupon.getReward());
}
@Override
@@ -55,7 +79,4 @@ public class CouponAdapter extends RecyclerView.Adapter<CouponAdapter.CouponView
return couponList.size();
}
}

View File

@@ -1,23 +1,33 @@
package com.a1.nextlocation.recyclerview;
import android.content.Context;
import com.a1.nextlocation.data.Coupon;
import java.util.ArrayList;
import java.util.List;
public class CouponListManager {
public enum CouponListManager {
INSTANCE;
private List<Coupon> coupon;
public CouponListManager(){
private List<Coupon> couponList;
private Context context;
public void setContext(Context context) {
this.context = context;
this.couponList = new ArrayList<>();
}
public List<Coupon> getCoupon() {
return coupon;
public List<Coupon> getCouponList() {
return couponList;
}
public void setCoupon(List<Coupon> location) {
this.coupon = coupon;
/**
* prepares the list for the adapter
*/
public void load() {
CouponLoader couponLoader = new CouponLoader(this.context);
this.couponList = couponLoader.load();
}
}

View File

@@ -1,8 +1,43 @@
package com.a1.nextlocation.recyclerview;
public class CouponLoader implements Loader{
import android.content.Context;
import android.util.Log;
import com.a1.nextlocation.data.Coupon;
import com.a1.nextlocation.data.FileIO;
import com.google.gson.reflect.TypeToken;
import java.util.ArrayList;
import java.util.List;
public class CouponLoader implements Loader<List<Coupon>> {
private final Context context;
private final String TAG = CouponLoader.class.getCanonicalName();
public CouponLoader(Context context) {
this.context = context;
}
/**
* Loads the Arraylist of coupons out of the JSON
*
* @return Arraylist of coupons
*/
@Override
public void load() {
public ArrayList<Coupon> load() {
FileIO<ArrayList<Coupon>> fileIO = new FileIO<>();
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;
}
}

View File

@@ -1,5 +1,5 @@
package com.a1.nextlocation.recyclerview;
public interface Loader {
void load();
public interface Loader<T> {
T load();
}

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -16,9 +17,9 @@ import java.util.List;
public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.LocationViewHolder> {
private Context appContext;
private List<Location> locationList;
private CouponAdapter.OnItemClickListener clickListener;
private final Context appContext;
private final List<Location> locationList;
private final OnItemClickListener clickListener;
public interface OnItemClickListener {
void onItemClick(int clickedPosition);
@@ -27,10 +28,13 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private TextView locationName;
private ImageView locationImage;
public LocationViewHolder(@NonNull View itemView) {
super(itemView);
this.locationName = itemView.findViewById(R.id.location_name);
this.locationImage = itemView.findViewById(R.id.location_image);
itemView.setOnClickListener(this);
}
@Override
@@ -38,12 +42,30 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
clickListener.onItemClick(getAdapterPosition());
}
public void setTextViewText(String text){
locationName.setText(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);
this.locationName.setText(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());
locationImage.setImageResource(id);
}
}
public LocationAdapter(Context context, List<Location> location, CouponAdapter.OnItemClickListener listener){
public LocationAdapter(Context context, List<Location> location, OnItemClickListener listener) {
this.appContext = context;
this.locationList = location;
this.clickListener = listener;
@@ -52,15 +74,15 @@ public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.Locati
@NonNull
@Override
public LocationAdapter.LocationViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.fragment_location, parent, false);
LocationViewHolder viewHolder = new LocationViewHolder(itemView);
return viewHolder;
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.location_item, parent, false);
return new LocationViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
Location location = locationList.get(position);
holder.setTextViewText(location.getName());
holder.setImageViewImage(location.getIconUrl());
}
@Override

View File

@@ -1,22 +1,42 @@
package com.a1.nextlocation.recyclerview;
import android.content.Context;
import com.a1.nextlocation.data.Location;
import java.util.ArrayList;
import java.util.List;
public class LocationListManager {
public enum LocationListManager {
INSTANCE;
private List<Location> location;
public LocationListManager(){
private List<Location> locationList;
private Context context;
public void setContext(Context context) {
this.context = context;
this.locationList = new ArrayList<>();
}
public List<Location> getLocation() {
return location;
public List<Location> getLocationList() {
return locationList;
}
public void setLocation(List<Location> location) {
this.location = location;
/**
* 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;
}
}

View File

@@ -1,8 +1,40 @@
package com.a1.nextlocation.recyclerview;
public class LocationLoader implements Loader{
@Override
public void load() {
import android.content.Context;
import com.a1.nextlocation.data.FileIO;
import com.a1.nextlocation.data.Location;
import com.google.gson.reflect.TypeToken;
import java.util.ArrayList;
import java.util.List;
public class LocationLoader implements Loader<List<Location>> {
private final Context context;
public LocationLoader(Context context) {
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<>();
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;
}
}

View File

@@ -1,21 +1,24 @@
package com.a1.nextlocation.recyclerview;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.a1.nextlocation.R;
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);
@@ -23,17 +26,31 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
class RouteViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private TextView routeName;
public RouteViewHolder(@NonNull View itemView) {
super(itemView);
this.routeName = itemView.findViewById(R.id.route_name);
itemView.setOnClickListener(this);
}
@Override
public void onClick(View view) {
clickListener.onItemClick(getAdapterPosition());
}
/**
* 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;
@@ -42,12 +59,14 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
@NonNull
@Override
public RouteAdapter.RouteViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return null;
View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.route_item, parent, false);
return new RouteViewHolder(itemView);
}
@Override
public void onBindViewHolder(@NonNull RouteAdapter.RouteViewHolder holder, int position) {
Route route = routeList.get(position);
holder.setTextViewText(route.getName());
}
@Override

View File

@@ -1,27 +1,32 @@
package com.a1.nextlocation.recyclerview;
import android.content.Context;
import com.a1.nextlocation.data.Route;
import java.util.ArrayList;
import java.util.List;
public class RouteListManager implements Loader{
public enum RouteListManager {
INSTANCE;
List<Route> routes;
public RouteListManager(){
private List<Route> routeList;
private Context context;
public void setContext(Context context) {
this.context = context;
this.routeList = new ArrayList<>();
}
public List<Route> getRoutes() {
return routes;
public List<Route> getRouteList() {
return routeList;
}
public void setRoutes(List<Route> routes) {
this.routes = routes;
}
@Override
/**
* prepares the array list for the adapter
*/
public void load() {
RouteLoader routeLoader = new RouteLoader(this.context);
this.routeList = routeLoader.load();
}
}

View File

@@ -1,8 +1,41 @@
package com.a1.nextlocation.recyclerview;
public class RouteLoader implements Loader {
import android.content.Context;
import com.a1.nextlocation.data.FileIO;
import com.a1.nextlocation.data.Route;
import com.google.gson.reflect.TypeToken;
import java.util.ArrayList;
import java.util.List;
public class RouteLoader implements Loader<List<Route>> {
private final Context context;
public RouteLoader(Context context) {
this.context = context;
}
/**
* loads an array list from a JSON
*
* @return an array list with routes
*/
@Override
public void load() {
public ArrayList<Route> load() {
FileIO<ArrayList<Route>> fileIO = new FileIO<>();
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;
}
}

View File

@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="#333333"
android:alpha="0.6">
<path
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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 780 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -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="@android:color/white"
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>

View 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>

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 KiB

Some files were not shown because too many files have changed in this diff Show More