mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-03 02:18:34 +00:00
Comments & Dictionaries
Reformatted comments to work in VSCode and converted `dict.get(:key)` to `dict[:key]` syntax as its nicer.
This commit is contained in:
@ -35,38 +35,38 @@ class Alert extends WatchUi.View {
|
||||
|
||||
//! Class Constructor
|
||||
//! @param params A dictionary object as follows:<br>
|
||||
//! {<br>
|
||||
//!   :timeout as Lang.Number, // Timeout in millseconds<br>
|
||||
//!   :font as Graphics.FontType, // Text font size<br>
|
||||
//!   :text as Lang.String, // Text to display<br>
|
||||
//!   :fgcolor as Graphics.ColorType, // Foreground Colour<br>
|
||||
//!   :bgcolor as Graphics.ColorType // Background Colour<br>
|
||||
//! }
|
||||
//! `{`<br>
|
||||
//!   `:timeout as Lang.Number,` // Timeout in millseconds<br>
|
||||
//!   `:font as Graphics.FontType,` // Text font size<br>
|
||||
//!   `:text as Lang.String,` // Text to display<br>
|
||||
//!   `:fgcolor as Graphics.ColorType,` // Foreground Colour<br>
|
||||
//!   `:bgcolor as Graphics.ColorType` // Background Colour<br>
|
||||
//! `}`
|
||||
//
|
||||
function initialize(params as Lang.Dictionary) {
|
||||
View.initialize();
|
||||
|
||||
mText = params.get(:text) as Lang.String;
|
||||
mText = params[:text] as Lang.String;
|
||||
if (mText == null) {
|
||||
mText = "Alert";
|
||||
}
|
||||
|
||||
mFont = params.get(:font) as Graphics.FontType;
|
||||
mFont = params[:font] as Graphics.FontType;
|
||||
if (mFont == null) {
|
||||
mFont = Graphics.FONT_MEDIUM;
|
||||
}
|
||||
|
||||
mFgcolor = params.get(:fgcolor) as Graphics.ColorType;
|
||||
mFgcolor = params[:fgcolor] as Graphics.ColorType;
|
||||
if (mFgcolor == null) {
|
||||
mFgcolor = Graphics.COLOR_BLACK;
|
||||
}
|
||||
|
||||
mBgcolor = params.get(:bgcolor) as Graphics.ColorType;
|
||||
mBgcolor = params[:bgcolor] as Graphics.ColorType;
|
||||
if (mBgcolor == null) {
|
||||
mBgcolor = Graphics.COLOR_WHITE;
|
||||
}
|
||||
|
||||
mTimeout = params.get(:timeout) as Lang.Number;
|
||||
mTimeout = params[:timeout] as Lang.Number;
|
||||
if (mTimeout == null) {
|
||||
mTimeout = 2000;
|
||||
}
|
||||
|
Reference in New Issue
Block a user