BREAKING CHANGE: [Android] NativeScript no longer overwrites the horizontal/vertical alignment on the user-defined root visual element when opening it in modal dialog window (i.e. not fullscreen).
If your application logic relied on the previous behavior you need to manually set `horizontalAlignment="center"` and `verticalAlignment="middle"` on the root visual element you are showing modally.
* Do not depend on current device screen while calculating Image Asset size.
* Scale the image asset to the exact requested size.
* Process image assets natively, pass keepAspectRatio based on the stretch property and Asset options.
* Fixed the splashscreen resource name as it cannot be read when containing a dot.
* Updated the Image Asset scale and rotate logic based on the Native one.
* Make the ImageAsset size more important than the Image decode size as its more specific.
* Fixed tslint errors.
* Added filePath support in the ImageAsset constructor for iOS in order to unify it with the Android implementation, support for relative files and file not found support errors.
* Added unit tests for ImageAssets.
* Added a sample app for UI testing of image-view with ImageAsset src.
* chore: apply PR comments
* feat: add option to set a different root view at run time
* feat: expose application getRootView method
* refactor: Introduce ViewEntry interface
* fix: Respect root view rturned from launch event in Android
* refactor: getRootView() code + caching root view per activity.
* refactor: add app-root.xml in apps
* refactor: http test made async
* refactor(console): remove the console module
Removing the console module implementation eliminates some error-prone
formatting logic, and certain platform-specific checks. The
implementation was also android-specific. Left a stub Console class
implementation as one is necessary to avoid errors with `console` being
undefined during the snapshot stage for android.
The console module is replaced by a 'console' implementation in the Android Runtime. See
android-runtime/PR #884
* fix(tests): update console module tests
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
Remove code that moves actionBar when there is incoming call. We now depend on the autolayout to position us correctly.
_addView, _removeView won't request layout for iOS.
LayoutBase: addChild & remvoeChild will request layout.
ContentView: content change will request layout.
iOS layout positioning now respects native properties like automaticallyAdjustsScrollViewInsets, edgesForExtendedLayout, extendedLayoutIncludesOpaqueBars, navigationBar.translucent, tabBar.translucent
Removed frame-tests.ios.ts - those tests are now invalid
Added new layout tests inside page-tests.ios.ts
Commented few asserts in scroll-view-tests
View now expose ios namespace with layoutView method and UILayoutViewController used by page, tab-view and application module
ViewBase now expose viewController property that should be set from all widgets that are using viewcontrollers internally (like Page, Frame, TabView)
ViewBase now sets ios property to either the view returned from createNativeView or to nativeViewProptected
fragment.transitions now use animation/transition start to add fragments to waitingQueue. Before we did it manually in navigate/goBack. This way we can reuse the fragment.transition when calling showDialog. Also when animation/transition ends we check the animation/transition to see if this fragment should be set as current.
Frame expose new loadViewFromEntry method (to load a view from URI)
Frame navigation happens once frame is loaded
Frame now supports Page as a child in XML
Fixed GridLayout row, rowSpan, column, columnSpan properties type
Fixed bug in GridLayout where add/remove of columns/rows won't update the internal state of the grid (backport from android when GridLayout is recycled)
ListView will no longer invalidate layout when cell is removed
Fixed bug in ScrollView ios where effectiveMinWidth/Height was multiplied to density (it is already on device pixels so no need to multiply)
TabView android now calls loaded only on the selected child (not all)
Core refactoring
Fixed bug where goBack took the last element in backstack while navigationQueue is not empty.
Fixed bug where goBack to specific entry in the backstack was removing that entry...
Removed duplicated method
Refactored method name
Fixed TS
Implemented custom fragment save/restore state.
When navigating back we reverse manually transitions/animations because we no longer add them to navite backstack.
Fragment instance stored on entry.
Animation and Transition listeners now holds reference to entry instead of fragment for easier update of fragment.
Animation and Transition listeners removed when entry removed from backstack.
Animation and Transition removed from fragment when fragment activity is destroyed.
* feat(animation): support animating width/height properties
- width/height can be specified in any valid PercentLength form that can be parsed.
- make width/height properties be based on animatable CSS property. TODO: affectsLayout????
- add a few basic tests. Could probably use a few more?
- fix a few null pointer exceptions in PercentLength helpers
* test(ui): add animation examples to ui-tests-app
- basic height animation
- height animation in StackLayout
- fix an issue where strings were not automatically converted to PercentLength when calling directly into `View.animate`
* test(ui): cleanup and add summary/details layout example
- use height transition to cover textview content.
- when clicking on the summary view, animate the summary height up to a small header and show the text view.
- fake animating the height on the textview by very subtly animating its translateY value while shrinking the header height. This tricks your mind into think that the text view is also vertically growing, even thought it's just slightly moving up along the Y axis.
* test(ui): add animation curves test page
- verify all built-in animation curve types work as expected.
* test(ui): update animation curve example for multiple properties
- add a segmented bar that allows choosing which properties to animate using the various curves.
- interestingly, a whole bunch of properties fail with spring on iOS.
- refactor width/height animations handlers to remove duplication on iOS.
- implement proper spring animation for width/height on iOS.
* test(ui): add stress example with 100 labels animating and fps meter
- same curve/property selector as the curves example, but with 10x10 grid of items that stagger animate, and an FPS meter.
- sadly it looks like width/height animations are considerably slower than the others when you have a bunch of them. I'm not sure that's entirely surprising since they interact with the layout system.
- the better news is that even with the army example, my really old android 4 tablet manages ~30fps. On height/width animations from the curves example, the old tablet does fine with no noticeable FPS hit.
* refactor: deduplicate existing droid width/height animations
- stash to prep for replacing with LayoutTransition.
* test(animation): unit tests for extent animation and PercentLength parse
- update animation scaffold to allow specifying the parent stack layout height/width
- test basic supported units, px, %
- test basic percent length parser behaviors
* chore: cleanup cruft and remove noise from diff
- undo the import mangling that WebStorm helpfully applied
- remove .editorconfig file
- clean up in tests, remove cruft
* chore: cleanup from review
- more import changes
* chore: remove .editorconfig
* Introduce background shorthand style property
* Add text property in parser for BackgroundPosition value
reason: prevent parsing of background position (pass it as sample string)
* Introduce background-shorthand test page
* Modify parser unit tests to respect the new BackgroundPosition 'text' property
* Fix android search-bar bug
Searching twice for the same item in the search bar leads to a bug where `submit` event won't be raised.
This PR fixes https://github.com/NativeScript/NativeScript/issues/5039
* test: include new test page
Add parsers for the background css shorthand property, make ViewBase unit testable in node environment
Add background parser and linear-gradient parser
Use sticky regexes
Simplify some types, introduce generic Parsed<T> instead of & TokenRange
Apply each parser to return a { start, end, value } object
Move the css selector parser to the css/parser and unify types
Add the first steps toward building homegrown css parser
Add somewhat standards compliant tokenizer, add baseline, rework and shady css parsers
Enable all tests again, skip flaky perf test
Improve css parser tokenizer by converting some char token types to simple string
Implement 'parse a stylesheet'
Add gonzales css-parser
Add parseLib and css-tree perf
Add a thin parser layer that will convert CSS3 tokens to values, for now output is compatible with rework
Make root tsc green
Return the requires of tns-core-modules to use relative paths for webpack to work
Implement support for '@import 'url-string';
Fix function parser, function-token is no-longer neglected
Make the style-scope be able to load from "css" and "css-ast" modules
Add a loadAppCss event so theme can be added to snapshot separately from loaded
* fix: Navigation test app added
* Removed native popToBackstack call.
Implemented custom fragment save/restore state.
When navigating back we reverse manually transitions/animations because we no longer add them to navite backstack.
Fragment instance stored on entry.
Animation and Transition listeners now holds reference to entry instead of fragment for easier update of fragment.
Animation and Transition listeners removed when entry removed from backstack.
Animation and Transition removed from fragment when fragment activity is destroyed.
* Revert package.json start up entry
Fixed bug where goBack took the last element in backstack while navigationQueue is not empty.
Fixed bug where goBack to specific entry in the backstack was removing that entry...
Removed duplicated method
Refactored method name
Fixed TS
* Move the applyStyleFromScope to onLoaded, when the views are created and id or className properties are set the CSS selectors are queried and applied multiple times
* Condense the changes when applying properties
* Added tests for native view recycling
Disabled android native view recycling
Move toString from view-common to view-base
Fix crash on application restore and navigation back on API26
Added setAsRootView method
Added missing logo into perf-tests/recycling app
* additional fix for image-source-tests. ios is case sensitive.
* Add @private to some internal properties
Fix where padding is not respected when background is reset.
* cache page on forward navigation
Still some failing navigation tests
* Current page is kept alive when navigating forward
Refactoring code and removing all hacks and flags
Remove one module circular reference
* Disable Page recycling because when there is transition between pages the nativeView stays animated (e.g. when transition is Fade the hidden page nativeView stays with Alpha 0)
Disable recycling if there is native anitmation
* Fix failing tests on ios & android API17
Fix wrong urls in http tests
Made some timer tests async
* Animations are not stored in BackstackEntry instead of Fragment because fragments could die (activity die) and recreated and we lose animations.
* Fix android crash when activity is recreated.
Refactoring transitionListener.