Commit Graph

189 Commits

Author SHA1 Message Date
Vasil Chimev
d35e14ed0f feat(hmr): preserve navigation history on applying changes (#7146) 2019-04-23 17:47:29 +03:00
Martin Yankov
663dbb9dae chore: add deprecation console warnings (#7098) 2019-04-03 16:15:31 +03:00
Eddy Verbruggen
3efc06ed98 feat(android): implement a 'activityNewIntent' event 2019-04-03 11:06:14 +03:00
Martin Yankov
b59d32eb68 Merge branch 'master' into myankov/merge 2019-03-26 12:38:09 +02:00
Martin Yankov
4f0d6d36e3 refactor: guard ng and vue entry points (#7071) 2019-03-26 12:35:43 +02:00
Manol Donev
b436ecde36 refactor: replace var usage with let/const (#7064) 2019-03-25 18:09:14 +02:00
Martin Yankov
26679d42ff refactor(): add better err msg for missing main entry (#7063) 2019-03-25 14:07:23 +02:00
Manol Donev
cf07b2719f chore: update deprecations (#7046) 2019-03-21 14:25:36 +02:00
Manol Donev
b40f027f10 Merge branch 'master' into mdonev/release-to-master-7011 2019-03-15 18:35:41 +02:00
Manol Donev
91d90ccd0f fix: navigation b/n single and nested frame pages (#7011) 2019-03-15 15:38:04 +02:00
Vasil Chimev
3c2c1d9b69 feat(HMR): style views at runtime (#7012)
* feat(HMR): style view at runtime

test: module root view component

test: update livesync tests

refactor: _onLivesync function

* style: remove a comment

* refactor: rename the property
2019-03-13 13:24:49 +02:00
Manol Donev
2247e6d28b Merge branch 'release' into mdonev-merge-release-resourceid-fix 2019-02-22 15:37:32 +02:00
Manol Donev
33d6d1f228 fix(android): resource ID #0xffffffec not found on nav (#6955) 2019-02-22 15:00:24 +02:00
Martin Yankov
07194225b3 Merge branch 'master' into merge-release-master-5.2.1 2019-02-19 11:53:30 +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
Alexander Djenkov
cea97c6b45 fix(ios-frame): tearDownUI and reset UINavigationController (#6817) 2019-02-06 22:11:13 +02:00
Vasil Chimev
1f1d722008 fix(Android): a crash on application restart after livesync changes (#6756)
```
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method run failed

TypeError: Cannot read property 'getRootView' of undefined
File: file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js, line: 56, column:29
```
2019-01-08 21:03:28 +02:00
Manol Donev
46c9de020e fix(android): raise resume event on activity.onPostResume() (#6766) 2019-01-08 15:20:11 +02:00
Manol Donev
4dc35a5e6f fix(android): failure saving state in mixed parent/nested frame nav (#6719) 2018-12-18 10:23:02 +02:00
Manol Donev
c034d6ead6 fix(android): animator restore logic on simulated nav (#6710) 2018-12-17 15:27:52 +02:00
Vasil Chimev
790bcfb470 refactor(HMR): apply changes in application styles at runtime 2018-12-14 14:34:50 +02:00
Vasil Chimev
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
Manol Donev
c084660d0b fix(android): nested fragment disappears on parent fragment removal (#6677) 2018-12-12 14:16:10 +02:00
Manol Donev
5b9b335489 fix(android-fragment): child already has a parent (#6589) 2018-11-23 14:48:41 +02:00
Alexander Djenkov
fc1f8c1e42 fix(back-navigation): app freeze on going back in parent frame with states (#6595)
Endless loop while searching for parent frame that can go back.
Caught in Angular app when trying to go back from nested named lazy loaded outlet using the android hadrware back button.
2018-11-23 10:05:49 +02:00
Leonardo Donelli
efe331862f fix: doc of transitionAndroid property of NavigationEntry interface (#6563) 2018-11-15 20:10:29 +00:00
Manol Donev
7df8038d09 fix: nested frames order with tabs & suspend/resume (#6528) 2018-11-14 10:20:52 +02:00
Manol Donev
41ba93de41 fix(android): IllegalStateException with tabview&nested frames (#6495) 2018-11-05 16:17:51 +02:00
Manol Donev
fac970e753 fix(android): back navigation on app suspend/resume (#6489) 2018-11-02 17:31:52 +02:00
Manol Donev
95c4ec5a96 Revert "fix-next(android): restore fade animation for simulated nav (#6463)" (#6473)
This reverts commit 448936d6e6.
2018-10-29 19:43:34 +02:00
Manol Donev
448936d6e6 fix-next(android): restore fade animation for simulated nav (#6463) 2018-10-26 17:09:19 +03:00
Martin Yankov
e48782511d fix-next: handle action bar safe area nesting (#6455) 2018-10-26 14:05:14 +03:00
Manol Donev
4765dd9302 fix-next(android): exit fragment animation (#6421) 2018-10-26 13:32:30 +03: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
Manol Donev
c8c0be7684 refactor: restore animators api usage (#6403) 2018-10-16 15:37:57 +03:00
Manol Donev
307172003d fix: nested fragments interact thru child fragment manager (#6293) 2018-10-11 17:44:30 +03:00
Manol Donev
436a318de5 fix(android): second livesync (#6330) 2018-10-04 15:57:11 +03:00
Manol Donev
0bf6dc2e93 fix(android): nested frames on app suspend/resume (#6339) 2018-10-04 14:31:57 +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
Alexander Vakrilov
71107533bb refactor: guard livesync for cases the app is not yet started (#6276) 2018-09-20 09:47:53 +03:00
Manol Donev
6c9fa16f6e fix(android): parallel navigations should not be triggered (#6275) 2018-09-18 11:25:31 +03:00
Alexander Vakrilov
12fade7155 fix: Page and Frame isLoaded undefined checks (#6255)
* fix(view): isLoaded handling

closes https://github.com/NativeScript/NativeScript/issues/6179

* refactor: Error handling code in onCreateView
2018-09-17 15:37:29 +03:00
Manol Donev
cca548d31a refactor: AndroidFrame.hasOwnActivity cleanup (#6241) 2018-09-10 11:25:08 +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
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
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
feaf1408a4 chore(android): update AndroidP sdk version check (#6093) 2018-07-23 13:57:14 +03:00