133 Commits

Author SHA1 Message Date
cb1f7cc182 refactor(dark-mode): arrow functions to properties 2019-10-03 15:06:22 +03:00
dfda58111e refactor(dark-mode): remove compatibility color module 2019-10-03 15:06:22 +03:00
27bb151c8d feat(dark-mode): compatibility color 2019-10-03 15:06:22 +03:00
4e4cbb7c55 feat(dark-mode): window and page background color 2019-10-03 15:06:22 +03:00
dfcbe6c319 style: formatting and whitespaces (#7840) 2019-09-19 15:40:31 +03:00
4f39fb728b chore: update tslint rules (#7391) 2019-06-26 15:13:48 +03:00
c5db112b8d feat(android): androidX support (#7039)
* feat: migrate support library namespaces to androidX

* feat(tns-platform-declarations): update to androidX typings

* chore(tests): migrate test apps to AndroidX

* chore(tns-platform-declarations): update tsconfig to include androidx dts files

* update package.json to androidx

* chore(androidx): migrate forgotten support library namspaces

* feat(tns-core-modules-widgets): migrate to AndroidX namespaces

* chore(utils): update androidx namspace for getPaletteColor method

* chore(apps): update tns-platform-declarations package

* Update package.json
2019-06-10 09:21:41 +03:00
6d36041823 fix back navigation 2019-06-04 17:50:26 +03:00
30d06f2d7e fix iOS back transition after hmr 2019-05-31 19:16:33 +03:00
7c22ffed45 fix(hmr): support for multi module replacement 2019-05-31 16:17:55 +03:00
0aca08755a fix(hmr): quick fade upon replace navigation (#7251) 2019-05-22 11:45:55 +03:00
8a2f592df9 refactor(HMR): Refactor livesync propagaton 2019-05-03 17:48:44 +03:00
d35e14ed0f feat(hmr): preserve navigation history on applying changes (#7146) 2019-04-23 17:47:29 +03:00
83ae729a6a Merge branch 'master' into myankov/merge 2019-03-29 13:39:13 +02:00
1dc395215d fix(ios): flat action bar incorrect layout after navigation (#7077)
* fix(action-bar): incorrect layout after navigation

* set extended layout for opaque bars earlier
2019-03-29 13:36:45 +02:00
b436ecde36 refactor: replace var usage with let/const (#7064) 2019-03-25 18:09:14 +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
603c901be4 feat(action-bar): flat mode breaks ios safe area (#6862) 2019-02-06 13:13:03 +02:00
19dfd163e0 fix: call onNavigatingFrom event only if it exists (#6773)
I ran into an issue where `owner.onNavigatingFrom` didn't exist when rendering a view was blocked by the biometric scanner and then user hit the back button to navigate back.

This code simply adds a check to see if `onNavigatingFrom` exists on the owner
2019-01-21 15:23:43 +02:00
790bcfb470 refactor(HMR): apply changes in application styles at runtime 2018-12-14 14:34:50 +02:00
42a1491e6e feat(HMR): apply changes in application styles at runtime
Expose `HmrContext` interface.
Apply changes in `app.css` instantly.
Avoid navigation on livesync when changes in `app.css` have been made.
Apply changes in `app.css` on back navigation.
2018-12-14 14:34:47 +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
e48782511d fix-next: handle action bar safe area nesting (#6455) 2018-10-26 14:05:14 +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
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
2fc1d8a8d4 chore(tsc): enable noUnusedLocals compiler option for tns-core-modules (#5755) 2018-05-10 16:12:59 +03:00
1cbb1e8d0d feat(webpack): mark the CSS type for stylable views explicitly (#5257)
We want webpack's uglification to mangle function and class names
but that's what the current implementation of the CSS in {N} relys on
to get the CSS type for each view when targeted by CSS type selectors.

The implementation is changed a little so now the CSS type can be set
directly on the prototype of each View class or for TS, through decorator.

BREAKING CHANGES:


Extending classes requires marking the derived class with @CSSType
The root classes are not marked with CSSType and classes derived from ViewBase and View
will continue to work as expected. More concrete view classes (Button, Label, etc.) are
marked with @CSSType now and store their cssType on the prototype suppressing the previous
implementation that looked up the class function name. So clien classes that derive from one of
our @CSSType decorated classes will now have to be marked with @CSSType.
2018-03-12 16:34:25 +02:00
714af6bb02 fix(ios-frame): do not update backstack when navigating the same page (#5426) 2018-02-19 11:53:04 +02:00
85dc75e09a fix-next: navigation events' workflow in modal dialog scenarios (#5341) 2018-02-06 19:18:28 +02:00
b492996647 fix(layouts): Set automaticallyAdjustsScrollViewInsets (#5311) 2018-01-23 17:53:31 +02:00
016c64fe04 showModal & closeModal can be called on any View
fix livesync implementation to be compatible with 3.4 and to replace mainEntry for 4.0 when root is not Frame
some refactoring of page.ios in order to allow showing multiple modal dialogs
2018-01-18 13:34:25 +02:00
3f2f5f41f0 Fix page styleScope for iOS 2018-01-12 12:43:55 +02:00
058a216ac9 Move styleScope from Page to View
Fix image-source test for API 27
setupAsRootView now makes the component styleScope
set css, addCss & addCssFile makes view to be styleScopeHost which cannot be overriden later from parent
Android modals now call setupAsRootView
Small fixes on ios layouts
launch event fired in andriod too
Moved some requestLayout calls to ios files where they belongs
2017-12-19 16:35:15 +02:00
63ab46eb2a Layout improvements 2017-12-15 17:11:51 +02:00
365d48550f Revert Page.android onContentChange to addViewToNativeVisualTre due to Angular issue with ProxyViewContainer 2017-12-15 13:08:15 +02:00
a416fa4fb6 Fix TabViewItem loading
Fix showModal not on full screen
2017-12-15 13:08:15 +02:00
ac04ede97e Implemented showModal on View 2017-12-15 13:08:15 +02:00
04c1132541 Fix broken merge conflict 2017-12-15 13:06:34 +02:00
28f1a5875e Fix crash on android where we queue few back navigations an exception is thrown.
Fix https://github.com/NativeScript/NativeScript/issues/4986
2017-12-15 13:06:34 +02:00
1778ba1eb9 Fix showModal on iOS 2017-12-15 13:06:34 +02:00
501b954c47 Fix issue with angular not rendering... 2017-12-15 13:06:34 +02:00
53b92ad83a Fix broken TS 2017-12-15 13:06:34 +02:00
5bcccd28a8 Fix: when page disappears because parent viewController is removed (e.g. selecting different tab in TabBar) our navigation stack was incorrectly removing backstack entry. This fix may not work if the tab is hosted in Page but it is unlikely that someone will host Page->TabView->Frame->Page 2017-12-15 13:06:34 +02:00