1298 Commits

Author SHA1 Message Date
8141737f74 fix-next(tabview): visually pre-load tab items on android (#5495) 2018-03-08 14:39:59 +02:00
0138873ee3 feat(modal): introduce stretched param to showModal method (#5496)
* fix-next(ios-modal-view): force stretch alignment

* feat(modal): introduce stretched param to showModal method

* test(modal-view): add modal view stretched test
2018-03-07 18:17:52 +02:00
92148833d3 fix-next(tabview): fix tab title layout in modal root tabview Fixes #5392 (#5435)
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.
2018-03-02 13:27:21 +02:00
a94ec9946f Improve ImageAsset scaling (#5110)
* 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
2018-02-28 14:04:01 +02:00
949a99ec35 Extend console tests for iOS (#5459) 2018-02-26 16:41:44 +02:00
b8e0beccdd fix(ios-layouts): switch contentInsetAdjustmentBehavior on ScrollView (#5411)
* fix(layouts): switch contentInsetAdjustmentBehavior on ScrollView

* chore(ui-tests-app): add test for ScrollView as a root Page element
2018-02-15 09:27:16 +02:00
e1eea8efe7 test(e2e): add modal-navigation app (#5393)
* chore(apps): add modal-navigation-app for ui testing

* test(e2e): add modal-navigation app

* test(apps): remove modal-navigation-app

The app has been moved to `e2e/modal-navigation`.

* chore: include e2e folder to npm scripts

* docs: include e2e folder to DevelopmentWorkflow.md

* chore(e2e): update .gitignore

* fix(e2e): relative paths

* chore(e2e): update package.json

* test(e2e): add change root view to modal-navigation

* test(e2e): set androidTabsPosition to botton

* chore(e2e): add VSCode launch.json config

* docs(e2e): delete LICENSE and README.md files

* refactor(e2e): rename modal-tab-page to modal-tab-root

* test(e2e): update iOS launch screen
2018-02-14 16:51:51 +02:00
b113b0021a feat: Add methods to get the root view and set a different root view at run time (#5386)
* 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
2018-02-09 16:04:20 +02:00
f8dce08f0e feat(tab-view-android): enable tabs repositioning (#5385)
* feat(tab-view-android): enable tabs repositioning

* feat(tab-view-android): enable tabs repositioning

* chore(apps): add bottom tab view example
2018-02-08 11:06:07 +02:00
0b1c36192d refactor(console): remove the console module (#5338)
* 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
2018-02-04 23:29:58 +02:00
e69af8dda9 update(launch screen): Add iPhone X launch screens (#5163) 2018-01-29 13:58:14 +02:00
a0378e8b74 Update package.json 2018-01-19 17:26:01 +02:00
8d59cc4de6 fix: cleanup modaltest paths (#5300) 2018-01-19 16:21:09 +02:00
3114a9d7b1 migrated JS files toTS 2018-01-18 14:02:36 +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
a35e603d85 Fix to always get the same bounds no matter if we are shown modally or not (for iOS).
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.
2017-12-15 13:06:34 +02:00
af034089ca iOS Frame, Page and TabView measure/layout methods removed. We now rely on the framework positioning. This will result in a change that width, height, minWidth, minHeight, margins not respected on these controls
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
2017-12-15 13:06:34 +02:00
7bc0daf222 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
2017-12-15 13:06:34 +02:00
8026e46a72 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.
2017-12-15 13:06:34 +02:00
4d23e3777d fix: Navigation test app added 2017-12-15 13:06:34 +02:00
8973a6febd Revert "feat(animation): support animating width/height properties (WIP) (#4917)" (#5136)
This reverts commit 57ed0cf405be44e31358ff17f372b5d926e63639.
2017-12-07 12:11:24 +02:00
57ed0cf405 feat(animation): support animating width/height properties (WIP) (#4917)
* 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
2017-12-05 13:55:54 +02:00
fc9a0b7ad8 Introduce background shorthand property (#5053)
* 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
2017-11-15 14:07:40 +02:00
729b068e7b Fix android search-bar bug (#5046)
* 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
2017-11-10 15:46:23 +02:00
6e9a99a962 chore: update repo to be compiled with TS ^2.6.1 (#5020) 2017-11-01 14:18:52 +02:00
32b9ec2159 refactor: set selectedIndex = 3 of list-picker (#5008)
* refactor: set selectedIndex = 3 of list-picker

* refactor: list-picker.ts

* refactor: list-picker.xml

* fix: remove ios import
2017-10-31 14:15:11 +02:00
0fe1806aaf fix: Require core modules used for inspector lazily (#4977) 2017-10-24 11:53:51 +03:00
f7a3a36b9c Housekeeping node tests, renamed to unit-tests (#4936)
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
2017-10-20 10:42:07 +03:00
7c68953009 Fix clear history transition (#4951)
* 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
2017-10-20 08:37:36 +03:00
f0a060a477 tests: update test date-picker tests page in relation with issue 4851 (#4955) 2017-10-16 19:13:47 +03:00
f50ae4bb17 test: include test page for button highlight related to issue 4740 (#4952) 2017-10-16 14:01:39 +03:00
6d7c1ff295 Avoid applying CSS multiple times (#4784)
* 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
2017-09-25 18:32:00 +03:00
c12b287227 Update scrolling-and-sizing tests to be compatible with lower resolutions (#4770) 2017-08-29 15:58:50 +03:00
12c0199fb5 UIScrollViews will now report 'scroll' events and the background in ios will adjust added layers (#4762) 2017-08-29 10:25:45 +03:00
3fd65cce9f Include ui tests for focus/ blur events for text-view and text-field (#4765)
* Include ui tests for focus/ blur events for text-view and text-field

* Update main-page.ts
2017-08-28 23:29:56 +03:00
bba7a82bdf Disable recycling, refactoring & fixes (#4705)
* 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.
2017-08-17 09:15:35 +03:00
2701ea3c1e Fix failing test on ios 11 (#4686)
Add new perf-test page for view recycling
Changed the initialization of TextTransformation field
2017-08-16 15:19:01 +03:00
172152a897 Update link in webView test page (#4684) 2017-08-10 15:36:09 +03:00
93d940d6d2 Remove gallery app and include new tests in uitests app (#4679) 2017-08-09 17:12:12 +03:00
50d399101e Fixes TabView icons changes. (#4666)
* Fixes TabView icons/title changes.

* Access TabLayput trough parent

* TabView icon change example
2017-08-08 13:06:56 +03:00
075e70e336 cache page on forward navigation (#4652)
* 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.
2017-08-07 17:24:12 +03:00
c26f1c916a Add line-height test page (#4638)
* Add lineHeight property to text-base.d.ts

* Add line-height test page
2017-08-02 09:30:29 +03:00
2dbd1b19ea Fix: refresh flat property on change in IOS (#4628)
* Fix: refresh flat property on change in IOS

* Fix typos
2017-08-01 10:40:51 +03:00
d949cc7128 Include example action-bar flat property (#4618)
* Inlcude example for flat property

* Update xml
2017-07-31 13:11:07 +03:00
0a695b0089 Include new examples for font-weight (#4616) 2017-07-28 18:07:15 +03:00
43659799bc Implement non uniform border corner radiuses and fix blinking image-view radiuses (#4573)
* Image corners were blinking in #4322 and CSS border will now draw non uniform corner radiuses if the border color is uniform

* Implement per-side corner radiuses for iOS

* Update stretch-mode example

* Update matrix-mode example

* Update image resources

* Add clipping for non uniform radii without border width, don't throw for missing image resources in css
2017-07-27 15:36:47 +03:00
2f6ca2524b CssAnimationProperties, when unset, were not setting the default native value. (#4595) 2017-07-26 19:16:26 +03:00
5a660a6eda Set text-field and text-view tintColor to textColor (iOS) (fixes #4357) EXTENDED (#4549)
* set text-field and text-view tintColor to textColor (#4357)

* Rest tint color
2017-07-25 11:22:21 +03:00
09535627b9 disable recycling on specific button (#4527)
* disable recycling on specific button
add more thorough test for view recycling
fix memory leak with android ActionBar
improve padding reset when view is recycled
improve reset of several controls

* stopping local animations when view is recycled
fix tns-ios version in tests/package.json

* Fix isClickable on android when reusing nativeView
2017-07-11 09:48:08 +03:00
24d9f18c5d Include values/string.xml in android resources (#4503) 2017-07-04 18:59:17 +03:00