src/c/main.c
static void back_update_proc(Layer *layer, GContext *ctx) {
  // Colors
  graphics_context_set_text_color(ctx,ColorSelect(settings.NightTheme, true, settings.IsNightNow, settings.ForegroundColor, settings.ForegroundColorNight));
  GRect bounds2layer = layer_get_bounds(layer);
  if (settings.BatteryBar){
    int battlevel=battery_state_service_peek().charge_percent;
    graphics_context_set_stroke_color(ctx,ColorSelect(settings.NightTheme, 
                                                    true, settings.IsNightNow, settings.ForegroundColor, settings.ForegroundColorNight));
    graphics_context_set_stroke_width(ctx, 2);
    graphics_draw_line(ctx,GPoint(bounds2layer.origin.x, bounds2layer.origin.y),GPoint(bounds2layer.size.w*battlevel/100,bounds2layer.origin.y));  
  }
  //Translate
  char WeekDay_END[BUFFER_SIZE];
  char Date_END[BUFFER_SIZE];
  char Month_END[BUFFER_SIZE];
  // Set language
  writedatelang(mast_wday,mast_mon,mast_day, WeekDay_END, Date_END,Month_END,settings.LangKey);
  //Draw day of the week
  GRect WDay_rect=GRect(bounds2layer.origin.x,bounds2layer.origin.y,bounds2layer.size.w,bounds2layer.size.h);
  graphics_draw_text(ctx, WeekDay_END, FontWDay, WDay_rect, GTextOverflowModeFill, GTextAlignmentCenter, NULL);
  //Draw date
  char builddate[BUFFER_SIZE];
  //Build based on config settings
  if (settings.DateFormat==1){ //DD MM
    strcpy(builddate,Date_END);
    strcat(builddate," ");
    strcat(builddate,Month_END);
  }
  else { //MM DD
    strcpy(builddate,Month_END);
    strcat(builddate," ");
    strcat(builddate,Date_END);
  }
  GRect Date=GRect(WDay_rect.origin.x,WDay_rect.origin.y+20,WDay_rect.size.w,WDay_rect.size.h);
  graphics_draw_text(ctx, builddate, FontDate, Date, GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, NULL);
  int offsetx=PBL_IF_ROUND_ELSE(0, 10);
  int offsety=PBL_IF_ROUND_ELSE(5, 10);
  
  int offsetconnect;
  if (!settings.BTOn || !settings.GPSOn){
    offsetconnect=5;
  }
  else {
    offsetconnect=0;
  }  
  //Draw Rect for temp
  GRect temprect=GRect(WDay_rect.origin.x,
                       WDay_rect.origin.y+offsetconnect,
                       WDay_rect.size.w/2-25-offsetx/3,
                       WDay_rect.size.h);
  //Draw Rect for cond
  GRect condrect=GRect(WDay_rect.size.w/2+25+offsetx,
                       WDay_rect.origin.y+offsety,
                       WDay_rect.size.w,
                       WDay_rect.size.h);

  //If Bluetooth off and some info was requested display warning
  if (!settings.BTOn){
    if (settings.DisplayTemp){
      graphics_draw_text(ctx, "a",
                         FontSymbol,
                         temprect,
                         GTextOverflowModeWordWrap, GTextAlignmentRight, NULL
                        );
    }
  }
  //If connected but GPS off then display warning
  else {
    if (!settings.GPSOn){
      if (settings.DisplayTemp){
        graphics_draw_text(ctx, "b",
                           FontSymbol,
                           temprect,
                           GTextOverflowModeWordWrap, GTextAlignmentRight, NULL
                          );
      }
    }
    // If BT on and GPS on display according with preferences
    else{
      //If weather active create text
      if (settings.DisplayTemp){
        // Create temp display
        graphics_draw_text(ctx, tempstring, FontWDay, temprect, GTextOverflowModeTrailingEllipsis, GTextAlignmentRight, NULL);
        // Create condition display
        if (settings.IsNightNow){
          graphics_draw_text(ctx, condstringnight, FontCond,condrect, GTextOverflowModeTrailingEllipsis, GTextAlignmentLeft, NULL);
        }
        else {
          graphics_draw_text(ctx, condstringday, FontCond,condrect, GTextOverflowModeTrailingEllipsis, GTextAlignmentLeft, NULL);
        }
      }
    }
  }
}
// Proc to update Date and Month layer
Proc to update Date and Month layer
Proc to update Date and Month layer
static void back_update_proc(Layer *layer, GContext *ctx) {
  graphics_context_set_text_color(ctx,ColorSelect(settings.NightTheme, true, settings.IsNightNow, settings.ForegroundColor, settings.ForegroundColorNight));
  GRect bounds2layer = layer_get_bounds(layer);
  if (settings.BatteryBar){
    int battlevel=battery_state_service_peek().charge_percent;
    graphics_context_set_stroke_color(ctx,ColorSelect(settings.NightTheme, 
                                                    true, settings.IsNightNow, settings.ForegroundColor, settings.ForegroundColorNight));
    graphics_context_set_stroke_width(ctx, 2);
    graphics_draw_line(ctx,GPoint(bounds2layer.origin.x, bounds2layer.origin.y),GPoint(bounds2layer.size.w*battlevel/100,bounds2layer.origin.y));  
  }
  char WeekDay_END[BUFFER_SIZE];
  char Date_END[BUFFER_SIZE];
  char Month_END[BUFFER_SIZE];
  writedatelang(mast_wday,mast_mon,mast_day, WeekDay_END, Date_END,Month_END,settings.LangKey);
  GRect WDay_rect=GRect(bounds2layer.origin.x,bounds2layer.origin.y,bounds2layer.size.w,bounds2layer.size.h);
  graphics_draw_text(ctx, WeekDay_END, FontWDay, WDay_rect, GTextOverflowModeFill, GTextAlignmentCenter, NULL);
  char builddate[BUFFER_SIZE];
  if (settings.DateFormat==1){ 
    strcpy(builddate,Date_END);
    strcat(builddate," ");
    strcat(builddate,Month_END);
  }
  else { 
    strcpy(builddate,Month_END);
    strcat(builddate," ");
    strcat(builddate,Date_END);
  }
  GRect Date=GRect(WDay_rect.origin.x,WDay_rect.origin.y+20,WDay_rect.size.w,WDay_rect.size.h);
  graphics_draw_text(ctx, builddate, FontDate, Date, GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, NULL);
  int offsetx=PBL_IF_ROUND_ELSE(0, 10);
  int offsety=PBL_IF_ROUND_ELSE(5, 10);
  int offsetconnect;
  if (!settings.BTOn || !settings.GPSOn){
    offsetconnect=5;
  }
  else {
    offsetconnect=0;
  }  
  GRect temprect=GRect(WDay_rect.origin.x,
                       WDay_rect.origin.y+offsetconnect,
                       WDay_rect.size.w/2-25-offsetx/3,
                       WDay_rect.size.h);
  GRect condrect=GRect(WDay_rect.size.w/2+25+offsetx,
                       WDay_rect.origin.y+offsety,
                       WDay_rect.size.w,
                       WDay_rect.size.h);
  if (!settings.BTOn){
    if (settings.DisplayTemp){
      graphics_draw_text(ctx, "a",
                         FontSymbol,
                         temprect,
                         GTextOverflowModeWordWrap, GTextAlignmentRight, NULL
                        );
    }
  }
  else {
    if (!settings.GPSOn){
      if (settings.DisplayTemp){
        graphics_draw_text(ctx, "b",
                           FontSymbol,
                           temprect,
                           GTextOverflowModeWordWrap, GTextAlignmentRight, NULL
                          );
      }
    }
    else{
      if (settings.DisplayTemp){
        graphics_draw_text(ctx, tempstring, FontWDay, temprect, GTextOverflowModeTrailingEllipsis, GTextAlignmentRight, NULL);
        if (settings.IsNightNow){
          graphics_draw_text(ctx, condstringnight, FontCond,condrect, GTextOverflowModeTrailingEllipsis, GTextAlignmentLeft, NULL);
        }
        else {
          graphics_draw_text(ctx, condstringday, FontCond,condrect, GTextOverflowModeTrailingEllipsis, GTextAlignmentLeft, NULL);
        }
      }
    }
  }
}
static void back_update_proc ( Layer * layer , GContext * ctx ) { graphics_context_set_text_color ( ctx , ColorSelect ( settings . NightTheme , true , settings . IsNightNow , settings . ForegroundColor , settings . ForegroundColorNight ) ) ; GRect bounds2layer = layer_get_bounds ( layer ) ; if ( settings . BatteryBar ) { int battlevel = battery_state_service_peek ( ) . charge_percent ; graphics_context_set_stroke_color ( ctx , ColorSelect ( settings . NightTheme , true , settings . IsNightNow , settings . ForegroundColor , settings . ForegroundColorNight ) ) ; graphics_context_set_stroke_width ( ctx , 2 ) ; graphics_draw_line ( ctx , GPoint ( bounds2layer . origin . x , bounds2layer . origin . y ) , GPoint ( bounds2layer . size . w * battlevel / 100 , bounds2layer . origin . y ) ) ; } char WeekDay_END [ BUFFER_SIZE ] ; char Date_END [ BUFFER_SIZE ] ; char Month_END [ BUFFER_SIZE ] ; writedatelang ( mast_wday , mast_mon , mast_day , WeekDay_END , Date_END , Month_END , settings . LangKey ) ; GRect WDay_rect = GRect ( bounds2layer . origin . x , bounds2layer . origin . y , bounds2layer . size . w , bounds2layer . size . h ) ; graphics_draw_text ( ctx , WeekDay_END , FontWDay , WDay_rect , GTextOverflowModeFill , GTextAlignmentCenter , NULL ) ; char builddate [ BUFFER_SIZE ] ; if ( settings . DateFormat == 1 ) { strcpy ( builddate , Date_END ) ; strcat ( builddate , " " ) ; strcat ( builddate , Month_END ) ; } else { strcpy ( builddate , Month_END ) ; strcat ( builddate , " " ) ; strcat ( builddate , Date_END ) ; } GRect Date = GRect ( WDay_rect . origin . x , WDay_rect . origin . y + 20 , WDay_rect . size . w , WDay_rect . size . h ) ; graphics_draw_text ( ctx , builddate , FontDate , Date , GTextOverflowModeTrailingEllipsis , GTextAlignmentCenter , NULL ) ; int offsetx = PBL_IF_ROUND_ELSE ( 0 , 10 ) ; int offsety = PBL_IF_ROUND_ELSE ( 5 , 10 ) ; int offsetconnect ; if ( ! settings . BTOn || ! settings . GPSOn ) { offsetconnect = 5 ; } else { offsetconnect = 0 ; } GRect temprect = GRect ( WDay_rect . origin . x , WDay_rect . origin . y + offsetconnect , WDay_rect . size . w / 2 - 25 - offsetx / 3 , WDay_rect . size . h ) ; GRect condrect = GRect ( WDay_rect . size . w / 2 + 25 + offsetx , WDay_rect . origin . y + offsety , WDay_rect . size . w , WDay_rect . size . h ) ; if ( ! settings . BTOn ) { if ( settings . DisplayTemp ) { graphics_draw_text ( ctx , " " , FontSymbol , temprect , GTextOverflowModeWordWrap , GTextAlignmentRight , NULL ) ; } } else { if ( ! settings . GPSOn ) { if ( settings . DisplayTemp ) { graphics_draw_text ( ctx , " " , FontSymbol , temprect , GTextOverflowModeWordWrap , GTextAlignmentRight , NULL ) ; } } else { if ( settings . DisplayTemp ) { graphics_draw_text ( ctx , tempstring , FontWDay , temprect , GTextOverflowModeTrailingEllipsis , GTextAlignmentRight , NULL ) ; if ( settings . IsNightNow ) { graphics_draw_text ( ctx , condstringnight , FontCond , condrect , GTextOverflowModeTrailingEllipsis , GTextAlignmentLeft , NULL ) ; } else { graphics_draw_text ( ctx , condstringday , FontCond , condrect , GTextOverflowModeTrailingEllipsis , GTextAlignmentLeft , NULL ) ; } } } } }
Proc to update Date and Month layer
Proc to update Date and Month layer
// Colors //Translate // Set language //Draw day of the week //Draw date //Build based on config settings //DD MM //MM DD //Draw Rect for temp //Draw Rect for cond //If Bluetooth off and some info was requested display warning //If connected but GPS off then display warning // If BT on and GPS on display according with preferences //If weather active create text // Create temp display // Create condition display