Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Adding support for toast.showWithOptions #1273

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brickpop
Copy link

@brickpop brickpop commented Jun 18, 2016

Version 2.4 of cordovaplugin-x-toast allows to provide styling for the toast messages.

  window.plugins.toast.showWithOptions({
    message: "hey there",
    duration: "short", // 2000 ms
    position: "bottom",
    styling: {
      opacity: 0.75, // 0.0 (transparent) to 1.0 (opaque). Default 0.8
      backgroundColor: '#FF0000', // make sure you use #RRGGBB. Default #333333
      textColor: '#FFFF00', // Ditto. Default #FFFFFF
      textSize: 20.5, // Default is approx. 13.
      cornerRadius: 16, // minimum is 0 (square). iOS default 20, Android default 100
      horizontalPadding: 20, // iOS default 16, Android default 50
      verticalPadding: 16 // iOS default 12, Android default 30
    }
  });

Also, the cordova plugin name is updated and some control code is added to prevent runtime errors if the plugin is not yet installed.
Thank you!

Version 2.4 of cordovaplugin-x-toast allows to provide styling for the toast messages.

  window.plugins.toast.showWithOptions({
    message: "hey there",
    duration: "short", // 2000 ms
    position: "bottom",
    styling: {
      opacity: 0.75, // 0.0 (transparent) to 1.0 (opaque). Default 0.8
      backgroundColor: '#FF0000', // make sure you use #RRGGBB. Default #333333
      textColor: '#FFFF00', // Ditto. Default #FFFFFF
      textSize: 20.5, // Default is approx. 13.
      cornerRadius: 16, // minimum is 0 (square). iOS default 20, Android default 100
      horizontalPadding: 20, // iOS default 16, Android default 50
      verticalPadding: 16 // iOS default 12, Android default 30
    }
  });

Also, the cordova plugin name is updated and some control code is added to prevent runtime errors if the plugin is not yet installed. 
Thank you!
@gortok
Copy link
Contributor

gortok commented Jun 20, 2016

This should be put in dev-next branch; which I believe already has this PR.

@gortok
Copy link
Contributor

gortok commented Jun 28, 2016

I love some of these changes; so if you target the dev-next branch and you pull the latest from it to do your additions off of, I'd be happy to add it.

Copy link
Contributor

@gortok gortok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please base this off of dev-next.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants