diff --git a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java index 4db58f4..3549a40 100644 --- a/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java +++ b/app/src/main/java/com/a1/nextlocation/fragments/SettingsFragment.java @@ -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()) { diff --git a/app/src/main/java/com/a1/nextlocation/recyclerview/CouponListManager.java b/app/src/main/java/com/a1/nextlocation/recyclerview/CouponListManager.java index eba6b40..5bef09f 100644 --- a/app/src/main/java/com/a1/nextlocation/recyclerview/CouponListManager.java +++ b/app/src/main/java/com/a1/nextlocation/recyclerview/CouponListManager.java @@ -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); diff --git a/app/src/main/java/com/a1/nextlocation/recyclerview/LocationListManager.java b/app/src/main/java/com/a1/nextlocation/recyclerview/LocationListManager.java index e677d52..10fe3f7 100644 --- a/app/src/main/java/com/a1/nextlocation/recyclerview/LocationListManager.java +++ b/app/src/main/java/com/a1/nextlocation/recyclerview/LocationListManager.java @@ -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(); diff --git a/app/src/main/java/com/a1/nextlocation/recyclerview/LocationLoader.java b/app/src/main/java/com/a1/nextlocation/recyclerview/LocationLoader.java index 313c151..ae17206 100644 --- a/app/src/main/java/com/a1/nextlocation/recyclerview/LocationLoader.java +++ b/app/src/main/java/com/a1/nextlocation/recyclerview/LocationLoader.java @@ -17,6 +17,10 @@ public class LocationLoader implements Loader> { this.context = context; } + /** + * loads the array list from a JSON file + * @return array list with locations + */ @Override public ArrayList load() { FileIO> fileIO = new FileIO<>(); diff --git a/app/src/main/java/com/a1/nextlocation/recyclerview/RouteAdapter.java b/app/src/main/java/com/a1/nextlocation/recyclerview/RouteAdapter.java index dffb982..1c5ea9a 100644 --- a/app/src/main/java/com/a1/nextlocation/recyclerview/RouteAdapter.java +++ b/app/src/main/java/com/a1/nextlocation/recyclerview/RouteAdapter.java @@ -41,6 +41,10 @@ public class RouteAdapter extends RecyclerView.Adapter(); } - public List 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(); diff --git a/app/src/main/java/com/a1/nextlocation/recyclerview/RouteLoader.java b/app/src/main/java/com/a1/nextlocation/recyclerview/RouteLoader.java index df65664..0317961 100644 --- a/app/src/main/java/com/a1/nextlocation/recyclerview/RouteLoader.java +++ b/app/src/main/java/com/a1/nextlocation/recyclerview/RouteLoader.java @@ -18,6 +18,10 @@ public class RouteLoader implements Loader> { this.context = context; } + /** + * loads an array list from a JSON + * @return an array list with routes + */ @Override public ArrayList load() {