How to use the nativescript-fancyalert.TNSFancyAlertButton function in nativescript-fancyalert

To help you get started, we’ve selected a few nativescript-fancyalert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NathanWalker / nativescript-fancyalert / demo / app / main-view-model.ts View on Github external
public showCustomButtons() {
    let buttons = [
      new TNSFancyAlertButton({
        label: "One",
        action: () => {
          console.log("One");
        }
      }),
      new TNSFancyAlertButton({
        label: "Two",
        action: () => {
          console.log("Two");
        }
      }),
      new TNSFancyAlertButton({
        label: "Three",
        action: () => {
          console.log("Three");
        }
      }),
      new TNSFancyAlertButton({
        label: "Four",
        action: () => {
          console.log("Four");
        }
github NathanWalker / nativescript-fancyalert / demo / app / main-view-model.ts View on Github external
let underline = nsString.rangeOfStringOptions(
        "too!",
        NSCaseInsensitiveSearch
      );
      subTitle.addAttributeValueRange(
        NSUnderlineStyleAttributeName,
        NSUnderlineStyleSingle,
        underline
      );

      return subTitle;
    };
    TNSFancyAlert.showCustomTextAttributes(
      textAttribution,
      new TNSFancyAlertButton({
        label: "Wow, ok.",
        action: (value: any) => {
          console.log(`Clicked ok.`);
        }
      }),
      undefined,
      undefined,
      "Custom text color?",
      `Yep, that can be done too!`,
      null
    );
  }
github NathanWalker / nativescript-fancyalert / demo / app / main-view-model.ts View on Github external
public showTextField() {
    TNSFancyAlert.showTextField(
      "Enter your name",
      "",
      new TNSFancyAlertButton({
        label: "Save",
        action: (value: any) => {
          console.log(`User entered ${value}`);
        }
      }),
      undefined,
      undefined,
      "User Input?",
      `Yeah, sure we can.`,
      "Ok, lots of options."
    );
  }
github NathanWalker / nativescript-fancyalert / demo / app / main-view-model.ts View on Github external
public showSwitch() {
    TNSFancyAlert.showSwitch(
      `Don't show again`,
      "#58B136",
      new TNSFancyAlertButton({
        label: "Save",
        action: (isSelected: boolean) => {
          console.log(`Don't show again was selected: ${isSelected}`);
        }
      }),
      "switch.png",
      "#B3714F",
      "Need a switch?",
      `It can be useful.`,
      "Got it."
    );
  }