changed currentView to int
This commit is contained in:
parent
0faf25f00b
commit
552fc5cb32
@ -121,7 +121,7 @@ public class ConfigurationHandler implements IFAVORITES {
|
|||||||
* Method to get the name of the current view.
|
* Method to get the name of the current view.
|
||||||
* @return the name of the current view
|
* @return the name of the current view
|
||||||
*/
|
*/
|
||||||
public String getCurrentView() {
|
public int getCurrentView() {
|
||||||
return configurations.getCurrentView();
|
return configurations.getCurrentView();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ public class ConfigurationHandler implements IFAVORITES {
|
|||||||
* @param viewName the name to be set
|
* @param viewName the name to be set
|
||||||
* @return the name that has been set
|
* @return the name that has been set
|
||||||
*/
|
*/
|
||||||
public String setCurrentView(final String viewName) {
|
public int setCurrentView(final int viewName) {
|
||||||
configurations.setCurrentView(viewName);
|
configurations.setCurrentView(viewName);
|
||||||
writeJsonFile();
|
writeJsonFile();
|
||||||
return getCurrentView();
|
return getCurrentView();
|
||||||
@ -155,7 +155,7 @@ public class ConfigurationHandler implements IFAVORITES {
|
|||||||
JSONObject jsonObject = new JSONObject(jsonData);
|
JSONObject jsonObject = new JSONObject(jsonData);
|
||||||
configurations.setAddress(jsonObject.getString("address"));
|
configurations.setAddress(jsonObject.getString("address"));
|
||||||
configurations.setPort(jsonObject.getInt("port"));
|
configurations.setPort(jsonObject.getInt("port"));
|
||||||
configurations.setCurrentView(jsonObject.getString("currentView"));
|
configurations.setCurrentView(jsonObject.getInt("currentView"));
|
||||||
List<String> favoriteNames = new ArrayList<>();
|
List<String> favoriteNames = new ArrayList<>();
|
||||||
JSONArray favorites = jsonObject.getJSONArray("favorites");
|
JSONArray favorites = jsonObject.getJSONArray("favorites");
|
||||||
for (int i = 0; i < favorites.length(); i++) {
|
for (int i = 0; i < favorites.length(); i++) {
|
||||||
@ -211,12 +211,14 @@ public class ConfigurationHandler implements IFAVORITES {
|
|||||||
private int port = -1;
|
private int port = -1;
|
||||||
/** The names of the favorite devices. **/
|
/** The names of the favorite devices. **/
|
||||||
private List<String> favoriteNames = new ArrayList<>();
|
private List<String> favoriteNames = new ArrayList<>();
|
||||||
|
/** The name of the current view. **/
|
||||||
|
private int currentView = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for currentView.
|
* Getter for currentView.
|
||||||
* @return the name of the current view
|
* @return the name of the current view
|
||||||
*/
|
*/
|
||||||
public String getCurrentView() {
|
public int getCurrentView() {
|
||||||
return currentView;
|
return currentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,13 +226,11 @@ public class ConfigurationHandler implements IFAVORITES {
|
|||||||
* Setter for currentView.
|
* Setter for currentView.
|
||||||
* @param pCurrentView the name of the current view
|
* @param pCurrentView the name of the current view
|
||||||
*/
|
*/
|
||||||
public void setCurrentView(final String pCurrentView) {
|
public int setCurrentView(final int pCurrentView) {
|
||||||
this.currentView = pCurrentView;
|
this.currentView = pCurrentView;
|
||||||
|
return this.currentView;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The name of the current view. **/
|
|
||||||
private String currentView = "";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getter for the address variable.
|
* Getter for the address variable.
|
||||||
* @return the address of the raspberry
|
* @return the address of the raspberry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user