<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lake on Medium]]></title>
        <description><![CDATA[Stories by Lake on Medium]]></description>
        <link>https://medium.com/@todaypoc?source=rss-c47050565003------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mFkevYPVfRWI1l-kYGxpjg.jpeg</url>
            <title>Stories by Lake on Medium</title>
            <link>https://medium.com/@todaypoc?source=rss-c47050565003------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:02:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@todaypoc/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why Zepeto Chose Jetpack Compose for Their Android App UI]]></title>
            <link>https://techblog.zepeto.me/why-zepeto-chose-jetpack-compose-for-their-android-app-ui-44e30f8c6842?source=rss-c47050565003------2</link>
            <guid isPermaLink="false">https://medium.com/p/44e30f8c6842</guid>
            <category><![CDATA[jetpack-compose]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[zepeto]]></category>
            <dc:creator><![CDATA[Lake]]></dc:creator>
            <pubDate>Tue, 09 May 2023 01:40:39 GMT</pubDate>
            <atom:updated>2023-05-09T01:40:39.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*npvlWuDdFC5Ga6ItThK3Sw.png" /></figure><p>It’s only been a year since Jetpack Compose was first introduced at <a href="https://www.naverz-corp.com/en/">Zepeto</a>, but already more than 20% of its existing UI code and all new UI functions are coded entirely with Compose. Even at this moment, Compose is continuing to grow in popularity and has become a core part of the app architecture for Zepeto’s Android developer team. Now no one on the team wants to write view code anymore.</p><h3>Zepeto is all for Compose</h3><p>Introducing new technology is a challenging task that requires a lot of resources. Especially in cases like Zepeto, a more conservative approach is required, given its large scale and combination of various technologies. For this reason, it took the team a comprehensive analysis and extensive discussion before introducing this new technology. What led Zepeto to adopt Jetpack Compose, and how has it gained the full support of all our team members?</p><h4>Multiple-Layered List UI</h4><p>Compose shines in handling UI with multiple-layered lists. In Zepeto’s case, a lot of pagers and lists had to be layered to fit more content within the screen. With the existing view system, simple lists and pagers in layers would require a lot of boilerplate code with multiple adapters, ViewHolders, and XML. When the content within the list needs to be changed at runtime, the difference between the old list and the new one either needs to be tracked or needs to be calculated (such as with DiffUtil) and the adapter has to be notified of the change. In addition, since ViewHolder does not have a built-in lifecycle, extra code is needed for side effects like sequential processing for animations or data observing. The more layers there are in the list UI, the more complex these processes become. Every developer has a different approach, which makes it more difficult to write and comprehend the code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*H9OLs1FU0GBdzV6VnxD03Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*VilNr2e7FLaiidO-weIcEw.png" /><figcaption>Elements needed for a layered list with the existing view system</figcaption></figure><p>On the other hand, Compose allows for a much simpler method which is similar to adding elements to a LinearLayout without the need to consider adapters. Other elements like headers and footers that need to be weaved into the list can also be added directly. This has simplified the development as there is no need to worry about how to detect and reflect changes in the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*H9OLs1FU0GBdzV6VnxD03Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*5S4Q5ererRMtx-XT4jdCIg.png" /><figcaption>Elements needed for a layered list with Compose</figcaption></figure><p>With Compose, the amount of coding required for this type of UI was reduced by up to 60%, and its simpler design increased efficiency in maintenance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*MpkMg7NDgDuYeJIv9AG5_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*qmT8HKLCfjaK4mUvBh7dEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*TSZ9rtj2DdktTXaIQ9gPFw.png" /><figcaption>Various list UIs in Zepeto App</figcaption></figure><h4>Custom UI Components</h4><p>Zepeto has a variety of custom UI components including sliders, color pickers, and video trimmers. There are countless things to consider when achieving various UI/UX requirements such as how responding to touch input in one component can affect the appearance of another in the existing view system. Even a simple task like drawing a circle will require a Drawable XML file or a new custom view. For more complicated UI, there are even more things to consider such as the binding of XML, MeasureSpec, various invalidation policies depending on the state changes, isEditorMode, and so on. But with Compose, these complex problems can be solved in much simpler ways, allowing developers to develop custom UI much more easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*QF2p9vkwg4T97n52imHjHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*tWGzRIiD72InEE34nC0Pyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*HqoVeOfh9PMVi4-Sf5mJxw.png" /><figcaption>Various Custom UI components in the Zepeto App</figcaption></figure><h4>Modifier Simplifies the Matter</h4><p>In the existing view system, there are a lot of possible approaches even for a simple task like drawing a circle. This made each developer write complicated code and go through bothersome processes just to add a border. As a simple example in the picture below, in order to add the circle figure on the right-hand side of the UI, the existing view system can have various different approaches, such as Drawable XML files and custom views. However, Compose offers a simpler method with its background function in Modifier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*kyzzFcdAyqDfrr0u9MlOxw.png" /><figcaption>Rounded button feature on the right side of the Zepeto App</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*Z6CI8p2oMXPeKi7bvS6aUQ.png" /><figcaption>Code required for the button with a round side</figcaption></figure><p>The Modifier offers simple methods for common UI needs such as size adjustments, borders, shapes, blurring, clipping, and shadows. <strong>This replaced the existing view system’s complicated method of using classes and XML at the same time with just a few lines of coding.</strong></p><h4>Simple Placement of Custom UI</h4><p>For custom layouts, composables can determine the size and placement of a component in a very simple manner and can interact with child components much more intuitively compared to the existing view system. As you can see below, suppose that we’re trying to make a panel with two-dimensional sliding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*AiHsK2n8dVRzssBoLV8r1g.gif" /><figcaption>Example of a slider panel</figcaption></figure><p>To calculate the size of the background rectangle for a panel like this, its length and width measurements need to include the radius of the thumb as well. And when the size and shape of the thumb and the panel should be able to vary, the size of the child components (thumb and panel) have to be considered starting from the onMeasure step where the size of the entire ViewGroup is calculated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/152/1*kXftU6sejOu1dczZSn4Rbw.png" /><figcaption>Panel Size including the thumb radius</figcaption></figure><p>With the existing view system, this process is rather complicated: Create a class by expanding the view of both the background panel and the thumb, and from within the expanded ViewGroup class, calculate according to the MeasureSpec of each child view size from the onMeasure step, then place it onLayout. However, as can be seen in the picture below, the same can be achieved in Compose with less than 30 lines of coding using Layout.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*fQ14MXD-9YfCspnshwuu3Q.png" /></figure><ol><li>Declare Layout</li><li>Measure the size of child composables (thumb, panel)</li><li>Calculate the size of the entire composable<br>(entire width = panel width + thumb width, entire height = panel height + thumb height)</li><li>Apply the size of the composable as a whole and enter placement phase for child composables</li><li>Place the child composables in desired locations</li></ol><p><strong>With the existing view system, this component would have required us to consider several elements such as XML, attributes, and MeasureSpecs. But with Compose, the same can be accomplished in a simpler and more intuitive manner with about 30 lines of code.</strong></p><h3>The Innovative Compose Preview</h3><h4>Compose Preview Does Not Require App Building</h4><p>Compose Preview is an innovation for Android UI development. With the existing view system, previews (XML and custom views) required building the app for developers to check its display or animation, but that’s no longer necessary with Compose. Compose Preview offers previews for not only touch interactions but also animated effects that can be checked frame by frame. The UI layer of Zepeto’s gift feature was actually created entirely using only the preview; building the app was only necessary when connecting with the data layer. With this, we could achieve the UI layer regardless of external factors like server APIs and accelerate the development by communicating with designers with the preview.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*loC7Y0RrCVAbSC48mGzETA.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*NqVwAaURsVNLBEcCeIlwYQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*wnS1lPqy8XEo5TmzGCh6xg.gif" /><figcaption>Screenshots of Compose Preview in Zepeto</figcaption></figure><h4>Locale and Various Device Sizes</h4><p>The Zepeto app is in service for roughly 200 countries worldwide and supports various languages including RTL text. Compose is also effective in adapting to these different locales. Simply adding the locale information in the preview annotation generates the UI results based on the features of the language, such as RTL or LTR, word order, or word length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*RFtIgo1Oq5ckpkP7DbMgkA.png" /><figcaption>RTL preview in Zepeto</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XqCPlEQpfwT8VTIWGoiYYQ.png" /><figcaption>Ellipsis preview for different languages in Zepeto</figcaption></figure><p>Aside from locale, Compose Preview is also extremely useful for adapting to different screen sizes, especially larger screens.</p><p>You can check the visuals directly from the preview without the need for app building by simply entering the desired resolution as such <strong><em>@Preview(widthDp = 690, heightDp = 829)</em></strong> or set the default device as such <strong><em>@Preview(device = Devices.PIXEL_4_XL)</em></strong> to the preview annotation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*oH0H_rWmuO5gfEuXPffnLA.png" /><figcaption>Preview of Zepeto in Galaxy Fold 4</figcaption></figure><p>In addition, it bundles together frequently used preview options as a new preview annotation, allowing you to create preview annotation rules to be used throughout your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*QaazZsFVuffUFDomzE75rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*uJkImxesBysZ6k-BnZ-ykA.png" /><figcaption>Common annotation preview in Zepeto</figcaption></figure><p>While the design guide in the existing view system was feared by many developers, it is now a source of excitement with Compose, and you’ll find yourself looking forward to what new interesting UI/UX will be made. Zepeto expects to develop a richer and more complete design with Compose.</p><h3>Amazing Interoperability</h3><p>To verify its stability, the introduction of Compose started with the conversion of independent parts, such as custom UI or dialogs in the view system screen. It was a choice made to have minimal impact on the app, but we were also able to confirm Compose’s high compatibility with the existing view system.</p><p>We started introducing Compose by implementing ComposeView in the newly added DialogFragment, and progressed by weaving it into the existing view system’s XML through AbstractComposeView, converting UI components that are somewhat difficult to implement, such as color pickers and sliders, into Compose. These converted UI components confirmed Compose’s compatibility with ExoPlayer, OpenGL, Unity, Lottie, and CoordinatorLayout as well as with the existing views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*QF2p9vkwg4T97n52imHjHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*gvZmViqYL0ZTmKxxexPzdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*9fpXFI2f6SAkxmhyd4YcqA.png" /><figcaption>Color picker created with Compose reused in different view system displays</figcaption></figure><p>In the opposite case, applying the logic of the existing view system to Compose was also compatible. As a simple example, in order to implement the marquee effect on text, we wrapped the Ellipsize function of TextView with AndroidView and used it in Compose, and we were able to implement the desired function without compatibility problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ausR7MEBSKI_7BRHMZ96fw.gif" /><figcaption>TextView Marquee effect used with Compose</figcaption></figure><p>Zepeto is currently using the existing view system and Compose interchangeably for various functions. Compose is used not only with views and view groups, but also with OpenGL, Lottie, Exoplayer, and CoordinatorLayout. If you’re concerned about Compose’s compatibility, take the Zepeto app as an example and consider switching.</p><h3><strong><em>“Compose: don’t hesitate, just try it!”</em></strong></h3><p>If anyone is hesitant about adopting Compose, I always tell them to just try it out. Tooling support such as Compose Preview and simple APIs like Modifiers make writing UI code with Compose intuitive, but the only way to truly appreciate that experience is to try it. Compose has improved development productivity in not only the amount of coding required, but also the time spent coding, maintaining, and building the app. Every single one of our team members is happy with Compose, and no one wants to go back to the old view system now. In the future, Zepeto aims to write all new UI functions in Compose as well as convert existing functions, so it will be difficult to find the old view system in future Zepeto projects.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44e30f8c6842" width="1" height="1" alt=""><hr><p><a href="https://techblog.zepeto.me/why-zepeto-chose-jetpack-compose-for-their-android-app-ui-44e30f8c6842">Why Zepeto Chose Jetpack Compose for Their Android App UI</a> was originally published in <a href="https://techblog.zepeto.me/">Zepeto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adapter와 ViewHolder 없이 RecyclerView 구현하기]]></title>
            <link>https://techblog.zepeto.me/adapter%EC%99%80-viewholder-%EC%97%86%EC%9D%B4-recyclerview-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0-4235b6516676?source=rss-c47050565003------2</link>
            <guid isPermaLink="false">https://medium.com/p/4235b6516676</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[zepeto]]></category>
            <category><![CDATA[recyclerview]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[naverz]]></category>
            <dc:creator><![CDATA[Lake]]></dc:creator>
            <pubDate>Thu, 23 Dec 2021 02:54:11 GMT</pubDate>
            <atom:updated>2022-01-04T12:17:10.542Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqdfnsOI3trSXZygqnm6SA.png" /></figure><p><em>어떻게 하면 최소한의 코드로 RecyclerView를 구현할 수 있을까?</em></p><p>이 글에서는 위 질문으로부터 시작된 NAVER Z의 오픈소스 Antonio 라이브러리를 간단히 소개하고, 일반적으로 RecyclerView를 구현하는 방식과 비교하여 Antonio를 사용하면 얼마나 개선될 수 있을지 확인해보겠습니다.</p><h3>Why Antonio?</h3><p>모바일 애플리케이션이 고도화됨과 함께 UI/UX는 점점 더 깊은 계층 형태로 변화하고 있습니다. 이는 단순해 보이는 겉모습과는 다르게 많은 양의 Adapter와 ViewHolder 코드를 작성해야 합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGD_iMo6xAJj7kRMQNFW5g.png" /><figcaption>계층에 따라 증가하는 Adapter, ViewHolder</figcaption></figure><p>또 이런 깊은 계층의 구조는 각 계층별 Adapter나 ViewHolder 간의 의존성이 생기기 쉽기 때문에 추후 탐색 및 유지보수가 어려운 형태로 변화될 가능성이 높고, 동일한 형태의 ViewHolder라도 재활용이 어려워질 수 있습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRyvlMrFmy25A4HMzRTL0A.png" /><figcaption>탐색 및 유지보수에 용이하지 않은 구조</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m-4Lb6Q4t9ff1jKitrtE_Q.png" /><figcaption>재활용이 어려운 ViewHolder</figcaption></figure><p>Antonio에서는 위와 같은 문제들을 해결하기 위해서 데이터 바인딩을 활용해 Adapter, ViewHolder 구현을 생략하고 Data class가 곧 RecyclerView의 상태로 표현되도록 했습니다.</p><h3>일반적으로 RecyclerView 를 구현 하려면..</h3><p>먼저 다음과 같은 그리드 형태의 RecyclerView를 일반적인 방식으로 구현한다고 가정해보겠습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*A7EwNSpN-zT-i0KKUXO6rw.png" /><figcaption>예시 Grid RecyclerView</figcaption></figure><ol><li>해당 RecyclerView 를 위한 Adapter 를 구현한다.</li><li>ViewHolder 에 바인딩 될 데이터 모델을 구현한다.</li><li>ViewHolder 를 위한 XML 을 구현한다.</li><li>XML 데이터 주입 혹은 ViewHolder 의 비지니스 로직 구현을 위해 ViewHolder 클래스 구현한다.</li><li>RecyclerView에 Adapter를 설정하고 데이터를 추가한다.</li></ol><p>위와 같은 과정에서 간단한 RecyclerView에도 꽤 많은 상용구 코드가 필요해지고, 계층이 늘어나면 어느새 상용구 코드로 뒤덮여 있는 패키지를 만나게 됩니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*OmcMVQzHyErvWgn3q5vJjw.png" /><figcaption>계층이 깊어질 수록 많아지는 상용구 코드들</figcaption></figure><p>그뿐만 아니라 위와 같은 상용구 코드 문제 외에도 아직 다음과 같은 여러 추가 고려 사항이 남아있습니다.</p><ul><li>양/단방향 바인딩을 위한 LifecycleOnwer</li><li>다중 타입 구현</li><li>OnCreateViewHolder 시점에 외부에서 주입 받을 객체</li></ul><p>이런 부분은 구현하는 사람마다 다르게 구현할 수 있고, 잘못 구현할 경우 Adapter와 ViewHolder를 왕래하는 스파게티 코드가 될 수 있어 유지보수가 어려워질 수 있습니다.</p><h3>Adapter, ViewHolder 없이 Data, XML 로만 표현하기</h3><p>그렇다면 Antonio와 함께하면 어떤 부분이 달라질 수 있을까요? 실제 코드를 통해 알아보겠습니다.</p><ol><li>ViewHolder 가 될 XML 을 DataBinding을 통하여 구현</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8bed2e08f8af405e6c7670f34f99ed88/href">https://medium.com/media/8bed2e08f8af405e6c7670f34f99ed88/href</a></iframe><p>2. onBindViewHolder 시점에 XML에 주입될 데이터 모델을 구현</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/51644211abe3acab1f2204de6562c99f/href">https://medium.com/media/51644211abe3acab1f2204de6562c99f/href</a></iframe><p>3. AntonioAdapter(혹은 AntonioListAdapter)를 선언하고 RecyclerView에 Adapter를 설정한 뒤 일반적인 Adapter와 동일한 방식으로 사용합니다.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7370a1e5f8fc2bd0173e595e92382e95/href">https://medium.com/media/7370a1e5f8fc2bd0173e595e92382e95/href</a></iframe><p><strong>끝입니다.</strong> 기존 RecyclerView 에서의 많은 상용구 코드를 없애고, 다중 타입에 대해서 고민할 필요도 없어졌습니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*tGvOHuj3ltoNTCoYnOYv4Q.gif" /><figcaption>Adapter, ViewHolder 없애기</figcaption></figure><p>이뿐만 아니라 Antonio를 사용하면 다음과 같은 이슈도 함께 해결할 수 있습니다.</p><ul><li>양/단방향 바인딩을 위한 LifecycleOnwer</li><li>onCreateViewHolder 시점 주입</li></ul><h3>LifecycleOnwer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*_F6TmtlEes_gbgocsAD1jw.png" /></figure><p>Antonio를 사용하면 ViewHolder의 Attach 여부와 가장 가까운 LifecyclerOwner(Fragment, Activity)에 최적화된 LifecycleOwner를 내부적으로 주입받도록 해, 별다른 구현 없이 Layout XML에서 양/단방향 바인딩이 가능합니다.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pJi9HHGOHwWL4dMwuu_xvQ.png" /></figure><h3>ViewHolder 가 생성되는 시점에 주입 받을 데이터 (onCreateViewHolder)</h3><p>ViewHolder를 구현하다 보면 onBindViewHolder 시점마다 바인딩될 필요 없이 생성되는 시점에 생성자를 통하여 전달받아야 할 데이터가 있을 수 있습니다.</p><p>이 경우 AntonioAdapter(혹은 AntonioListAdapter)의 생성자 파라미터 중 하나인 additionalVariables를 활용할 수 있습니다. 이 파라미터에 주입된 데이터는 onCreateViewHolder 시점, <strong>즉 ViewHolder가 생성되는 시점에 XML에 한 번만 주입됩니다.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/97cd72e6361db253b14e3de6995efbe0/href">https://medium.com/media/97cd72e6361db253b14e3de6995efbe0/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a001c1c7c78ac12d9c1eb0df4ffd698/href">https://medium.com/media/4a001c1c7c78ac12d9c1eb0df4ffd698/href</a></iframe><p>이 뿐만 아니라 Antonio 에서는 XML에서 사용 될만한 아래의 각종 데이터를 스스로 XML에 주입하여 줍니다.</p><ul><li><a href="https://github.com/naverz/Antonio/wiki/Additional-tips-for-Data-binding#LifecycleOwner">LifecycleOwner</a> to BR.lifecycleOwner</li><li><a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder#itemView">ViewHolder.itemView</a> to BR.itemView</li><li><a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder#getAbsoluteAdapterPosition()">ViewHolder.absoluteAdapterPosition</a> to BR.absoluteAdapterPosition</li><li><a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder#getBindingAdapterPosition()">ViewHolder.bindingAdapterPosition</a> to BR.bindingAdapterPosition</li><li><a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.ViewHolder#getLayoutPosition()">ViewHolder.layoutPosition</a> to BR.layoutPosition</li><li><a href="https://developer.android.com/reference/androidx/recyclerview/widget/RecyclerView.Adapter#onBindViewHolder(VH,%20int)">Position in onBindViewHolder</a> to BR.itemPosition</li></ul><p>연동하는 입장에서는 특별한 처리 없이 위에 선언된 아이템들을 XML Variable에 선언한 뒤 사용하면 됩니다.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b478f337bbbb38a9e54051796ed69cd7/href">https://medium.com/media/b478f337bbbb38a9e54051796ed69cd7/href</a></iframe><p>어떤가요, 참 쉽죠?</p><h3>More about Antonio!</h3><p>위에 설명된 Antonio의 기능들은 전체 기능에 있어서는 빙산의 일각이며 다음과 같이 다양하고 유용한 기능이 더 있습니다.</p><ul><li>Data class = View state (RecyclerViewState)</li><li>ViewPager, Paging plug-in</li><li>FragmentStateAdapter State management.</li><li>데이터 바인딩 없이 Antonio 사용 하기 (Antonio Annotation)</li></ul><p>위 나열된 기능들에 대해서는 <a href="https://medium.com/naver-z">NAVER Z Medium</a> 에 시리즈로 올릴 예정이므로 <a href="https://medium.com/naver-z">NAVER Z Medium</a> 팔로우 해주시면 빠르게 만나보실 수 있습니다. <a href="https://github.com/naverz/Antonio">Antonio Github</a> 에도 흥미로운 이야기가 있으니 많은 관심 부탁드립니다.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4235b6516676" width="1" height="1" alt=""><hr><p><a href="https://techblog.zepeto.me/adapter%EC%99%80-viewholder-%EC%97%86%EC%9D%B4-recyclerview-%EA%B5%AC%ED%98%84%ED%95%98%EA%B8%B0-4235b6516676">Adapter와 ViewHolder 없이 RecyclerView 구현하기</a> was originally published in <a href="https://techblog.zepeto.me/">Zepeto</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android library without initializing code likes firebase]]></title>
            <link>https://todaypoc.medium.com/android-library-without-initializing-code-likes-firebase-aa63d956955b?source=rss-c47050565003------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa63d956955b</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Lake]]></dc:creator>
            <pubDate>Thu, 08 Apr 2021 17:04:52 GMT</pubDate>
            <atom:updated>2021-04-08T17:04:52.606Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have ever integrated firebase, you already know there is no initialize code. How can they get the context without initializing the code?</p><p><a href="https://firebase.googleblog.com/2016/12/how-does-firebase-initialize-on-android.html">The firebase blog</a> already posted about this topic. But this post is about a real use case with an android library, <a href="https://github.com/LakeLab/Notifier">Notifier</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*hT2ElRxEDDQffmlB1beeCw.png" /></figure><h3>Purpose</h3><p>Initialize an android library with an Application Context by using Content Provider.</p><h3>TL;DR</h3><ul><li>Make Content Provider &amp; Inject Context</li><li>Register your Content Provider in your library manifest</li><li>Use the context, or Initialize your library from your Content provider</li></ul><h4>Make Content Provider &amp; Inject Context</h4><p>You just need to extend the ContentProvider and implement abstract methods without any special implementations. (You can implement abstract methods for this content provider If your library needs use contents provider)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1b9f6945fa1e29c21b5c52611feaa0e0/href">https://medium.com/media/1b9f6945fa1e29c21b5c52611feaa0e0/href</a></iframe><p><em>The full code of ContextInjections class in Notifier is </em><a href="https://github.com/LakeLab/Notifier/blob/master/notifier/src/main/java/com/lakelab/notifier/ContextInjections.java"><em>here</em></a>.</p><h4>Register your Content Provider in your library manifest</h4><p>There can be only one ContentProvider on an Android device with a given “authority” string. If your library is used in more than one app on a device, you have to make sure that they get added with two different authority strings. For that, You can use <a href="https://developer.android.com/studio/build/manifest-build-variables.html">${applicationId}</a> for your authorities like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/792d5875046a2dbff466bc8c5b945ed3/href">https://medium.com/media/792d5875046a2dbff466bc8c5b945ed3/href</a></iframe><h4>Use the context or Initialize your library from your Content provider</h4><p>You can use context in your library as follow<br>Context context = ContextInjections.getApplicationContext();</p><p>Or You can initialize your library in onCreate method on the Content provider, which you made.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7644fb23f1a530a37aa19e889c698480/href">https://medium.com/media/7644fb23f1a530a37aa19e889c698480/href</a></iframe><h3>C.F</h3><h4>Notice for the applications that are not in the main process</h4><p>For an application that needs to run in another process, You should either serve another way to initialize your library or avoid calling anything that requires the initialization and the context. Because Your ContentProvider onCreate will never get invoked in another process if that process won’t create any ContentProviders.</p><h3>References</h3><ul><li><a href="https://firebase.googleblog.com/2016/12/how-does-firebase-initialize-on-android.html">How does Firebase initialize on Android?</a></li><li><a href="https://github.com/LakeLab/Notifier">Notifier</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa63d956955b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network debugging in android with Stetho]]></title>
            <link>https://todaypoc.medium.com/network-debugging-in-android-with-stetho-eff9c2b15ccd?source=rss-c47050565003------2</link>
            <guid isPermaLink="false">https://medium.com/p/eff9c2b15ccd</guid>
            <category><![CDATA[chrome]]></category>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[okhttp]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[glide]]></category>
            <dc:creator><![CDATA[Lake]]></dc:creator>
            <pubDate>Tue, 06 Apr 2021 17:12:01 GMT</pubDate>
            <atom:updated>2021-04-06T17:12:01.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_cAn0z1EJpBSrMqiDkQ9A.png" /></figure><h3>Stetho</h3><p><a href="http://facebook.github.io/stetho/">Stetho</a> is a debug bridge for Android, created by Facebook. It helps you use your Chrome inspector to inspect your app’s Network, DB, View Hierarchy, etc. These are Stetho’s specifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nztaOop7vAKXZewQbRS67Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYeNdZ847ZPrPxcx74zCTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VL8Hzm6NublfmB06cqmw2A.png" /></figure><p>This post is about integrating with Android libraries related to Networking (OkHttp — Retrofit, Glide).</p><h3>TL;DR</h3><p>Integrating with Stetho</p><ul><li>Add dependencies &amp; proguard</li><li>Initialize Stetho and make Stetho injected OkHttpClient &amp; Retrofit</li><li>Make a Stetho injected glide module to replace a default glide module</li><li><strong>Using GlideApp</strong></li><li>Debugging on Chrome inspector</li></ul><p>Extra part</p><ul><li>Separate build variants (Build type)</li></ul><h3>Integrating with Stetho</h3><h4>Add dependencies &amp; proguard</h4><p>Add dependencies for network debugging. — Stetho, Glide, Retrofit.<br><em>C.F) DebugImplementation is for separating build variants which will be explained in the extra part.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a0eb68d52a4e210f755d21dd582171fa/href">https://medium.com/media/a0eb68d52a4e210f755d21dd582171fa/href</a></iframe><p>If you are using <a href="https://developer.android.com/studio/build/shrink-code">Proguard</a>, Add some required rules for Glide &amp; OkHttp &amp; Retrofit on your proguard-rules.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/89740e6a5d3a8cebc7d220755eaca7c5/href">https://medium.com/media/89740e6a5d3a8cebc7d220755eaca7c5/href</a></iframe><h4>Initialize Stetho and make Stetho injected OkHttpClient &amp; Retrofit</h4><p>Initialize Stetho with an Application context.<br><em>C.F) Usually, Stetho is initialized at an Application class.</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e40e1cc6c7f4ff3310900cd9a285f73e/href">https://medium.com/media/e40e1cc6c7f4ff3310900cd9a285f73e/href</a></iframe><p>Make OkHttpClient which is injected Stetho.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5293c6e0b1ab40ad0e817393bf7483ee/href">https://medium.com/media/5293c6e0b1ab40ad0e817393bf7483ee/href</a></iframe><h4>Make a Stetho injected glide module to replace a default glide module</h4><p>Replace a default Glide module with a Stetho-injected Glide module for debugging a glide network. To replace the default glide module, Create an AppGlideModule for connecting Glide and the Stetho-injected OkHttp.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/273aa5b58e3f4b84e2e4145710e979be/href">https://medium.com/media/273aa5b58e3f4b84e2e4145710e979be/href</a></iframe><p>After finishing making GlideModule, Register meta-data at android manifest in the application tags.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93cf2c1e7f8550066b9287728f9ef73b/href">https://medium.com/media/93cf2c1e7f8550066b9287728f9ef73b/href</a></iframe><p><em>C.F) This is for avoiding conflict between your glide module and the default glide module. If you want to know the detail about this, You can explore </em><a href="https://github.com/bumptech/glide/wiki/Configuration#conflicting-glidemodules"><em>here</em></a><em>.</em></p><h4>Using GlideApp</h4><p>Using GlideApp instead of normal Glide class.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/852a96bfdc1b27262c56f7628474cc92/href">https://medium.com/media/852a96bfdc1b27262c56f7628474cc92/href</a></iframe><p>This is because limiting the generated API to applications allows us to have a single implementation of the API in Glide. For more details about this, please visit <a href="http://bumptech.github.io/glide/doc/generatedapi.html#availability">here</a>.</p><h4>Debugging on Chrome inspector</h4><p>Open Chrome and Browse chrome://inspect/#devices for enjoying easy debugging :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nztaOop7vAKXZewQbRS67Q.png" /></figure><h3>Extra part</h3><p>It should be a disaster if your application can be debugged on a release build. So We usually use it this way.</p><pre>if (BuildConfig.DEBUG) {<br>     // initialize<br>}</pre><p>But this way can make your codes complex and easy to make confused. So For clear and mistake-proof code, Separating builds variants (Build type) will be introduced in this extra part.</p><h4>Separate build variants (Build type)</h4><p>It’s already separated by Debug/Release when you make a project. So Only the separating folder is necessary for separating build variants. This is my sample project structure for separating build variants.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*uaCIyDXgFgK3WK-4.png" /></figure><p>Make two directories debug/release like above and Make classes of the same name in each directory as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f542f2e28a521278cf582cd794e5294/href">https://medium.com/media/7f542f2e28a521278cf582cd794e5294/href</a></iframe><p>Your manifest even can be separated by the debug variant as follows. It will be merged automatically with your manifest in the main directory.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dcaf40c950446cd0eeef03295543b8e/href">https://medium.com/media/9dcaf40c950446cd0eeef03295543b8e/href</a></iframe><p>C.F) You can change your build variant in the menu in Android Studio as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/0*8YLjnu3eUIub5zqq.png" /></figure><p>Your code is completely separated by debugging and release build variables, And It makes you safe from mistakenly leaking your network information.</p><h3>References</h3><ul><li><a href="http://facebook.github.io/stetho/">Stetho official website</a></li><li><a href="https://proandroiddev.com/glide4-and-stetho-to-easily-debug-your-image-loading-system-c274d0d9966b">Glide4 and Stetho to easily debug your image loading system</a></li></ul><h3>If you’d like to see the full codes for this post</h3><p>Please feel free to visit <a href="https://github.com/LakeLab/android-network">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eff9c2b15ccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>