Commit Graph

744 Commits

Author SHA1 Message Date
Martin Yankov
f042417f10 refactor(android-tabview): tab adapter data changed event is called too many times (#5364) 2018-02-05 13:52:32 +02:00
Alexander Vakrilov
c0a7a45ab9 refactor: Handle TS2.7 stricter tuples checks (#5366) 2018-02-01 13:04:55 +02:00
Martin Yankov
2b843195e4 fix-next(android-tabview): handle tab fragments attach/detach properly (#5333) 2018-01-29 17:25:36 +02:00
Dimitar Tachev
01fab68e58 feat: support intent replacement in the android activity (#5337) 2018-01-29 16:54:07 +02:00
Alexander Djenkov
9d7f0e5315 fix(frame): recreate frame if no cached one found on app resume #5318 (#5330) 2018-01-25 11:37:47 +02:00
Alexander Djenkov
af934ccabf feature(frame): introduce src property (#5320) 2018-01-25 10:57:13 +02:00
Alexander Vakrilov
923d48b23a fix: layoutParent crash with ProxyViewContainer (#5315) 2018-01-24 18:27:00 +02:00
Alexander Vakrilov
b492996647 fix(layouts): Set automaticallyAdjustsScrollViewInsets (#5311) 2018-01-23 17:53:31 +02:00
Hristo Hristov
016c64fe04 showModal & closeModal can be called on any View
fix livesync implementation to be compatible with 3.4 and to replace mainEntry for 4.0 when root is not Frame
some refactoring of page.ios in order to allow showing multiple modal dialogs
2018-01-18 13:34:25 +02:00
Hristo Hristov
9dd3e1a807 Fix crash with nested frames navigation when aactivity is recreated. We now check if frame native view is atached to window before running navigation.
Livesync now recreates the main page instead of calling frame.navigate
2018-01-15 18:07:20 +02:00
Hristo Hristov
3f2f5f41f0 Fix page styleScope for iOS 2018-01-12 12:43:55 +02:00
Hristo Hristov
ef86addd6d Fix Page to be styleScope if frame is not 2018-01-12 10:23:54 +02:00
Hristo Hristov
1e690a7b83 Add more typings to methods 2018-01-11 13:37:30 +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
82f081d603 fix android keyboard 2018-01-10 17:45:08 +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
8df8d754ab Fix Enter key not moving caret on next line in TextView for android
Fixes #5121
2017-12-20 10:31:39 +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
63ab46eb2a Layout improvements 2017-12-15 17:11:51 +02:00
Hristo Hristov
33cd058718 Call loaded/unloaded on the rootView when application is resumed/suspended
Remove dead code from frame.ios
2017-12-15 15:26:23 +02:00
Hristo Hristov
4e74c37313 Fix android crash TabViewItem canBeLoaded was true even when TabView was destroyed
Fix android crash modal view was not destroyed even though his dialog was
2017-12-15 13:08:15 +02:00
Hristo Hristov
365d48550f Revert Page.android onContentChange to addViewToNativeVisualTre due to Angular issue with ProxyViewContainer 2017-12-15 13:08:15 +02:00
Hristo Hristov
c0d3a4048d Fix ListView itemClick for android 2017-12-15 13:08:15 +02:00
Hristo Hristov
a416fa4fb6 Fix TabViewItem loading
Fix showModal not on full screen
2017-12-15 13:08: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
04c1132541 Fix broken merge conflict 2017-12-15 13:06:34 +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
edb0eb1721 Bring back ios property of CustomLayoutView 2017-12-15 13:06:34 +02:00
Hristo Hristov
1778ba1eb9 Fix showModal on iOS 2017-12-15 13:06:34 +02:00
Hristo Hristov
b489e52a5f Fix iOS 11 titleView misplacement in ActionBar 2017-12-15 13:06:34 +02:00
Hristo Hristov
501b954c47 Fix issue with angular not rendering... 2017-12-15 13:06:34 +02:00
Hristo Hristov
a35e603d85 Fix to always get the same bounds no matter if we are shown modally or not (for iOS).
Remove code that moves actionBar when there is incoming call. We now depend on the autolayout to position us correctly.
_addView, _removeView won't request layout for iOS.
LayoutBase: addChild & remvoeChild will request layout.
ContentView: content change will request layout.
2017-12-15 13:06:34 +02:00
Hristo Hristov
53b92ad83a Fix broken TS 2017-12-15 13:06:34 +02:00
Hristo Hristov
5bcccd28a8 Fix: when page disappears because parent viewController is removed (e.g. selecting different tab in TabBar) our navigation stack was incorrectly removing backstack entry. This fix may not work if the tab is hosted in Page but it is unlikely that someone will host Page->TabView->Frame->Page 2017-12-15 13:06:34 +02:00
Hristo Hristov
1ee686d9bc Remove list-view.ios contentInsetAdjustmentBehavior (it should be defult) 2017-12-15 13:06:34 +02:00
Hristo Hristov
2a10b7a220 Remove public iOS types from view.d.ts 2017-12-15 13:06:34 +02:00
Hristo Hristov
a7ae124ad8 ActionBar is measured the moment we create native buttons otherwise it won't show correctly 2017-12-15 13:06:34 +02:00
Hristo Hristov
f3aecad369 ScrollingContent is not checking innerviews anymore 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
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
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
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
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