Merge branch 'develop' of https://github.com/SemvdH/Next-Location into develop

This commit is contained in:
Sem van der Hoeven
2021-01-06 19:34:29 +01:00
7 changed files with 23 additions and 10 deletions

View File

@@ -59,18 +59,22 @@ public class SettingsFragment extends Fragment {
((FragmentActivity) view.getContext()).getSupportFragmentManager().beginTransaction().replace(R.id.fragment_layout, homeFragment).addToBackStack(null).commit();
});
//Initialises 65+ switchCompat
this.fontChanger = view.findViewById(R.id.BigFont);
//Initialises sharedpreference to save state of 65+ mode
SharedPreferences sharedPreferences = requireActivity().getSharedPreferences("com.a1.nextlocation",0);
SharedPreferences.Editor editor = sharedPreferences.edit();
fontChanger.setChecked(sharedPreferences.getBoolean("switch", false));
//Initial check to see what setting was last chosen
if (fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocationBig);
}else if (!fontChanger.isChecked()){
requireActivity().setTheme(R.style.Theme_NextLocation);
}
//Changes the font settings depending on the state of the toggle
fontChanger.setOnClickListener(view1 -> {
if(fontChanger.isChecked())
{

View File

@@ -23,7 +23,7 @@ public enum CouponListManager {
}
/**
* Prepares the list for loading
* prepares the list for the adapter
*/
public void load(){
CouponLoader couponLoader = new CouponLoader(this.context);

View File

@@ -24,10 +24,9 @@ public enum LocationListManager {
return locationList;
}
public Location getLocation(int place) {
return locationList.get(place);
}
/**
* prepares the array list for the adapter
*/
public void load() {
LocationLoader locationLoader = new LocationLoader(this.context);
this.locationList = locationLoader.load();

View File

@@ -17,6 +17,10 @@ public class LocationLoader implements Loader<List<Location>> {
this.context = context;
}
/**
* loads the array list from a JSON file
* @return array list with locations
*/
@Override
public ArrayList<Location> load() {
FileIO<ArrayList<Location>> fileIO = new FileIO<>();

View File

@@ -41,6 +41,10 @@ public class RouteAdapter extends RecyclerView.Adapter<RouteAdapter.RouteViewHol
clickListener.onItemClick(getAdapterPosition());
}
/**
* sets the text of the route name
* @param text the text that will be set
*/
public void setTextViewText(String text){
this.routeName = itemView.findViewById(R.id.route_name);
this.routeName.setText(text);

View File

@@ -18,15 +18,13 @@ public enum RouteListManager{
this.routeList = new ArrayList<>();
}
public List<Route> getRouteList() {
return routeList;
}
public Route getRoute(int place) {
return routeList.get(place);
}
/**
* prepares the array list for the adapter
*/
public void load() {
RouteLoader routeLoader = new RouteLoader(this.context);
this.routeList = routeLoader.load();

View File

@@ -18,6 +18,10 @@ public class RouteLoader implements Loader<List<Route>> {
this.context = context;
}
/**
* loads an array list from a JSON
* @return an array list with routes
*/
@Override
public ArrayList<Route> load() {