You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(webpack): mark the CSS type for stylable views explicitly (NativeScript#5257)
We want webpack's uglification to mangle function and class names
but that's what the current implementation of the CSS in {N} relys on
to get the CSS type for each view when targeted by CSS type selectors.
The implementation is changed a little so now the CSS type can be set
directly on the prototype of each View class or for TS, through decorator.
BREAKING CHANGES:
Extending classes requires marking the derived class with @csstype
The root classes are not marked with CSSType and classes derived from ViewBase and View
will continue to work as expected. More concrete view classes (Button, Label, etc.) are
marked with @csstype now and store their cssType on the prototype suppressing the previous
implementation that looked up the class function name. So clien classes that derive from one of
our @csstype decorated classes will now have to be marked with @csstype.
* This is called to find out how big a view should be. The parent supplies constraint information in the width and height parameters.
341
357
* The actual measurement work of a view is performed in onMeasure(int, int), called by this method. Therefore, only onMeasure(int, int) can and must be overridden by subclasses.
342
-
* @param widthMeasureSpecHorizontal space requirements as imposed by the parent
343
-
* @param heightMeasureSpecVertical space requirements as imposed by the parent
358
+
* @param widthMeasureSpecHorizontal space requirements as imposed by the parent
359
+
* @param heightMeasureSpecVertical space requirements as imposed by the parent
* Measure the view and its content to determine the measured width and the measured height. This method is invoked by measure(int, int) and should be overriden by subclasses to provide accurate and efficient measurement of their contents.
372
388
* When overriding this method, you must call setMeasuredDimension(int, int) to store the measured width and height of this view. Failure to do so will trigger an exception, thrown by measure(int, int).
373
-
* @param widthMeasureSpechorizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
374
-
* @param heightMeasureSpecvertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
389
+
* @param widthMeasureSpechorizontal space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
390
+
* @param heightMeasureSpecvertical space requirements as imposed by the parent. The requirements are encoded with View.MeasureSpec.
* This method must be called by onMeasure(int, int) to store the measured width and measured height. Failing to do so will trigger an exception at measurement time.
389
-
* @param measuredWidth The measured width of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
390
-
* @param measuredHeightThe measured height of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
405
+
* @param measuredWidth The measured width of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
406
+
* @param measuredHeightThe measured height of this view. May be a complex bit mask as defined by MEASURED_SIZE_MASK and MEASURED_STATE_TOO_SMALL.
0 commit comments