131 Commits

Author SHA1 Message Date
cf07b2719f chore: update deprecations (#7046) 2019-03-21 14:25:36 +02:00
b40f027f10 Merge branch 'master' into mdonev/release-to-master-7011 2019-03-15 18:35:41 +02:00
88f224272b fix: expose missing css background* properties on View (#7032) 2019-03-15 17:42:03 +02:00
f05616743b fix: set/unset touchListener.owner onLoaded/onUnloaded (#6922) 2019-03-15 10:29:32 +02:00
3c2c1d9b69 feat(HMR): style views at runtime (#7012)
* feat(HMR): style view at runtime

test: module root view component

test: update livesync tests

refactor: _onLivesync function

* style: remove a comment

* refactor: rename the property
2019-03-13 13:24:49 +02:00
41f3834106 Merge branch 'master' into myankov/merge-release-master 2019-02-28 10:22:01 +02:00
a9d2043a0c fix(ios): resize of scrollview content breaks layout (#6965) 2019-02-28 10:20:21 +02:00
bf1dd0aeea Merge branch 'master' into myankov/merge-release-master 2019-02-21 15:58:13 +02:00
f34068d59b fix(angular): Re-add references to tns-core-modules.d.ts (#6949)
They were removed in #6927 because we thought they were
unnecessary.
2019-02-21 09:43:38 +02:00
4a4bbfbad1 Merge branch 'master' into myankov/merge-release-master 2019-02-20 18:47:33 +02:00
09fa0856b8 fix(ios): opaque bars break ui layout (#6929)
* fix(ios): opaque bars break ui layout

* test(): change flat action bar tests

* test(): revert test flat change test
2019-02-20 18:46:14 +02:00
5449cfa238 fix(docs): Move NativeScriptError declaration to a separate file (#6927)
It is used by `application.d.ts` and needs to be documented. The reason
that it wasn't included in the documentation by now is that `tns-core-modules.d.ts`
(which imports `module.d.ts`) defines types which are part of the internal
modules and runtimes APIs. As such they are excluded from the generation
of API documentation.
2019-02-20 13:58:09 +02:00
44b8acd79c feat(HMR): apply changes in page styles at runtime when app root is a frame (#6857)
* feat(HMR): apply changes in page styles at runtime

* fix: livesync tests

* test: changeCssFile method

* refactor: address comments

Add a comment.
Update `let` to `const`.
Update `changesCssFile` test.

* test: add an assert
2019-02-14 14:03:13 +02:00
8c80044cc0 fix(view-android): clear dialog fragment when closing modal view (#6852) 2019-02-04 15:34:37 +02:00
08acd84fe2 fix(ios): native view frame optimizations in nested scenario (#6809) 2019-01-23 11:09:04 +02:00
3a8c3fca75 feat(modals): option to make dialogs cancelable in Android (#6765) 2019-01-08 16:56:30 +02:00
1ae0cfd4b3 refactor: cleanup unused elements (#6732) 2019-01-02 11:17:55 +02:00
6cdb01d432 set the correct application theme while creating the dialog fragment (#6691)
* set the correct application theme while creating the dialog fragment

* useing the new approche fusing the new approach for setting the theme only when the modal view is fullscreen(it will break the style when using non-fullscreen modal)

* note - get theme change

* set the correct application theme while creating the dialog fragment

* useing the new approche fusing the new approach for setting the theme only when the modal view is fullscreen(it will break the style when using non-fullscreen modal)

* note - get theme change
2018-12-31 14:20:52 +02:00
8a32102fa1 fix(modal): Fix crash if modal is destroyed before dismissed in Android (#6723) 2018-12-20 17:24:13 +02:00
540b2b4f82 feat(view): added iOS parameter for modal presentation style (#6409)
* feat(view): added iOS parameter for modal presentation style

* Now passing options to showModal in one argument

* refactor: Move context and close in modal options

* chore: Comments added for UIModalPresentationStyle.Popover case

* refactor: Use modalOptions in e2e demo

* chore: fix pbroken test
2018-12-13 17:03:25 +02:00
63be78a69c fix(listview): incorrect layout when scroll (#6656) 2018-12-05 16:28:37 +02:00
30df4d9c4a fix(modals): regression with modals in angular (#6655) 2018-12-04 16:39:07 +02:00
ae0fa90290 feat(scrollbar): add isScrollEnabled property (#6640) 2018-11-30 17:18:40 +02:00
64bccb9bbc feat(modals): Enable modal dialog chaining in IOS (#6637)
* feat(modals): fire close callback after close in IOS

* chore(tests): Fix some test depending on the order of events
2018-11-30 12:05:33 +02:00
51a191f396 fix(ios): safe area handling in scrollview (#6561) 2018-11-15 13:07:15 +00:00
7fbdc7adc8 fix: layoutChanged event in landscape (#6520) 2018-11-07 14:23:02 +02:00
58c9d424f5 fix-next(ios): handle nesting in proxyViewContainer ng (#6475) 2018-10-30 14:00:00 +02:00
7625d6cb21 fix-next: handle view controller nesting in ng (#6472) 2018-10-29 19:22:30 +02:00
f5cca13a7c fix-next: correct raising of layoutChanged event (#6457)
Currently the layoutChanged event can be raised even when there is no change due to safe area calculations.
2018-10-26 17:03:23 +03:00
e48782511d fix-next: handle action bar safe area nesting (#6455) 2018-10-26 14:05:14 +03:00
dfa208a54d fix-next: apply ios safe area before transform (#6443) 2018-10-23 13:38:02 +03:00
7e891a91f9 fix-next: restrict to safe area when transform (#6405) 2018-10-15 10:17:56 +03:00
5b77017d37 refactor(android): root fragment manager usage (#6399) 2018-10-11 19:02:41 +03:00
307172003d fix: nested fragments interact thru child fragment manager (#6293) 2018-10-11 17:44:30 +03:00
04233b65c1 fix-next: ios 10 safe area backwards compat (#6364)
* fix-next: ios 10 safe area backwards compat

* refactor: update a comment

* fix-next: ios 10 page on layout fix

* fix-next: handle ios 11 flat action bar
2018-10-09 10:16:31 +03:00
982acdc168 feat(iOS): Safe Area Support (#6230) 2018-09-28 18:21:50 +03:00
46705ee332 refactor(core-modules): implement createNativeView and initNativeView for all components
refactor(core-modules): implement createNativeView and initNativeView for all components
2018-09-26 13:59:12 +03:00
262568314b feat: add ability to pass touch event thru parent view (#6204)
* feat: enhance hit-testing support
* refactor(android): update passthroughParent logic as per reqs
* refactor: move isPassthroughParentEnabled to LayoutBase
* Update view-common.ts
* refactor: touchListener logic
* refactor: renames
* added ui test page
2018-09-18 18:59:40 +03:00
6c9fa16f6e fix(android): parallel navigations should not be triggered (#6275) 2018-09-18 11:25:31 +03:00
1db1e81174 docs: document eachChild callback function (#6253) 2018-09-17 22:34:26 +03:00
12fade7155 fix: Page and Frame isLoaded undefined checks (#6255)
* fix(view): isLoaded handling

closes https://github.com/NativeScript/NativeScript/issues/6179

* refactor: Error handling code in onCreateView
2018-09-17 15:37:29 +03:00
8575c60b13 fix(modals): application activityBackPressed event not fired for modals (#6261) 2018-09-17 15:37:16 +03:00
8a5f73055e fix(gestures)propagate touch to parent so that gestures can work (#6171)
* propagate gesture touch to parent so that gestures can work

* test: swipe passtrough test
2018-09-17 10:11:50 +03:00
ca0043701b refactor: remove obsolete ViewHelper.setBackground method (#6240) 2018-09-05 17:35:59 +03:00
6da1b33b50 refactor: update getSupportFragmentManager cast (#6155) 2018-08-07 13:45:48 +03:00
cf034dd04d feat(android): migrate to support library apis (#6129)
Switch Activity / Fragment / FragmentManager implementation from native framework to support library APIs

BREAKING CHANGE:


NativeScript core framework now extends support library APIs versus native framework classes as per Google's latest guidelines:
- NativeScript activities now extend `android.support.v7.app.AppCompatActivity` (vs android.app.Activity)
- NativeScript fragments now extend `android.support.v4.app.Fragment` (vs android.app.Fragment)
- NativeScript now works internally with `android.support.v4.app.FragmentManager` (vs android.app.FragmentManager) 

The implications of these changes should be mostly transparent to the developer except for the fact that the support library Fragment / FragmentManager work with Animation APIs versus Animator APIs.

For Android API Levels lower than 28 the new Fragment API uses a different fragment enter animation by default. You can customise the transition per navigation entry or globally via the [navigation transitions API](https://docs.nativescript.org/core-concepts/navigation#navigation-transitions)
Before:
Default fragment enter animation was fade animation

After:
Default fragment enter animation for API levels lower than 28 is now a fast "push fade" animation; default fragment enter animation for API levels equal to or greater than 28 remains fade animation

Before:
AndroidFragmentCallbacks interface exposed the following `onCreateAnimator(...)` method
``` ts
export interface AndroidFragmentCallbacks {
    onCreateAnimator(fragment: any, transit: number, enter: boolean, nextAnim: number, superFunc: Function): any;
    // ...
}
```

After:
AndroidFragmentCallbacks interface now exposes the following `onCreateAnimation(...)` method instead (and `onCreateAnimator(...)` is now removed)
``` ts
export interface AndroidFragmentCallbacks {
    onCreateAnimation(fragment: any, transit: number, enter: boolean, nextAnim: number, superFunc: Function): any;
    // ...
}
```

Before:
Transition class exposed the following abstract `createAndroidAnimator(...)` method
``` ts
export class Transition {
    public createAndroidAnimator(transitionType: string): any;
    // ...
}
```

After:
Transition class now exposes the following abstract `createAndroidAnimation(...)` method instead (and `createAndroidAnimation(...) is now removed)
``` ts
export class Transition {
    public createAndroidAnimation(transitionType: string): any;
    // ...
}
```

To migrate the code of your custom transitions follow the example below:

Before:
``` ts
import * as transition from "tns-core-modules/ui/transition";

export class CustomTransition extends transition.Transition {
    constructor(duration: number, curve: any) {
        super(duration, curve);
    }

    public createAndroidAnimator(transitionType: string): android.animation.Animator {
        var scaleValues = Array.create("float", 2);
        switch (transitionType) {
            case transition.AndroidTransitionType.enter:
            case transition.AndroidTransitionType.popEnter:
                scaleValues[0] = 0;
                scaleValues[1] = 1;
                break;
            case transition.AndroidTransitionType.exit:
            case transition.AndroidTransitionType.popExit:
                scaleValues[0] = 1;
                scaleValues[1] = 0;
                break;
        }
        var objectAnimators = Array.create(android.animation.Animator, 2);
        objectAnimators[0] = android.animation.ObjectAnimator.ofFloat(null, "scaleX", scaleValues);
        objectAnimators[1] = android.animation.ObjectAnimator.ofFloat(null, "scaleY", scaleValues);
        var animatorSet = new android.animation.AnimatorSet();
        animatorSet.playTogether(objectAnimators);

        var duration = this.getDuration();
        if (duration !== undefined) {
            animatorSet.setDuration(duration);
        }
        animatorSet.setInterpolator(this.getCurve());

        return animatorSet;
    }
}
```

After:
``` ts
import * as transition from "tns-core-modules/ui/transition";

export class CustomTransition extends transition.Transition {
    constructor(duration: number, curve: any) {
        super(duration, curve);
    }

    public createAndroidAnimation(transitionType: string): android.view.animation.Animation {
        const scaleValues = [];

        switch (transitionType) {
            case transition.AndroidTransitionType.enter:
            case transition.AndroidTransitionType.popEnter:
                scaleValues[0] = 0;
                scaleValues[1] = 1;
                break;
            case transition.AndroidTransitionType.exit:
            case transition.AndroidTransitionType.popExit:
                scaleValues[0] = 1;
                scaleValues[1] = 0;
                break;
        }
            
        const animationSet = new android.view.animation.AnimationSet(false);
        const duration = this.getDuration();
        if (duration !== undefined) {
            animationSet.setDuration(duration);
        }

        animationSet.setInterpolator(this.getCurve());
        animationSet.addAnimation(
            new android.view.animation.ScaleAnimation(
                scaleValues[0], 
                scaleValues[1], 
                scaleValues[0], 
                scaleValues[1]
            ));

        return animationSet;
    }
}
```
2018-07-31 18:48:34 +03:00
398c9b3f33 feat(typings): Adding Android typings for API levels from 17 to 27 (#5890)
Adding android typings for API levels from 17 to 27

BREAKING CHANGES:
There is no longer added `I` prefix in the names of the interfaces. For example `android.view.IMenuItem` is now `android.view.MenuItem`. This matches the original name of the interface in the android framework.
2018-07-05 18:36:23 +03:00
b5b8d51b0d fix(modal): parent page invalid hierarchy handling [extended] (#5966)
* fix(modal): parent page invalid hierarchy handling

* refactor(modals): Refactor safe guard in show/hide modal
2018-06-20 16:10:03 +03:00
4b5754a6d4 fix(ios): safeAreaLayoutGuide fallback for iOS 10 cases (#5960) 2018-06-20 07:28:06 +03:00
e59d1567a5 fix(ios-dialogs): unable to show dialog from modal view without a page (#5881)
* fix(ios-dialogs): unable to show dialog from modal view

* tests(modal-navigation): add test that opens dialog inside modal view
2018-05-29 18:06:02 +03:00