fix: css calc inline break app#9582
fix: css calc inline break app#9582vallemar wants to merge 222 commits intoNativeScript:release/8.2.0from vallemar:master
Conversation
rely on android logic
That way we dont “unload” and “load” fragments. This fixes black screens and slow transitions with opengl or cameras # Conflicts: # packages/core/ui/frame/fragment.transitions.android.ts # packages/core/ui/frame/frame-common.ts # packages/core/ui/frame/index.android.ts
# Conflicts: # package.json
should be done in a plugin
It comes with a major refactoring of the BorderDrawable. Now all Paths are cached not to regenerate them on every draw pass. Also it is important to understand that the clipping feature on android comes at a cost. It will be done only when truelly necessary. but with complex paths ((border radius > 0 && border non uniform) || border-width >0) then we must apply a costly drawing pass (though hardware accelerated) to accomplish it.
This should not happen but it does. Did not manage to find the real source but it seems ok to test it here. Plus if it happens the measurement chain for that view will be broken
# Conflicts: # package.json # packages/core/bundle-entry-points.ts # packages/core/color/color-common.ts # packages/core/color/index.d.ts # packages/core/globals/index.ts # packages/core/package.json # packages/core/ui/core/bindable/index.ts # packages/core/ui/core/properties/index.ts # packages/core/ui/core/view/index.android.ts # packages/core/ui/frame/index.android.ts # packages/core/ui/styling/style-scope.ts # packages/ui-mobile-base/android/gradle/wrapper/gradle-wrapper.properties # packages/webpack5/package.json # packages/webpack5/src/configuration/base.ts
|
Thanks for the PR, We can make it work on properties like this - but I'm a little hesitant on the change due to the processing overhead of evaluating the expressions. I would like us to run a few benchmarks, and hold off on merging this right away - some numbers would make this easier to reason about. |
|
I agree with what you say. I think that setting the property in the |
|
Inline style should work with Maybe I believe the distinction here is that views have different ways of setting their properties and CSS is an abstraction on top of them. |
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign the CLA at https://www.nativescript.org/cla. |
|
Sorry, I have done a push of everything without wanting to, I have deleted the repo thinking that the PR would be deleted but it has not been like that. I don't usually work with github XD |
|
@vallemar Have you tried @edusperoni comments above? Let us know if those options do not work - if they do, we may want to close this. |
|
@NathanWalker @edusperoni I have tested the scenarios and this is the result without the PR view.setInlineStyle("width: calc(200 - 10)") //WORK
view.style.width= "calc(200 - 10)" //NO WORK
view.width= "calc(200 - 10)" //NO WORKNow when I have typed the object to type view I have realized that it is of type CoreTypes.PercentLengthType |
|
Looks like the 8.2.0 merge auto deleted and closed this, and I can't seem to reopen it. Not sure what the consensus is regarding the change, we can still discuss it! |
If you insert the width property:
calc(x - x);in an element with inline styles the application breaks, it also happens if you doobject.nativeView.width = "calc(x - x)"Works fine if put as styles of a class.
Sample project
https://play.nativescript.org/?template=play-vue&id=mncNi9&v=2
Note: with NS 8.1.x it also breaks the app
Fix: #9581