Hi,
Hoping one of you intelligent people can help me with the correct way to code this.
I am looking to order the widget screen shown depending on a variable value (rising/falling)
So if the status is falling, show the falling screen first with rising page 2nd and visa versa
In its simplest form this works
if (screenNum == 1 && weatherData[2].equals("rising"))) {
System.println("screen" + screenNum);
str = "High Tide in " + weatherData[3] + "\nAt " + weatherData[4];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
} else {
System.println("screen" + screenNum);
str = "Low Tide in " + weatherData[5] + "\n" + weatherData[6];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
}
but I want to show change the order of them, I have tried variations of the below and I know this is not going to work but I hope explains the logic I am after.
if (screenNum == 1 && weatherData[2].equals("rising"))) {
// System.println("screen" + screenNum);
str = "High Tide in " + weatherData[3] + "\nAt " + weatherData[4];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
} else {
System.println("screen" + screenNum);
str = "Low Tide in " + weatherData[5] + "\n" + weatherData[6];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
} else if (screenNum == 2 && weatherData[2].equals("falling")) {
str = "Low Tide in " + weatherData[5] + "\n" + weatherData[6];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
} else {
str = "High Tide in " + weatherData[3] + "\nAt " + weatherData[4];
drawStr(dc, 50, 50, G.FONT_SYSTEM_SMALL, G.COLOR_LT_GRAY, str, G.TEXT_JUSTIFY_CENTER | G.TEXT_JUSTIFY_VCENTER);
}
Also I read somewhere there was a way to show the dots on the screen to signify there are more pages/screens to scroll through but cannot find it again. Any advice would be great
Lee