Commit Graph

545 Commits

Author SHA1 Message Date
Martin Yankov
07194225b3 Merge branch 'master' into merge-release-master-5.2.1 2019-02-19 11:53:30 +02:00
Martin Yankov
5dd01a3cb9 fix(ios): searcbar hint color before hint property (#6902) 2019-02-14 16:21:19 +02:00
Vasil Chimev
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
Alexander Djenkov
57f07a3ec7 fix(frame-ios): tearDownUI when UINavigationController disappear (#6892) 2019-02-13 15:11:04 +02:00
Martin Yankov
8330ac0ac1 fix(css): widget properties in css didn't work (#6889) 2019-02-13 15:10:06 +02:00
Martin Bektchiev
8b4a9b3c6b feat: Provide API to release the native object wrapped by a JS one (#6873)
* Add `releaseNativeObject` function in `utils`
* Add tests
* Add typings for the global `__releaseNativeCounterpart` functions
provided by Android and iOS runtimes

refs https://github.com/NativeScript/ios-runtime/issues/1062 and https://github.com/NativeScript/android-runtime/issues/1254
2019-02-08 10:42:51 +02:00
Vasil Chimev
ff476d983d refactor: rename HmrContext to ModuleContext (#6843)
* refactor: rename HmrContext to ModuleContext

* refactor(ModuleContext): rename module to path
2019-01-31 18:32:25 +02:00
Simon Tang
672c821d14 feat: add rebeccapurple to known css colors (#6819) 2019-01-23 16:08:09 +02:00
SvetoslavTsenov
21494f946c chore: log of deps 2019-01-23 13:59:07 +02:00
SvetoslavTsenov
f2dc9cd69d test: circular deps 2019-01-23 13:35:35 +02:00
Vasil Trifonov
28db2afbd4 feat: OnDiscardedError typings and event (#6777)
* feat: OnDiscardedError typings and event

* remove ios and android from DiscardedErrorEventData
2019-01-09 18:24:25 +02:00
Vasil Chimev
c404a38038 refactor: tests to parce templates 2018-12-14 14:35:47 +02:00
Vasil Chimev
b9d7d6bb62 test(HMR): apply changes in application styles at runtime 2018-12-14 14:35:46 +02:00
Manol Donev
60957799ad chore: restore tabroot/resetrootview tests (#6705) 2018-12-14 14:22:07 +02:00
Nicu
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
Manol Donev
44dba1a0b7 chore: temporarily disable failing tests (#6703) 2018-12-13 16:27:14 +02:00
Alexander Vakrilov
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
Martin Bektchiev
65e3a19f8c fix(tests): Sporadic failures after upgrade to WebKit 12.0 (#6635)
* An additional GC and wait are needed since WebKit upgrade to version 12.0
(TEXT-FIELD.testMemoryLeak test started failing sporadically)
* Compare colors by value because the runtime has started
to sometimes return instances with different addresses in memory
2018-11-29 16:14:13 +02:00
Eduardo Speroni
11d3884243 fix(android-styling): correctly detect if drawable uses ColorFilter (#6342)
* fix(android-styling): correctly detect if drawable uses ColorFilter

Treat a widget with a BorderDrawable background as any other, even if it's FilterOnly

If the drawable has been replaced with a new one, clear _cachedDrawable

Fixes #6341

* test(button): add test for changing border-radius and color in button

* test: fix test checks for IOS

* keep original drawable cached
2018-11-27 10:44:34 +02:00
Martin Yankov
9388a4e147 test(ios): add repeater and webview safe area tests (#6578) 2018-11-19 16:46:12 +00:00
Alexander Vakrilov
5c03abefba chore: update to TypeScript 3 (#6556) 2018-11-14 17:00:42 +00:00
Manol Donev
8e83a61879 chore: remove flaky test (#6548) 2018-11-12 15:28:07 +02:00
Manol Donev
4c08839459 test: add test for #6490 (#6517) 2018-11-06 16:57:38 +02:00
Todor Petrov
1485445123 test(safe-area): add layoutChanged test (#6462) 2018-11-06 11:26:23 +02:00
Martin Yankov
0002624d3c feat(frame): add new actionBarVisibility property (#6449) 2018-10-24 14:51:43 +03:00
Alexander Djenkov
af651d6e83 feat(frame): hardware back in parent frame when back states available (#6446) 2018-10-24 10:18:50 +03:00
Martin Yankov
a211bbdbdc test(safe-area): fix ios 12 landscape tests (#6434) 2018-10-19 18:48:20 +03:00
Nicu
c0438df9a7 fix(observable-array): reduce no longer ignores zero as initial value (#6402)
* fix(observable-array): reduce no longer ignores zero as initial value

* fix(observable-array): reduceRight now functions  properly when initial value is not specified or zero
2018-10-19 17:14:47 +03:00
Rakesh Girase
a3f149325f 5620 GridLayout addChild to set row and column (#6411) 2018-10-19 15:20:41 +03:00
Alexander Vakrilov
a93e418a66 tests: Frame tests refactor (#6406) 2018-10-18 13:49:55 +03:00
Manol Donev
c8c0be7684 refactor: restore animators api usage (#6403) 2018-10-16 15:37:57 +03:00
Nicu
829d18b56d feat(application-settings): implemented allKeys method (#6371) 2018-10-12 13:28:48 +03:00
Manol Donev
307172003d fix: nested fragments interact thru child fragment manager (#6293) 2018-10-11 17:44:30 +03:00
Manol Donev
b2246ad089 chore: fix nav tests with cli next (#6374) 2018-10-10 15:52:23 +03:00
Morten Sjøgren
1232d1edfd feat(tslib): add tslib helpers to global (#6351)
* feat(tslib): add tslib helpers to global

* Adds tslib as a dependency to tns-core-modules
* Replaces globals/decorators with globals/tslib
* Adds support for async/await, rest and spread operators.

* refactor: rename tslib to ts-helpers to avoid confusion with npm package
2018-10-05 17:12:45 +03:00
Vasil Chimev
0f067a03ca fix-next(flexbox): flex end for justify content (#6337)
* fix-next(flexbox): flex end for justify content

* refactor: add lessOrCloseEnough assert method
2018-10-03 16:39:39 +03:00
Vasil Chimev
982acdc168 feat(iOS): Safe Area Support (#6230) 2018-09-28 18:21:50 +03:00
Martin Guillon
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
Manol Donev
43f0fd0ffc refactor: remove ununsed Layout class (#6228) 2018-08-31 15:00:16 +03:00
Rakesh Girase
97a7b7ea32 5868 observable array reduce bug (#6219)
* 5868 ObservableArray Reduce Bug

* 5868 ObservableArray Reduce Bug
tslint fixes
2018-08-28 13:54:02 +03:00
Manol Donev
a8d016c6d7 fix(ios): listview scrollToIndex crash with async data (#6182) 2018-08-17 17:09:48 +03:00
Alexander Vakrilov
ec24c5a96f fix(list-view): Layout list-view items on request (#6159)
* test: list items relayout example

* fix(list-view): Layout list-view items on request

* refactor(tests): refactor list-view tests imports
2018-08-09 18:19:56 +03:00
Alexander Vakrilov
9c67d7ba02 chore(tests): increased wait-timeout for tests for slower ad emulators (#6172) 2018-08-09 15:49:19 +03:00
Nathanael Anderson
85b8c018a5 feat(styling): Added 2 functions to control applicationAdditionalSelectors (#6124)
* Added getAdditionalSelectors function so that nativescript-theme can be functional again in NS 4.x

* Change to a better more extensible additional css system.

* removed redunant function on the name.

* Fix lint issues

* Adding mergeSelectors to the remove function

* Added test of new add/remove css functions.

* fix: revert testRunner.ts changes that disabled all tests except style

* refactor: fix typo

* chore: fix typo and change test to no not affect global styles
2018-08-02 11:51:07 +03:00
Manol Donev
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
Alexander Djenkov
81e63ee19e feat(image-asset-ios): add autoScaleFactor option to switch auto scaling (#6127) 2018-07-31 10:12:27 +03:00
Manol Donev
7e89f942b4 fix(android): HEAD request should return statusCode 2018-07-30 16:37:08 +03:00
Vasil Chimev
6ce1d22d9a feat(CSS): import of relative paths (#6023)
* feat(CSS): import of relative paths

* refactor: address comments
2018-07-21 05:54:32 +03:00
Manol Donev
d53c6b3863 chore: add test for http gzip request (#6076) 2018-07-18 08:36:12 +03:00
Vasil Trifonov
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