Decorators – layered painting – MiG InfoCom MiG Calendar Tutorial User Manual

Page 15

Advertising
background image

MiG InfoCom AB

The above paragraph describes what happens within one level. Since
activities can be divided into layers, a lower level will be laid
completely before the next level is laid out. The occupied rectangles
will be cleared between layers making them visually overlap. In short
one layout cycle will be made for every layer (see

Activity.getLayerIndex()

) that has at least one

Activity

.

This flexibility is needed to accommodate for the possibility to have,
for instance, background images for Christmas, normal date range
rectangles for most activities and maybe icons for alarms and
reminders.

Implementations of interface

ActivityLayoutBroker

(

DefaultDateArea

is one) will decide which activities is laid out

by which

ActivityLayout

s. The default implementation decides

upon whether the activity's layout context
(

Activity.getLayoutContext()

) matches the installed

layout's. The

ActivityLayoutBroker

and the

Activity

thus

cooperates in this process.

Three

ActivityLayout

implementations are included by default.

FlexGridLayout

lays out in a grid or flow like formation. It is

hight customizable, even trough a Theme.

TimeBoundsLayout

lays out the views according to their exact

or rounded dates and times in the

DateGrid

. Overlapping date

ranges are handled and the overlap can be specified both absolute
or relative. The size in the secondary dimension is also very
flexible with min/preferred/max size that can be absolute or relative
to the available bounds for the

GridRow

.

HideLayout

can be used to hide views with certain properties.

Currently the duration is evaluated. It can for instance hide activity
views that spans more than one day or is less than on hour.

The layout framework in MiG Calendar is very flexible though you will
probably just install the layout that you need and that's it. It it probably
even simpler, you just configure one or more layouts in the GUI
Theme Editor and everything is handled automatically!

Decorators – layered painting

Decorators is used to paint in both the

DefaultDateArea

and

AbstactDateHeader

and its sub classes.

Decorator

s are very

MiG Calendar Tutorial

Page 15 / 24

Advertising