4872 Commits

Author SHA1 Message Date
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
17e0dcc5ed chore: add npm version script (#6168)
* chore: update versions

* Update README.md

* docs: add changelog for 4.2.0 (#6165)

* chore: update versions

* chore: update versions

* chore: set versions of packages to 4.2.0

The versions of packages to reflect in `master` to reflect the `latest` official release in `npm`.
Bumping up versions will execute in CI job through the `npm --no-git-tag-version version minor` command.
This is to unify the release process across the `NativeScript`, `nativescript-angular` and `nativescript-dev-webpack` repositories.

* chore: add npm version script

* docs: add release section to CONTRIBUTING.md

* chore: update npm version script

* chore(deps): update to widgets@next

* chore(deps): update to widgets@next

* docs(CONTRIBUTING): update Releasing new versions section

Add a note that these instructions concern NativeScript Core Team Members.
2018-08-09 11:11:46 +03:00
f1bef481e6 feat(android): add Bluetooth connectivity type for Android (#6162)
* feat(android): add Bluetooth connectivity type for Android

* Update connectivity.d.ts
2018-08-09 10:25:32 +03:00
106d417365 docs: add Android typings breaking changes to CHANGELOG.md (#6167)
* Add android typings breaking changes

* docs: minor tweaks in CHANGELOG.md
2018-08-08 19:05:11 +03:00
bb4343e69a Update README.md 2018-08-08 15:16:02 +03:00
d8c6b256a1 docs: add changelog for 4.2.0 (#6165) 2018-08-08 15:11:42 +03:00
6da1b33b50 refactor: update getSupportFragmentManager cast (#6155) 2018-08-07 13:45:48 +03:00
2f7c4b8ab7 enabling reportProgress property for NativeScirpt Angular's HTTPClient (#6154) 2018-08-07 11:59:37 +03:00
33395889c3 Update package.json 2018-08-02 17:03:37 +03:00
cc19b400b9 fix(android): suppress reflection for default animations (#6141)
Fixes `Error: java.lang.CloneNotSupportedException: Class android.support.v4.app.FragmentManagerImpl$AnimationOrAnimator doesn't implement Cloneable` in specific projects.

Related to #5785
Related to #6129 

BREAKING CHANGE


Before:
Default fragment enter animation was Android version specific

After:
Default fragment enter animation is now fade animation for all Android versions

You can customise the transition per navigation entry or globally via the [navigation transitions API](
https://docs.nativescript.org/core-concepts/navigation#navigation-transitions)
2018-08-02 16:01:52 +03:00
7ebac7c353 fix(iOS-gestures) touch delegate does not call base class touch methods (#6113)
* fix ios Touch gestures super methods not being called on nativeView

* use “this.view”
2018-08-02 11:52:35 +03:00
8100727043 chore: Add comments about CI phrases (#6142)
* chore: Add comments about CI phrases

* docs: fix a typo
2018-08-02 11:51:22 +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
5db3e67915 chore: update file-system api reference (#6135) 2018-07-31 10:25:52 +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
88f7ed84d2 fix: iOS TimePicker minuteInterval property (#6116) 2018-07-27 16:19:12 +03:00
9dfac425c4 chore: bump version to 4.3.0 2018-07-25 19:36:19 +03:00
9e2e8ec3a1 feat(list-picker): add textField, valueField and selectedValue properties (#6033)
* Added textField, valueField and selectedValue properties

textField and valueField - should be used with arrays of JSON objects
textField - tells the listview which property should be used to display each item
valueField - tells the listview, which property should be used to update the selectedValue
selectedValue - is the property that will contain the selectedValue, if valueField is specified, then it will contain the value from that field, otherwise it will contain the whole selected item

* Example showing textField, valueField and selectedValue in action

* Update import paths
4.2.0
2018-07-23 17:06:01 +03:00
feaf1408a4 chore(android): update AndroidP sdk version check (#6093) 2018-07-23 13:57:14 +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
bdf55d9552 test(): add scenarios for listview scrolling (#6092) 2018-07-20 11:25:32 +03:00
1fac718a58 feat(UI): Added animated scroll to index for ListView (#6077)
* feat(UI): Added animated scroll to index for ListView

* Update list-view.d.ts
2018-07-19 16:40:59 +03:00
20e1d78f7d Add missing globalAndroid import (#6080) 2018-07-18 16:36:59 +03:00
8813e9bc57 fix: require devtools-elements.js with the extension mentioned explicitly (#6079)
This is a workaround for the issue with `@ngtools/webpack@6.1.0-rc.2`, described here: https://github.com/NativeScript/nativescript-dev-webpack/issues/607#issuecomment-405209925
2018-07-18 11:38:22 +01:00
d53c6b3863 chore: add test for http gzip request (#6076) 2018-07-18 08:36:12 +03:00
8b22585249 Added parameterless constructors (#6044) 2018-07-13 17:29:36 +03:00
39acaa8e11 Fixing onReceiveError for API level >= 23 (#6056)
* Fixing onReceiveError for API level >= 23

* using @ts-ignore as "super as any" is not a valid statement
2018-07-13 09:50:32 +03:00
09431572e5 chore(listview-tests): add tests for width property with percentages (#6047) 2018-07-11 10:54:09 +03:00
324fdcebcd fix(action-bar): #5743 navController may be null (#6029)
* fix(action-bar): #5743 navController may be null

From my own Crashlytics:
`stderr: file:///app/vendor.js:1:860568: JS ERROR TypeError: null is not an object (evaluating 'a.viewControllers')`
```
file:///app/vendor.js:1:860489
var l,p=a.viewControllers.indexOfObject(n);if(p>0&&p<a.viewControllers.count&&(t=a.viewControllers[p-1]),t)
```
which corresponds to:
2fc1d8a8d4/tns-core-modules/ui/action-bar/action-bar.ios.ts (L132)

further up `navController` is checked for truthiness:
2fc1d8a8d4/tns-core-modules/ui/action-bar/action-bar.ios.ts (L119)

So applying same logic.

* Adjusted per request
2018-07-10 13:22:30 +03:00
fb4dad8272 ignore transition-definitions.android.d.ts from typedoc (#6038) 2018-07-09 14:58:42 +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
bcadcbe7b5 fix(animations): avoid steady mem consumption rise (#6004) 2018-07-04 13:44:01 +03:00
a37da87c08 fix(grunt): Add platforms folder to produced NPM package (#6015) 2018-07-03 12:08:19 +03:00
0082dfbdb0 fix(dialogs-ios): dialogs not showing in single page apps (non Frame based apps) (#6000) 2018-07-03 10:23:51 +03:00
e557d66f0d fix(build): Add platforms/ios folder to produced NPM package (#6007) 2018-06-29 15:31:53 +03:00
05c2460fc4 feat: Pass NS app to the native app instead of presenting it over the root VC (#5967)
* feat: Pass NS app native controller to the native app instead of presenting it over the rootViewController

When NativeScript embedded app is created from the native one we check for whether the topmost UIViewController has NativeScriptEmbedder protocol (implemented in the iOS Runtime) method 'presentNativeScriptApp:'. If yes, we call it with the NS app viewcontroller as a parameter so the embedder has control over the NS app (where and how to present it etc.) For backwards compatibility we present the NS app on top of the topmost UIViewController as a fallback.

* style: Fix lint errors

* feat: Check for protocol instead of selector in embedding

I

* Check for rootController instead of topViewController to prevent crash if !rootController

* feat: Introduce NativeScriptEmbedder singleton

NativeScriptEmbedder is responsive for communication between the NS and the native iOS app. His delegate will implement methods which we can call from javascript such as "presentNativeScriptApp:".
2018-06-27 16:48:11 +03:00
67f9e060c6 fix normalisation formula (#5979) 2018-06-25 13:33:56 +03:00
f3714176d9 Typo on # 146? (#5980) 2018-06-21 09:27:22 +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
d79ac300f3 refactor: migrate animation-demo repo content (#5970) 2018-06-19 18:58:11 +03:00
f9b0f6268d refactor: animation app (#5968) 2018-06-19 17:52:02 +03:00
357c8ecf15 fix(core/properties): Fix typings for nativeValueChange (#5791)
* Fix typings for nativeValueChange

* Update properties.d.ts

Changed parameter name of nativeValueChange from “target” to “owner”
Fixed white space to match coding style

* Update properties.d.ts

Fixed white space
2018-06-19 14:20:55 +03:00
6cfdc206d9 fix(ios): translate transform breaks sequential animation set (#5961)
* fix(ios): translate transform breaks sequential animation set

* chore: add e2e test app for animations
2018-06-19 10:38:29 +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