Compare commits
81 Commits
bottomNavi
...
directions
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b93ddaec5 | ||
|
|
5e218f3b99 | ||
|
|
96f32ccdbc | ||
|
|
d433565fef | ||
|
|
1ca13e3a6b | ||
|
|
9c4eb98fb4 | ||
|
|
610b23b056 | ||
|
|
95a2e4e849 | ||
|
|
74fb4440ed | ||
|
|
17d977bb17 | ||
|
|
b52c5556d2 | ||
|
|
70342c6506 | ||
|
|
311a794a69 | ||
|
|
dbc10014f9 | ||
|
|
1f835a94b0 | ||
|
|
12c8d6a62d | ||
|
|
9e8e9f4cdd | ||
|
|
1d48ada0ab | ||
|
|
6a07ce77f0 | ||
|
|
5edf50c808 | ||
|
|
db7d944a41 | ||
|
|
3f132f48a7 | ||
|
|
17f624cc30 | ||
|
|
4f68398f33 | ||
|
|
4229acf87c | ||
|
|
521c9fd188 | ||
|
|
1fd245f4f0 | ||
|
|
8d210a9707 | ||
|
|
ee1ae23e0f | ||
|
|
49f78efdd3 | ||
|
|
512ad3980f | ||
|
|
e2f76c94f7 | ||
|
|
2479563474 | ||
|
|
ea59b97f0f | ||
|
|
0b9bba63a3 | ||
|
|
75b7ff47cd | ||
|
|
a2d1ecfc71 | ||
|
|
890a5264d6 | ||
|
|
2792a62069 | ||
|
|
b3be078361 | ||
|
|
148e84483a | ||
|
|
bf1c5d0ac4 | ||
|
|
0092b2e839 | ||
|
|
9854f5f6ab | ||
|
|
7c200bf780 | ||
|
|
b174778dbf | ||
|
|
d33237791b | ||
|
|
c6a9b175cc | ||
|
|
d4d3e8d19f | ||
|
|
8aa316fc97 | ||
|
|
ed6d80b399 | ||
|
|
dc69d9a2ad | ||
|
|
83796481e8 | ||
|
|
14d9cf686f | ||
|
|
49ec448e56 | ||
|
|
996b061b65 | ||
|
|
64f76f46c0 | ||
|
|
8fdb88f71a | ||
|
|
8c25197967 | ||
|
|
180f7fc051 | ||
|
|
9622d3d068 | ||
|
|
a2365d1c19 | ||
|
|
6b97c21a8b | ||
|
|
23d23bead4 | ||
|
|
297067fcb2 | ||
|
|
19ae360ee0 | ||
|
|
16b9b15856 | ||
|
|
204d45cece | ||
|
|
08215e18c5 | ||
|
|
63c49c40d7 | ||
|
|
13b73fb0de | ||
|
|
e5fa7db27d | ||
|
|
c4fd44ad76 | ||
|
|
3e9e41c118 | ||
|
|
64c8b0591a | ||
|
|
aee2797a0f | ||
|
|
12b446b679 | ||
|
|
8f8303d66a | ||
|
|
a2ffef1099 | ||
|
|
dec62e8b9a | ||
|
|
fac41e2ade |
@@ -26,14 +26,21 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
repositories {
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
//gson
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
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-maps:17.0.0'
|
||||
testImplementation 'junit:junit:4.13.1'
|
||||
|
||||
// okhttp
|
||||
@@ -43,6 +50,9 @@ dependencies {
|
||||
//osm
|
||||
implementation 'org.osmdroid:osmdroid-android:6.1.8'
|
||||
|
||||
//osm bonus pack
|
||||
implementation 'com.github.MKergall:osmbonuspack:6.6.0'
|
||||
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.a1.nextlocation">
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<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" />
|
||||
|
||||
|
||||
6
app/src/main/assets/coupons.json
Normal file
6
app/src/main/assets/coupons.json
Normal file
@@ -0,0 +1,6 @@
|
||||
[
|
||||
{
|
||||
"code": "2345",
|
||||
"reward": "fdasfasdf"
|
||||
}
|
||||
]
|
||||
135
app/src/main/assets/locations.json
Normal file
135
app/src/main/assets/locations.json
Normal file
@@ -0,0 +1,135 @@
|
||||
[
|
||||
{
|
||||
"name":"McDonald's Breda Karnemelkstraat",
|
||||
"coordinates":"51.58596318905295,4.77586651481887",
|
||||
"description":"McDonald's restaurant",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Subway Karnemelkstraat 10 A, 1",
|
||||
"coordinates":"51.58632782568612,4.775219531501114",
|
||||
"description":"4811 KJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Wok To Go Halstraat 40",
|
||||
"coordinates":"51.58650312572897,4.777467069592386",
|
||||
"description":"4811HX Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"De Boterhal Grote Markt 19",
|
||||
"coordinates":"51.588069667604756,4.7762685632180695",
|
||||
"description":"4811XL Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Gauchos Grote Markt 33",
|
||||
"coordinates":"51.58859328857082,4.77601349563689",
|
||||
"description":"4811XP Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"The Tosti Club Breda A4, Vlaszak 2",
|
||||
"coordinates":"51.58905632735254,4.780729463841719",
|
||||
"description":"4811GR Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Coffee & Lunch 4 you Oude Vest 31",
|
||||
"coordinates":"51.58741730235298,4.779832967540571",
|
||||
"description":"4811HS Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"t Zusje Breda Vismarktstraat 28",
|
||||
"coordinates":"51.590133292554434,4.773911506170458",
|
||||
"description":"4811WE Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"VR-World Nassaustraat 2",
|
||||
"coordinates":"51.5913566342086,4.786256804321071",
|
||||
"description":"4811DD Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Kees Kroket Houtmarkt 9",
|
||||
"coordinates":"51.58647180329833,4.77741809637617",
|
||||
"description":"KEEEEES KROKET!",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Prison Escape Kloosterlaan 168",
|
||||
"coordinates":"51.59073795635181,4.784917104321059",
|
||||
"description":"4811EE Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"De Koepel - FutureDome Events Nassausingel 26",
|
||||
"coordinates":"51.590431588532105,4.786756741648511",
|
||||
"description":"4811HP Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
|
||||
{
|
||||
"name":"Escaping Breda: Escape Room Games Boschstraat 114",
|
||||
"coordinates":" 51.59110835530862,4.784147222780912",
|
||||
"description":"4811GK Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"MEZZ Breda Keizerstraat 101",
|
||||
"coordinates":"51.58394697737321,4.779757901349616",
|
||||
"description":"4811HL Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Het Klooster Breda Schorsmolenstraat 13",
|
||||
"coordinates":"51.58775443759389,4.765568874365066",
|
||||
"description":"4811VN Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Beach & Lounge club Spider “rooftop bar” Nieuwe Prinsenkade",
|
||||
"coordinates":"51.59212977605884,4.774043765582372",
|
||||
"description":"4811VC Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Koningin Wilhelmina Paviljoen Kraanstraat 4b",
|
||||
"coordinates":"51.590645369292396,4.776045124415531",
|
||||
"description":"4811XV Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Hercules en de Nemeïsche leeuw",
|
||||
"coordinates":"51.59130522182325,4.778161739135078",
|
||||
"description":"4811XJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Nassau-Baroniemonument - 1905 - Pierre Cuypers Delpratsingel 1",
|
||||
"coordinates":"51.592530636759136,4.780278353833301",
|
||||
"description":"4811AM Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Station Breda Gravinnen van Nassauboulevard 43",
|
||||
"coordinates":"51.59569850758307,4.780295549958155",
|
||||
"description":"4815CA Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"Belcrum Beach Veilingkade 12a",
|
||||
"coordinates":"51.599434239284726,4.76632797992092",
|
||||
"description":"4815HC Breda",
|
||||
"imageUrl":"NULL"
|
||||
},
|
||||
{
|
||||
"name":"De Belcrum Watertoren (1935) Speelhuislaan 158",
|
||||
"coordinates":"51.60135351009892,4.7705765989322755",
|
||||
"description":"4815CJ Breda",
|
||||
"imageUrl":"NULL"
|
||||
}
|
||||
]
|
||||
14
app/src/main/assets/routes.json
Normal file
14
app/src/main/assets/routes.json
Normal file
@@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"name": "rondje stad",
|
||||
"locations": [
|
||||
{
|
||||
"name": "kees kroket",
|
||||
"coordinates": "2.4654645,6.2342323",
|
||||
"description": "lekkere patatjes"
|
||||
}
|
||||
],
|
||||
"totalDistance": 2.3434,
|
||||
"totalTime": 342342
|
||||
}
|
||||
]
|
||||
@@ -13,6 +13,10 @@ import com.a1.nextlocation.fragments.HomeFragment;
|
||||
import com.a1.nextlocation.fragments.RouteFragment;
|
||||
import com.a1.nextlocation.fragments.SettingsFragment;
|
||||
import com.a1.nextlocation.fragments.StatisticFragment;
|
||||
import com.a1.nextlocation.network.ApiHandler;
|
||||
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 {
|
||||
@@ -28,6 +32,13 @@ public class MainActivity extends AppCompatActivity {
|
||||
BottomNavigationView bottomNav = findViewById(R.id.navbar);
|
||||
bottomNav.setOnNavigationItemSelectedListener(navListener);
|
||||
|
||||
LocationListManager.INSTANCE.setContext(this);
|
||||
LocationListManager.INSTANCE.load();
|
||||
CouponListManager.INSTANCE.setContext(this);
|
||||
CouponListManager.INSTANCE.load();
|
||||
RouteListManager.INSTANCE.setContext(this);
|
||||
RouteListManager.INSTANCE.load();
|
||||
|
||||
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, new HomeFragment()).commit();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,42 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
||||
public class Coupon {
|
||||
|
||||
/**
|
||||
* fields need to be public for the database to be able to use them
|
||||
*/
|
||||
@NonNull
|
||||
private String code;
|
||||
|
||||
@NonNull
|
||||
private String reward;
|
||||
|
||||
|
||||
public Coupon(@NonNull String code, @NotNull String reward) {
|
||||
this.code = code;
|
||||
this.reward = reward;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public void setCode(@NonNull String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public void setReward(@NonNull String reward) {
|
||||
this.reward = reward;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,88 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Data {
|
||||
|
||||
private float distanceTraveled;
|
||||
|
||||
private int locationsVisited;
|
||||
|
||||
private int totalTime;
|
||||
|
||||
private List<Coupon> couponList;
|
||||
|
||||
private Location nextLocation;
|
||||
|
||||
private Location lastLocation;
|
||||
|
||||
private Route currentRoute;
|
||||
|
||||
|
||||
public Data() {
|
||||
this.distanceTraveled = 0;
|
||||
this.locationsVisited = 0;
|
||||
this.totalTime = 0;
|
||||
couponList = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public float getDistanceTraveled() {
|
||||
return distanceTraveled;
|
||||
}
|
||||
|
||||
public void setDistanceTraveled(float distanceTraveled) {
|
||||
this.distanceTraveled = distanceTraveled;
|
||||
}
|
||||
|
||||
public int getLocationsVisited() {
|
||||
return locationsVisited;
|
||||
}
|
||||
|
||||
public void setLocationsVisited(int locationsVisited) {
|
||||
this.locationsVisited = locationsVisited;
|
||||
}
|
||||
|
||||
public int getTotalTime() {
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
public void setTotalTime(int totalTime) {
|
||||
this.totalTime = totalTime;
|
||||
}
|
||||
|
||||
public List<Coupon> getCouponList() {
|
||||
return couponList;
|
||||
}
|
||||
|
||||
public void setCouponList(List<Coupon> couponList) {
|
||||
this.couponList = couponList;
|
||||
}
|
||||
|
||||
public Location getNextLocation() {
|
||||
return nextLocation;
|
||||
}
|
||||
|
||||
public void setNextLocation(Location nextLocation) {
|
||||
this.nextLocation = nextLocation;
|
||||
}
|
||||
|
||||
public Location getLastLocation() {
|
||||
return lastLocation;
|
||||
}
|
||||
|
||||
public void setLastLocation(Location lastLocation) {
|
||||
this.lastLocation = lastLocation;
|
||||
}
|
||||
|
||||
public Route getCurrentRoute() {
|
||||
return currentRoute;
|
||||
}
|
||||
|
||||
public void setCurrentRoute(Route currentRoute) {
|
||||
this.currentRoute = currentRoute;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,56 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
public class FileIO {
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
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();
|
||||
try {
|
||||
InputStream is = am.open(fileName);
|
||||
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;
|
||||
}
|
||||
|
||||
public void writeFileData(T objectToWrite) {
|
||||
//TODO make
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,93 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
public class Location {
|
||||
|
||||
@NonNull
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* coordinates will be saved as for example: 2.434343,4.65656;3.656565,6.43434
|
||||
* so lat1,long1;lat2,long2
|
||||
*/
|
||||
private String coordinates;
|
||||
private String description;
|
||||
|
||||
@Nullable
|
||||
private String imageUrl;
|
||||
|
||||
public Location(@NotNull String name, String coordinates, String description, @Nullable String imageUrl) {
|
||||
this.name = name;
|
||||
this.coordinates = coordinates;
|
||||
this.description = description;
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public Location(@NotNull String name, double latCoord, double longCoord, String description, @Nullable String imageUrl) {
|
||||
this(name,getStringFromCoordinates(latCoord,longCoord),description,imageUrl);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(@NotNull String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getCoordinates() {
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
public void setCoordinates(String coordinates) {
|
||||
this.coordinates = coordinates;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getImageUrl() {
|
||||
return imageUrl;
|
||||
}
|
||||
|
||||
public void setImageUrl(@Nullable String imageUrl) {
|
||||
this.imageUrl = imageUrl;
|
||||
}
|
||||
|
||||
public double[] getCoordinatesAsDoubles() {
|
||||
double[] res = new double[2];
|
||||
res[0] = getLat();
|
||||
res[1] = getLong();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return Double.parseDouble(this.coordinates.split(",")[0]);
|
||||
}
|
||||
|
||||
public double getLong() {
|
||||
return Double.parseDouble(this.coordinates.split(",")[1]);
|
||||
}
|
||||
|
||||
public static String getStringFromCoordinates(double lat1, double long1) {
|
||||
return lat1 + "," + long1;
|
||||
}
|
||||
|
||||
public GeoPoint convertToGeoPoint() {
|
||||
return new GeoPoint(this.getLat(),this.getLong());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,72 @@
|
||||
package com.a1.nextlocation.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Route {
|
||||
|
||||
|
||||
@NonNull
|
||||
private String name;
|
||||
|
||||
|
||||
private List<Location> locations;
|
||||
|
||||
|
||||
private float totalDistance;
|
||||
|
||||
|
||||
private int totalTime;
|
||||
|
||||
public Route(@NotNull String name) {
|
||||
|
||||
this.name = name;
|
||||
this.locations = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
||||
public void addLocation(Location location) {
|
||||
this.locations.add(location);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(@NotNull String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<Location> getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public void setLocations(List<Location> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public float getTotalDistance() {
|
||||
//TODO calculate total distance according to all locations in list
|
||||
return totalDistance;
|
||||
}
|
||||
|
||||
|
||||
public int getTotalTime() {
|
||||
//TODO calculate total time according to all locations in list
|
||||
return totalTime;
|
||||
}
|
||||
|
||||
public void setTotalDistance(float totalDistance) {
|
||||
this.totalDistance = totalDistance;
|
||||
}
|
||||
|
||||
public void setTotalTime(int totalTime) {
|
||||
this.totalTime = totalTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,59 @@
|
||||
package com.a1.nextlocation.fragments;
|
||||
|
||||
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
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 androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.recyclerview.CouponListManager;
|
||||
import com.a1.nextlocation.recyclerview.CustomOverlay;
|
||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||
import com.a1.nextlocation.recyclerview.RouteListManager;
|
||||
|
||||
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.Overlay;
|
||||
import org.osmdroid.views.overlay.OverlayItem;
|
||||
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;
|
||||
|
||||
public class HomeFragment extends Fragment {
|
||||
private final String userAgent = "com.ai.nextlocation.fragments";
|
||||
private MapView mapView;
|
||||
private final int REQUEST_PERMISSIONS_REQUEST_CODE = 1;
|
||||
private final String TAG = HomeFragment.class.getCanonicalName();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
requestPermissionsIfNecessary(
|
||||
// if you need to show the current location request FINE_LOCATION permission
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
// WRITE_EXTERNAL_STORAGE is required in order to show the map
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
|
||||
}
|
||||
|
||||
@@ -23,5 +62,94 @@ public class HomeFragment extends Fragment {
|
||||
Bundle savedInstanceState) {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_home, container, false);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
initMap(view);
|
||||
}
|
||||
|
||||
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.setDestroyMode(false);
|
||||
mapView.setTag("mapView");
|
||||
mapView.setMultiTouchControls(true);
|
||||
|
||||
// get the location provider
|
||||
GpsMyLocationProvider gpsMyLocationProvider = new GpsMyLocationProvider(this.requireContext());
|
||||
|
||||
// add the compass overlay
|
||||
CompassOverlay compassOverlay = new CompassOverlay(requireContext(),new InternalCompassOrientationProvider(requireContext()),mapView);
|
||||
compassOverlay.enableCompass();
|
||||
mapView.getOverlays().add(compassOverlay);
|
||||
|
||||
// add the location overlay
|
||||
MyLocationNewOverlay mLocationOverlay = new MyLocationNewOverlay(gpsMyLocationProvider, mapView);
|
||||
mLocationOverlay.enableFollowLocation();
|
||||
mLocationOverlay.enableMyLocation();
|
||||
mapView.getOverlays().add(mLocationOverlay);
|
||||
|
||||
CustomOverlay customOverlay = new CustomOverlay(getResources().getDrawable(R.drawable.ic_baseline_location_on_24),mapView);
|
||||
|
||||
for (com.a1.nextlocation.data.Location l : LocationListManager.INSTANCE.getLocationList()) {
|
||||
GeoPoint p = new GeoPoint(l.getLat(), l.getLong());
|
||||
OverlayItem overlayItem = new OverlayItem(l.getName(),l.getDescription(), p);
|
||||
|
||||
customOverlay.addOverlayItem(overlayItem);
|
||||
Log.d(TAG, "initMap: " + "succes");
|
||||
}
|
||||
|
||||
|
||||
mapView.getOverlays().add(customOverlay);
|
||||
|
||||
// add the zoom controller
|
||||
IMapController mapController = mapView.getController();
|
||||
mapController.setZoom(15.0);
|
||||
|
||||
// add location manager and set the start point
|
||||
LocationManager locationManager = (LocationManager) requireActivity().getSystemService(Context.LOCATION_SERVICE);
|
||||
|
||||
|
||||
try {
|
||||
Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
|
||||
GeoPoint startPoint = new GeoPoint(location.getLatitude(), location.getLongitude());
|
||||
mapController.setCenter(startPoint);
|
||||
|
||||
} catch (SecurityException e) {
|
||||
Log.d(TAG, "onViewCreated: exception while getting location: " + e.getLocalizedMessage());
|
||||
|
||||
requestPermissionsIfNecessary(
|
||||
// if you need to show the current location request FINE_LOCATION permission
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
// WRITE_EXTERNAL_STORAGE is required in order to show the map
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private void requestPermissionsIfNecessary(String... permissions) {
|
||||
ArrayList<String> permissionsToRequest = new ArrayList<>();
|
||||
if (this.getContext() != null)
|
||||
for (String permission : permissions) {
|
||||
if (ContextCompat.checkSelfPermission(this.getContext(), permission)
|
||||
!= PackageManager.PERMISSION_GRANTED) {
|
||||
// Permission is not granted
|
||||
permissionsToRequest.add(permission);
|
||||
}
|
||||
}
|
||||
if (permissionsToRequest.size() > 0 && this.getActivity() != null) {
|
||||
ActivityCompat.requestPermissions(
|
||||
this.getActivity(),
|
||||
permissionsToRequest.toArray(new String[0]),
|
||||
REQUEST_PERMISSIONS_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,29 @@ package com.a1.nextlocation.fragments;
|
||||
|
||||
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 com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
import com.a1.nextlocation.network.ApiHandler;
|
||||
import com.a1.nextlocation.network.DirectionsListener;
|
||||
|
||||
public class RouteFragment extends Fragment {
|
||||
private static final String TAG = RouteFragment.class.getCanonicalName();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
ApiHandler.INSTANCE.addListener(this::onDirectionsAvailable);
|
||||
|
||||
}
|
||||
|
||||
@@ -24,4 +34,21 @@ public class RouteFragment extends Fragment {
|
||||
// Inflate the layout for this fragment
|
||||
return inflater.inflate(R.layout.fragment_route, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
// ApiHandler.INSTANCE.getDirections(8.681436,49.41461,8.687872,49.420318);
|
||||
Route r = new Route("test");
|
||||
r.addLocation(new Location("test",8.681436,49.41461,"route",null));
|
||||
r.addLocation(new Location("test",8.687872,49.420318,"route",null));
|
||||
ApiHandler.INSTANCE.getDirections(r);
|
||||
}
|
||||
|
||||
public void onDirectionsAvailable(DirectionsResult result) {
|
||||
Log.d(TAG, "onDirectionsAvailable: got result! " + result);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,17 @@ package com.a1.nextlocation.fragments;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.a1.nextlocation.MainActivity;
|
||||
import com.a1.nextlocation.R;
|
||||
|
||||
public class SettingsFragment extends Fragment {
|
||||
@@ -15,13 +20,25 @@ public class SettingsFragment extends Fragment {
|
||||
@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_settings, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
// Inflate the layout for this fragment
|
||||
Spinner dropdown = view.findViewById(R.id.dropdown_menu_Settings);
|
||||
|
||||
String[] items = new String[]{"Nederlands", "Engels", "Chinees"};
|
||||
ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
|
||||
|
||||
dropdown.setAdapter(arrayAdapter);
|
||||
}
|
||||
}
|
||||
164
app/src/main/java/com/a1/nextlocation/json/DirectionsResult.java
Normal file
164
app/src/main/java/com/a1/nextlocation/json/DirectionsResult.java
Normal file
@@ -0,0 +1,164 @@
|
||||
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.json.JSONArray;
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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");
|
||||
|
||||
for (JsonElement element : segments) {
|
||||
JsonObject segment = element.getAsJsonObject();
|
||||
|
||||
setDistance(segment.get("distance").getAsDouble());
|
||||
setDuration(segment.get("duration").getAsDouble());
|
||||
|
||||
JsonArray steps = segment.getAsJsonArray("steps");
|
||||
|
||||
for (JsonElement j : steps) {
|
||||
|
||||
DirectionsStep step = gson.fromJson(j,DirectionsStep.class);
|
||||
double lat;
|
||||
double longl;
|
||||
|
||||
// kinda stinky but it works
|
||||
for (int i = 0; i < 2; i++) {
|
||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
||||
step.getWaypoints()[i] = new GeoPoint(lat,longl);
|
||||
}
|
||||
|
||||
addStep(step);
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
for (JsonElement e : segments) {
|
||||
JsonObject segment = e.getAsJsonObject();
|
||||
|
||||
setDistance(segment.get("distance").getAsDouble());
|
||||
setDuration(segment.get("duration").getAsDouble());
|
||||
|
||||
JsonArray steps = segment.getAsJsonArray("steps");
|
||||
|
||||
for (JsonElement j : steps) {
|
||||
|
||||
DirectionsStep step = gson.fromJson(j,DirectionsStep.class);
|
||||
double lat;
|
||||
double longl;
|
||||
|
||||
// kinda stinky but it works
|
||||
for (int i = 0; i < 2; i++) {
|
||||
lat = this.wayPointCoordinates[step.getWay_points().get(i)][0];
|
||||
longl = this.wayPointCoordinates[step.getWay_points().get(i)][1];
|
||||
step.getWaypoints()[i] = new GeoPoint(lat,longl);
|
||||
}
|
||||
|
||||
addStep(step);
|
||||
Log.d(TAG, "parse: added step" + step);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.a1.nextlocation.json;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
/**
|
||||
* source: https://github.com/GIScience/openrouteservice-docs#geometry-decoding
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
130
app/src/main/java/com/a1/nextlocation/network/ApiHandler.java
Normal file
130
app/src/main/java/com/a1/nextlocation/network/ApiHandler.java
Normal file
@@ -0,0 +1,130 @@
|
||||
package com.a1.nextlocation.network;
|
||||
|
||||
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 com.google.gson.JsonObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
|
||||
public enum ApiHandler {
|
||||
INSTANCE;
|
||||
|
||||
|
||||
private static String TAG = ApiHandler.class.getCanonicalName();
|
||||
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
|
||||
private final String BASE_URL = "https://api.openrouteservice.org/v2/directions/";
|
||||
private final String API_KEY = "5b3ce3597851110001cf6248d4eee2099f724255918adc71cc502b2a";
|
||||
private final String DIRECTIONS_MODE = "foot-walking";
|
||||
private List<DirectionsListener> listeners = new ArrayList<>();
|
||||
|
||||
private OkHttpClient client = new OkHttpClient();
|
||||
|
||||
public void getDirections(Location startLocation, Location endLocation) {
|
||||
getDirections(startLocation.getCoordinates(),endLocation.getCoordinates());
|
||||
}
|
||||
|
||||
public void getDirections(double startLat, double startLong, double endLat, double endLong) {
|
||||
getDirections(startLat + "," + startLong, endLat + "," + endLong);
|
||||
}
|
||||
|
||||
public void getDirections(String startLocation, String endLocation) {
|
||||
|
||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY + "&start=" +startLocation + "&end=" + endLocation;
|
||||
Thread t = new Thread(() -> {
|
||||
|
||||
Request request = new Request.Builder().url(requestUrl).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);
|
||||
|
||||
DirectionsResult result = new DirectionsResult();
|
||||
result.parse(responseString);
|
||||
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
||||
|
||||
for (DirectionsListener listener : listeners) {
|
||||
listener.onDirectionsAvailable(result);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, "getDirections: caught exception: " + e.getLocalizedMessage());
|
||||
}
|
||||
});
|
||||
|
||||
t.start();
|
||||
|
||||
}
|
||||
|
||||
public void addListener(DirectionsListener listener) {
|
||||
this.listeners.add(listener);
|
||||
}
|
||||
|
||||
public void getDirections(Route route) {
|
||||
// for (int i = 0; i < route.getLocations().size()-1; i+= 2) {
|
||||
// Location start = route.getLocations().get(i);
|
||||
// Location end = route.getLocations().get(i+1);
|
||||
// getDirections(start,end);
|
||||
// }
|
||||
|
||||
ArrayList<double[]> allCoords = new ArrayList<>();
|
||||
for (Location location : route.getLocations()) {
|
||||
allCoords.add(location.getCoordinatesAsDoubles());
|
||||
}
|
||||
|
||||
String body = "{\"coordinates\":" + new Gson().toJson(allCoords) + "}";
|
||||
|
||||
|
||||
String requestUrl = BASE_URL + DIRECTIONS_MODE + "?api_key=" + API_KEY;
|
||||
|
||||
Thread t = new Thread(() -> {
|
||||
|
||||
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);
|
||||
|
||||
DirectionsResult result = new DirectionsResult();
|
||||
result.parseRoute(responseString);
|
||||
Log.d(TAG, "getDirections: " + result.getSteps().size());
|
||||
|
||||
for (DirectionsListener listener : listeners) {
|
||||
listener.onDirectionsAvailable(result);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
Log.d(TAG, "getDirections: caught exception: " + e.getLocalizedMessage());
|
||||
}
|
||||
});
|
||||
|
||||
t.start();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.a1.nextlocation.network;
|
||||
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.a1.nextlocation.json.DirectionsResult;
|
||||
|
||||
public interface DirectionsListener {
|
||||
void onDirectionsAvailable(DirectionsResult result);
|
||||
}
|
||||
@@ -1,8 +1,61 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class CouponAdapter {
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
class CouponViewHolder {
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
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 OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int clickedPosition);
|
||||
}
|
||||
|
||||
class CouponViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
|
||||
public CouponViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
clickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
public CouponAdapter(Context context, List<Coupon> coupon, OnItemClickListener listener){
|
||||
appContext = context;
|
||||
couponList = coupon;
|
||||
clickListener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public CouponViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull CouponViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return couponList.size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class CouponListManager {
|
||||
import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.Coupon;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum CouponListManager {
|
||||
INSTANCE;
|
||||
|
||||
private List<Coupon> couponList;
|
||||
private Context context;
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
this.couponList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<Coupon> getCouponList() {
|
||||
return couponList;
|
||||
}
|
||||
|
||||
public Coupon getCoupon(int place) {
|
||||
return couponList.get(place);
|
||||
}
|
||||
|
||||
public void load(){
|
||||
CouponLoader couponLoader = new CouponLoader(this.context);
|
||||
this.couponList = couponLoader.load();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class CouponLoader {
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.a1.nextlocation.data.Coupon;
|
||||
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.Arrays;
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Coupon> load() {
|
||||
FileIO<ArrayList<Coupon>> fileIO = new FileIO<>();
|
||||
ArrayList<Coupon> res = fileIO.readFileData(context, "coupons.json",new TypeToken<ArrayList<Coupon>>(){}.getType());
|
||||
Log.d(TAG, "load: " + res);
|
||||
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import org.osmdroid.api.IMapView;
|
||||
import org.osmdroid.views.MapView;
|
||||
import org.osmdroid.views.overlay.ItemizedOverlay;
|
||||
import org.osmdroid.views.overlay.OverlayItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CustomOverlay extends ItemizedOverlay<OverlayItem> {
|
||||
private final MapView mapView;
|
||||
private ArrayList<OverlayItem> overlayItems = new ArrayList<>();
|
||||
|
||||
public CustomOverlay(Drawable pDefaultMarker, MapView mapView) {
|
||||
super(pDefaultMarker);
|
||||
this.mapView = mapView;
|
||||
|
||||
}
|
||||
|
||||
public void addOverlayItem(OverlayItem item) {
|
||||
overlayItems.add(item);
|
||||
populate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected OverlayItem createItem(int i) {
|
||||
return overlayItems.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return overlayItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onSnapToItem(int x, int y, Point snapPoint, IMapView mapView) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public interface Loader<T> {
|
||||
T load();
|
||||
}
|
||||
@@ -1,8 +1,70 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class LocationAdapter {
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
class LocationViewHolder {
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.a1.nextlocation.R;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LocationAdapter extends RecyclerView.Adapter<LocationAdapter.LocationViewHolder> {
|
||||
|
||||
private Context appContext;
|
||||
private List<Location> locationList;
|
||||
private CouponAdapter.OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int clickedPosition);
|
||||
}
|
||||
|
||||
class LocationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
|
||||
private TextView locationName;
|
||||
|
||||
public LocationViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
this.locationName = itemView.findViewById(R.id.location_name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
clickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
|
||||
public void setTextViewText(String text){
|
||||
locationName.setText(text);
|
||||
}
|
||||
}
|
||||
|
||||
public LocationAdapter(Context context, List<Location> location, CouponAdapter.OnItemClickListener listener){
|
||||
this.appContext = context;
|
||||
this.locationList = location;
|
||||
this.clickListener = listener;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull LocationAdapter.LocationViewHolder holder, int position) {
|
||||
Location location = locationList.get(position);
|
||||
holder.setTextViewText(location.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return locationList.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,36 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class LocationListManager {
|
||||
import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.Location;
|
||||
|
||||
import org.osmdroid.util.GeoPoint;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum LocationListManager {
|
||||
INSTANCE;
|
||||
|
||||
private List<Location> locationList;
|
||||
private Context context;
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
this.locationList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public List<Location> getLocationList() {
|
||||
return locationList;
|
||||
}
|
||||
|
||||
public Location getLocation(int place) {
|
||||
return locationList.get(place);
|
||||
}
|
||||
|
||||
public void load() {
|
||||
LocationLoader locationLoader = new LocationLoader(this.context);
|
||||
this.locationList = locationLoader.load();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class LocationLoader {
|
||||
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.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class LocationLoader implements Loader<List<Location>> {
|
||||
private final Context context;
|
||||
|
||||
public LocationLoader(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Location> load() {
|
||||
FileIO<ArrayList<Location>> fileIO = new FileIO<>();
|
||||
|
||||
ArrayList<Location> res = fileIO.readFileData(context,"locations.json",new TypeToken<ArrayList<Location>>(){}.getType());
|
||||
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,57 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class RouteAdapter {
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
class RouteViewHolder {
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.a1.nextlocation.data.Route;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHolder>{
|
||||
|
||||
private Context appContext;
|
||||
private List<Route> routeList;
|
||||
private CouponAdapter.OnItemClickListener clickListener;
|
||||
|
||||
public interface OnItemClickListener {
|
||||
void onItemClick(int clickedPosition);
|
||||
}
|
||||
|
||||
class RouteViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
|
||||
public RouteViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
clickListener.onItemClick(getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
public RouteAdapter(Context context, List<Route> route, CouponAdapter.OnItemClickListener listener){
|
||||
appContext = context;
|
||||
routeList = route;
|
||||
clickListener = listener;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RouteAdapter.RouteViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RouteAdapter.RouteViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return routeList.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class RouteListManager {
|
||||
import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.Route;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum RouteListManager{
|
||||
INSTANCE;
|
||||
|
||||
private List<Route> routeList;
|
||||
private Context context;
|
||||
|
||||
public void setContext(Context context) {
|
||||
this.context = context;
|
||||
this.routeList = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
public List<Route> getRouteList() {
|
||||
return routeList;
|
||||
}
|
||||
|
||||
public Route getRoute(int place) {
|
||||
return routeList.get(place);
|
||||
}
|
||||
|
||||
public void load() {
|
||||
RouteLoader routeLoader = new RouteLoader(this.context);
|
||||
this.routeList = routeLoader.load();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
package com.a1.nextlocation.recyclerview;
|
||||
|
||||
public class RouteLoader {
|
||||
import android.content.Context;
|
||||
|
||||
import com.a1.nextlocation.data.FileIO;
|
||||
import com.a1.nextlocation.data.Location;
|
||||
import com.a1.nextlocation.data.Route;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class RouteLoader implements Loader<List<Route>> {
|
||||
private final Context context;
|
||||
|
||||
public RouteLoader(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<Route> load() {
|
||||
|
||||
FileIO<ArrayList<Route>> fileIO = new FileIO<>();
|
||||
ArrayList<Route> res = fileIO.readFileData(context, "routes.json",new TypeToken<ArrayList<Route>>(){}.getType());
|
||||
return res == null ? new ArrayList<>() : res;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
10
app/src/main/res/drawable/ic_back_button_24.xml
Normal file
10
app/src/main/res/drawable/ic_back_button_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.77,3.77l-1.77,-1.77l-10,10l10,10l1.77,-1.77l-8.23,-8.23z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_graphic_eq_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_graphic_eq_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M7,18h2L9,6L7,6v12zM11,22h2L13,2h-2v20zM3,14h2v-4L3,10v4zM15,18h2L17,6h-2v12zM19,10v4h2v-4h-2z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_info_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_info_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_location_on_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_location_on_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@color/primaryColour"
|
||||
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_outlined_flag_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_outlined_flag_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M14,6l-1,-2L5,4v17h2v-7h5l1,2h7L20,6h-6zM18,14h-4l-1,-2L7,12L7,6h5l1,2h5v6z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_play_arrow_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M8,5v14l11,-7z"/>
|
||||
</vector>
|
||||
10
app/src/main/res/drawable/ic_baseline_settings_24.xml
Normal file
10
app/src/main/res/drawable/ic_baseline_settings_24.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.14,12.94c0.04,-0.3 0.06,-0.61 0.06,-0.94c0,-0.32 -0.02,-0.64 -0.07,-0.94l2.03,-1.58c0.18,-0.14 0.23,-0.41 0.12,-0.61l-1.92,-3.32c-0.12,-0.22 -0.37,-0.29 -0.59,-0.22l-2.39,0.96c-0.5,-0.38 -1.03,-0.7 -1.62,-0.94L14.4,2.81c-0.04,-0.24 -0.24,-0.41 -0.48,-0.41h-3.84c-0.24,0 -0.43,0.17 -0.47,0.41L9.25,5.35C8.66,5.59 8.12,5.92 7.63,6.29L5.24,5.33c-0.22,-0.08 -0.47,0 -0.59,0.22L2.74,8.87C2.62,9.08 2.66,9.34 2.86,9.48l2.03,1.58C4.84,11.36 4.8,11.69 4.8,12s0.02,0.64 0.07,0.94l-2.03,1.58c-0.18,0.14 -0.23,0.41 -0.12,0.61l1.92,3.32c0.12,0.22 0.37,0.29 0.59,0.22l2.39,-0.96c0.5,0.38 1.03,0.7 1.62,0.94l0.36,2.54c0.05,0.24 0.24,0.41 0.48,0.41h3.84c0.24,0 0.44,-0.17 0.47,-0.41l0.36,-2.54c0.59,-0.24 1.13,-0.56 1.62,-0.94l2.39,0.96c0.22,0.08 0.47,0 0.59,-0.22l1.92,-3.32c0.12,-0.22 0.07,-0.47 -0.12,-0.61L19.14,12.94zM12,15.6c-1.98,0 -3.6,-1.62 -3.6,-3.6s1.62,-3.6 3.6,-3.6s3.6,1.62 3.6,3.6S13.98,15.6 12,15.6z"/>
|
||||
</vector>
|
||||
284
app/src/main/res/layout-land/fragment_coupon.xml
Normal file
284
app/src/main/res/layout-land/fragment_coupon.xml
Normal file
@@ -0,0 +1,284 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.CouponFragment">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/coupons"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Code"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Waarde"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="FRISDRANKJE20"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Frisdrank"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CHOCOMEL30"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Chocomel"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box5"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="FRISTI200"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2x Fristi"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/ButtonActivate"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box4"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OLA30"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk5"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Waterijsje"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/ButtonActivate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:text="Activate"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
55
app/src/main/res/layout-land/fragment_location_detail.xml
Normal file
55
app/src/main/res/layout-land/fragment_location_detail.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.LocationDetailFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_location_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Locatie detail"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/detail_location_image"
|
||||
android:layout_width="309dp"
|
||||
android:layout_height="283dp"
|
||||
android:layout_marginStart="30dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_location_text"
|
||||
android:layout_width="309dp"
|
||||
android:layout_height="283dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:background="@color/secondaryColour"
|
||||
android:text="Detail tekst"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/detail_location_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="30dp"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/detail_location_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/detail_location_name"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
83
app/src/main/res/layout-land/fragment_route_detail.xml
Normal file
83
app/src/main/res/layout-land/fragment_route_detail.xml
Normal file
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.RouteDetailFragment">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/routeDetailBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/routeTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/routeTitle"
|
||||
app:layout_constraintEnd_toStartOf="@id/routeTitle"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="250dp"
|
||||
android:text="titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
|
||||
app:layout_constraintEnd_toStartOf="@+id/routeDetailText"
|
||||
app:layout_constraintStart_toEndOf="@id/routeDetailBackButton"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/routeDetailImage"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_marginEnd="350dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeDetailText"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/routeDetailImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/startRouteButton"
|
||||
android:src="@drawable/ic_baseline_play_arrow_24"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:scaleX="5"
|
||||
android:scaleY="5"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginStart="350dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/startRouteText"
|
||||
app:layout_constraintEnd_toStartOf="@id/startRouteText"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/startRouteText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startRouteText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="@string/start_route"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/startRouteButton"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -11,28 +11,18 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/scroller_devider"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/scroller_devider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="32dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/navbar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
android:showAsAction="always|withText"
|
||||
android:id="@+id/navbar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
app:itemIconTint="@color/primaryColour"
|
||||
app:itemIconTint="@color/secondaryColour"
|
||||
app:itemTextColor="@color/primaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -40,6 +30,39 @@
|
||||
app:menu="@menu/navmenu"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/topBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="50dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/fragment_layout"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@color/primaryColour"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/infoButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_baseline_info_24"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/topBar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/topBar"
|
||||
android:tint="@color/secondaryColour"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toEndOf="@id/infoButton"
|
||||
app:layout_constraintTop_toTopOf="@id/topBar"
|
||||
app:layout_constraintBottom_toBottomOf="@id/topBar"
|
||||
android:text="@string/app_name"
|
||||
android:textSize="25dp"
|
||||
android:textColor="@color/secondaryColour"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,284 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.CouponFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/coupons"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Code"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Waarde"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="FRISDRANKJE20"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Frisdrank"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="CHOCOMEL30"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Chocomel"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box5"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="FRISTI200"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="2x Fristi"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box5"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/ButtonActivate"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box4"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="OLA30"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk5"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="1x Waterijsje"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk5"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/ButtonActivate"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:text="Activate"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box5"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -5,10 +5,10 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".fragments.HomeFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
|
||||
<org.osmdroid.views.MapView
|
||||
android:id="@+id/mapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,14 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.LocationFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
android:id="@+id/location_RV"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:text="Locations"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/routeBackButton"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</FrameLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/routeBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/buttonColour"
|
||||
android:text="Back"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/routeBackButton" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.LocationDetailFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
android:id="@+id/detail_location_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="Locatie detail"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</FrameLayout>
|
||||
<ImageView
|
||||
android:id="@+id/detail_location_image"
|
||||
android:layout_width="357dp"
|
||||
android:layout_height="196dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_name"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/detail_location_text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/secondaryColour"
|
||||
android:text="Detail tekst"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/detail_location_image" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/detail_location_back_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/detail_location_name"
|
||||
app:layout_constraintEnd_toStartOf="@+id/detail_location_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/detail_location_name" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.RouteFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
<ImageButton
|
||||
android:id="@+id/routeBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
android:text="Back"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/routeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="9dp"
|
||||
android:text="titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintStart_toEndOf="@id/routeBackButton"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/routeListRV"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="@color/primaryColour"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/routeBackButton" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.RouteDetailFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
<ImageButton
|
||||
android:id="@+id/routeDetailBackButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="100dp"
|
||||
android:background="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@id/routeTitle"
|
||||
app:layout_constraintEnd_toStartOf="@id/routeTitle"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/routeTitle" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/routeTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="titel"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/routeDetailImage"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="250dp"
|
||||
android:layout_margin="40dp"
|
||||
android:id="@+id/routeDetailImage"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailBackButton"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/routeDetailText"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/routeDetailText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/startRouteText"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailImage" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/startRouteButton"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:scaleX="5"
|
||||
android:scaleY="5"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="70dp"
|
||||
android:layout_margin="20dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/startRouteText"
|
||||
app:layout_constraintEnd_toStartOf="@+id/startRouteText"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/startRouteText"
|
||||
android:src="@drawable/ic_baseline_play_arrow_24"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/startRouteText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:text="@string/start_route"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/startRouteButton"
|
||||
app:layout_constraintTop_toBottomOf="@id/routeDetailText" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,217 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.SettingsFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/settings"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/taal"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/dropdown_menu_Settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:tooltipText="Taal"
|
||||
android:spinnerMode="dropdown"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/imperiaal_systeem"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/_65_stand"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/kleurenblind"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,14 +1,224 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/primaryColour"
|
||||
tools:context=".fragments.StatisticFragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@string/hello_blank_fragment" />
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:backgroundTint="@color/primaryColour"
|
||||
android:src="@drawable/ic_back_button_24"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toStartOf="@+id/textView"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/textView" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/statistieken"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/totale_afstand"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" km"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box1"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/bezochte_locaties"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk2"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="GETAL"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk2"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:background="@color/secondaryColour"
|
||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/totale_tijd"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk3"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" minuten"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/Box4"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="70dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/Box3"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/coupons_gespaard"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<View
|
||||
android:id="@+id/Balk4"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="GETAL"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/Balk4"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
26
app/src/main/res/layout/location_item.xml
Normal file
26
app/src/main/res/layout/location_item.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/location_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/location_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="location"
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintStart_toEndOf="@+id/routeImage" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
27
app/src/main/res/layout/route_item.xml
Normal file
27
app/src/main/res/layout/route_item.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/secondaryColour"
|
||||
android:layout_margin="20dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:id="@+id/routeImage"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/routeName"
|
||||
android:text="test text"
|
||||
android:gravity="center"
|
||||
android:textSize="20dp"
|
||||
app:layout_constraintStart_toEndOf="@+id/routeImage"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -4,25 +4,25 @@
|
||||
<item
|
||||
android:id="@+id/locations"
|
||||
android:title="@string/locations"
|
||||
android:icon="@drawable/ic_placeholder"
|
||||
android:icon="@drawable/ic_baseline_outlined_flag_24"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/routes"
|
||||
android:title="@string/routes"
|
||||
android:icon="@drawable/ic_placeholder"
|
||||
android:icon="@drawable/ic_baseline_location_on_24"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/statistics"
|
||||
android:title="@string/statistics"
|
||||
android:icon="@drawable/ic_placeholder"
|
||||
android:icon="@drawable/ic_baseline_graphic_eq_24"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/settings"
|
||||
android:title="@string/settings"
|
||||
android:icon="@drawable/ic_placeholder"
|
||||
android:icon="@drawable/ic_baseline_settings_24"
|
||||
/>
|
||||
|
||||
</menu>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/purple_200</item>
|
||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
||||
|
||||
@@ -6,4 +6,15 @@
|
||||
<string name="routes">Routes</string>
|
||||
<string name="statistics">Statistieken</string>
|
||||
<string name="settings">Instellingen</string>
|
||||
<string name="taal">Taal</string>
|
||||
<string name="imperiaal_systeem">Imperiaal systeem</string>
|
||||
<string name="_65_stand">65+ stand</string>
|
||||
<string name="kleurenblind">Kleurenblind</string>
|
||||
<string name="statistieken">Statistieken</string>
|
||||
<string name="totale_afstand">Totale afstand:</string>
|
||||
<string name="bezochte_locaties">Bezochte locaties:</string>
|
||||
<string name="totale_tijd">Totale tijd:</string>
|
||||
<string name="coupons_gespaard">Coupons gespaard:</string>
|
||||
<string name="coupons">Coupons</string>
|
||||
<string name="start_route">Start Route</string>
|
||||
</resources>
|
||||
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Primary brand color. -->
|
||||
<item name="colorPrimary">@color/primaryColour</item>
|
||||
<!-- Secondary brand color. -->
|
||||
|
||||
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
#Tue Dec 08 10:31:45 CET 2020
|
||||
#Mon Dec 14 14:48:57 CET 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
|
||||
|
||||
Reference in New Issue
Block a user