155 Commits

Author SHA1 Message Date
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
d62df3789c Do not change the Android layer types (hardware/software) (#4625) 2017-08-25 10:45:58 +03:00
3a447b6f3f Added @profile on several key methods in the Android lifecycle, refactored by extracting into methods a little (#4685) 2017-08-24 13:10:53 +03:00
b6d5510627 Fix crash where some android Drawables doesn't implement getConstantState... (#4742)
Changed all places where getConstantState was used.
2017-08-24 11:06:33 +03:00
24923445bd Image cache is cleared when livesync happens (#4672) 2017-08-08 16:52:39 +03:00
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
7983895c8e FIX: Background drawable cache conflicts with local property (#4633) 2017-08-01 11:53:42 +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
43b21ce7e7 refactor(css-selector): export createSelector method (#4580)
needed for NativeScript Angular's animation driver
2017-07-20 18:02:01 +03:00
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
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
4319ca5fc5 refactor(animations): export declarations parser (#4370) 2017-06-14 11:52:22 +03:00
b7c61cad96 fix(css-animations): convert transform value properly (#4352) 2017-06-09 20:54:46 +03:00
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
c519a4bb6f add profile for functions, profile CSS-es on startup, use __time 2017-05-25 14:40:13 +03:00
0d21f52c99 Hhristov/ios background image crash fix (#4214)
* uiColorFromImage should return if there is no image.

* added unit-test
2017-05-17 15:40:14 +03:00
af38cf5f3e Create css combnators tests page in apps
Setup direct siblings apps tests

Fix direct child test

Add direct sibling test on class and type element

Add sibling combinator handling for id selectors

Completely redo sibling selector and add attributes and pseudo class selectors tests

Handle sibling via a custom group instead of a selector

Fix Selector groups creation

Add unit test for sibling selection

Fix tslint errors
2017-05-09 11:29:11 +03:00
e26032f5fe Revert the translateX/Y to be in dip 2017-04-25 14:49:12 +03:00
5457424766 Expose statusBarStyle on page (#4021) 2017-04-21 17:16:57 +03:00
9e3222781a backgroundImage property now use Fetcher & Cache as Image component (#4030)
* backgroundImage property now use Fetcher & Cache as Image component
Fix GridLayout tests on iPhone Plus - actualLength wasn’t rounded
ImageCache is closed when activity is stopped

* Fix reset of background drawable.

* additional check for drawable

* imageCache init cache on activity Started
2017-04-21 16:50:12 +03:00
d098ff43f5 Add module names for the typedoc, make it work
Mark members with @private for typedoc.
2017-04-20 16:58:30 +03:00
108f4c287d Inital animations were not played in android, since CSS in android is now applied before the native view is created/assigned 2017-04-12 10:40:45 +03:00
f350f7191d textTransform, whiteSpace & textAlignment defaultValue is now “initia” (#3948)
removed enum namespaces
add valueConverter to clipToBounds
2017-04-06 09:50:37 +03:00
4105083dd4 Fix iOS animations, transition was workin in DIP, when css class is change objects were flickering 2017-04-03 17:17:59 +03:00
740d71a238 Apply page css when using nav-entry with create method 2017-04-03 14:51:57 +03:00
120230c297 ios cornder radius is rendered as circle now (#3915)
* ios cornder radius is rendered as circle now

* fix failing test
2017-03-31 16:18:12 +03:00
f2898f84d5 NativeView recycled for android 2017-03-28 18:08:59 +03:00
b89951845b Fix CSS animations for elements that have not been loaded yet.
- Always apply animations even if it happens before the loaded event.
- Add an extra check for Android LinearInterpolator to get rid of a
curve resolution crash.
2017-03-24 15:28:29 +02:00
9b47fff54a Fix clip-path for iOS (#3839) 2017-03-21 15:14:42 +02:00
92723d176b Livesync reloads css (#3835) 2017-03-21 13:04:50 +02:00
fe54ac6ead Layout round instead of ceiling (#3833)
* Layout round instead of cailing
Add helper method to layout module to convert to/from dips to px and measure the native view
whiteSpace affects layout added for iOS
Fix bug in switch onMeasure implementation
Fix bug in cssValueToDevicePixels iOS implementation
ActionBar for iOS is measured with AT_MOST modifier

* Fix switch measure routine
2017-03-20 16:11:16 +02:00
2bd9d6f167 All units ceil up, except percents that do round 2017-03-15 17:49:47 +02:00
629eb6e683 Use relative imports in tns-core-modules.
Use tns-core-modules/* imports in outside code (apps, tests, etc)
2017-03-13 14:37:59 +02:00
e6691472da FIX: CSS imports not applied 2017-03-13 11:26:08 +02:00
d38e99cabd Expose hasLaunched() on the application, style-scope will load css-es if app hasLaunched 2017-03-13 10:57:51 +02:00
4f36a07634 Fix iOS corner radiuses dip incorrectly converted 2017-03-10 11:02:01 +02:00
1d49f5f3c3 fix padding on text-view & text-field (#3758)
* fix padding on text-view & text-field
text-base is now snapshotable
view.android is now snapshotable

* createNativeView returns the nativeView for android
Fix image tests
Implement test for image loaded from res://
EffectivePaddings updated when nativeView have some from its native theme
2017-03-09 16:09:53 +02:00
b487aa0790 Fix application.cssFile var, promoted to get/set function 2017-03-09 13:47:36 +02:00
9f1ebc11ca Add support for 'px' on Length in iOS 2017-03-08 09:01:17 +02:00
b45cbe929b No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings
- Only use ambient mobules for global API's
- Move single-file modules to a subdir with the same name so that
we can provide a hand-written typing next to it (via package.json)
- Delete all mentions of tns-core-modules.d.ts
- Delete reference d.ts assembly build steps. Not needed anymore.
- HACK! Use a <reference> for global typings in application.d.ts
to avoid publishing a separate @types/tns-core-modules package.
- Rename declarations.d.ts to tns-core-modules.d.ts to preserve
JS project mappings in references.d.ts (the only place we use those)
2017-03-07 17:59:02 +02:00
244034e39e Fix: set/reset background in android 2017-03-07 17:02:17 +02:00
ea22eb9c20 refactoring circular imports 2017-03-06 14:05:55 +02:00
33aa48bdfd Add support for snapshot
Fix Layout class getMeasuredWidth & getMeasuredHeight
Move some classes to widgets
Fix API17 tests
2017-03-06 14:05:55 +02:00
4d81670072 Merge pull request #3704 from NativeScript/action-bar-bkg
Fix: Background not re-drawing on android
2017-02-28 14:20:51 +02:00
3066dbd072 Clipping is required for iOS even with uniform borders, as long as the radius is > 0 2017-02-27 16:07:21 +02:00
cf2b3de662 Fix: Background not re-drawing on android 2017-02-24 13:52:38 +02:00
dc97ed24f9 Fix flexbox css not applied. Fix addCss duplicating some selectors. 2017-02-23 16:41:08 +02:00
dca4317c2a Android buttons didn't apply bold or italic 2017-02-22 10:22:11 +02:00
8a0d98e815 Inset clip path + Background circ-ref 2017-02-21 18:00:48 +02:00