49 Commits

Author SHA1 Message Date
11d3884243 fix(android-styling): correctly detect if drawable uses ColorFilter (#6342)
* fix(android-styling): correctly detect if drawable uses ColorFilter

Treat a widget with a BorderDrawable background as any other, even if it's FilterOnly

If the drawable has been replaced with a new one, clear _cachedDrawable

Fixes #6341

* test(button): add test for changing border-radius and color in button

* test: fix test checks for IOS

* keep original drawable cached
2018-11-27 10:44:34 +02:00
ca0043701b refactor: remove obsolete ViewHelper.setBackground method (#6240) 2018-09-05 17:35:59 +03:00
9d21a743c4 Revert 5772 revert 5534 css gradients (#5779)
* Revert "Revert "Css gradients" (#5772)"

This reverts commit 7edf56197a179b13e1afe4c706aea4a99ac62aca.

* chore(): fix LinearGradient circular dependency
2018-05-10 10:44:35 +03:00
7edf56197a Revert "Css gradients" (#5772)
This reverts commit 5a83a1c858e8095353aa50fe4ea080b07bf85813.
2018-05-03 18:17:07 +03:00
5a83a1c858 Css gradients (#5534)
* feat(ios): Added support for css gradients.

* feat(android): Added support for css gradients.

* fix: Fixed gradient borders on ios

* fix(gradient): added backgroundGradient to View and Style.

* fix(ios-gradients): fixed ios gradients covering view content.

* test(gradient): Added ui app tests for background gradients.

* test(gradient): Added a test ensuring background gradient property is applied to style.

* style(gradient): Fixed tslint errors.

* fix(gradient): Removed the background-gradient property and added the gradient to background-image.

* style: fixed a consecutive blank line tslint error.

* fix(tests): fixed the bug that was causing tests to fail.

* chore(linear-gradient): fix equality comparer

* test(gradient): add linear gradients test app

* chore(tslint): update with latest tslint rules
2018-05-03 13:24:41 +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
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
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
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
f2898f84d5 NativeView recycled for android 2017-03-28 18:08:59 +03: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
244034e39e Fix: set/reset background in android 2017-03-07 17:02:17 +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
cf2b3de662 Fix: Background not re-drawing on android 2017-02-24 13:52:38 +02:00
8a0d98e815 Inset clip path + Background circ-ref 2017-02-21 18:00:48 +02:00
b34802d7fc Use density for clip-path calculations 2017-02-21 14:14:32 +02:00
70cc1dd5d9 Move the effective* values from style to this 2016-12-27 10:57:10 +02:00
417064fd38 Fix Android lifecycle 2016-12-20 16:12:52 +02:00
6feeb140e3 Fixing type errors in tests 2016-12-19 10:36:25 +02:00
befb494a50 up to segmented-bar.ios 2016-12-13 15:51:18 +02:00
1202cb7288 almost all without layouts 2016-12-13 15:51:18 +02:00
645f428f59 alpha1 2016-12-13 15:51:18 +02:00
30d202b5f1 Fix: Transparent border rendered as black
Resolves #3113
2016-11-21 12:25:13 +02:00
978bd8c524 Use setBackgroundDrawable for API < 16. (#3108) 2016-11-18 14:47:06 +02:00
d674d806aa Use setColorFilter on post-21 ActionBars only 2016-11-07 14:13:31 +02:00
e507d6403a Fix: Enhancement: Android Actionbar elevation lost with background-color
Resolves #1799
2016-11-03 16:49:12 +02:00
28f084e7d2 Fix: java.lang.NumberFormatException when applying clip-path with percentage values
Resolves #3007
2016-11-02 16:59:06 +02:00
52fb85acd3 Prevent padding from accumulating
Related to #2719
2016-09-19 10:48:48 +03:00
a05f842a84 Non-uniform borders 2016-09-17 09:27:36 +03:00
51bfa93879 Padding is not reset if the elements has a border-related property set 2016-09-14 17:17:20 +03:00
2cff891ca0 Background borderWidth, borderColor, borderRadius and clipPath are now used on Android only and ignored on iOS
Related to #2318
2016-06-30 16:15:56 +03:00
ad05f55dc0 Fix: background-repeat is not respected
Related to #2318
2016-06-30 11:26:24 +03:00
05a3f3c846 Remove optimisation 2016-06-24 16:23:01 +03:00
53a699b50b Background performance optimizations 2016-06-24 14:49:11 +03:00
345b2a8163 Fix tslint errors 2016-06-20 12:18:36 +03:00
36fd83365c Fix tslint errors 2016-06-20 12:13:39 +03:00
559a7c816e Implement the BorderDrawable class used in background.android.ts in Java
Resolves #2318
2016-06-20 11:30:52 +03:00
0407aaf5d2 Remove a forgotten console.log 2016-05-31 16:49:07 +03:00
0a8d211665 Enable hardware acceleration for views animations in Android
Resolves #2217
2016-05-31 16:46:19 +03:00
fd9a0c98e6 Merge pull request #2211 from NativeScript/layer-type
Fixed:  Android layerType should not be changed if there is no need
2016-05-31 09:14:04 +03:00
e2f1e272b4 Fixed: Android layerType should not be changed if there is no need
Resolves #1899
2016-05-30 16:53:09 +03:00
58b4a6eec6 Add 'npm test' for mac 2016-05-30 16:10:57 +03:00
e135c20b14 Rename the files 2016-05-26 14:30:25 +03:00