Skip to main content
Language

Custom Views

PhotoEditor SDK supports using your custom views in the editor. Using custom views gives you more control over the layout and allows you to dynamically react to events, and read values from ImglySettings or ImglyState subclasses.

Extending from IMG.LY views#

Extending from views provided by the PhotoEditor SDK reduces the amount of boilerplate code required for accessing settings or subscribing/unsubscribing to events.

Here, we extend from an ImgLyUIRelativeContainer and modify the visibility of the view depending upon whether the main menu is being shown or not.

Custom views#

In situations where it is not possible to extend from the views provided by the PhotoEditor SDK, you can create your views and manually add the boilerplate code for accessing settings or subscribing/unsubscribing to events.

Here, we extend from a RelativeLayout and modify the visibility of the view depending upon whether the main menu is being shown or not.

To see the usage of custom views, refer to the next section.