Package 

Interface ReactClippingViewGroup


  • 
    public interface ReactClippingViewGroup
    
                        

    Interface that should be implemented by View subclasses that support {@code * removeClippedSubviews} property. When this property is set for the ViewGroup subclass it's responsible for detaching it's child views that are clipped by the view boundaries. Those view boundaries should be determined based on it's parent clipping area and current view's offset in parent and doesn't necessarily reflect the view visible area (in a sense of a value that getGlobalVisibleRect may return). In order to determine the clipping rect for current view helper method calculateClippingRect can be used that takes into account parent view settings.

    • Method Summary

      Modifier and Type Method Description
      abstract void updateClippingRect() Notify view that clipping area may have changed and it should recalculate the list of childrenthat should be attached/detached.
      abstract void getClippingRect(Rect outClippingRect) Get rectangular bounds to which view is currently clipped to.
      abstract void setRemoveClippedSubviews(boolean removeClippedSubviews) Sets property {@code removeClippedSubviews} as a result of property update in JS.
      abstract boolean getRemoveClippedSubviews() Get the current value of {@code removeClippedSubviews} property.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • updateClippingRect

         abstract void updateClippingRect()

        Notify view that clipping area may have changed and it should recalculate the list of childrenthat should be attached/detached. This method should be called only when property {@code * removeClippedSubviews} is set to {@code true} on a view.

        CAUTION: Views are responsible for calling updateClippingRect on it's children.This should happen if child implement ReactClippingViewGroup, return true from and clipping rect change of the current view may affect clippingrect of this child.

      • getClippingRect

         abstract void getClippingRect(Rect outClippingRect)

        Get rectangular bounds to which view is currently clipped to. Called only on views that has set {@code removeCLippedSubviews} property value to {@code true}.

        Parameters:
        outClippingRect - output clipping rect should be written to this object.
      • setRemoveClippedSubviews

         abstract void setRemoveClippedSubviews(boolean removeClippedSubviews)

        Sets property {@code removeClippedSubviews} as a result of property update in JS. Should becalled only from @{link ViewManager#updateView} method.

        Helper method applyRemoveClippedSubviewsProperty may beused by ViewManager subclass to apply this property based on property update map .

      • getRemoveClippedSubviews

         abstract boolean getRemoveClippedSubviews()

        Get the current value of {@code removeClippedSubviews} property.