PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
notification_layout.h File Reference
#include "item.h"
#include "layout_layer.h"
#include "timeline_layout.h"
#include <applib/ui/kino/kino_layer.h>
#include <pbl/services/timeline/attribute.h>
#include <pbl/services/timeline/timeline_resources.h>

Data Structures

struct  NotificationStyle
 Fonts and spacing of a notification card, per content size. More...
 
struct  NotificationLayoutInfo
 LayoutLayerConfig context of a notification layout. More...
 
struct  NotificationLayout
 Notification and reminder layout; can be cast to a LayoutLayer. More...
 

Macros

#define LAYOUT_BANNER_HEIGHT_RECT
 Banner height of notification and reminder layouts on rectangular displays, excluding the status bar; the top and bottom banners have the same size.
 
#define LAYOUT_TOP_BANNER_HEIGHT_ROUND   60
 Height of the top banner on round displays, including the status bar.
 
#define LAYOUT_BOTTOM_BANNER_HEIGHT_ROUND   40
 Height of the bottom banner on round displays.
 
#define LAYOUT_TOP_BANNER_HEIGHT
 Height of the top banner, excluding the status bar.
 
#define LAYOUT_ARROW_HEIGHT   PBL_IF_RECT_ELSE(19, 16)
 Height of the white arrow layer.
 
#define LAYOUT_HEIGHT   (DISP_ROWS - STATUS_BAR_LAYER_HEIGHT - LAYOUT_ARROW_HEIGHT)
 Height of the layout text region: the display minus the status bar and arrow.
 
#define LAYOUT_BEFORE_TEXT_SPACING_Y   40
 Vertical offset before the text begins.
 
#define BANNER_CIRCLE_RADIUS   140
 Radius of the round banner.
 
#define LAYOUT_TOP_BANNER_ORIGIN_Y    (LAYOUT_TOP_BANNER_HEIGHT_ROUND - (BANNER_CIRCLE_RADIUS + STATUS_BAR_LAYER_HEIGHT) - 1)
 Vertical origin of the round top banner circle.
 
#define TEXT_VISIBLE_UPPER_THRESHOLD   (STATUS_BAR_LAYER_HEIGHT - INTERPOLATE_MOOOK_BOUNCE_BACK - 1)
 Largest layout origin y at which its text is considered visible.
 
#define TEXT_VISIBLE_LOWER_THRESHOLD(h)    (-(h) + DISP_ROWS - STATUS_BAR_LAYER_HEIGHT - INTERPOLATE_MOOOK_BOUNCE_BACK - 1)
 Smallest layout origin y at which its text is considered visible.
 
#define DEFAULT_NOTIFICATION_COLOR   (GColorFolly)
 Default notification background color.
 
#define DEFAULT_REMINDER_COLOR   (GColorRed)
 Default reminder background color.
 
#define NOTIFICATION_TINY_RESOURCE_HEIGHT   (ATTRIBUTE_ICON_TINY_SIZE_PX)
 Height of the tiny icon in the notification banner.
 
#define NOTIFICATION_TINY_RESOURCE_SIZE   (GSize(30, NOTIFICATION_TINY_RESOURCE_HEIGHT))
 Size of the tiny icon in the notification banner; some icons are 30 px wide.
 
#define NOTIFICATION_TINY_RESOURCE_VERTICAL_OFFSET
 Vertical adjustment of the banner icon.
 
#define CARD_ICON_UPPER_PADDING
 Vertical position of the banner icon within the layout.
 
#define NOTIFICATION_IMAGE_MIN_ASPECT   (4)
 Widest image band a notification can reserve, 4:1 landscape, as a height/width ratio in sixteenths.
 
#define NOTIFICATION_IMAGE_MAX_ASPECT   (24)
 Tallest image band a notification can reserve, 2:3 portrait, in sixteenths.
 

Functions

LayoutLayer * notification_layout_create (const LayoutLayerConfig *config)
 Create a notification layout.
 
bool notification_layout_verify (bool existing_attributes[])
 Check the attributes of a notification or reminder.
 
bool notification_layout_get_image_size (const LayoutLayer *layout, GSize *size_out)
 Get the size of the image band a notification layout reserves.
 
TimelineResourceId notification_layout_get_fallback_icon_id (TimelineItemType item_type)
 Get the icon used when an item has none.
 

Variables

static const TimelineResourceId NOTIF_FALLBACK_ICON = TIMELINE_RESOURCE_NOTIFICATION_GENERIC
 Icon of notifications without one.
 
static const TimelineResourceId REMINDER_FALLBACK_ICON = TIMELINE_RESOURCE_NOTIFICATION_REMINDER
 Icon of reminders without one.