1279 Commits

Author SHA1 Message Date
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
5ec8242654 Tsenov/button alignment (#4460)
* Include new example for issue 4385

* Include new test page for issue 4385. Restyle and rename main-page.

* Update main-page

* Fix navigation
2017-06-29 22:16:17 +03:00
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
fca8b16ca6 Fonts refactored (#4436)
* Fonts refactored

* Fix: never return null font
2017-06-28 14:49:02 +03:00
6cc1db950b Update typo in search-bar tests (#4402) 2017-06-16 14:27:30 +03:00
9866350559 Include autocorrect = fasle (#4395) 2017-06-15 19:13:46 +03:00
1d20845b7c Use AppCompat SearchView (#4371)
* Use AppCompat SearchView

* GetNative elements for appcompat

* Classes renamed

* test modified
2017-06-14 14:11:04 +03:00
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
c228b97263 Fix button wrap (#4350)
* Fix button wrap

* Update path to hint-text-color page
2017-06-09 16:37:14 +03:00
0d3a307dee Fix wrap text alignment test page (#4348) 2017-06-09 10:55:14 +03:00
2526ac06f2 Update tests (#4345)
* Update tests

* Fix typos

* Fix tslint
2017-06-09 09:54:38 +03:00
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
ce01ab597f Fix search bar test page and images template test page (#4331) 2017-06-07 14:02:51 +03:00
97b1cd9060 Tsenov/searchbar (#4328)
* Searchbar tests

* Update search bar test page

* Fix path to events test pages

* Update text-view test pages
2017-06-07 10:25:16 +03:00
51d1be5bb8 Tsenov/auto complete (#4318)
* Init steps

* Implement logic for auto-complete for all test pages

* Init steps

* Implement logic for auto-complete for all test pages

* Expose TestPageMainViewModel

* Merge

* Improve check if example is already loaded in collection

* Reorder tests

* Fix tslint

* Include csslv

* Include new image source
2017-06-06 16:06:21 +03:00
855caf3e43 Remove max-length example from list-view folder. Move images from list-view folder to resources/images 2017-06-05 16:48:56 +03:00
109f57476d Include test page for max-lenght poperty 2017-06-05 16:48:56 +03:00
40d5badd40 Update issue-3354.xml 2017-06-05 14:05:55 +03:00
1b260ac2b5 Extend test page issue-3354 2017-06-05 14:05:55 +03:00
9f47746d98 Merge pull request #4292 from NativeScript/fix-ios-text-view-hint
Fix: IOS text view hint should never show while editing
2017-06-01 13:31:28 +03:00