Compare commits
9 Commits
geofence
...
fuckcolour
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f56cbe30a | ||
|
|
2f5b53e2b4 | ||
|
|
4c09192f9a | ||
|
|
8740362553 | ||
|
|
0663dabca5 | ||
|
|
e7f152bc00 | ||
|
|
f3dbb2b1d1 | ||
|
|
cf650f6cf4 | ||
|
|
c15125d0c2 |
@@ -40,10 +40,8 @@ dependencies {
|
|||||||
implementation 'com.google.android.material:material:1.2.1'
|
implementation 'com.google.android.material:material:1.2.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.gms:play-services-location:17.1.0'
|
|
||||||
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
implementation 'com.google.android.gms:play-services-maps:17.0.0'
|
||||||
testImplementation 'junit:junit:4.13.1'
|
testImplementation 'junit:junit:4.13.1'
|
||||||
// implementation "com.android.support:support-compat:28.0.0"
|
|
||||||
|
|
||||||
// okhttp
|
// okhttp
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
|
||||||
|
|||||||
@@ -25,11 +25,6 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<receiver android:name=".geofencing.GeoFenceBroadcastReceiver">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.USER_PRESENT" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -8,6 +8,7 @@ import android.view.View;
|
|||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.fragment.app.DialogFragment;
|
import androidx.fragment.app.DialogFragment;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
|
|||||||
@@ -11,15 +11,6 @@ public enum Data {
|
|||||||
private int locationsVisited = 0;
|
private int locationsVisited = 0;
|
||||||
private long totalTime = 0;
|
private long totalTime = 0;
|
||||||
private double zoom = 0;
|
private double zoom = 0;
|
||||||
private LocationProximityListener locationProximityListener;
|
|
||||||
|
|
||||||
public LocationProximityListener getLocationProximityListener() {
|
|
||||||
return locationProximityListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLocationProximityListener(LocationProximityListener locationProximityListener) {
|
|
||||||
this.locationProximityListener = locationProximityListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getZoom() {
|
public double getZoom() {
|
||||||
return zoom;
|
return zoom;
|
||||||
@@ -59,10 +50,5 @@ public enum Data {
|
|||||||
return locationsVisited;
|
return locationsVisited;
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
|
||||||
public interface LocationProximityListener {
|
|
||||||
void onLocationVisited(Location location);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,6 @@ public class Location implements Parcelable {
|
|||||||
private String imageUrl;
|
private String imageUrl;
|
||||||
private String iconUrl;
|
private String iconUrl;
|
||||||
|
|
||||||
private boolean visited;
|
|
||||||
|
|
||||||
public Location(@NotNull String name, String coordinates, String description, @Nullable String imageUrl) {
|
public Location(@NotNull String name, String coordinates, String description, @Nullable String imageUrl) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.coordinates = coordinates;
|
this.coordinates = coordinates;
|
||||||
@@ -173,12 +171,4 @@ public class Location implements Parcelable {
|
|||||||
parcel.writeString(description);
|
parcel.writeString(description);
|
||||||
parcel.writeString(imageUrl);
|
parcel.writeString(imageUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVisited() {
|
|
||||||
return visited;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVisited(boolean visited) {
|
|
||||||
this.visited = visited;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ package com.a1.nextlocation.fragments;
|
|||||||
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.app.NotificationChannel;
|
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@@ -21,7 +19,6 @@ import android.widget.Toast;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.app.ActivityCompat;
|
import androidx.core.app.ActivityCompat;
|
||||||
import androidx.core.app.NotificationCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
@@ -29,7 +26,6 @@ import androidx.fragment.app.FragmentActivity;
|
|||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
import com.a1.nextlocation.data.Data;
|
import com.a1.nextlocation.data.Data;
|
||||||
import com.a1.nextlocation.data.RouteHandler;
|
import com.a1.nextlocation.data.RouteHandler;
|
||||||
import com.a1.nextlocation.geofencing.GeofenceInitalizer;
|
|
||||||
import com.a1.nextlocation.json.DirectionsResult;
|
import com.a1.nextlocation.json.DirectionsResult;
|
||||||
import com.a1.nextlocation.network.ApiHandler;
|
import com.a1.nextlocation.network.ApiHandler;
|
||||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
import com.a1.nextlocation.recyclerview.LocationListManager;
|
||||||
@@ -64,8 +60,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
private int color;
|
private int color;
|
||||||
private Location currentLocation;
|
private Location currentLocation;
|
||||||
private Overlay allLocationsOverlay;
|
private Overlay allLocationsOverlay;
|
||||||
private GeofenceInitalizer initializer;
|
|
||||||
private final static String CHANNEL_ID = "next_location01";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -77,7 +71,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||||
|
|
||||||
color = requireContext().getColor(R.color.red);
|
color = requireContext().getColor(R.color.red);
|
||||||
Data.INSTANCE.setLocationProximityListener(this::onLocationVisited);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -148,7 +141,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
initializer = new GeofenceInitalizer(requireContext(),requireActivity());
|
|
||||||
initMap(view);
|
initMap(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,8 +217,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* displays the route that is currently being followed as a red line
|
* displays the route that is currently being followed as a red line
|
||||||
*/
|
*/
|
||||||
@@ -255,12 +245,11 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
private void addLocations() {
|
private void addLocations() {
|
||||||
// get the locations of the current route or all locations
|
// get the locations of the current route or all locations
|
||||||
List<com.a1.nextlocation.data.Location> locations = RouteHandler.INSTANCE.isFollowingRoute() ? RouteHandler.INSTANCE.getCurrentRoute().getLocations() : LocationListManager.INSTANCE.getLocationList();
|
List<com.a1.nextlocation.data.Location> locations = RouteHandler.INSTANCE.isFollowingRoute() ? RouteHandler.INSTANCE.getCurrentRoute().getLocations() : LocationListManager.INSTANCE.getLocationList();
|
||||||
initializer.removeGeoFences();
|
|
||||||
final ArrayList<OverlayItem> items = new ArrayList<>(locations.size());
|
final ArrayList<OverlayItem> items = new ArrayList<>(locations.size());
|
||||||
// marker icon
|
// marker icon
|
||||||
Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24);
|
Drawable marker = ContextCompat.getDrawable(requireContext(), R.drawable.ic_baseline_location_on_24);
|
||||||
marker.setAlpha(255);
|
marker.setAlpha(255);
|
||||||
marker.setTint(getResources().getColor(R.color.primaryColour));
|
marker.setTint(getResources().getColor(R.color.secondaryColour));
|
||||||
|
|
||||||
// add all locations to the overlay itemss
|
// add all locations to the overlay itemss
|
||||||
for (com.a1.nextlocation.data.Location location : locations) {
|
for (com.a1.nextlocation.data.Location location : locations) {
|
||||||
@@ -310,19 +299,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
mapView.getOverlays().add(allLocationsOverlay);
|
mapView.getOverlays().add(allLocationsOverlay);
|
||||||
Log.d(TAG, "addLocations: successfully added locations");
|
Log.d(TAG, "addLocations: successfully added locations");
|
||||||
|
|
||||||
addGeofences(locations);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* adds the geofences for the currently active locations
|
|
||||||
* @param locations the locations to add geofences for
|
|
||||||
*/
|
|
||||||
private void addGeofences(List<com.a1.nextlocation.data.Location> locations) {
|
|
||||||
|
|
||||||
Log.d(TAG, "addGeofences: adding geofences!");
|
|
||||||
|
|
||||||
initializer.init(locations);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -389,33 +365,6 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onLocationVisited(com.a1.nextlocation.data.Location location) {
|
|
||||||
Data.INSTANCE.visitLocation(location);
|
|
||||||
showNotification(location);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void showNotification(com.a1.nextlocation.data.Location location) {
|
|
||||||
|
|
||||||
NotificationManager mNotificationManager = (NotificationManager) requireActivity().getSystemService(Context.NOTIFICATION_SERVICE);
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
|
||||||
int importance = NotificationManager.IMPORTANCE_LOW;
|
|
||||||
NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, "next_location", importance);
|
|
||||||
notificationChannel.enableLights(true);
|
|
||||||
notificationChannel.enableVibration(true);
|
|
||||||
notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
|
|
||||||
mNotificationManager.createNotificationChannel(notificationChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(requireContext(),CHANNEL_ID)
|
|
||||||
.setSmallIcon(R.drawable.ic_launcher_foreground)
|
|
||||||
.setContentTitle(getString(R.string.notification_title))
|
|
||||||
.setContentText(getString(R.string.notification_text,location.getName()))
|
|
||||||
.setAutoCancel(true);
|
|
||||||
|
|
||||||
mNotificationManager.notify(0,mBuilder.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
// empty override methods for the LocationListener
|
// empty override methods for the LocationListener
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
|||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -13,11 +14,13 @@ import android.widget.ArrayAdapter;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
import androidx.appcompat.widget.SwitchCompat;
|
import androidx.appcompat.widget.SwitchCompat;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.fragment.app.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
|
import com.a1.nextlocation.MainActivity;
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -29,6 +32,7 @@ public class SettingsFragment extends Fragment {
|
|||||||
private SharedPreferences.Editor editor;
|
private SharedPreferences.Editor editor;
|
||||||
private SwitchCompat fontSwitch;
|
private SwitchCompat fontSwitch;
|
||||||
private SwitchCompat imperialSwitch;
|
private SwitchCompat imperialSwitch;
|
||||||
|
private SwitchCompat colorBlindMode;
|
||||||
private Refreshable refreshable;
|
private Refreshable refreshable;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -42,6 +46,7 @@ public class SettingsFragment extends Fragment {
|
|||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
editor = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).edit();
|
editor = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).edit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -94,17 +99,37 @@ public class SettingsFragment extends Fragment {
|
|||||||
if(fontSwitch.isChecked())
|
if(fontSwitch.isChecked())
|
||||||
{
|
{
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||||
editor.putBoolean("fontSwitch",true);
|
|
||||||
editor.apply();
|
|
||||||
}
|
}
|
||||||
if(!fontSwitch.isChecked())
|
if(!fontSwitch.isChecked())
|
||||||
{
|
{
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
requireActivity().setTheme(R.style.Theme_NextLocation);;
|
||||||
editor.putBoolean("fontSwitch",false);
|
|
||||||
editor.apply();
|
|
||||||
}
|
}
|
||||||
|
editor.putBoolean("fontSwitch",fontSwitch.isChecked());
|
||||||
|
editor.apply();
|
||||||
editor.commit();
|
editor.commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.colorBlindMode = view.findViewById(R.id.colourblindSwitch);
|
||||||
|
this.colorBlindMode.setChecked(sharedPreferences.getBoolean("colorBlindModeSwitch", false));
|
||||||
|
|
||||||
|
this.colorBlindMode.setOnClickListener(view1 -> {
|
||||||
|
editor.putBoolean("colorBlindModeSwitch", colorBlindMode.isChecked());
|
||||||
|
editor.apply();
|
||||||
|
editor.commit();
|
||||||
|
|
||||||
|
if (colorBlindMode.isChecked()){
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES);
|
||||||
|
getActivity().recreate();
|
||||||
|
System.out.println("AAN");
|
||||||
|
}else if (!colorBlindMode.isChecked()){
|
||||||
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
|
||||||
|
getActivity().recreate();
|
||||||
|
System.out.println("UIT");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeLanguageDropdown(View view) {
|
private void initializeLanguageDropdown(View view) {
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
package com.a1.nextlocation.geofencing;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.a1.nextlocation.data.Data;
|
|
||||||
import com.a1.nextlocation.data.Location;
|
|
||||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
|
||||||
import com.google.android.gms.location.Geofence;
|
|
||||||
import com.google.android.gms.location.GeofenceStatusCodes;
|
|
||||||
import com.google.android.gms.location.GeofencingEvent;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class GeoFenceBroadcastReceiver extends BroadcastReceiver {
|
|
||||||
private final String TAG = GeoFenceBroadcastReceiver.class.getCanonicalName();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReceive(Context context, Intent intent) {
|
|
||||||
|
|
||||||
GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);
|
|
||||||
Log.i(TAG, "onReceive: RECEIVED GEOFENCE STUFF");
|
|
||||||
|
|
||||||
if (geofencingEvent.hasError()) {
|
|
||||||
String errorMessage = GeofenceStatusCodes
|
|
||||||
.getStatusCodeString(geofencingEvent.getErrorCode());
|
|
||||||
Log.e(TAG, errorMessage);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the transition type.
|
|
||||||
int geofenceTransition = geofencingEvent.getGeofenceTransition();
|
|
||||||
|
|
||||||
switch (geofenceTransition) {
|
|
||||||
case Geofence.GEOFENCE_TRANSITION_ENTER:
|
|
||||||
List<Geofence> geofenceList = geofencingEvent.getTriggeringGeofences();
|
|
||||||
// loop through list of geofences
|
|
||||||
for (Geofence geofence : geofenceList) {
|
|
||||||
for (Location l : LocationListManager.INSTANCE.getLocationList()) {
|
|
||||||
if (geofence.getRequestId().equals(l.getName())) {
|
|
||||||
l.setVisited(true);
|
|
||||||
// let the homefragment know that we are close to a location
|
|
||||||
Data.INSTANCE.getLocationProximityListener().onLocationVisited(l);
|
|
||||||
Log.d(TAG, "onReceive: VISITED LOCATION " + l.getName());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case Geofence.GEOFENCE_TRANSITION_EXIT:
|
|
||||||
Log.d(TAG, "onReceive: exiting geofence...");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package com.a1.nextlocation.geofencing;
|
|
||||||
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.ContextWrapper;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.provider.SyncStateContract;
|
|
||||||
|
|
||||||
import com.google.android.gms.location.Geofence;
|
|
||||||
import com.google.android.gms.location.GeofencingRequest;
|
|
||||||
|
|
||||||
import org.osmdroid.util.GeoPoint;
|
|
||||||
|
|
||||||
public class GeoFencingHelper extends ContextWrapper {
|
|
||||||
private PendingIntent pendingIntent;
|
|
||||||
|
|
||||||
public GeoFencingHelper(Context base) {
|
|
||||||
super(base);
|
|
||||||
}
|
|
||||||
|
|
||||||
public GeofencingRequest getGeoFencingRequest(Geofence geofence) {
|
|
||||||
GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
|
|
||||||
builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
|
|
||||||
builder.addGeofence(geofence);
|
|
||||||
return builder.build();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Geofence getGeofence(String ID, GeoPoint point, float radius) {
|
|
||||||
|
|
||||||
return new Geofence.Builder()
|
|
||||||
.setCircularRegion(point.getLatitude(), point.getLongitude(), radius)
|
|
||||||
.setRequestId(ID)
|
|
||||||
.setTransitionTypes(Geofence.GEOFENCE_TRANSITION_ENTER |
|
|
||||||
Geofence.GEOFENCE_TRANSITION_EXIT)
|
|
||||||
.setLoiteringDelay(5000)
|
|
||||||
.setExpirationDuration(Geofence.NEVER_EXPIRE)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public PendingIntent getPendingIntent() {
|
|
||||||
if (pendingIntent != null) {
|
|
||||||
return pendingIntent;
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = new Intent(this, GeoFenceBroadcastReceiver.class);
|
|
||||||
pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
|
|
||||||
|
|
||||||
return pendingIntent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
package com.a1.nextlocation.geofencing;
|
|
||||||
|
|
||||||
import android.Manifest;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.core.app.ActivityCompat;
|
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
|
|
||||||
import com.a1.nextlocation.data.Data;
|
|
||||||
import com.a1.nextlocation.data.Location;
|
|
||||||
import com.a1.nextlocation.recyclerview.LocationListManager;
|
|
||||||
import com.google.android.gms.location.Geofence;
|
|
||||||
import com.google.android.gms.location.GeofencingClient;
|
|
||||||
import com.google.android.gms.location.GeofencingRequest;
|
|
||||||
import com.google.android.gms.location.LocationServices;
|
|
||||||
import com.google.android.gms.tasks.OnFailureListener;
|
|
||||||
import com.google.android.gms.tasks.OnSuccessListener;
|
|
||||||
|
|
||||||
import org.osmdroid.util.GeoPoint;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static android.content.ContentValues.TAG;
|
|
||||||
|
|
||||||
public class GeofenceInitalizer {
|
|
||||||
private final Activity activity;
|
|
||||||
private GeofencingClient geofencingClient;
|
|
||||||
private GeoFencingHelper geoFencingHelper;
|
|
||||||
private final Context context;
|
|
||||||
private final String TAG = GeofenceInitalizer.class.getCanonicalName();
|
|
||||||
private List<Location> locations;
|
|
||||||
private int BACKGROUND_LOCATION_ACCESS_REQUEST_CODE = 10002;
|
|
||||||
|
|
||||||
public GeofenceInitalizer(Context context, Activity activity) {
|
|
||||||
this.context = context;
|
|
||||||
this.activity = activity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void init(List<Location> locations) {
|
|
||||||
if (!checkFineLocationPermission()) return;
|
|
||||||
|
|
||||||
geofencingClient = LocationServices.getGeofencingClient(context);
|
|
||||||
geoFencingHelper = new GeoFencingHelper(context);
|
|
||||||
this.locations = locations;
|
|
||||||
if (Build.VERSION.SDK_INT >= 29) {
|
|
||||||
//If API is higher then 29 we need background permission
|
|
||||||
|
|
||||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
|
||||||
addFences();
|
|
||||||
} else {
|
|
||||||
//Permission is not granted!! Need to request it..
|
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.ACCESS_BACKGROUND_LOCATION)) {
|
|
||||||
//We show a dialog and ask for permission
|
|
||||||
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE);
|
|
||||||
} else {
|
|
||||||
ActivityCompat.requestPermissions(activity, new String[]{Manifest.permission.ACCESS_BACKGROUND_LOCATION}, BACKGROUND_LOCATION_ACCESS_REQUEST_CODE);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
addFences();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addFences() {
|
|
||||||
for (Location location : locations) {
|
|
||||||
GeoPoint t = new GeoPoint(location.getLat(), location.getLong());
|
|
||||||
addGeofence(t, location.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeGeoFences() {
|
|
||||||
geofencingClient = LocationServices.getGeofencingClient(context);
|
|
||||||
geoFencingHelper = new GeoFencingHelper(context);
|
|
||||||
|
|
||||||
PendingIntent pendingIntent = geoFencingHelper.getPendingIntent();
|
|
||||||
|
|
||||||
geofencingClient.removeGeofences(pendingIntent)
|
|
||||||
.addOnSuccessListener(aVoid -> Log.d(TAG, "Geofence is removed... "))
|
|
||||||
.addOnFailureListener(e -> Log.d(TAG, e.getLocalizedMessage()));
|
|
||||||
if (this.locations != null) this.locations.clear();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addGeofence(GeoPoint p, String name) {
|
|
||||||
if (!checkFineLocationPermission()) return;
|
|
||||||
|
|
||||||
Geofence geofence = geoFencingHelper.getGeofence(name, p, 45);
|
|
||||||
GeofencingRequest geofencingRequest = geoFencingHelper.getGeoFencingRequest(geofence);
|
|
||||||
PendingIntent pendingIntent = geoFencingHelper.getPendingIntent();
|
|
||||||
|
|
||||||
geofencingClient.addGeofences(geofencingRequest, pendingIntent).addOnSuccessListener(v -> {
|
|
||||||
Log.i(TAG, "addGeofence: added geofence");
|
|
||||||
}).addOnFailureListener(v -> {
|
|
||||||
Log.e(TAG, "addGeofence: failure adding geofence " + v.getMessage());
|
|
||||||
});
|
|
||||||
Log.i(TAG, "addGeofence: added geofence to client");
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean checkFineLocationPermission() {
|
|
||||||
return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
android:tint="#333333"
|
android:tint="#333333"
|
||||||
android:alpha="0.6">
|
android:alpha="0.6">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@android:color/white"
|
android:fillColor="@color/primaryColour"
|
||||||
android:pathData="M8,16h8V8H8V16zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2L12,2z"
|
android:pathData="M8,16h8V8H8V16zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10s10,-4.48 10,-10S17.52,2 12,2L12,2z"
|
||||||
android:fillType="evenOdd"/>
|
android:fillType="evenOdd"/>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
android:viewportHeight="24"
|
android:viewportHeight="24"
|
||||||
android:tint="?attr/colorControlNormal">
|
android:tint="?attr/colorControlNormal">
|
||||||
<path
|
<path
|
||||||
android:fillColor="@color/primaryColour"
|
android:fillColor="@color/secondaryColour"
|
||||||
android:pathData="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
|
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>
|
</vector>
|
||||||
|
|||||||
@@ -22,9 +22,9 @@
|
|||||||
android:id="@+id/navigation_bar"
|
android:id="@+id/navigation_bar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/white"
|
android:background="@color/primaryColour"
|
||||||
app:itemIconTint="@color/secondaryColour"
|
app:itemIconTint="@color/secondaryColour"
|
||||||
app:itemTextColor="@color/primaryColour"
|
app:itemTextColor="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
|
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.4"
|
app:layout_constraintHorizontal_bias="0.4"
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="20dp"
|
android:layout_marginStart="20dp"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
android:backgroundTint="@color/secondaryColour"
|
android:backgroundTint="@color/primaryColour"
|
||||||
android:src="@drawable/ic_baseline_outlined_flag_24"
|
android:src="@drawable/ic_baseline_outlined_flag_24"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
android:layout_marginEnd="20dp"
|
android:layout_marginEnd="20dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/location_list_button"
|
app:layout_constraintTop_toBottomOf="@+id/location_list_button"
|
||||||
android:backgroundTint="@color/secondaryColour"
|
android:backgroundTint="@color/primaryColour"
|
||||||
android:src="@drawable/ic_stop_icon"/>
|
android:src="@drawable/ic_stop_icon"/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="200dp"
|
android:layout_height="200dp"
|
||||||
android:layout_margin="20dp"
|
android:layout_margin="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:text=""
|
android:text=""
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
android:id="@+id/detail_location_text"
|
android:id="@+id/detail_location_text"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:text=""
|
android:text=""
|
||||||
/>
|
/>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/route_title"
|
android:id="@+id/route_title"
|
||||||
|
android:textColor="@color/secondaryColour"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="9dp"
|
android:layout_margin="9dp"
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
|
android:textColor="@color/secondaryColour"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.6"
|
app:layout_constraintHorizontal_bias="0.6"
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
android:layout_marginBottom="45dp"
|
android:layout_marginBottom="45dp"
|
||||||
android:backgroundTint="@color/secondaryColour"
|
android:backgroundTint="@color/secondaryColour"
|
||||||
android:text="@string/start_route"
|
android:text="@string/start_route"
|
||||||
android:textColor="@color/buttonColour"
|
android:textColor="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.498"
|
app:layout_constraintHorizontal_bias="0.498"
|
||||||
@@ -70,9 +71,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:text="@string/total_distance"
|
android:text="@string/total_distance"
|
||||||
android:textColor="@color/buttonColour"
|
android:textColor="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
|
app:layout_constraintBottom_toTopOf="@+id/start_route_button"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.498"
|
app:layout_constraintHorizontal_bias="0.498"
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:id="@+id/settingFragment"
|
android:id="@+id/settingFragment"
|
||||||
tools:context=".fragments.SettingsFragment">
|
tools:context=".fragments.SettingsFragment"
|
||||||
|
android:theme="@style/Theme.Switches">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageButton
|
<androidx.appcompat.widget.AppCompatImageButton
|
||||||
android:id="@+id/settings_back_button"
|
android:id="@+id/settings_back_button"
|
||||||
@@ -25,12 +26,22 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/settings"
|
android:text="@string/settings"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/name_box"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/name_box"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/name_box"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/name_box"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/name_box"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -39,16 +50,15 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/language"
|
android:text="@string/language"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||||
@@ -57,9 +67,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk"
|
android:id="@+id/Balk"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -79,12 +89,22 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box2"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box2"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box2"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box2"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box2"
|
android:id="@+id/Box2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -96,7 +116,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/imperial_system"
|
android:text="@string/imperial_system"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||||
@@ -105,9 +125,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk2"
|
android:id="@+id/Balk2"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -126,13 +146,22 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box3"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box3"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box3"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box3"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box3"
|
android:id="@+id/Box3"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/Box2"
|
app:layout_constraintTop_toBottomOf="@id/Box2"
|
||||||
@@ -142,7 +171,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/_65_mode"
|
android:text="@string/_65_mode"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||||
@@ -151,9 +180,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk3"
|
android:id="@+id/Balk3"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -168,6 +197,61 @@
|
|||||||
app:layout_constraintStart_toStartOf="@id/Balk3"
|
app:layout_constraintStart_toStartOf="@id/Balk3"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box4"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box4"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box4"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box4"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/Box4"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
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/primaryColour"
|
||||||
|
android:layout_marginHorizontal="20dp"
|
||||||
|
>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/colorblind"
|
||||||
|
android:textColor="@color/secondaryColour"
|
||||||
|
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="2dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/secondaryColour"
|
||||||
|
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:id="@+id/colourblindSwitch"
|
||||||
|
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>
|
||||||
|
|
||||||
|
|||||||
@@ -14,18 +14,27 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="@string/statistics"
|
android:text="@string/statistics"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="30sp"
|
android:textSize="30sp"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/name_box"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/name_box"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/name_box"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/name_box"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/name_box"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box2"
|
app:layout_constraintBottom_toTopOf="@id/Box2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -37,7 +46,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/total_distance"
|
android:text="@string/total_distance"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk"
|
app:layout_constraintEnd_toEndOf="@id/Balk"
|
||||||
@@ -46,9 +55,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk"
|
android:id="@+id/Balk"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -59,7 +68,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -69,12 +78,21 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box2"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box2"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box2"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box2"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box2"
|
android:id="@+id/Box2"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box3"
|
app:layout_constraintBottom_toTopOf="@id/Box3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -86,7 +104,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/visited_locations"
|
android:text="@string/visited_locations"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
app:layout_constraintEnd_toEndOf="@id/Balk2"
|
||||||
@@ -95,9 +113,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk2"
|
android:id="@+id/Balk2"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -108,7 +126,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -118,12 +136,21 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box3"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box3"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box3"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box3"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box3"
|
android:id="@+id/Box3"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toTopOf="@id/Box4"
|
app:layout_constraintBottom_toTopOf="@id/Box4"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -133,7 +160,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/total_time"
|
android:text="@string/total_time"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
app:layout_constraintEnd_toEndOf="@id/Balk3"
|
||||||
@@ -142,9 +169,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk3"
|
android:id="@+id/Balk3"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -155,7 +182,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -165,12 +192,21 @@
|
|||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/Box4"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/Box4"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@id/Box4"
|
||||||
|
app:layout_constraintRight_toRightOf="@id/Box4"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/Box4"
|
android:id="@+id/Box4"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="70dp"
|
android:layout_height="70dp"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.85"
|
app:layout_constraintHorizontal_bias="0.85"
|
||||||
@@ -182,7 +218,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/coupons_collected"
|
android:text="@string/coupons_collected"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
app:layout_constraintEnd_toEndOf="@id/Balk4"
|
||||||
@@ -191,9 +227,9 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/Balk4"
|
android:id="@+id/Balk4"
|
||||||
android:layout_width="1dp"
|
android:layout_width="2dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/black"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -204,7 +240,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:text="@string/help"
|
android:text="@string/help"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/secondaryColour"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:paddingVertical="10dp"/>
|
android:paddingVertical="10dp"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
android:layout_width="280dp"
|
android:layout_width="280dp"
|
||||||
android:layout_height="430dp"
|
android:layout_height="430dp"
|
||||||
android:text="@string/help_discription"
|
android:text="@string/help_discription"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/secondaryColour"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
|
android:backgroundTint="@color/buttonColour"
|
||||||
android:text="ok"
|
android:text="ok"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/helpPopTitle" />
|
app:layout_constraintTop_toTopOf="@+id/helpPopTitle" />
|
||||||
|
|||||||
@@ -4,10 +4,28 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:id="@+id/locationItem"
|
android:id="@+id/locationItem"
|
||||||
android:layout_margin="20dp">
|
android:layout_margin="20dp">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="54dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:background="@color/primaryColour"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/location_image"
|
android:id="@+id/location_image"
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
@@ -25,6 +43,7 @@
|
|||||||
android:layout_height="47dp"
|
android:layout_height="47dp"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
|
android:textColor="@color/secondaryColour"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
@@ -4,10 +4,28 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:background="@color/secondaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:id="@+id/routeItem"
|
android:id="@+id/routeItem"
|
||||||
android:layout_margin="20dp">
|
android:layout_margin="20dp">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="54dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="46dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
android:background="@color/primaryColour"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="50dp"
|
android:layout_width="50dp"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
@@ -21,6 +39,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
|
android:textColor="@color/secondaryColour"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textSize="20sp"
|
android:textSize="20sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
|||||||
14
app/src/main/res/values-night/colors.xml
Normal file
14
app/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="purple_200">#FFBB86FC</color>
|
||||||
|
<color name="purple_500">#FF6200EE</color>
|
||||||
|
<color name="purple_700">#FF3700B3</color>
|
||||||
|
<color name="teal_200">#FF03DAC5</color>
|
||||||
|
<color name="teal_700">#FF018786</color>
|
||||||
|
<color name="black">#FF000000</color>
|
||||||
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="primaryColour">#FF115571</color>
|
||||||
|
<color name="secondaryColour">#FF31AFB4</color>
|
||||||
|
<color name="buttonColour">#FF14212D</color>
|
||||||
|
<color name="red">#FF0000</color>
|
||||||
|
</resources>
|
||||||
@@ -2,15 +2,28 @@
|
|||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.NextLocation" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/purple_200</item>
|
<item name="colorPrimary">@color/primaryColour</item>
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
|
||||||
<item name="colorOnPrimary">@color/black</item>
|
|
||||||
<!-- Secondary brand color. -->
|
<!-- Secondary brand color. -->
|
||||||
<item name="colorSecondary">@color/teal_200</item>
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
|
||||||
<item name="colorOnSecondary">@color/black</item>
|
|
||||||
<!-- Status bar color. -->
|
|
||||||
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
|
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||||
|
<item name="android:textSize">16sp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Switches" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<item name="colorControlActivated">@color/buttonColour</item>
|
||||||
|
<item name="colorSwitchThumbNormal">@color/primaryColour</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/primaryColour</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
|
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||||
|
<item name="android:textSize">24sp</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,6 +26,4 @@
|
|||||||
<string name="Chinese">Chinees</string>
|
<string name="Chinese">Chinees</string>
|
||||||
<string name="help">HELP</string>
|
<string name="help">HELP</string>
|
||||||
<string name="help_discription">Onderaan het scherm zijn verschillende knoppen te zien. Deze knoppen hebben de volgende functies: \n\nLocaties: toont een lijst met alle locaties die bezocht kunnen worden. Elke locatie wordt kort beschreven. \n\nRoutes: Toont een lijst met alle routes die gelopen kunnen worden. Van elke route wordt een omschrijving gegeven. \n\nStatistieken: Toont persoonlijke statistieken. \n\nInstellingen: Hier kunnen app-instellingen worden aangepast naar eigen voorkeur. \n\nEen locatie ingedrukt houden laat extra informatie zien over de gekozen locatie</string>
|
<string name="help_discription">Onderaan het scherm zijn verschillende knoppen te zien. Deze knoppen hebben de volgende functies: \n\nLocaties: toont een lijst met alle locaties die bezocht kunnen worden. Elke locatie wordt kort beschreven. \n\nRoutes: Toont een lijst met alle routes die gelopen kunnen worden. Van elke route wordt een omschrijving gegeven. \n\nStatistieken: Toont persoonlijke statistieken. \n\nInstellingen: Hier kunnen app-instellingen worden aangepast naar eigen voorkeur. \n\nEen locatie ingedrukt houden laat extra informatie zien over de gekozen locatie</string>
|
||||||
<string name="notification_title">Je bent dicht bij een locatie!</string>
|
|
||||||
<string name="notification_text">Je bent bijna bij %1$s</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -7,8 +7,11 @@
|
|||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#FF000000</color>
|
<color name="black">#FF000000</color>
|
||||||
<color name="white">#FFFFFFFF</color>
|
<color name="white">#FFFFFFFF</color>
|
||||||
<color name="primaryColour">#FF115571</color>
|
<color name="primaryColour">#FFFFFFFF</color>
|
||||||
<color name="secondaryColour">#FF31AFB4</color>
|
<color name="secondaryColour">#FF000000</color>
|
||||||
<color name="buttonColour">#FF14212D</color>
|
<color name="buttonColour">#FF000000</color>
|
||||||
<color name="red">#FF0000</color>
|
<color name="red">#FF0000</color>
|
||||||
|
<color name="primaryColourCB">#FF115571</color>
|
||||||
|
<color name="secondaryColourCB">#FF31AFB4</color>
|
||||||
|
<color name="buttonColourCB">#FF14212D</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -25,6 +25,4 @@
|
|||||||
<string name="Chinese">Chinese</string>
|
<string name="Chinese">Chinese</string>
|
||||||
<string name="help">HELP</string>
|
<string name="help">HELP</string>
|
||||||
<string name="help_discription">Hasn\'t been translated yet</string>
|
<string name="help_discription">Hasn\'t been translated yet</string>
|
||||||
<string name="notification_title">You\'re close to a location!</string>
|
|
||||||
<string name="notification_text">You\'re almost at %1$s</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -11,6 +11,11 @@
|
|||||||
<item name="android:textSize">16sp</item>
|
<item name="android:textSize">16sp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.Switches" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<item name="colorControlActivated">@color/buttonColour</item>
|
||||||
|
<item name="colorSwitchThumbNormal">@color/primaryColour</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/primaryColour</item>
|
<item name="colorPrimary">@color/primaryColour</item>
|
||||||
@@ -21,4 +26,7 @@
|
|||||||
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||||
<item name="android:textSize">24sp</item>
|
<item name="android:textSize">24sp</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Reference in New Issue
Block a user