Commit Graph

432 Commits

Author SHA1 Message Date
Vasil Chimev
3e6f465cc8 fix: TextField not secure when keyboardType="number" (#5012) 2017-10-31 18:29:39 +02:00
Panayot Cankov
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
Hristo Hristov
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
Peter Kanev
cb029225c3 Elements tab support for iOS Chrome DevTools (#4930)
* add initial implementation of the dom agent for ios

* add implementation of the css agent for ios

* refactor devtools inspector methods to somewhat accomodate ios and android

patch elements dom-node tests to test for ios too

* fix android dom-node test

* fix ios dom-node-tests to mock the ios devtools inspector properly

* fix: minor changes
2017-10-12 11:32:31 +03:00
Alexander Vakrilov
1e47117179 fix: DatePicker month off by 1 in Android (#4872) 2017-09-26 09:44:33 +03:00
Panayot Cankov
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
Emil Tabakov
2f0d3b0e0b Add RssFeed to the ContentTypes considered as text (#4820) 2017-09-09 15:45:07 +03:00
Nikolay Tsonev
ea9213b243 edit broken page snippet tag (#4776)
* edit broken page snippet tag

* Increase timeout for HTTP tests (#4775)

* Typos (#4789)

* TypeScript 2.5 compatibility (#4794)

* edit broken page snippet tag

* fix(date-picker): Date picker changed check (#4797)

* edit broken page snippet tag
2017-09-05 18:23:46 +03:00
Alexander Vakrilov
3e38eb4b2f Increase timeout for HTTP tests (#4775) 2017-08-30 13:30:53 +03:00
SvetoslavTsenov
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
Panayot Cankov
7c9fceec65 Delete the layer type tests, for now the layer type is the default (#4763) 2017-08-28 18:05:05 +03:00
SvetoslavTsenov
03a0ac75b1 Include assert to test_NavigateToNewPage_WithAndroidCache for reuse native views on forward navigation (#4764) 2017-08-28 17:16:41 +03:00
Hristo Hristov
617fa92efc Fix MultiTemplateParser to not eat its closing tag (#4756) 2017-08-25 17:44:10 +03:00
Alexander Vakrilov
ab42715089 FIX: Async test runner check-timeout bumped. (#4751) 2017-08-24 18:52:05 +03:00
Alexander Vakrilov
1171da2742 fix(image-source): Fix test for base64 image source for android API 26 (#4741) 2017-08-24 11:17:53 +03:00
Hristo Hristov
06ad345015 Fix issue 4302 (#4723)
Fix tests for that issue
2017-08-22 09:52:07 +03:00
Hristo Hristov
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
Stanimira Vlaeva
08dcfabe82 refactor(date-picker): value converter for month is 1-based (#4656) 2017-08-08 17:07:21 +03:00
Hristo Hristov
2c27b1ac7a Cache android.widget.SeekBar as SeekBar for better performance (#4669)
* Cache android.widget.SeekBar as SeekBar for better performance
Made singleton listener for SeekBar
Fix slider issue
Add slider test

* Futher refactoring
2017-08-08 16:04:41 +03:00
Hristo Hristov
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
Stanimira Vlaeva
14098d40db fix: set default values to time widgets (#4383) 2017-08-03 22:03:05 +03:00
Hristo Hristov
0f14101238 recycling now happens only if nativeView and android properties are not accessed. (#4627)
recycleNativeView filed now accepts: "always" | "never" | "auto". Always will recycle the nativeView no matter if its nativeView or android proprties are accessed. Never will disable recycling. Auto will recycle it only if nativeView and android properties are not accessed.
2017-08-01 15:04:16 +03:00
Hristo Hristov
8535e5459a Fix unitests on API <20 (#4624)
* Fix unitests on API <20

* Fix tests for API >19.
Previous commit breaks them
2017-08-01 14:48:16 +03:00
Alexander Vakrilov
7983895c8e FIX: Background drawable cache conflicts with local property (#4633) 2017-08-01 11:53:42 +03:00
Panayot Cankov
8711b54b5e Shorthand properties does not update if sub-property is changed (#4607) 2017-07-27 15:42:47 +03:00
Panayot Cankov
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
Eddy Verbruggen
74f26f4498 Add CSS support for line-height (#4534)
* Add CSS support for line-height (issue #1664)

* Implemented @vakrilov's feedback

* Implemented @vakrilov's feedback (changed Android default impl)
2017-07-13 15:00:18 +03:00
Alexander Vakrilov
3d49d1436d Disable reflection recycling tests for api lvls 17 and 19 (#4548) 2017-07-13 14:54:54 +03:00
Steve McNiven-Scott
3dbcf088be Allow toggling of visible scrollbar indicators (#4523)
* Allow toggling of visible scrollbar indicators

* Add unit test

* Make what the prop does more clear

* Fix tslint

* Rename property per @vakrilov

* Missed string property rename

* Move property from method

* Update orientationChanged to use new property name
2017-07-11 18:14:29 +03:00
Vasil Chimev
57cf2314ee Remove permission request from tests app (#4539) 2017-07-11 18:02:23 +03:00
Alexander Vakrilov
661e6cf582 Remove generation of test-results.xml (#4537) 2017-07-11 11:04:36 +03:00
Hristo Hristov
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
Andy Kopp
f092a6ecae text/xml responses are now treated as text on iOS (#4531)
fixes github issue 4514
2017-07-07 21:45:14 +03:00
SvetoslavTsenov
e7d0824421 Rename tests to UnitTestApp (#4520) 2017-07-06 18:26:34 +03:00
Panayot Cankov
8adb2fdfef Fix TypeScript 2.4 errors, introduced mainly due weak types and covariant checking for callbacks (#4476) 2017-07-03 11:57:00 +03:00
Alexander Vakrilov
23757e5dfc Enable recycling of nativeView 2 (#4467)
* enable recycling of nativeView

* backgroundInternal is reset if setting new value leads to background.isEmpty() == true.

* android background.getDefault always return copy of the background. Now all controls that mutate the background can be reset to initial state (e.g. Button & ActionBar)
passing resources to copied background so it respect density.
fix properties initNativeView

* reset padding when backgroundInternal is reset.

* Fix text reset
Fix padding reset

* fix tsc errors

* fix ugly text rendering.

* Add unit tests for recycling native views
Fix several issues that came from the above tests
Fix maxLength property missing a converter callback
Remove old files

* Remove old files

* Revert backgroundInternal setter

* change the order of tests so that appium can work again

* Remove suggestion on every TextView & TextField init (strangely it is enabled after view is recycled....)

* Fix function to get parent layout if specified

* Button stateListAnimator restored when button is recycled
zIndex defaultValue is now undefined instead of NaN

* revert zIndex.setNative to always clear stateListAnimator because it was breaking one UI test (setting value=0 was returning the previous stateListAnimator)

* fix search-bar backgound-color recycling

* Fix alignments setters

* Fix imageView recycling
Fix button recycling
Fix edit-text recycling
resetNativeView is called only if recycleNativeView flag is true

* Fix incorrect merge

* Fix text-view & text-field textTransform

* Fix EditText text reset

* Fix runtime crash on ARM emulator API 21

* Fix text-base minHeight. maxHeight reset
Fix reset of isUserInteractionEnabled
2017-06-29 18:01:22 +03:00
Eddy Verbruggen
f399f6c62b Ability to load local files in a WebView on iOS devices (#4444)
* Ability to load local files in a WebView on iOS devices

* Ability to load local files in a WebView on iOS devices (removed doc-comments in test)
2017-06-28 11:00:02 +03:00
Panayot Cankov
bf81b534ad Resetting profiles had to be in the retry body (#4428) 2017-06-22 08:52:18 +03:00
Nikolay Tsonev
f9ec0c9aba add sample code snippet for maxLength property (#4429)
* add sample code snippet for maxLength property

* removing Page and StackLayout

* remove the other Page tag
2017-06-21 21:48:57 +03:00
SvetoslavTsenov
213722fd81 Include test for issue #849 from nativescirpt-angular (#4421)
* Include test for issue #849 from nativescirpt-angular

* Fix tslint
2017-06-21 16:49:22 +03:00
PetyaSotirova
30d4e93e3a Fix timer snippets (#4437) 2017-06-21 15:23:48 +03:00
Nick Iliev
3b75471e92 snippet fix for timer (#4418)
* snippet fix for timer

* timer test fix
2017-06-20 17:58:02 +03:00
Andrea Giammarchi
7e39bfb9d4 Standard timers - fix for #4384 (#4389)
Specifications define timers capable of accepting optional parameters.
https://www.w3.org/TR/2011/WD-html5-20110525/timers.html#timers

This PR goal is to standardize such behavior in NativeScript too.
2017-06-15 23:19:49 +03:00
Alexander Vakrilov
ab5da0a4a9 Profiling tests stability (#4379) 2017-06-14 14:11:54 +03:00
Alexander Vakrilov
1d20845b7c Use AppCompat SearchView (#4371)
* Use AppCompat SearchView

* GetNative elements for appcompat

* Classes renamed

* test modified
2017-06-14 14:11:04 +03:00
Alexander Vakrilov
f2462158fb Chrome devtools elements tab support for Android (#4351)
* Enable chrome-devtools elemets tab

* Trigger updates when property is chaned form native

* Tslint fixes

* Don't run dom-elemet tests in IOS

* fix tests

* Create package.json

* Update package.json

* domNode changed to field for performance
2017-06-12 16:48:27 +03:00
Stanimira Vlaeva
618433816e fix(slider): correct maxValue setter for android (#4346)
The setter should invoke setNativeValuesSilently with the new value and
max value respectively.

fixes #4343
2017-06-09 18:20:25 +03:00
Stanimira Vlaeva
9bba250424 Refactor transform animations (#4296)
* feat: add matrix module

* fix(animations): parse transform property correctly

* fix(css-animations): compute transformation value with matrix

* refactor: add typings for keyframes array in style scope

* fix(animations): transform regex and method invocation

* fix(matrix): rewrite decomposition function

* refactor: transform animations parse

* test: add tests for css animation transform

* refactor: move transformConverter to style-properties

* lint: remove unnecessary comma

* lint: remove unnecessary word in d.ts

* fix(style-properties): correctly use transformConverter

* fix(matrix): flat multiply affine 2d matrices

cc @PanayotCankov
2017-06-09 18:20:07 +03:00
Alexander Vakrilov
e33eca63d6 Implement custom measure for ios btn when textWrap is true (#4326)
Implement custom measure for ios btn when textWrap is true
2017-06-08 10:29:50 +03:00
Panayot Cankov
014e7a8e0f add profile for functions, profile CSS-es on startup, use __time (#4227)
Call native setters once when a page is instantiated.

Fix background not being reset, Label's background is now set to background, not layer

Make the nativeView field instead of property for performance reasons
2017-06-08 09:51:09 +03:00