Commit Graph

421 Commits

Author SHA1 Message Date
Sudhanshu Siddh
319c153360 feat(ios-image-source): standardize quality scale in image-source (#5517)
* feat(ios-image-source): standardize quality scale in image-source for both platforms

Normalize quality in saveToFile and toBase64String to follow 0-100 scale - standardize implementation on both platforms

closes #5474
2018-03-13 15:19:24 +01:00
Nathan Walker
fa80355464 fix(animations): change throw -> trace to avoid unnecessary app crash (#5475)
* fix(animations): change throw -> trace to avoid unnecessary app crash

Fixes major cause of crashes/bugs in production apps using animation.

* Fix fix animation throw (#1)

* chore(tests): Cleanup code snippets comments

* refactor(animations): Plat-specific cancel and play methods refactored
2018-03-08 20:42:33 +02:00
Martin Yankov
8141737f74 fix-next(tabview): visually pre-load tab items on android (#5495) 2018-03-08 14:39:59 +02:00
Vladimir Amiorkov
fb5c97cf57 fix-next(css): CSS not applied to "drawerContent" when RadSideDrawer is used as root (#5466)
* fix(XMLBuilder): Pass the "module path name" when building "custom component"
* test(root-view): root view css applied tests
2018-03-01 15:55:21 +02:00
Manol Donev
2704915384 fix(frame): add generic frame cleanup logic after modal dialog close (#5479) 2018-03-01 10:37:26 +02:00
Dimitar Tachev
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
Martin Yankov
27622d83ba fix-next: ensure proper events on tab change (#5468) 2018-02-28 10:40:05 +02:00
Manol Donev
4898c33a04 fix-next(modal) fix crash when closing modal dialog with root tabview inside (#5446) 2018-02-23 16:46:49 +02:00
Alexander Vakrilov
9423ae40fa test: Fixed unstable timer test (#5449) 2018-02-21 13:07:26 +02:00
Martin Yankov
4ce45666a5 test: add reset root view tests (#5437) 2018-02-21 11:38:37 +02:00
Nikolay Tsonev
625d801014 hiding cookbook/ui/action-bar article in favor of ui/action-bar (#5404)
* hiding cookbook/ui/action-bar article in favor of ui/action-bar

* removing action-bar article from cookbook
2018-02-20 16:43:45 +02:00
Martin Yankov
68d86fb6c6 fix(profiling): resetProfiles doesn't reset all profiles (#5425) 2018-02-19 13:18:50 +02:00
Manol Donev
2edef3de3b fix(frame): root tabview with modal frame when suspend/resume app (#5408) 2018-02-12 16:09:51 +02:00
Martin Yankov
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
Nikolay Tsonev
f27d5f212f edit cookbook/image article improve code snippets (#5396) 2018-02-07 18:42:36 +02:00
Nick Iliev
7121eaea89 refactor: update image source documentation snippets and tests (#5390) 2018-02-07 14:58:28 +02:00
Manol Donev
85dc75e09a fix-next: navigation events' workflow in modal dialog scenarios (#5341) 2018-02-06 19:18:28 +02:00
Alexander Vakrilov
464cdd5a07 fix: Fix scroll-view tests for ios 9 and 10 (#5358) 2018-02-02 09:50:15 +02:00
Nikolay Tsonev
9eb341bcb5 adding backStackEntry example, including missing import md file text field (#5319) 2018-01-24 15:28:58 +02:00
Hristo Hristov
18fe9392d6 Fix memory leak in edit-text.android
Fix fromObjectRecursive to doesn't override source object
2018-01-11 13:25:03 +02:00
Hristo Hristov
3384112ce8 When application start is called we don't set Frame to be styleScope
Added requestLayout for TextView
Round desiredSize in nativeMeasure
2018-01-09 13:17:50 +02:00
Hristo Hristov
058a216ac9 Move styleScope from Page to View
Fix image-source test for API 27
setupAsRootView now makes the component styleScope
set css, addCss & addCssFile makes view to be styleScopeHost which cannot be overriden later from parent
Android modals now call setupAsRootView
Small fixes on ios layouts
launch event fired in andriod too
Moved some requestLayout calls to ios files where they belongs
2017-12-19 16:35:15 +02:00
Hristo Hristov
0abfb1493c Fix crash on API17 and API21-25 2017-12-15 13:08:15 +02:00
Hristo Hristov
ac04ede97e Implemented showModal on View 2017-12-15 13:08:15 +02:00
Hristo Hristov
28f1a5875e Fix crash on android where we queue few back navigations an exception is thrown.
Fix https://github.com/NativeScript/NativeScript/issues/4986
2017-12-15 13:06:34 +02:00
Hristo Hristov
2e2467ce5d Fixed two android tests to account for small emulator screens and floating density 2017-12-15 13:06:34 +02:00
Hristo Hristov
6cff5f4796 Fix scroll-view-tests 2017-12-15 13:06:34 +02:00
Hristo Hristov
3a5006db10 Fix broken merge 2017-12-15 13:06:34 +02:00
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
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
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
Osei Fortune
31d10192f5 WebView upgrade [IOS] (#5093)
* WebView upgrade [IOS]

* lint fixes

* Content scaling fix
2017-12-05 11:52:13 +02:00
Svetoslav
43121cc815 chore(testRunner): update filnal message (#5119) 2017-12-01 17:47:38 +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
Stanimira Vlaeva
6e9a99a962 chore: update repo to be compiled with TS ^2.6.1 (#5020) 2017-11-01 14:18:52 +02:00
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