Commit Graph

4637 Commits

Author SHA1 Message Date
Hristo Hristov
5d7d70be2a Fix android unit-test 2017-12-15 13:06:34 +02:00
Hristo Hristov
199d83c902 Generated platforms declarations for iOS 11
Fixed broken unit-tests
ios layout now run only for the innermost viewcontoller
ios layout for viewcontrollers now implemented with constraints
Added ios11 safeAreas layout support
onMeasure back for frame and tab-view so that they won't throw exception if measure is called on them
Page parents layout updated after page is layout so that inner layout flags are correct
2017-12-15 13:06:34 +02:00
Hristo Hristov
38d026a3df Fix tslint
Revert code that set currentEntry in fragment.transitions.android
Update tests & apps runtime version
Fix broken import in frame-tests
Revert TabView to fire loaded for all TabViewItems
2017-12-15 13:06:34 +02:00
Hristo Hristov
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
Hristo Hristov
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
Hristo Hristov
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
vakrilov
4d23e3777d fix: Navigation test app added 2017-12-15 13:06:34 +02:00
Martin Yankov
60773e7545 fix(webpack): fix fragment css not being applied with webpack (#5172)
Support css files for fragments to be registered using global.registerModule
and global.registerWebpackModules.
2017-12-14 18:51:44 +02:00
Panayot Cankov
0986315374 feat: Add require.context typings (#5156)
Add WebpackRequire interface and append it with the require typing,
this will let us use `require.context("~/", true, /page\.(xml|js|css)/g)`
2017-12-12 15:36:47 +02:00
Panayot Cankov
d356339520 feat: Register ./app.css instead of app.css so it can be provided by webpack context (#5158)
This will let us register the app.css in webpack from a context, and potentially
have a configuration such as:
```
const appCssContext = require.context("~/", false, /^\.\/app\.(css|scss|less|sass)$/);
global.registerWebpackModules(appCssContext);
```
That will work with all of the app.css, app.scss, app.less etc. without further manual reconfiguration.
2017-12-12 14:34:38 +02:00
Vasil Chimev
699e6f5da8 chore: bump version to 4.0.0 (#5148) 2017-12-08 13:07:18 +02:00
Stanimira Vlaeva
f04b5eecd5 refactor: set parentNode property to ViewBase (#5134)
Setter:
You can set a '_templateParent' by setting node.parentNode. This won't
affect the native parent of the node.
Getter:
Returns '_templateParent', if set, or the native parent otherwise.
Reason:
This will help us remove that abstraction from nativescript-angular as
it matches the DOM Nodes API name.
2017-12-07 07:09:30 -08:00
Svetoslav
8973a6febd Revert "feat(animation): support animating width/height properties (WIP) (#4917)" (#5136)
This reverts commit 57ed0cf405.
2017-12-07 12:11:24 +02:00
Daniel Freiling
1615061591 Application-Settings: Non-blocking changes (#5091)
* fix(app-settings): changes are now non-blocking

* chore(app-settings): return result of flush to disk

* chore(app-settings): added test for flush
2017-12-05 23:38:18 +02:00
dbenninger
634cf9a822 Fix background scale quality (#5113)
UIGraphicsBeginImageContextWithOptions with scale factor 0 makes sure the device scale factor is used automatically and not 1.0
2017-12-05 23:12:12 +02:00
Justin DuJardin
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
Dirk Rudolph
4bcb9840c1 Expose itemIdGenerator that can be used to generate unique ID for items on ListView (#4964)
* fixed the context of the getItem() call in android's ListView adapter (#4962)

* added itemIdGenerator function to the list-view interface to allow delegating the creating of a unique id for an item to a consumer of the listview (#4962)
2017-12-05 11:53:32 +02:00
Osei Fortune
31d10192f5 WebView upgrade [IOS] (#5093)
* WebView upgrade [IOS]

* lint fixes

* Content scaling fix
2017-12-05 11:52:13 +02:00
Stanimira Vlaeva
53923d34f9 refactor: export list of valid css animation properties (#5114) 2017-12-04 23:41:39 -08:00
Panayot Cankov
cb4691b061 Check for .css files when .less, .scss etc. are queried in style-scope (#5128) 2017-12-05 08:59:21 +02:00
Panayot Cankov
ec2ce7fe45 Profile iOS keypoints in the UINavigationViewController (#5108) 2017-12-04 17:43:48 +02:00
radeva
13e8bfb9d3 docs: Change up-for-grabs filter with help wanted (#5078)
Since we do not use `up-for-grabs` label anymore, the starting point for contributions is changed to filter by `help wanted` label.
2017-12-04 17:31:05 +02:00
Svetoslav
43121cc815 chore(testRunner): update filnal message (#5119) 2017-12-01 17:47:38 +02:00
Stanimira Vlaeva
db41bec6fe refactor: reset css property value when ''" (empty string) is set (#5085) 2017-11-27 09:12:26 -05:00
Panayot Cankov
255fedac83 Add a globals.registerWebpackModules that can register dynamic require webpack context (#5087) 2017-11-22 13:02:42 +02:00
Darío Hereñú
71c50b2cb1 Typo (#5075) 2017-11-17 08:22:05 +02:00
Alexander Djenkov
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
Hristo Hristov
ac3c895c89 Fix crash on iOS (#5071)
* Fix crash on iOS where JS object that extend NSObject was not hold into memory.

* TS fix
2017-11-14 13:36:23 +02:00
Hristo Hristov
725475f860 Click next moves the focus to next focusable textfield (#5047)
* Click next moves the focus to next focusable textfield

Fixes https://github.com/NativeScript/NativeScript/issues/5033
When clicking next arrow on the virtual keyboard we were returning true which means we handled the event so the OS doesn't move the focus to the next item. This PR delete the `return true` when the action is `IME_ACTION_NEXT` so that next focusable item is automatically focued

* Fix IME_ACTION_PREVIOUS to raise returnPress event.
Added unit-test that IME_ACTION_PREVIOUS to raise returnPress event.
Refactored text-field-tests
2017-11-10 16:34:47 +02:00
Hristo Hristov
43fbabb5e9 Fixed most module cyclic references. There is one left for ios and android: (#4978)
- http -> http-request -> image-source
that can't be fixed easily and will be removed once we delete image-source module because it is obsolete anyway.
There is one more for android:
- frame -> fragment that could be removed if we use global object.
Updated madge bersion
2017-11-10 15:47:02 +02:00
Hristo Hristov
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
Panayot Cankov
011be368b1 Add a simple polyfil for System.import so we can use some Angular services out-of-the-box (#5042) 2017-11-07 14:59:36 +02:00
Nick Iliev
65a50bbf82 fixed removeEventListener super call (#4994) 2017-11-03 12:57:11 +02:00
Stanimira Vlaeva
6e9a99a962 chore: update repo to be compiled with TS ^2.6.1 (#5020) 2017-11-01 14:18:52 +02:00
Panayot Cankov
f1c33d2420 Add function for profile loggin in release (#5018) 2017-11-01 13:24:57 +02:00
Vasil Chimev
3e6f465cc8 fix: TextField not secure when keyboardType="number" (#5012) 2017-10-31 18:29:39 +02:00
Svetoslav
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
Emil Tabakov
b192abf4f2 Note about silent install mode in setup-scripts 2017-10-26 17:31:43 +03:00
vchimev
d68ff42cc1 chore: bump version to 3.4.0 2017-10-24 15:39:06 +03:00
Alexander Vakrilov
bb3a28453c docs: add changelog for 3.3.0 (#4979)
* chore: Changelog update for 3.3.0

* docs: minor tweaks on the changelog for 3.3.0
2017-10-24 15:19:35 +03:00
Alexander Vakrilov
0fe1806aaf fix: Require core modules used for inspector lazily (#4977) 2017-10-24 11:53:51 +03: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
Vladimir Amiorkov
2eba7c66e4 Fix for iOS 11 ListView top offset (#4919)
* Changed the default value of the new iOS11 'contentInsetAdjustmentBehavior' property #4916

* Fixed missing ts definitions and added TODOs
2017-10-20 08:38: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
Dave Coffin
2e09d3714a FIX: Now checking that webView.request.URL is not null before accessing properties on it. (#4830)
- The symptom is the app would crash when web view tries to load
certain (valid) requests.
2017-10-20 08:36:06 +03:00
Eddy Verbruggen
d3a6a3f782 Line-height property breaks text alignment (iOS) (#4909) 2017-10-20 08:35:11 +03:00
Hristo Hristov
1b9610b4dd The original issue described here: https://github.com/NativeScript/NativeScript/issues/4804 is fixed in 3.2 but there is another bug which doesn't render borderRadius on Image element. (#4963) 2017-10-20 08:33:08 +03:00
Panayot Cankov
188c1f2568 Hanlde hint color reset properly in iOS (#4968) 2017-10-20 08:31:18 +03:00
Panayot Cankov
69199a5df2 Fix hint color in ios, the attributedPlaceholder and placeholder was set following two very distinct paths (#4945) 2017-10-18 16:10:23 +03:00
Peter Kanev
374f31cbf7 fix(minor): reword missing-xml-error to be clearer (#4947) 2017-10-18 10:43:17 +03:00