Code Monkey home page Code Monkey logo

nativescript-dialog's People

Contributors

enchev avatar mitko-kerezov avatar pietervz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

nativescript-dialog's Issues

Swift library increases app size dramatically

Hey there!

Awesome package.

Our app was solely Objective-C until we added this package, and this was the first Swift package. The app binary increased by about 15MB because of this package, as all the Swift frameworks have to be included in the .ipa itself.

Would an older version of SDCAlertView that wasn't Swift be usable?

TypeError: result.dialog.dismissAnimatedCompletion is not a function

Hi,

I try to set up the dialog for iOS, but I always get the following error when I try to close the dialog after an http request has finished:
TypeError: result.dialog.dismissAnimatedCompletion is not a function. (In 'result.dialog.dismissAnimatedCompletion(true, null)', 'result.dialog.dismissAnimatedCompletion' is undefined)

This is what I am doing:

exports.showActivityIndicatorDialog = function() {
    if(platform.device.os === platform.platformNames.ios){
        nativeView = UIActivityIndicatorView.alloc().initWithActivityIndicatorStyle(UIActivityIndicatorViewStyle.UIActivityIndicatorViewStyleGray);
        nativeView.startAnimating();
    } else if(platform.device.os === platform.platformNames.android){
        nativeView = new android.widget.ProgressBar(application.android.currentContext);
        nativeView.setIndeterminate(true);
        nativeView.setPadding(0, 0, 0, 30); //left, top, right, bottom
    }

    dialog.show({
        message: "Some message",
        cancelButtonText: "",
        nativeView: nativeView
    }).then(function(result){
        console.log(result);
    });
};


exports.closeActivityIndicatorDialog = function() {
    try {
        dialog.close();
    } catch(e) {
        console.log(e);
    }
};

So when any http-request in my app has finished, I try to call the closeActivityIndicatorDialog function.
My testing environment:

  • Telerik AppBuilder 3.7.0
  • NativeScript 2.5
  • tns-core-modules: 2.5.2
  • nativescript-dialog: 0.1.0
  • iPhone 4S with iOS 8.4

Everything works fine on Android. Does anybody know what is going wrong here on iOS?

Best regards,
Felix

When there's no message set, there's whitespace where the message should be

Hey there,

So I see when there's no message set that the message field is still initialised on both iOS and Android with an empty string. This leaves a fairly obvious space between the title and the nativeView. The way I fixed it was by checking whether the message was set, and then setting the message rather than initialising it with an empty string. So:

for example on Android, rather than:

alert.setMessage(options.message || "");

I use:

if (options.message) {
  alert.setMessage(options.message);
}

I'm not exactly sure if it's default behaviour on iOS, as removing the message doesn't seem to change anything.

Question: position of message/indicator?

Can the message and indicator be together on the same "row"? I'll attach an image when I get to my computer but they're on the same line in the apps I use. Trello, Twitter, Facebook. If you don't have the time to look into this I'll see about the android side, iOS I have no clue.

Using your own views instead of native componenets

Is this possible? I'd like to use this on iOS due to the built in nativescript modal covering the whole screen. I have a page with some icons and text and I'd like to load this and use it in the nativeView component.

Close/Hide method to dispose of the dialog

Are there any methods to remove the dialog from the UI? I didn't see anything in the .js files to do this. Thanks.

Oh and a huge ๐Ÿ‘ for this, I've been trying to achieve this for a couple days with no luck.

Can not build apps with Xcode7.2

When try to build sample app with Xcode 7.2 result is:

