421 Commits

Author SHA1 Message Date
0002624d3c feat(frame): add new actionBarVisibility property (#6449) 2018-10-24 14:51:43 +03:00
af651d6e83 feat(frame): hardware back in parent frame when back states available (#6446) 2018-10-24 10:18:50 +03:00
a211bbdbdc test(safe-area): fix ios 12 landscape tests (#6434) 2018-10-19 18:48:20 +03:00
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
a3f149325f 5620 GridLayout addChild to set row and column (#6411) 2018-10-19 15:20:41 +03:00
a93e418a66 tests: Frame tests refactor (#6406) 2018-10-18 13:49:55 +03:00
c8c0be7684 refactor: restore animators api usage (#6403) 2018-10-16 15:37:57 +03:00
829d18b56d feat(application-settings): implemented allKeys method (#6371) 2018-10-12 13:28:48 +03:00
307172003d fix: nested fragments interact thru child fragment manager (#6293) 2018-10-11 17:44:30 +03:00
b2246ad089 chore: fix nav tests with cli next (#6374) 2018-10-10 15:52:23 +03:00
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
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
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
43f0fd0ffc refactor: remove ununsed Layout class (#6228) 2018-08-31 15:00:16 +03:00
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
a8d016c6d7 fix(ios): listview scrollToIndex crash with async data (#6182) 2018-08-17 17:09:48 +03:00
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
9c67d7ba02 chore(tests): increased wait-timeout for tests for slower ad emulators (#6172) 2018-08-09 15:49:19 +03:00
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
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
81e63ee19e feat(image-asset-ios): add autoScaleFactor option to switch auto scaling (#6127) 2018-07-31 10:12:27 +03:00
7e89f942b4 fix(android): HEAD request should return statusCode 2018-07-30 16:37:08 +03:00
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
d53c6b3863 chore: add test for http gzip request (#6076) 2018-07-18 08:36:12 +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
3dc3a411c3 feat: Flexible Error/Exception handling (#5929)
* feat: trace.error() implementation

* refactor: Based on PR review

* chore: adding error-handling guide

* docs: fix typos
2018-06-18 16:37:55 +03:00
a75505fbc0 test(): move the tab view tests before frame tests (#5957) 2018-06-15 19:29:08 +03:00
69b3eb70d5 test(): add more timeout to tab navigations tests (#5953) 2018-06-14 13:19:06 +03:00
0e04cb4ad1 fix(android): NavigationButton was read as "Button" by screenreaders. (#5949)
The navigation button for the vision-impaired users were always read as:
"Button" by the TalkBack service on Android.
2018-06-14 12:54:33 +03:00
0b9d4aea0a fix(android): label width shrinking on shorter text change (#5917) 2018-06-07 16:44:33 +03:00
b122bd4a37 fix(ios): set current tab as topmost frame on load (#5908) 2018-06-06 14:47:42 +03:00
c3a7c815e5 chore(layout-changed): update layoutChanged event tests delay 2018-05-23 00:54:29 +03:00
0fc1547a19 feat(view): introduce LayoutChanged event on every View component (#5825)
* feat(view): introduce LayoutChanged event

* test(view): add LayoutChanged event tests

* chore(view-android): attach to onLayoutChange only if listener attached

* feat(view-android): override on/off in order to attach and detach from OnLayoutChangeListener
2018-05-21 17:22:40 +03:00
1365f13594 fix(modal): innerView.closeModal(...) not passing back context (#5833) 2018-05-18 16:50:27 +03:00
2168c36a5f tests: disable all tests related to outside urls (#5800) 2018-05-09 13:17:32 +03:00
d58665115b test(platform): fix typo in platform module cookbook example (#5758)
* test(platform): add missing properties to platformModule documentation

The platformModule cookbook documentation was missing a few properties
that are now available. This commit adds those properties to be
included in the examples.

resolves: NativeScript/NativeScript#5707

* test(platform): fix typo in platform module cookbook example
2018-04-30 10:49:54 +03:00
03cfc0cee3 chore(tslint): update tslint rules and fix errors (#5747)
* chore(tslint): fix tslint config & errors
* chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
2018-04-26 18:36:32 +03:00
451589dbd6 fix(modal): exception when calling ViewBase.showModal(...) (#5737) 2018-04-26 00:19:44 +03:00
0fd0812ede test(platform): add missing properties to platformModule documentation (#5709)
The platformModule cookbook documentation was missing a few properties
that are now available. This commit adds those properties to be
included in the examples.

resolves: NativeScript/NativeScript#5707
2018-04-25 14:05:30 +03:00
49ea10b81e fix(layout): IOS Layout not invalidated with custom root (#5724)
* fix(layout): Buuple up layout trough viewControllers

* test: Layout invalidates correctly with different root view

* chore: tslint
2018-04-23 15:47:27 +03:00
6bdb5b553f feat(file-system): add ability to retrieve file size (#5710) 2018-04-20 18:01:15 +03:00
a616dbb9bb Updated weak event listener tests for v8 6.5 (#5697)
* Updated weak event listener tests for v8 6.5

* added missing parentheses
2018-04-18 16:57:26 +03:00
cf950e1ebb fix(navigation): fix frame.navigate call inside page.navigatedTo handler (#5649) 2018-04-11 11:25:54 +03:00
c06d5bae63 chore: set keepAspectRatio to true as default in image-asset (#5613)
* chore: set keepAspectRatio to true as default in image-asset

* fix: remove empty lines
2018-04-10 00:46:27 +03:00
a316e53d54 new tabview examples (#5628)
* new tabview exmples

* tabs limit example

* minor code snippet edits
2018-04-05 17:35:36 +03:00
81a2cbd0fe refactor(ios): clean up iOS8 or lower specific checks in codebase (#5581) 2018-03-26 13:37:21 +03:00
4b244921d4 feat(List-View) : Add the ability to check if an item is visible or not. (#5557)
* feat(list-view): Adds the ability to check whether or not an Item at index is Visible on screen within a listView

* feat(list-view): add the unit-test for checking if list-item is visible.

* clean(list-view): fix invalid reference in list-view-common

* chore(list-view): remove unused logic

* test(list-view) updates the tests for checking if item at index is visible

* chore(ListView Tests): update the test_check_if_item_at_index_is_visible unit test to include 40 children, and test if the last item is visible or not.

* Chore(ListView IOS): Apply requested changes to the for-loop, and replace with Array.some for readability.

* chore(ListView android): Fix TSLint issues.
2018-03-21 07:18:01 +01:00
7506905770 fix(image): image aspect dimensions for ImageSource.fromAsset(...) (#5556) 2018-03-19 17:01:26 +02:00
dfa70dd384 feat(frame): rework frame retrieval api (#5527)
Rework the frame api to support working with multiple Frames.
* frameModule.topmost() - now returns the last navigated Frame or
the currently selected tab item's Frame if the tab item's view is a
Frame.
* frameModule.getFrameById(id: string) - returns a navigated Frame by id.
* args.object.page.frame - can be used in page elements event handlers.
Returns the Frame of the current element's page.
* chore: Update madge-android npm script path
2018-03-13 18:10:45 +02:00