95 Commits

Author SHA1 Message Date
173665a620 refactor: address a comment 2019-10-03 15:06:22 +03:00
3de233887a feat(dark-mode): text-view colors 2019-10-03 15:06:22 +03:00
dfcbe6c319 style: formatting and whitespaces (#7840) 2019-09-19 15:40:31 +03:00
4f39fb728b chore: update tslint rules (#7391) 2019-06-26 15:13:48 +03:00
ecd9fc3e9d feat: bundle workflow support (#7337) 2019-06-20 15:58:36 +03:00
37b53c6030 fix(text): crash when removing FormattedText (#7237)
* fix(text): crash when removing FormattedText

* refactor: fixed crash on ios too
2019-05-13 17:03:46 +03:00
82f7e24b80 fix(label-android): numeric text ignores text-transform (#7123) 2019-04-10 10:46:38 +03:00
0416f7e80e fix(ios-textview): text alignment reset to default on blur (#6903) 2019-02-14 15:00:04 +02:00
9f8d24a811 Prevent app crash for css text-transform (#6815)
* Prevent app crash for css text-transform

* refactor: formatting

* refactor: formatting

* minor refactoring

* fix: use isString - text is sometimes String

* fix: use isString - text is sometimes String
2019-02-07 10:59:53 +02:00
1c0218ea15 feat(tns-platform-declarations): Generate iOS typings from iOS 12.1 SDK (#6693)
* feat(tns-platform-declarations): Generate iOS typings from iOS 12.1 SDK

* Instructions for generating iOS typescript definitions
* Refactor `typings-gen.sh` to use {N} CLI and generate fuller
metadata for the system libraries
* Automatically generate `ios.d.ts` wrapper
* Add interop pointers and references as alternatives
to `string` for `char*` args
(implemented in https://github.com/NativeScript/ios-runtime/pull/1022)

BREAKING CHANGE: Several enum values have changed because
    they have been wrongly generated.

    To migrate your app or plugin code use the new names of the
    following:
    *  enum NSUnderlineStyle:
        - `StyleNone` -> `None`
        - `StyleSingle` -> `Single`
        - `StyleThick` -> `Thick`
        - `StyleDouble` -> `Double`
     * enum AVAudioSessionErrorCode:
        - `CodeNone` -> `None`
        - `CodeMediaServicesFailed` -> `MediaServicesFailed`
        - `CodeIsBusy` -> `IsBusy`
        - `CodeIncompatibleCategory` -> `IncompatibleCategory`
        - `CodeCannotInterruptOthers` -> `CannotInterruptOthers`
        - `CodeMissingEntitlement` -> `MissingEntitlement`
        - `CodeSiriIsRecording` -> `SiriIsRecording`
        - `CodeCannotStartPlaying` -> `CannotStartPlaying`
        - `CodeCannotStartRecording` -> `CannotStartRecording`
        - `CodeBadParam` -> `BadParam`
        - `CodeResourceNotAvailable` -> `ResourceNotAvailable`
        - `CodeUnspecified` -> `Unspecified`

* fix(ui/text-base): Update NSUnderlineStyle.StyleSingle constant

After the typings regeneration its and several others' names have
changed to the expected `NSUnderlineStyle.Single`.

* fix(tns-platform-declarations): Restore deprecated enum values

In order to not introduce a breaking change in a patch version, we
are keeping `Style...` and `Code...` values that have been wrongly
generated till now. In the next major/minor release of the package
when the typings are regenerated we can safely remove them.

Revert to using the deprecated one's in `text-base.ios.ts` so that
the introduction of this breaking change doesn't slip in undetected.

* fix(application.ios): Directly call presetnNativeScriptApp

We've been using `performSelectorWithObject` but it's
declaration has been manually added. Moreover it's more
convenient to directly call the method.
2018-12-13 17:04:13 +02:00
46705ee332 refactor(core-modules): implement createNativeView and initNativeView for all components
refactor(core-modules): implement createNativeView and initNativeView for all components
2018-09-26 13:59:12 +03:00
0b9d4aea0a fix(android): label width shrinking on shorter text change (#5917) 2018-06-07 16:44:33 +03:00
03cfc0cee3 chore(tslint): update tslint rules and fix errors (#5747)
* chore(tslint): fix tslint config & errors
* chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
2018-04-26 18:36:32 +03:00
7cd8e7ef54 fix(text): Allow -1 to be a valid binding value for text views (#5563)
* fix(android/text ios/text): allow -1 to be a valid binding value

Instead of using -1 as special value, use Symbol(-1)
so that it can't be reset accidentally

Closes issue #5559

* renamed the symbol
2018-03-21 11:37:30 +01:00
75bd1d2c49 fix(uilabel): line height setter should not break line break mode (#5544)
fix(uilabel): line height setter should not break line break mode
2018-03-15 16:21:03 +02:00
d3a6a3f782 Line-height property breaks text alignment (iOS) (#4909) 2017-10-20 08:35:11 +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
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
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
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
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
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
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
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
6b10e94005 FIX: Span with unknown font-family crash 2017-05-10 18:42:23 +03:00
d7638c3ae4 Fix missing private _addChildFromBuilder 2017-04-24 10:24:05 +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
a6909da543 Fix: TextAlign initial value 2017-04-12 17:43:40 +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
7a1f1b2b80 Merge pull request #3891 from NativeScript/tab-view-text-transform
Initial value for text transform
2017-03-31 09:57:56 +03:00
be85af4a0d Text transform - no default value 2017-03-30 18:35:55 +03:00
29e07dd027 Hhristov/fix tab view selected index (#3893)
* fix button ios color property when textDecoration is applied

* Button ios color set on titleLabel

* Coerce tabView selectedIndex after native items are set
2017-03-29 16:39:54 +03:00
e6250e718a Disable recycling of native views
createNativeView will set iOS nativeView if it is null/undefined
2017-03-28 18:08:59 +03:00
c18a76c93a rename:
_createNativeView to createNativeView;
_initNativeView to initNativeView
_disposeNativeView to disposeNativeView
_resetNativeView to resetNativeView
2017-03-28 18:08:59 +03:00
f2898f84d5 NativeView recycled for android 2017-03-28 18:08:59 +03:00
2b28730011 Split get/set native to getDefault setNative 2017-03-22 16:37:52 +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
01368d4bb5 FontAwesome will now work in iOS buttons, being bold will fallback to Helvetica 2017-03-15 17:03:37 +02:00
a64bba62aa whiteSpace default value change to undefined (#3782)
TKUnit default message change to empty string
isSet method is now instance method of Property classes
fix detaching from parent bindingContext - were using oldParent.parent instead of parent
editable-text-base.android - onTextChanged implementation commented. Does nothing.
frame - onCreateView wrapped in try/catch and shows label with exception message if any
text-base.android - should support reset of nativeView. TransformationMethod won’t be set if TextField is secure
Change some types to their string couterparts
TextField.android won’t support multilines anymore in order to work as iOS
In android when page is removed from native backstack we won’t call tearDownUI again a second time
2017-03-14 10:26:45 +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
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
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
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
a2e09d5db0 Fix text view decorations, setting underline to none was not applied, setting decoration and text immediately was not applying the decoration 2017-03-01 11:50:35 +02:00
a0c74bb4a9 Fix resetting horizontal text alignment 2017-02-22 13:37:10 +02:00
709dff0258 fix horizontal text-align for Button in iOS, use horizontalContentAlign of the native button 2017-02-21 16:01:53 +02:00
b2cf286948 Fixed text decoration tests, Color will now store just a single argb info in 32bit unsigned int internally and covert to a/r/g/b or hex when necessary 2017-02-17 14:45:31 +02:00
f539dd5f95 Improve background setter in iOS (#3582)
CoercableProperty now inherits from Property
VS Code typescript sdk removed
ViewBase will no longer clear native view if recycleNativeView is false
2017-02-06 11:49:54 +02:00
3770f7e636 formatted text fix (#3531)
* Fix formattedText implementation for iOS
Fix typeof undefined checks
Add slow tests message
Improve tests speed

* fix tslint
reduce transitions duration in test

* waitUntilReady will throw if timeout
fix tests that needs to wait without throwing
improve test speed
2017-01-26 18:21:30 +02:00