Swift._ContiguousArrayBuffer<A.Element> in ActionSheetView-D196E6E1AE053852.o
      ...
  "_swift_slowAlloc", referenced from:
      l_get_field_types_ActionCell in ActionCell-4FAA7E5C39EF3278.o
      l_get_field_types_ActionSeparatorView in ActionCell-4FAA7E5C39EF3278.o
      l_get_field_types_ActionSheetView in ActionSheetView-D196E6E1AE053852.o
      l_get_field_types_UIGestureRecognizerState in ActionSheetView-D196E6E1AE053852.o
      l_get_field_types_ActionsCollectionView in ActionsCollectionView.o
      l_get_field_types_UICollectionViewScrollDirection in ActionsCollectionView.o
      l_get_field_types_UIGestureRecognizerState in ActionsCollectionView.o
      ...
  "_swift_slowDealloc", referenced from:
      l_get_field_types_ActionCell in ActionCell-4FAA7E5C39EF3278.o
      l_get_field_types_ActionSeparatorView in ActionCell-4FAA7E5C39EF3278.o
      l_get_field_types_ActionSheetView in ActionSheetView-D196E6E1AE053852.o
      l_get_field_types_UIGestureRecognizerState in ActionSheetView-D196E6E1AE053852.o
      l_get_field_types_ActionsCollectionView in ActionsCollectionView.o
      l_get_field_types_UICollectionViewScrollDirection in ActionsCollectionView.o
      l_get_field_types_UIGestureRecognizerState in ActionsCollectionView.o
      ...
  "_swift_unknownRelease", referenced from:
      @objc SDCAlertView.ActionCell.titleLabel.setter : __ObjC.UILabel! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.(highlightedBackgroundView in _9D875CD50AFC0A29E6CC02B5D165BE76).setter : __ObjC.UIView! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.enabled.setter : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.enabled.setter : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.enabled.didset : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.highlighted.setter : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.highlighted.didset : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      ...
  "_swift_unknownRetain", referenced from:
      @objc SDCAlertView.ActionCell.titleLabel.getter : __ObjC.UILabel! in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.titleLabel.getter : __ObjC.UILabel! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.titleLabel.setter : __ObjC.UILabel! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.(highlightedBackgroundView in _9D875CD50AFC0A29E6CC02B5D165BE76).getter : __ObjC.UIView! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.(highlightedBackgroundView in _9D875CD50AFC0A29E6CC02B5D165BE76).setter : __ObjC.UIView! in ActionCell-4FAA7E5C39EF3278.o
      @objc SDCAlertView.ActionCell.enabled.setter : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      SDCAlertView.ActionCell.enabled.setter : Swift.Bool in ActionCell-4FAA7E5C39EF3278.o
      ...
  "_swift_unknownWeakAssign", referenced from:
      @objc SDCAlertView.ActionSheetView.(cancelActionView in _1A63DC1157DE00F3AB9B9EAE982FC99F).setter : weak __ObjC.UIView? in ActionSheetView-D196E6E1AE053852.o
      @objc SDCAlertView.ActionSheetView.(cancelLabel in _1A63DC1157DE00F3AB9B9EAE982FC99F).setter : weak __ObjC.UILabel? in ActionSheetView-D196E6E1AE053852.o
      @objc SDCAlertView.ActionSheetView.(cancelButton in _1A63DC1157DE00F3AB9B9EAE982FC99F).setter : weak __ObjC.UIButton? in ActionSheetView-D196E6E1AE053852.o
  "_swift_unknownWeakDestroy", referenced from:
      @objc SDCAlertView.ActionSheetView.__ivar_destroyer in ActionSheetView-D196E6E1AE053852.o
      l_objectdestroy30 in AlertController.o
  "_swift_unknownWeakInit", referenced from:
      SDCAlertView.ActionSheetView.init (SDCAlertView.ActionSheetView.Type)(frame : __C.CGRect) -> SDCAlertView.ActionSheetView in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.ActionSheetView.__allocating_init (SDCAlertView.ActionSheetView.Type)(frame : __C.CGRect) -> SDCAlertView.ActionSheetView in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.ActionSheetView.__allocating_init (SDCAlertView.ActionSheetView.Type)(coder : __ObjC.NSCoder) -> SDCAlertView.ActionSheetView? in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.ActionSheetView.init (SDCAlertView.ActionSheetView.Type)(coder : __ObjC.NSCoder) -> SDCAlertView.ActionSheetView? in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.AlertController.(configureAlertView in _03556AC34B15272832C68ED974279B9D) (SDCAlertView.AlertController)() -> () in AlertController.o
  "_swift_unknownWeakLoadStrong", referenced from:
      @objc SDCAlertView.ActionSheetView.(cancelActionView in _1A63DC1157DE00F3AB9B9EAE982FC99F).getter : weak __ObjC.UIView? in ActionSheetView-D196E6E1AE053852.o
      @objc SDCAlertView.ActionSheetView.(cancelLabel in _1A63DC1157DE00F3AB9B9EAE982FC99F).getter : weak __ObjC.UILabel? in ActionSheetView-D196E6E1AE053852.o
      @objc SDCAlertView.ActionSheetView.(cancelButton in _1A63DC1157DE00F3AB9B9EAE982FC99F).getter : weak __ObjC.UIButton? in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.ActionSheetView.prepareLayout (SDCAlertView.ActionSheetView)() -> () in ActionSheetView-D196E6E1AE053852.o
      SDCAlertView.ActionSheetView.tintColorDidChange (SDCAlertView.ActionSheetView)() -> () in ActionSheetView-D196E6E1AE053852.o
      @objc SDCAlertView.ActionSheetView.tintColorDidChange (SDCAlertView.ActionSheetView)() -> () in ActionSheetView-D196E6E1AE053852.o
      function signature specialization <Arg[0] = Dead and Owned To Guaranteed> of SDCAlertView.ActionSheetView.actions.didset : [SDCAlertView.AlertAction] in ActionSheetView-D196E6E1AE053852.o
      ...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Showing first 200 notices only

** BUILD FAILED **


The following build commands failed:
    Ld /Users/nsbuilduser/workspace/tns-plugins-build-testapps-dialog-stable/demo/platforms/ios/build/emulator/SDCAlertView.framework/SDCAlertView normal i386
(1 failure)
Command xcodebuild failed with exit code 65

It looks like http://www.openradar.me/23857648
In order to fix this may be {N} cli should be able to pass something like:
destination 'platform=iOS Simulator,name=iPhone 6,OS=latest'

Add ability to update Message

When using this an a loading dialog people may need to update the message. Having an updateMessage method would be nice. Also the ability to not have the alert cancel if you click offscreen.

ReferenceError: Can't find variable: SDCAlertController

Current version (0.1.0) works on Android.

On iOS, I'm getting ReferenceError: Can't find variable: SDCAlertController

My code:

            var dialog = require("nativescript-dialog");

            var nativeView;
            if(platform.device.os === platform.platformNames.ios){
                nativeView = UIActivityIndicatorView.alloc().initWithActivityIndicatorStyle(UIActivityIndicatorViewStyle.UIActivityIndicatorViewStyleGray);
              nativeView.startAnimating();
            } else if(platform.device.os === platform.platformNames.android){
                nativeView = new android.widget.ProgressBar(application.android.currentContext);
              nativeView.setIndeterminate(true);
            }

            dialog.show({
              title: "Loading...",
              message: "Please wait!",
              cancelButtonText: "Cancel",
              nativeView: nativeView}
            ).then(function(r){ console.log("Result: " + r); },
            function(e){console.log("Error: " + e)});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.