<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Niklas – IMG.LY Blog</title><description>Coder @ img.ly</description><link>https://img.ly/blog/author/niklas/</link><language>en-us</language><image><url>https://img.ly/apple-touch-icon.png</url><title>Niklas – IMG.LY Blog</title><link>https://img.ly/blog/author/niklas/</link></image><atom:link href="https://img.ly/blog/author/niklas/rss.xml" rel="self" type="application/rss+xml"/><generator>Astro</generator><lastBuildDate>Fri, 19 Jun 2026 11:25:53 GMT</lastBuildDate><ttl>60</ttl><item><title>How to recreate Snapchat’s UI within a single day with the PhotoEditor SDK for Android</title><link>https://img.ly/blog/how-to-recreate-snapchats-ui-within-a-single-day-with-the-photoeditor-sdk-for-android-e985b348c52c/</link><guid isPermaLink="true">https://img.ly/blog/how-to-recreate-snapchats-ui-within-a-single-day-with-the-photoeditor-sdk-for-android-e985b348c52c/</guid><pubDate>Sun, 18 Feb 2018 23:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Is it possible to completely rejig the UI of the &lt;a href=&quot;https://img.ly/products/photo-sdk/&quot;&gt;PhotoEditor SDK&lt;/a&gt; within a day? Principally, everything is possible, however, for me as a prospective Java developer this whole undertaking seemed rather tough at first. The task at hand was to rebuild the SDK’s UI to match popular apps like Snapchat or Instagram Stories in only a few steps. A few weeks ago, we already did something similar with the iOS SDK, however, as there are some differences between the platforms the whole process had to be repeated for Android.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;Our default UI vs Story UI&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 900px) 900px, 100vw&quot; data-astro-image=&quot;constrained&quot; data-astro-image-pos=&quot;center&quot; width=&quot;900&quot; height=&quot;600&quot; src=&quot;https://img.ly/_astro/image-13_Z155gLz.webp&quot; srcset=&quot;/_astro/image-13_SB6P9.webp 640w, /_astro/image-13_Z1YEFsp.webp 750w, /_astro/image-13_16X6CG.webp 828w, /_astro/image-13_Z155gLz.webp 900w&quot;&gt;&lt;/p&gt;
&lt;p&gt;As my colleague Malte Baumann already pointed out in his &lt;a href=&quot;https://img.ly/blog/how-to-build-instagrams-story-editor-in-a-day-23be9adff9b/&quot;&gt;blog post&lt;/a&gt;, the main idea behind this endeavor is to explore the possibilities and limitations of the SDK’s customizable UI. But above that, it is also a great way of making oneself familiar with the SDK’s architecture and functionalities. Below, I’m going to explain some of the technical aspects as well as the setup of the story UI in a little more detail.&lt;/p&gt;
&lt;h2 id=&quot;the-architecture&quot;&gt;The Architecture&lt;/h2&gt;
&lt;p&gt;The interface is composed of several layers. The first layer is the &lt;code&gt;EditorRootView&lt;/code&gt; that contains all other views and is, therefore, their parent object. Beneath that lies the &lt;code&gt;EditorPreview&lt;/code&gt; that is responsible for the display of the selected image. Following comes the &lt;code&gt;BrushLayer&lt;/code&gt; that can be drawn upon. In this specific layer array, the brush cannot be placed in front of a sticker. The stickers, however, are all generated in dedicated layers which makes it easy to adjust their order. Once selected, a sticker will automatically be brought to the front. The UI elements can be switched visible and invisible at will; they lie at the very top so that no sticker can cover them.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;The view hierarchy. The user facing controls are on the bottom, the root window is on the top.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 473px) 473px, 100vw&quot; data-astro-image=&quot;constrained&quot; data-astro-image-pos=&quot;center&quot; width=&quot;473&quot; height=&quot;579&quot; src=&quot;https://img.ly/_astro/image-14_Z35Yqi.webp&quot; srcset=&quot;/_astro/image-14_Z35Yqi.webp 473w&quot;&gt;&lt;/p&gt;
&lt;p&gt;At the heart of the UI lies the &lt;code&gt;StateHandler&lt;/code&gt; that functions as the communication interface with the SDK. The &lt;code&gt;StateHandler&lt;/code&gt; includes the &lt;code&gt;EditorShowState&lt;/code&gt; and the &lt;code&gt;HistoryState&lt;/code&gt;. The &lt;code&gt;HistoryState&lt;/code&gt; allows for the retrieval of methods that are necessary for the function of the “undo” button. For example, every new brush stroke adds a new memory state that can be retrieved by the &lt;code&gt;HistoryState&lt;/code&gt; and hence reversed. The &lt;code&gt;EditorShowState&lt;/code&gt; manages the &lt;code&gt;EditMode&lt;/code&gt; that allows for the activation of the different SDK tools. To draw with the brush tool, the &lt;code&gt;EditMode&lt;/code&gt; simply has to be set to brush. Color and stroke width are then controlled by the &lt;code&gt;BrushLayerSettings&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;There is a dedicated button to add emojis that displays a &lt;code&gt;RecyclerView&lt;/code&gt; filled with every sticker available in the config upon press. Once a sticker is selected a new layer with matching &lt;code&gt;StickerLayerSettings&lt;/code&gt; is added to the image.&lt;/p&gt;
&lt;p&gt;Although text is realized as a sticker as well within the SDK, it is a little more complicated to generate a text sticker as the required &lt;code&gt;TextStickerConfig&lt;/code&gt; has to be generated first. The text tool can create text stickers through keyboard entries. The text and background color, as well as the text alignment, can be adjusted separately. Those functions can be controlled via different buttons. However, as the SDK has no canned methods for these operations, I had to write widgets that control the buttons. The different button states are interpreted and executed in the &lt;code&gt;TextPanel&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To export an image, you simply have to launch the &lt;code&gt;saveImage&lt;/code&gt; method.&lt;/p&gt;
&lt;p&gt;&lt;img alt=&quot;The customized Story UI in action.&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; sizes=&quot;(min-width: 300px) 300px, 100vw&quot; data-astro-image=&quot;constrained&quot; data-astro-image-pos=&quot;center&quot; width=&quot;300&quot; height=&quot;581&quot; src=&quot;https://img.ly/_astro/1-o1meOAWBo6YIzb_xRishgQ_O6YP6.webp&quot; srcset=&quot;/_astro/1-o1meOAWBo6YIzb_xRishgQ_O6YP6.webp 300w&quot;&gt;&lt;/p&gt;
&lt;h2 id=&quot;the-result&quot;&gt;The Result&lt;/h2&gt;
&lt;p&gt;Thanks to the documentation, the execution of the UI revamp was pretty straightforward even without previous knowledge or source code access. As main functionalities like the brush tool or the undo function are already built into the SDK, it was a manageable task to integrate those into the new UI. Against that, the styling of the &lt;code&gt;SeekBar&lt;/code&gt; that is needed to adjust the brush size was a little more time-consuming.&lt;/p&gt;
&lt;p&gt;The design was mainly realized through layouts with fairly simple code. Even though there were some minor hurdles to overcome, the allotted time of a working day should be adequate for a more experienced developer.&lt;/p&gt;
&lt;p&gt;You can find the code for this example UI in &lt;a href=&quot;https://github.com/imgly/pesdk-blog-instagram-ui&quot;&gt;our repository&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks to &lt;a href=&quot;https://medium.com/@Phoenix_Raw&quot;&gt;Felix Rau&lt;/a&gt; and &lt;a href=&quot;https://medium.com/@codingdivision&quot;&gt;Malte Baumann&lt;/a&gt;!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Thanks for reading! To stay in the loop, subscribe to our &lt;a href=&quot;https://photoeditorsdk.us13.list-manage.com/subscribe?u=dc9f652839dbb620d14d6d28d&amp;#x26;id=04a306e4b2&quot;&gt;Newsletter&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;</content:encoded><dc:creator>Niklas</dc:creator><media:content url="https://blog.img.ly/2020/04/image-46.png" medium="image"/><category>iOS</category><category>Android</category><category>Photo Editor</category><category>User Interface</category><category>JavaScript</category><category>Tech</category><category>How-To</category><category>Learning</category></item></channel></rss>