Skip to content

How to use Appearance

o5faruk edited this page May 2, 2021 · 14 revisions

⚠️⚠️⚠️

This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/appearance/

⚠️⚠️⚠️

buildfire.appearance

Use this property to modify the appearance of the plugin and sometimes the surrounding platform

buildfire.appearance.setHeaderVisibility(value)

Use this to hide and show the Header in the Control Panel - Control section. Use this in your control content, Header

arguments

  • value (bool) 'true'/'false' example buildfire.appearance.setHeaderVisibility(false);

buildfire.appearance.titlebar.show()

Use this to force showing the title bar on the app emulator or the mobile app. this function only works inside the widget.

buildfire.appearance.titlebar.hide()

Use this to force hiding the title bar on the app emulator or the mobile app. this function only works inside the widget.


buildfire.appearance.getAppTheme(callback)

use this to retrive the appTheme object in the callback as follows

{
"appName":"test App",
"colors":{"backgroundColor":"#0b0c0b",
  "titleBar":"#09a3ee",
  "titleBarTextAndIcons":"#ffffff",
  "headerText":"#09a3ee",
  "bodyText":"#3765c1",
  "icons":"#09a3ee",
  "primaryTheme":"#09a3ee",
  "successTheme":"#14cb5d",
  "infoTheme":"#69d5ff",
  "warningTheme":"#faba41",
  "dangerTheme":"#ed4b4b",
  "defaultTheme":"#0677ae",
  "footerMenuBackgroundColor":"#f05524",
  "footerMenuIconColor":"#f19969"
  },
"fontId":"Helvetica",
"fontName":"Helvetica"
}

It's possible that the appearance settings can change after the app has been loaded. If you wish to keep track of these changes, override the buildfire.appearance.triggerOnUpdate function with your own custom function. Within your custom function you can make an additional call to buildfire.appearance.getAppTheme and update the styling of your plugin as necessary.

buildfire.appearance.triggerOnUpdate = function(){
     buildfire.appearance.getAppTheme(function(err, appTheme){
     //apply theme changes here
 });
}

buildfire.appearance.ready()

Called when plugin content is fully loaded. Hides the buildfire spinner and makes the plugin immediately available.

Clone this wiki locally