Content-Length: 273165 | pFad | https://github.com/NativeScript/NativeScript/issues/615

09 View Component consistancy · Issue #615 · NativeScript/NativeScript · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View Component consistancy #615

Closed
NathanaelA opened this issue Aug 23, 2015 · 9 comments
Closed

View Component consistancy #615

NathanaelA opened this issue Aug 23, 2015 · 9 comments
Assignees
Milestone

Comments

@NathanaelA
Copy link
Contributor

In the View component; we use .observe to connect our event handlers to any Gesture events. Is their some reason why we can't make this be a lot more consistent with the Observable event handling system and use the on, addEventListener, off, and removeEventListener functions? That way all events go through those functions.

This seems inconsistent to have some events connected via on and some events connected via observe

@NathanaelA

This comment was marked as abuse.

@vakrilov
Copy link
Contributor

One more inconsistency worth fixing are the event args:
For gestures args.view(coming form GestureEventData) should be used to get the calling view.
For other events (for example Button.tap) it is args.object (coming from EventData).

@enchev
Copy link
Contributor

enchev commented Aug 28, 2015

In my opinion observe() for gestures cannot be replaced easily with on/addEventListener since in the first case (observe) you can listen for multiple gestures with single callback:

    var lbl = new Label();
    lbl.observe(GestureTypes.tap | GestureTypes.doubleTap | GestureTypes.longPress, args => {
       //
    });

while with on/addEventListener you can listen for just one event:

    var btn = new Button();
    btn.on(Button.tapEvent, args => {
        //
    });

@NathanaelA

This comment was marked as abuse.

@enchev
Copy link
Contributor

enchev commented Aug 31, 2015

Hi @NathanaelA,

It will be hard to apply the same pattern for regular events since they are strings (the first argument of on/addEventListener) while gesture types are numbers and you can use them in bitwise operations.

@NathanaelA

This comment was marked as abuse.

@enchev
Copy link
Contributor

enchev commented Aug 31, 2015

Hi @NathanaelA,

Actually you are right - I've made pull request with on/off support for gestures. Please let me know if you have any questions!

Thanks

@NathanaelA

This comment was marked as abuse.

@enchev enchev added this to the 1.3.0 milestone Sep 1, 2015
@enchev enchev added the done label Sep 1, 2015
@enchev enchev closed this as completed Sep 1, 2015
@enchev enchev added the feature label Sep 16, 2015
@lock
Copy link

lock bot commented Aug 31, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/NativeScript/NativeScript/issues/615

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy