Commit Graph

4906 Commits

Author SHA1 Message Date
Martin Yankov
f6ea9797f3 fix ts errors 2018-08-28 18:15:04 +03:00
Martin Yankov
2ccfb36ca7 refactor safe area application code 2018-08-28 18:15:04 +03:00
Vasil Chimev
3ab53ed26c fix(scroll-view): wrong locationOnScreen rounding 2018-08-28 18:14:13 +03:00
Vasil Chimev
4bbd4217cf test(safe-area): add scroll view with grid layout examples 2018-08-28 18:14:13 +03:00
Vasil Chimev
a3a86f1f42 fix(scroll-view): apply insets to layoutChild method
Delete `*-nav-page.*` files reproducing the issue.
Update `home-page.xml` with `ScrollView` to reproduce the issue.
2018-08-28 18:14:13 +03:00
Vasil Chimev
0348614b22 test(safe-area): add navigation scroll view example 2018-08-28 18:14:13 +03:00
Vasil Chimev
4adaa26b0c test(safe-area): update scroll view wrap layout examples 2018-08-28 18:14:13 +03:00
Vasil Chimev
add692755b test(safe-area): add nested wrap layout examples 2018-08-28 18:14:13 +03:00
Vasil Chimev
ccbda47873 test(safe-area): add scroll view wrap layout examples 2018-08-28 18:14:12 +03:00
Vasil Chimev
1ef579f391 test(safe-area): add nested wrap layout examples 2018-08-28 18:14:12 +03:00
Vasil Chimev
1544023595 refactor: wrap layout 2018-08-28 18:14:12 +03:00
Vasil Chimev
87dd4fc92f test(safe-area): update wrap layout examples 2018-08-28 18:14:12 +03:00
Vasil Chimev
86a24b2cf1 refactor: wrap layout safe area support 2018-08-28 18:14:12 +03:00
Vasil Chimev
215fa1e64c test(safe-area): update wrap layout examples 2018-08-28 18:14:12 +03:00
Martin Yankov
77bba75564 add listview support for safe area 2018-08-28 18:14:12 +03:00
Vasil Chimev
28afd17bba test(safe-area): add wrap layout examples 2018-08-28 18:10:20 +03:00
Vasil Chimev
96df688826 refactor: apply insets to wrap layout 2018-08-28 18:10:19 +03:00
Vasil Chimev
bc69a58945 test(safe-area): add component examples
Update `nativescript-dev-webpack` dependencies.
2018-08-28 18:10:19 +03:00
Martin Yankov
802ced7107 add scrollview safe area examples 2018-08-28 18:10:19 +03:00
Martin Yankov
0571f4a97d add safe area support for scroll view 2018-08-28 18:10:19 +03:00
Martin Yankov
8a624e4cc7 fix safe area for ios 10 and less 2018-08-28 18:10:19 +03:00
Martin Yankov
2c62520eda add horizontal stack examples to app 2018-08-28 18:10:19 +03:00
Martin Yankov
9b7b060cd4 add right and bottom to insets 2018-08-28 18:10:19 +03:00
Martin Yankov
ec5fc4b07e ensure correct position values after safe area reposition 2018-08-28 18:10:19 +03:00
Martin Yankov
8026e783c1 chore(): typo in safe area e2e app 2018-08-28 18:10:19 +03:00
Martin Yankov
ec2e2f03a0 chore(): add app for ios safe area tests 2018-08-28 18:10:19 +03:00
Martin Yankov
f056362d45 feat(ios): enable safe area for stack and grid 2018-08-28 18:10:19 +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
a1c570c702 fix(ios): nowrap label measure in horizontal stack layout (#6186) 2018-08-17 18:24:06 +03:00
Manol Donev
a8d016c6d7 fix(ios): listview scrollToIndex crash with async data (#6182) 2018-08-17 17:09:48 +03:00
Manol Donev
0f2192d4d7 refactor: clean up unused sdkVersion lazy eval (#6194) 2018-08-17 17:04:44 +03:00
Manol Donev
22cb539c9d fix(android-next): force frame fragment disposal on unload (#6189) 2018-08-17 11:31:44 +03:00
Emil Tabakov
8e9c6d5f32 fix: README's images are not visualised in api reference (#6185) 2018-08-16 14:34:43 +03:00
Peter Staev
2ee1d7dbd5 fix(android/platform): reinitialise screen metrics on orientation change (#6164)
* fix(android/platform): reinitialise screen metrics on orientation change

* fix(android/platform): reinitialise screen metrics on orientation change
2018-08-10 10:28:43 +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
Vasil Chimev
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
Nick Iliev
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
Vasil Trifonov
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
Vasil Trifonov
bb4343e69a Update README.md 2018-08-08 15:16:02 +03:00
Vasil Chimev
d8c6b256a1 docs: add changelog for 4.2.0 (#6165) 2018-08-08 15:11:42 +03:00
Manol Donev
6da1b33b50 refactor: update getSupportFragmentManager cast (#6155) 2018-08-07 13:45:48 +03:00
Nikolay Tsonev
2f7c4b8ab7 enabling reportProgress property for NativeScirpt Angular's HTTPClient (#6154) 2018-08-07 11:59:37 +03:00
Dimitar Topuzov
33395889c3 Update package.json 2018-08-02 17:03:37 +03:00
Manol Donev
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
Martin Guillon
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
Alexander Vakrilov
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
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
Manol Donev
5db3e67915 chore: update file-system api reference (#6135) 2018-07-31 10:25:52 +03:00