Compare commits
21 Commits
Locaitegez
...
routeFragm
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e2144bd08 | ||
|
|
d80f23ff82 | ||
|
|
e57e6cdcda | ||
|
|
37a803b3a6 | ||
|
|
65e7b99c86 | ||
|
|
5e2d49ac08 | ||
|
|
a7495d24ad | ||
|
|
428fa10433 | ||
|
|
6d21ca16b8 | ||
|
|
363899811a | ||
|
|
3880d7b4a2 | ||
|
|
5162dab0ff | ||
|
|
baf30b5dda | ||
|
|
70efd6b97c | ||
|
|
7f56cbe30a | ||
|
|
2f5b53e2b4 | ||
|
|
4c09192f9a | ||
|
|
8740362553 | ||
|
|
0663dabca5 | ||
|
|
e7f152bc00 | ||
|
|
f3dbb2b1d1 |
@@ -9,6 +9,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;
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ public class Route implements Parcelable {
|
|||||||
|
|
||||||
|
|
||||||
public int getTotalTime() {
|
public int getTotalTime() {
|
||||||
|
|
||||||
return totalTime;
|
return totalTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ public class CouponFragment extends Fragment {
|
|||||||
this.backButton = view.findViewById(R.id.coupon_back_button);
|
this.backButton = view.findViewById(R.id.coupon_back_button);
|
||||||
this.backButton.setOnClickListener(v -> {
|
this.backButton.setOnClickListener(v -> {
|
||||||
StatisticFragment statisticFragment = new StatisticFragment();
|
StatisticFragment statisticFragment = new StatisticFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, statisticFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.couponRecyclerView.setLayoutManager(this.layoutManager);
|
this.couponRecyclerView.setLayoutManager(this.layoutManager);
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ public class HomeFragment extends Fragment implements LocationListener {
|
|||||||
this.imageButton = view.findViewById(R.id.location_list_button);
|
this.imageButton = view.findViewById(R.id.location_list_button);
|
||||||
this.imageButton.setOnClickListener(v -> {
|
this.imageButton.setOnClickListener(v -> {
|
||||||
LocationFragment locationFragment = new LocationFragment();
|
LocationFragment locationFragment = new LocationFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
// set up the route stop button
|
// set up the route stop button
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import android.widget.ImageView;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
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;
|
||||||
@@ -50,20 +49,20 @@ public class LocationDetailFragment extends Fragment {
|
|||||||
this.titelText.setText(location.getName());
|
this.titelText.setText(location.getName());
|
||||||
|
|
||||||
double currentDistanceToLocation = 0.0;
|
double currentDistanceToLocation = 0.0;
|
||||||
if(Data.INSTANCE.getLocation() != null){
|
if (Data.INSTANCE.getLocation() != null) {
|
||||||
currentDistanceToLocation = Location.getDistance(Data.INSTANCE.getLocation().getLatitude(), Data.INSTANCE.getLocation().getLongitude(), this.location.getLat(), this.location.getLong());
|
currentDistanceToLocation = Location.getDistance(Data.INSTANCE.getLocation().getLatitude(), Data.INSTANCE.getLocation().getLongitude(), this.location.getLat(), this.location.getLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Adds distance text from the current distance of the user to the opened location
|
//Adds distance text from the current distance of the user to the opened location
|
||||||
String detailText;
|
String detailText;
|
||||||
if(getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)){
|
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false)) {
|
||||||
if(currentDistanceToLocation > 1609)
|
if (currentDistanceToLocation > 1609)
|
||||||
detailText = location.getDescription() + String.format("%.3f",currentDistanceToLocation * 0.000621371192) + "mi";
|
detailText = location.getDescription() + String.format("%.3f", currentDistanceToLocation * 0.000621371192) + "mi";
|
||||||
else
|
else
|
||||||
detailText = location.getDescription() + String.format("%.2f",currentDistanceToLocation * 1.0936133) + "yd";
|
detailText = location.getDescription() + String.format("%.2f", currentDistanceToLocation * 1.0936133) + "yd";
|
||||||
} else {
|
} else {
|
||||||
if(currentDistanceToLocation > 1000)
|
if (currentDistanceToLocation > 1000)
|
||||||
detailText = location.getDescription() + String.format("%.3f",currentDistanceToLocation / 1000) + "km";
|
detailText = location.getDescription() + String.format("%.3f", currentDistanceToLocation / 1000) + "km";
|
||||||
else
|
else
|
||||||
detailText = location.getDescription() + currentDistanceToLocation + "m";
|
detailText = location.getDescription() + currentDistanceToLocation + "m";
|
||||||
}
|
}
|
||||||
@@ -74,7 +73,8 @@ public class LocationDetailFragment extends Fragment {
|
|||||||
this.backButton = view.findViewById(R.id.detail_location_back_button);
|
this.backButton = view.findViewById(R.id.detail_location_back_button);
|
||||||
this.backButton.setOnClickListener(v -> {
|
this.backButton.setOnClickListener(v -> {
|
||||||
LocationFragment locationFragment = new LocationFragment();
|
LocationFragment locationFragment = new LocationFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
//Logs the location
|
//Logs the location
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ public class LocationFragment extends Fragment {
|
|||||||
this.backButton = view.findViewById(R.id.location_back_button);
|
this.backButton = view.findViewById(R.id.location_back_button);
|
||||||
this.backButton.setOnClickListener(v -> {
|
this.backButton.setOnClickListener(v -> {
|
||||||
HomeFragment homeFragment = new HomeFragment();
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
//Loads the location list
|
//Loads the location list
|
||||||
@@ -58,7 +59,8 @@ public class LocationFragment extends Fragment {
|
|||||||
//Gives the clicked location to the adapter
|
//Gives the clicked location to the adapter
|
||||||
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
|
locationBundle.putParcelable("location", this.locationList.get(clickedPosition));
|
||||||
locationDetailFragment.setArguments(locationBundle);
|
locationDetailFragment.setArguments(locationBundle);
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, locationDetailFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.locationRecyclerView.setLayoutManager(this.layoutManager);
|
this.locationRecyclerView.setLayoutManager(this.layoutManager);
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import android.widget.TextView;
|
|||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
import com.a1.nextlocation.data.Location;
|
import com.a1.nextlocation.data.Location;
|
||||||
@@ -31,6 +30,7 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
|
|
||||||
private Route route;
|
private Route route;
|
||||||
private Refreshable refreshable;
|
private Refreshable refreshable;
|
||||||
|
private String time;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAttach(@NotNull Context context) {
|
public void onAttach(@NotNull Context context) {
|
||||||
@@ -63,23 +63,24 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
|
|
||||||
TextView routeDetailText = view.findViewById(R.id.route_detail_tekst);
|
TextView routeDetailText = view.findViewById(R.id.route_detail_tekst);
|
||||||
StringBuilder locations = new StringBuilder();
|
StringBuilder locations = new StringBuilder();
|
||||||
for(Location location : this.route.getLocations()){
|
for (Location location : this.route.getLocations()) {
|
||||||
locations.append("<br>•").append(location.getName());
|
locations.append("<br>•").append(location.getName());
|
||||||
}
|
}
|
||||||
String detailText = this.route.getDescription() + "<br><br><b>" + getResources().getString(R.string.following_locations) + "</b>" + locations + "<br><br><b>" + getResources().getString(R.string.start_location) + ": </b>" + route.getLocations().get(0).getName() + "<br>" + "<b>" + getResources().getString(R.string.end_location) + ": </b>" + route.getLocations().get(route.getLocations().size()-1).getName();
|
String detailText = this.route.getDescription() + "<br><br><b>" + getResources().getString(R.string.following_locations) + "</b>" + locations + "<br><br><b>" + getResources().getString(R.string.start_location) + ": </b>" + route.getLocations().get(0).getName() + "<br>" + "<b>" + getResources().getString(R.string.end_location) + ": </b>" + route.getLocations().get(route.getLocations().size() - 1).getName();
|
||||||
routeDetailText.setText(Html.fromHtml(detailText));
|
routeDetailText.setText(Html.fromHtml(detailText));
|
||||||
|
|
||||||
|
//sets the text of the totaldistance
|
||||||
TextView totalDistance = view.findViewById(R.id.total_distance);
|
TextView totalDistance = view.findViewById(R.id.total_distance);
|
||||||
String distance_tekst = getResources().getString(R.string.total_distance_route);
|
//looks if imperial units or metric
|
||||||
boolean imperialChecked = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false);
|
boolean imperialChecked = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false);
|
||||||
totalDistance.setText(distance_tekst + " " + String.format("%.1f", calculateRoute(this.route.getLocations())) + (imperialChecked ? "yd" : "m"));
|
totalDistance.setText(getResources().getString(R.string.total_distance_route) + " " + String.format("%.1f", calculateRoute(this.route.getLocations())) + (imperialChecked ? "yd" : "m") + "\n" + getResources().getString(R.string.total_time) + " " + this.time);
|
||||||
|
|
||||||
//Initialises the back button
|
//Initialises the back button
|
||||||
ImageButton backButton = view.findViewById(R.id.route_detail_back_button);
|
ImageButton backButton = view.findViewById(R.id.route_detail_back_button);
|
||||||
backButton.setOnClickListener(v -> {
|
backButton.setOnClickListener(v -> {
|
||||||
RouteFragment routeFragment = new RouteFragment();
|
RouteFragment routeFragment = new RouteFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
Button startButton = view.findViewById(R.id.start_route_button);
|
Button startButton = view.findViewById(R.id.start_route_button);
|
||||||
@@ -123,6 +124,7 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
System.out.println("Total Distance: " + totalDistance);
|
System.out.println("Total Distance: " + totalDistance);
|
||||||
|
|
||||||
|
calculateTime(totalDistance);
|
||||||
// if the imperialSwitch is checked, return feet, if not, return meters
|
// if the imperialSwitch is checked, return feet, if not, return meters
|
||||||
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
|
if (getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE).getBoolean("imperialSwitch", false))
|
||||||
return totalDistance * 1.0936133;
|
return totalDistance * 1.0936133;
|
||||||
@@ -130,4 +132,15 @@ public class RouteDetailFragment extends Fragment {
|
|||||||
return totalDistance;
|
return totalDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("DefaultLocale")
|
||||||
|
public void calculateTime(double totalDistance){
|
||||||
|
double totalTimeInMinutes = ((totalDistance / 1000) / 5) * 60;
|
||||||
|
if(totalTimeInMinutes > 60) {
|
||||||
|
int hours = (int)(totalTimeInMinutes / 60);
|
||||||
|
int minutes = (int)(totalTimeInMinutes % 60);
|
||||||
|
this.time = hours + " " + getResources().getString(R.string.hour) + " " + minutes + " " + getResources().getString(R.string.minutes);
|
||||||
|
}
|
||||||
|
else this.time = (int)(((totalDistance / 1000) / 5) * 60) + " " + getResources().getString(R.string.minutes);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,7 +9,6 @@ import android.widget.ImageButton;
|
|||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@@ -49,13 +48,15 @@ public class RouteFragment extends Fragment {
|
|||||||
Bundle routeBundle = new Bundle();
|
Bundle routeBundle = new Bundle();
|
||||||
routeBundle.putParcelable("route", this.routeList.get(clickedPosition));
|
routeBundle.putParcelable("route", this.routeList.get(clickedPosition));
|
||||||
routeDetailFragment.setArguments(routeBundle);
|
routeDetailFragment.setArguments(routeBundle);
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, routeDetailFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
ImageButton backButton = view.findViewById(R.id.route_back_button);
|
ImageButton backButton = view.findViewById(R.id.route_back_button);
|
||||||
backButton.setOnClickListener(v -> {
|
backButton.setOnClickListener(v -> {
|
||||||
HomeFragment homeFragment = new HomeFragment();
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
routeRecyclerView.setLayoutManager(layoutManager);
|
routeRecyclerView.setLayoutManager(layoutManager);
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ 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.FragmentTransaction;
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
import com.a1.nextlocation.R;
|
import com.a1.nextlocation.R;
|
||||||
@@ -29,6 +29,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 +43,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
|
||||||
@@ -61,7 +63,8 @@ public class SettingsFragment extends Fragment {
|
|||||||
ImageView backButton = view.findViewById(R.id.settings_back_button);
|
ImageView backButton = view.findViewById(R.id.settings_back_button);
|
||||||
backButton.setOnClickListener(v -> {
|
backButton.setOnClickListener(v -> {
|
||||||
HomeFragment homeFragment = new HomeFragment();
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE);
|
SharedPreferences sharedPreferences = getContext().getSharedPreferences("Settings", Context.MODE_PRIVATE);
|
||||||
@@ -82,29 +85,50 @@ public class SettingsFragment extends Fragment {
|
|||||||
fontSwitch.setChecked(sharedPreferences.getBoolean("fontSwitch", false));
|
fontSwitch.setChecked(sharedPreferences.getBoolean("fontSwitch", false));
|
||||||
|
|
||||||
//Initial check to see what setting was last chosen
|
//Initial check to see what setting was last chosen
|
||||||
if (fontSwitch.isChecked()){
|
if (fontSwitch.isChecked()) {
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||||
}else if (!fontSwitch.isChecked()){
|
} else if (!fontSwitch.isChecked()) {
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Changes the font settings depending on the state of the toggle
|
//Changes the font settings depending on the state of the toggle
|
||||||
|
|
||||||
fontSwitch.setOnClickListener(view1 -> {
|
fontSwitch.setOnClickListener(view1 -> {
|
||||||
if(fontSwitch.isChecked())
|
if (fontSwitch.isChecked()) {
|
||||||
{
|
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
requireActivity().setTheme(R.style.Theme_NextLocationBig);
|
||||||
editor.putBoolean("fontSwitch",true);
|
getActivity().recreate();
|
||||||
editor.apply();
|
|
||||||
}
|
}
|
||||||
if(!fontSwitch.isChecked())
|
if(!fontSwitch.isChecked())
|
||||||
{
|
{
|
||||||
requireActivity().setTheme(R.style.Theme_NextLocation);
|
requireActivity().setTheme(R.style.Theme_NextLocation);
|
||||||
editor.putBoolean("fontSwitch",false);
|
getActivity().recreate();
|
||||||
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) {
|
||||||
|
|||||||
@@ -58,21 +58,24 @@ public class StatisticFragment extends Fragment {
|
|||||||
ImageView backButton = view.findViewById(R.id.statistics_back_button);
|
ImageView backButton = view.findViewById(R.id.statistics_back_button);
|
||||||
backButton.setOnClickListener(v -> {
|
backButton.setOnClickListener(v -> {
|
||||||
HomeFragment homeFragment = new HomeFragment();
|
HomeFragment homeFragment = new HomeFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
//Initialises the coupon button
|
//Initialises the coupon button
|
||||||
ImageView couponButton = view.findViewById(R.id.coupon_button);
|
ImageView couponButton = view.findViewById(R.id.coupon_button);
|
||||||
couponButton.setOnClickListener(v -> {
|
couponButton.setOnClickListener(v -> {
|
||||||
CouponFragment couponFragment = new CouponFragment();
|
CouponFragment couponFragment = new CouponFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
|
|
||||||
//Makes the constraintlayout clickable and opens the same layout as the coupon button
|
//Makes the constraintlayout clickable and opens the same layout as the coupon button
|
||||||
ConstraintLayout constraintLayout = view.findViewById(R.id.Box4);
|
ConstraintLayout constraintLayout = view.findViewById(R.id.Box4);
|
||||||
constraintLayout.setOnClickListener(v -> {
|
constraintLayout.setOnClickListener(v -> {
|
||||||
CouponFragment couponFragment = new CouponFragment();
|
CouponFragment couponFragment = new CouponFragment();
|
||||||
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
if (getActivity() != null)
|
||||||
|
getActivity().getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, couponFragment).addToBackStack(null).commit();
|
||||||
});
|
});
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
android:id="@+id/couponItem"
|
android:id="@+id/couponItem"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/name_box"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/name_box"
|
||||||
|
app:layout_constraintLeft_toLeftOf="@+id/name_box"
|
||||||
|
app:layout_constraintRight_toRightOf="@+id/name_box"
|
||||||
|
android:background="@color/secondaryColour"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/name_box"
|
android:id="@+id/name_box"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:backgroundTint="@color/buttonColour"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,6 @@
|
|||||||
/>
|
/>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/detail_location_back_button"
|
android:id="@+id/detail_location_back_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
@@ -43,7 +43,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:id="@+id/route_scroll_view"
|
android:id="@+id/route_scroll_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/route_detail_image"
|
app:layout_constraintTop_toBottomOf="@id/route_detail_image"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -14,8 +15,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:backgroundTint="@color/primaryColour"
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:src="@drawable/ic_back_button_24"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
@@ -31,6 +31,16 @@
|
|||||||
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"
|
||||||
@@ -41,7 +51,6 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@id/textView"
|
app:layout_constraintTop_toBottomOf="@id/textView"
|
||||||
android:background="@color/primaryColour"
|
android:background="@color/primaryColour"
|
||||||
android:layout_marginHorizontal="20dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -57,7 +66,7 @@
|
|||||||
|
|
||||||
<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/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -79,6 +88,16 @@
|
|||||||
|
|
||||||
</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"
|
||||||
@@ -105,9 +124,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/buttonColour"
|
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 +145,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/primaryColour"
|
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"
|
||||||
@@ -151,9 +179,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 +196,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>
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,15 @@
|
|||||||
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"
|
||||||
@@ -46,7 +55,7 @@
|
|||||||
|
|
||||||
<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/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -69,6 +78,15 @@
|
|||||||
|
|
||||||
</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"
|
||||||
@@ -95,7 +113,7 @@
|
|||||||
|
|
||||||
<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/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -118,6 +136,15 @@
|
|||||||
|
|
||||||
</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"
|
||||||
@@ -142,7 +169,7 @@
|
|||||||
|
|
||||||
<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/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -165,6 +192,15 @@
|
|||||||
|
|
||||||
</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"
|
||||||
@@ -191,7 +227,7 @@
|
|||||||
|
|
||||||
<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/secondaryColour"
|
android:background="@color/secondaryColour"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@@ -231,8 +267,6 @@
|
|||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:background="@drawable/ic_back_button_24"
|
android:background="@drawable/ic_back_button_24"
|
||||||
android:backgroundTint="@color/buttonColour"
|
|
||||||
android:src="@drawable/ic_back_button_24"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|||||||
@@ -22,24 +22,28 @@
|
|||||||
android:paddingVertical="10dp"/>
|
android:paddingVertical="10dp"/>
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:id="@+id/scrollView2"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/helpPopTitle"
|
|
||||||
android:layout_width="300dp"
|
android:layout_width="300dp"
|
||||||
android:layout_height="450dp">
|
android:layout_height="400dp"
|
||||||
|
android:layout_marginHorizontal="10dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/helpPopTitle"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/help_ok_button"
|
||||||
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/helpPopTitle"
|
|
||||||
android:layout_width="280dp"
|
android:layout_width="280dp"
|
||||||
android:layout_height="430dp"
|
android:layout_height="430dp"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
android:text="@string/help_discription"
|
android:text="@string/help_discription"
|
||||||
android:textColor="@color/secondaryColour"
|
android:textColor="@color/secondaryColour"
|
||||||
android:layout_marginStart="10dp"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
android:layout_marginEnd="10dp"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:layout_marginTop="10dp"
|
app:layout_constraintTop_toBottomOf="@id/helpPopTitle" />
|
||||||
android:layout_marginBottom="10dp"/>
|
|
||||||
|
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
@@ -48,11 +52,13 @@
|
|||||||
android:id="@+id/help_ok_button"
|
android:id="@+id/help_ok_button"
|
||||||
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:backgroundTint="@color/buttonColour"
|
android:backgroundTint="@color/buttonColour"
|
||||||
|
android:textColor="@color/primaryColour"
|
||||||
android:text="ok"
|
android:text="ok"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/helpPopTitle" />
|
app:layout_constraintTop_toBottomOf="@id/scrollView2"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,24 @@
|
|||||||
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"
|
||||||
|
|||||||
@@ -8,6 +8,24 @@
|
|||||||
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"
|
||||||
|
|||||||
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/white</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/secondaryColour</item>
|
||||||
|
<item name="colorSwitchThumbNormal">@color/buttonColourCB</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/primaryColour</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
|
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||||
|
<item name="android:textSize">24sp</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,10 +26,12 @@
|
|||||||
<string name="Dutch">Nederlands</string>
|
<string name="Dutch">Nederlands</string>
|
||||||
<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. \n\n\n</string>
|
||||||
<string name="end_location">Eind locatie</string>
|
<string name="end_location">Eind locatie</string>
|
||||||
<string name="start_location">Start locatie</string>
|
<string name="start_location">Start locatie</string>
|
||||||
<string name="following_locations">"Deze route bevat de volgende locaties: "</string>
|
<string name="following_locations">"Deze route bevat de volgende locaties: "</string>
|
||||||
<string name="notification_title">Je bent dicht bij een locatie!</string>
|
<string name="notification_title">Je bent dicht bij een locatie!</string>
|
||||||
<string name="notification_text">Je bent bijna bij %1$s</string>
|
<string name="notification_text">Je bent bijna bij %1$s</string>
|
||||||
|
<string name="hour">uur</string>
|
||||||
|
<string name="minutes">minuten</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -11,4 +11,7 @@
|
|||||||
<color name="secondaryColour">#FF000000</color>
|
<color name="secondaryColour">#FF000000</color>
|
||||||
<color name="buttonColour">#FF000000</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>
|
||||||
@@ -24,10 +24,12 @@
|
|||||||
<string name="English">English</string>
|
<string name="English">English</string>
|
||||||
<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">Various buttons can be seen at the bottom of the screen. These buttons have the following functions: \n\nLocations: displays a list of all locations that can be visited. Each location is briefly described. \n\nRoutes: Displays a list of all routes that can be walked. A description is given of each route. \n\nStats: Displays personal statistics. \n\nSettings: This is where app settings can be adjusted according to your preferences. \n\nHold down on a location to display additional information about the chosen location. \n\n\n</string>
|
||||||
<string name="notification_title">You\'re close to a location!</string>
|
<string name="notification_title">You\'re close to a location!</string>
|
||||||
<string name="notification_text">You\'re almost at %1$s</string>
|
<string name="notification_text">You\'re almost at %1$s</string>
|
||||||
<string name="following_locations">This route contains the following locations: </string>
|
<string name="following_locations">This route contains the following locations: </string>
|
||||||
<string name="end_location">End location</string>
|
<string name="end_location">End location</string>
|
||||||
<string name="start_location">Start location</string>
|
<string name="start_location">Start location</string>
|
||||||
|
<string name="hour">hour</string>
|
||||||
|
<string name="minutes">minutes</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -2,13 +2,19 @@
|
|||||||
<!-- 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/primaryColour</item>
|
<item name="colorPrimary">@color/black</item>
|
||||||
<!-- Secondary brand color. -->
|
<!-- Secondary brand color. -->
|
||||||
<item name="colorSecondary">@color/secondaryColour</item>
|
<item name="colorSecondary">@color/secondaryColour</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
<item name="colorButtonNormal">@color/buttonColour</item>
|
<item name="colorButtonNormal">@color/buttonColour</item>
|
||||||
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
<item name="colorPrimaryDark">@color/secondaryColour</item>
|
||||||
<item name="android:textSize">16sp</item>
|
<item name="android:textSize">16sp</item>
|
||||||
|
<item name="android:textColor">@color/black</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>
|
||||||
|
|
||||||
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
<style name="Theme.NextLocationBig" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
@@ -21,4 +27,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