Working navigation on main screen for higlights
This commit is contained in:
parent
06c9588b35
commit
171bf68d36
|
@ -30,11 +30,17 @@ UILCD::UILCD() {
|
|||
}
|
||||
|
||||
void UILCD::startUI() {
|
||||
splashScreen();
|
||||
mainScreen();
|
||||
drawSplashScreen();
|
||||
drawMainScreen();
|
||||
}
|
||||
|
||||
void UILCD::handleJoystickEvent(joyDirection direction) {
|
||||
if (DEBUG) {
|
||||
Serial.println("begin UILCD::handleJoystickEvent");
|
||||
Serial.print("Current Screen: ");
|
||||
Serial.println(currentScreen);
|
||||
}
|
||||
|
||||
switch (currentScreen) {
|
||||
case 1: // enum screen -> mainScreen
|
||||
mainScreenHilight(direction);
|
||||
|
@ -44,8 +50,7 @@ void UILCD::handleJoystickEvent(joyDirection direction) {
|
|||
|
||||
void UILCD::unHilightLine(int line) {
|
||||
tft->setCursor(0, line * FONT_HEIGHT);
|
||||
tft->setTextColor(HILIGHT);
|
||||
tft->print(" ");
|
||||
tft->fillRect(0, line * FONT_HEIGHT, FONT_WIDTH, FONT_HEIGHT, BACKGROUND);
|
||||
}
|
||||
|
||||
void UILCD::hilightLine(int line) {
|
||||
|
@ -90,7 +95,8 @@ void UILCD::mainScreenHilight(joyDirection direction) {
|
|||
}
|
||||
}
|
||||
|
||||
void UILCD::mainScreen() {
|
||||
void UILCD::drawMainScreen() {
|
||||
currentScreen = mainScreen;
|
||||
previousLine = 0;
|
||||
|
||||
tft->fillScreen(BACKGROUND);
|
||||
|
@ -114,7 +120,7 @@ void UILCD::mainScreen() {
|
|||
hilightLine(0);
|
||||
}
|
||||
|
||||
void UILCD::splashScreen() {
|
||||
void UILCD::drawSplashScreen() {
|
||||
tft->fillScreen(SPLASH_BACKGROUND);
|
||||
bmpDraw("splash.bmp", 13, 0);
|
||||
delay(1250);
|
||||
|
|
|
@ -38,8 +38,8 @@ private:
|
|||
uint32_t read32(File f);
|
||||
uint16_t read16(File f);
|
||||
|
||||
void splashScreen();
|
||||
void mainScreen();
|
||||
void drawSplashScreen();
|
||||
void drawMainScreen();
|
||||
void hilightLine(int line);
|
||||
void unHilightLine(int line);
|
||||
void mainScreenHilight(joyDirection direction);
|
||||
|
|
Reference in a new issue