From 552fc5cb3207a894c495d6f6666c51c3e7b50f7f Mon Sep 17 00:00:00 2001 From: paul-loedige Date: Thu, 7 Jan 2021 21:08:33 +0100 Subject: [PATCH] changed currentView to int --- .../example/aped/utils/ConfigurationHandler.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/APED/app/src/main/java/com/example/aped/utils/ConfigurationHandler.java b/APED/app/src/main/java/com/example/aped/utils/ConfigurationHandler.java index cf8e85d..1f416ef 100644 --- a/APED/app/src/main/java/com/example/aped/utils/ConfigurationHandler.java +++ b/APED/app/src/main/java/com/example/aped/utils/ConfigurationHandler.java @@ -121,7 +121,7 @@ public class ConfigurationHandler implements IFAVORITES { * Method to get the name of the current view. * @return the name of the current view */ - public String getCurrentView() { + public int getCurrentView() { return configurations.getCurrentView(); } @@ -130,7 +130,7 @@ public class ConfigurationHandler implements IFAVORITES { * @param viewName the name to be set * @return the name that has been set */ - public String setCurrentView(final String viewName) { + public int setCurrentView(final int viewName) { configurations.setCurrentView(viewName); writeJsonFile(); return getCurrentView(); @@ -155,7 +155,7 @@ public class ConfigurationHandler implements IFAVORITES { JSONObject jsonObject = new JSONObject(jsonData); configurations.setAddress(jsonObject.getString("address")); configurations.setPort(jsonObject.getInt("port")); - configurations.setCurrentView(jsonObject.getString("currentView")); + configurations.setCurrentView(jsonObject.getInt("currentView")); List favoriteNames = new ArrayList<>(); JSONArray favorites = jsonObject.getJSONArray("favorites"); for (int i = 0; i < favorites.length(); i++) { @@ -211,12 +211,14 @@ public class ConfigurationHandler implements IFAVORITES { private int port = -1; /** The names of the favorite devices. **/ private List favoriteNames = new ArrayList<>(); + /** The name of the current view. **/ + private int currentView = -1; /** * Getter for currentView. * @return the name of the current view */ - public String getCurrentView() { + public int getCurrentView() { return currentView; } @@ -224,13 +226,11 @@ public class ConfigurationHandler implements IFAVORITES { * Setter for currentView. * @param pCurrentView the name of the current view */ - public void setCurrentView(final String pCurrentView) { + public int setCurrentView(final int pCurrentView) { this.currentView = pCurrentView; + return this.currentView; } - /** The name of the current view. **/ - private String currentView = ""; - /** * Getter for the address variable. * @return the address of the raspberry