<?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 Yahor Urbanovich on Medium]]></title>
        <description><![CDATA[Stories by Yahor Urbanovich on Medium]]></description>
        <link>https://medium.com/@egorikftp?source=rss-e93d234beac6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*o68EbWXs-WgNt9csBgm9yw.jpeg</url>
            <title>Stories by Yahor Urbanovich on Medium</title>
            <link>https://medium.com/@egorikftp?source=rss-e93d234beac6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 20:13:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@egorikftp/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[Tiamat — simple Compose Multiplatform navigation]]></title>
            <link>https://medium.com/mobilepeople/tiamat-simple-compose-multiplatform-navigation-3956dc00a607?source=rss-e93d234beac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3956dc00a607</guid>
            <category><![CDATA[multiplatform]]></category>
            <category><![CDATA[navigation]]></category>
            <category><![CDATA[compose]]></category>
            <dc:creator><![CDATA[Yahor Urbanovich]]></dc:creator>
            <pubDate>Thu, 29 Feb 2024 12:52:22 GMT</pubDate>
            <atom:updated>2024-03-04T08:14:32.638Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*QgIqcUjwECJKnuAAnJankA.jpeg" /><figcaption>generated by Bing image creator</figcaption></figure><h3>Tiamat - simple Compose Multiplatform navigation</h3><h3>Intro</h3><p>Why do we need another navigation library? You can say: just choose one of the existing solutions.</p><p>For our project initially, we have chosen the Google Navigation Compose library. It was quite simple for developers who still migrated their minds to the new “Compose world”.</p><p>For some time we made a wrapper around the navigation library, to simplify access to the Navigation controller from any Compose screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ywnxtjalRjxPxa_H_mRHg.png" /><figcaption>LocalNavController returns the current controller in composition</figcaption></figure><p>Despite various improvements in navigation, we had a lot of critical moments that did not satisfy us:</p><ul><li>Navigation using String key</li><li>A difficult way to pass data between screens</li><li>Navigation only over replace</li></ul><p>We have experimented with some other libraries:</p><ul><li><a href="https://github.com/adrielcafe/voyager">Voyager</a> — it doesn’t update very often (recently got status 1.0), no possibility to pass lambda as a parameter (<a href="https://github.com/adrielcafe/voyager/issues/59">issue</a>)</li><li><a href="https://github.com/arkivanov/Decompose">Decompose</a> — a too complex <em>framework</em> for our project. By the way, I use it on personal projects and recommend to try 🌚</li><li>other solutions overengeenered (by our opinion)</li></ul><h3>Our requirements</h3><p>To reach a goal, we first need to understand what we are striving for.</p><p>Here is what we expect from the navigation library:</p><ol><li>Compose first support + Multiplatform</li><li>Simple API: Screeen creation, back stack handle, add/replace methods</li><li>Navigation using Screen instance without any String keys</li><li>A simple way to save State of the screen</li><li>Pass <strong>Any</strong> data types between screens (even lambdas) and deliver the result</li><li>Without code generation</li><li>Without tying to any architecture or existing frameworks</li></ol><h3>Welcome Tiamat</h3><p>We were so impressed with our internal library that we decided to make it open-source for Compose community.</p><p>After several months of experiments and polishing the code we fit all our requirements above.</p><p>Let’s deep dive into code examples.</p><h3>Also, we have created a demo multiplatform App to demonstrate all current features. Please checkout the <a href="https://github.com/ComposeGears/Tiamat/">repository</a> 🌚</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IRKgt6F_oJK8TsM3.jpeg" /><figcaption>iOS, Desktop, Android sample</figcaption></figure><h3>How to use</h3><ol><li>Adding dependency</li></ol><p>Android / JVM:</p><pre>implementation(&quot;io.github.composegears:tiamat:$version&quot;)</pre><p>Multiplatform:</p><pre>sourceSets {<br>    commonMain.dependencies {<br>        implementation(&quot;io.github.composegears:tiamat:$version&quot;)<br>    }<br>}</pre><p>2. Define you screens using navDestination delegate</p><pre>val ListScreen by navDestination&lt;Unit&gt; {<br>    // Composable content<br>}<br><br>val DetailScreen by navDestination&lt;Unit&gt; {<br>    // Composable content<br>}</pre><p>3. Create navController that will responsible to all navigation stuff</p><pre>val navController = rememberNavController(<br>    startDestination = ListScreen,<br>    destinations = arrayOf(<br>        ListScreen,<br>        DetailScreen,<br>        // ...<br>    )<br>)<br><br>Navigation(<br>    modifier = Modifier.fillMaxSize(),<br>    navController = navController<br>)</pre><p>4. Make navigation</p><pre>val ListScreen by navDestination&lt;Unit&gt; {<br>    val navController = navController()<br>    <br>    Column {<br>        Text(&quot;Screen Header&quot;)<br>        Button(onClick = { navController.navigate(DetailScreen)}){<br>            Text(&quot;Navigate&quot;)<br>        }<br>    }<br>}</pre><blockquote><em>Note: </em><em>navDestination delegate under the hood creates special </em>Scope<em>, and you can safely call </em><em>navController() and other things in your screen.</em></blockquote><p>To make a replace navigation, simply use replace method in navController</p><pre>val ListScreen by navDestination&lt;Unit&gt; {<br>    val navController = navController()<br><br>    Column {<br>        Text(&quot;Screen Header&quot;)<br>        Button(onClick = { navController.replace(DetailScreen)}){<br>            Text(&quot;Replace screen&quot;)<br>        }<br>    }<br>}</pre><h3>Passing data between screens</h3><p>Let&#39;s imagine you need to pass some <em>id</em> or <em>model</em> into a detail screen. To make it we need to change DetailScreen semantics from Unit to DetailParams.</p><pre>data class DetailParams(val id: String)<br><br>val ListScreen by navDestination&lt;Unit&gt; {<br>    val navController = navController()<br><br>    Column {<br>        Text(&quot;Screen Header&quot;)<br>        Button(onClick = {<br>            navController.navigate(<br>                dest = DetailScreen,<br>                navArgs = DetailParams(id = &quot;314442&quot;)<br>            )<br>        }) {<br>            Text(&quot;Navigate&quot;)<br>        }<br>    }<br>}<br><br>val DetailScreen by navDestination&lt;DetailParams&gt; {<br>    val args = navArgs()<br><br>    Text(text = args.id)<br>}</pre><p>To pass param you can use navArgs named argument</p><pre>navController.navigate(<br>    dest = DetailScreen,<br>    navArgs = DetailParams(id = &quot;314442&quot;)<br>)</pre><p>To read args you can use navArgs() for non-nullable params or navArgsOrNull for optional screen parameters.</p><p>If you need to return some data from DetailScreen you can use navController.back() method</p><pre>data class NavResult(val counter: Int)<br><br>val DetailScreen by navDestination&lt;DetailParams&gt; {<br>    val navController = navController()<br><br>    var counter by remember { mutableIntStateOf(0) }<br><br>    Column {<br>        Row(<br>            verticalAlignment = Alignment.CenterVertically,<br>            horizontalArrangement = Arrangement.spacedBy(8.dp)<br>        ) {<br>            CircleButton(&quot;-&quot;) { counter-- }<br>            Text(text = &quot;Value: $counter&quot;)<br>            CircleButton(&quot;+&quot;) { counter++ }<br>        }<br>        Button(onClick = { navController.back(NavResult(counter)) }) {<br>            Text(&quot;Deliver result&quot;)<br>        }<br>    }<br>}</pre><h3>Nested navigation</h3><p>Tiamat allows to make nested NavControllers.</p><p>For example, Login feature contains multiple screens. You can easily combine it into a separate LoginFlow and hide implementation details.</p><pre>val RootFlow by navDestination&lt;Unit&gt; {<br>    val navController = rememberNavController(<br>        startDestination = LoginFlow,<br>        destinations = arrayOf(<br>            LoginFlow,<br>            MainFlow,<br>            // ...<br>        )<br>    )<br><br>    Navigation(navController = navController)<br>}<br><br>val LoginFlow by navDestination&lt;Unit&gt; {<br>    val nestedController = rememberNavController(<br>        startDestination = Screen1,<br>        destinations = arrayOf(<br>            Screen1,<br>            Screen2,<br>            Screen3,<br>            // ...<br>        )<br>    )<br><br>    Navigation(navController = nestedController)<br>}</pre><h3>ViewModel support</h3><p>Library has own TiamatViewModel and provides the same experience as Androidx Viewmodel:</p><ul><li>saving state during configuration changes</li><li>provides viewModelScope</li></ul><pre>data class DetailParams(val id: String)<br><br>class DetailsViewModel(private val id: String) : TiamatViewModel() {<br>    // ...<br>}<br><br>val DetailScreen by navDestination&lt;DetailParams&gt; {<br>    val navController = navController()<br>    val args = navArgs()<br><br>    val viewModel = rememberViewModel { DetailsViewModel(args.id) }<br>    // ...<br>}<br></pre><p>In this sample we can easily pass argument from navArgs into our ViewModel and do smth with it.</p><blockquote>Note: <em>rememberViewModel</em> also attached to NavDestination Scope</blockquote><h3>Backstack alteration</h3><p>This feature is useful for Deeplink navigation, due to you need to create screen’s backstack in a specific order.</p><p>To use it simply call nestedNavController.editBackStack { } block and put screens in the necessary order.</p><blockquote>Note 1: During alteration you can also put some data into screens</blockquote><blockquote>Note 2: In sample below we don’t pass startDestination into rememberNavController 🌚</blockquote><pre>val BackStackAlterationRoot by navDestination&lt;Unit&gt; {<br>    Column {<br>        val nestedNavController = rememberNavController(<br>            key = &quot;BackStackAlterationNavController&quot;,<br>            destinations = arrayOf(<br>                Screen1,<br>                Screen2,<br>                Screen3,<br>                Screen4,<br>                Screen5<br>            )<br>        )<br>        Row {<br>            TextButton(&quot;Remove first&quot;) {<br>                if (nestedNavController.getBackStack().isNotEmpty())<br>                    nestedNavController.editBackStack {<br>                        removeAt(0)<br>                    }<br>                backstackKey = Unit<br>            }<br>            TextButton(&quot;Add at index 0&quot;) {<br>                nestedNavController.editBackStack {<br>                    if (nestedNavController.getBackStack().isNotEmpty()) {<br>                        add(0, ScreenAt0)<br>                    } else add(ScreenAt0)<br>                }<br>                backstackKey = Unit<br>            }<br>            TextButton(&quot;Add last&quot;) {<br>                nestedNavController.editBackStack {<br>                    add(ScreenLast)<br>                }<br>                backstackKey = Unit<br>            }<br>            TextButton(&quot;Make 1-2-3-4&quot;) {<br>                nestedNavController.editBackStack {<br>                    clear()<br>                    add(Screen1)<br>                    add(Screen2)<br>                    add(Screen3)<br>                    add(Screen4)<br>                }<br>                backstackKey = Unit<br>            }<br>        }<br>    }<br>}</pre><h3>Need more cases?</h3><p>Other more advanced cases may be found in the repository. What is not covered in this post, but available in the sample app:</p><ul><li>NestedNavigation</li><li>BottomBar navigation</li><li>Custom screen transitions</li></ul><p>Source code: <a href="https://github.com/ComposeGears/Tiamat/">https://github.com/ComposeGears/Tiamat/</a></p><p>Don’t forget to try it out and raise your feedback ❤️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3956dc00a607" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mobilepeople/tiamat-simple-compose-multiplatform-navigation-3956dc00a607">Tiamat — simple Compose Multiplatform navigation</a> was originally published in <a href="https://medium.com/mobilepeople">MobilePeople</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implement Themed Icons (Android 13)]]></title>
            <link>https://proandroiddev.com/implement-themed-icons-android-13-d20b89233681?source=rss-e93d234beac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d20b89233681</guid>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[material-you]]></category>
            <category><![CDATA[android-13]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[themed-icon]]></category>
            <dc:creator><![CDATA[Yahor Urbanovich]]></dc:creator>
            <pubDate>Wed, 16 Feb 2022 10:31:44 GMT</pubDate>
            <atom:updated>2022-02-16T10:31:44.072Z</atom:updated>
            <content:encoded><![CDATA[<p>Part of the Material You concept is Themed Icons. It means that all icons starting from Android 12 will be the same color and change dynamically based on wallpapers.</p><p>Android 12 introduced a beta option for enabling Themed Icons, but icons looked inconsistently across the system. Only Google apps had themed icons, other looks the same as previous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYda2DLjwB0QHO6tganaKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1G66tpvYxiYeYGkz7dRFAQ.png" /><figcaption>Android 12</figcaption></figure><p>So far not available no API for developers. I found only a few materials on how to implement themed icons on Android 12.</p><p>For example:</p><p><a href="https://levelup.gitconnected.com/material-you-app-icons-part-way-there-bb8cb02ce452">Material You App Icons: Part Way There</a></p><p>Briefly, we need to override icon colors in the <strong>values-v31</strong> folder to use new Material You colors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xw3LqjCndhoXk2vqMHXxVg.png" /></figure><p>It will work, but with several limitations:</p><ol><li>Changing color in the system doesn’t apply to the launch icon. Only after reinstall.</li><li>Disabling the <em>Themed icons</em> feature doesn’t affect the launch icon. Simply, the icon has dynamic color permanently.</li></ol><p>It’s logical, the application can’t have two launch icons simultaneously.</p><p>The Pixel Launcher does the whole magic under the hood and stores an additional set of icons with monochrome icons for all Google apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sz-HRc21DetW1z3Y1hHygQ.png" /><figcaption>Pixel Launcher APK resources</figcaption></figure><h3>Android 13 way</h3><p>Google recently announced the first Developer Preview of Android 13, while there are a lot of new APIs. One of them is that developers got access to API for Themed app icons.</p><p>To implement the new approach, we need to take several steps:</p><ol><li>Clear icon from shadows, unnecessary details and etc. Otherwise, the icon will differ from the uniform style.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRlP3KMe5IL5WOtwYgQBtg.jpeg" /><figcaption>Icon with shadow</figcaption></figure><p>2. Add &lt;monochrome android:drawable=&quot;&quot;/&gt; attribute to the &lt;adaptive-icon&gt; element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M2-8CaLjK41Z_IJ3qf_JmQ.png" /><figcaption>monochrome tag in icon resource</figcaption></figure><blockquote><strong>Note:</strong> If <strong>android:roundIcon</strong> and <strong>android:icon</strong> are both in your manifest, you must either remove the reference to <strong>android:roundIcon</strong> or supply the monochrome icon in the drawable defined by the <strong>android:roundIcon</strong> attribute.</blockquote><p>That’s all, the system automatically applies tint color for the monochrome icon.</p><p>Demo result:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUp-jOfUFtRM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUp-jOfUFtRM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUp-jOfUFtRM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f60ea9df88d7a59f2d7357f128fcc14/href">https://medium.com/media/5f60ea9df88d7a59f2d7357f128fcc14/href</a></iframe><h3>Other cases</h3><p>The recommended approach is to use flat icons for the monochrome icon resource. But in reality, we can have a situation where the icon will be layered or 3d.</p><p>Let’s take a look at the sample icon Microsoft Teams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*aOEEEJTCVb-k8XNq" /><figcaption><a href="https://commons.wikimedia.org/wiki/File:Microsoft_Office_Teams_(2018%E2%80%93present).svg">https://commons.wikimedia.org/wiki/File:Microsoft_Office_Teams_(2018%E2%80%93present).svg</a></figcaption></figure><p>Let’s do steps from the previous part, remove the shadow &lt;path /&gt; , and launch sample application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6NQ2p8zB3dRsfHBKZ3YFA.png" /><figcaption>Microsoft Teams themed icon</figcaption></figure><p>Ooops, appear horrible. The problem is that the original icon uses different color shades to show deep.</p><p>How to achieve the same effect in the monochrome icon?</p><p>The solution is pretty simple. We will apply &lt;android:fillAlpha=&quot;&quot;/&gt; for necessary &lt;path/&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BjW6Dobpyzq8afszuqFnxw.jpeg" /><figcaption>Apply fillAlpha for path</figcaption></figure><p>By the way, in case more complex icon designers should provide a new resource drawn from scratch.</p><p>Thanks for your attention 😎</p><p><strong>References</strong>:</p><p><a href="https://developer.android.com/about/versions/13/features#themed-app-icon-specs">https://developer.android.com/about/versions/13/features#themed-app-icon-specs</a></p><p><strong>Sample projects:</strong></p><ul><li><a href="https://github.com/egorikftp/TechTalk/tree/main/ThemedIconAndroid12">Themed Icon for Android 12</a></li><li><a href="https://github.com/egorikftp/TechTalk/tree/main/ThemedIconAndroid13">Themed Icon for Android 13</a></li><li><a href="https://github.com/egorikftp/TechTalk/tree/main/ThemedIconAndroid13WithAlpha">Themed Icon for Android 13 (With alpha)</a></li></ul><p>____________________</p><p>Powered by <a href="https://t.me/whydroid"><strong>Why Android?</strong></a><strong> </strong>community</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*j9BbeZCdUOtwbg-n" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d20b89233681" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/implement-themed-icons-android-13-d20b89233681">Implement Themed Icons (Android 13)</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kotlin property delegates for Datastore Preferences library]]></title>
            <link>https://proandroiddev.com/kotlin-property-delegates-for-datastore-preferences-library-5d4e1cdb609b?source=rss-e93d234beac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d4e1cdb609b</guid>
            <category><![CDATA[property-delegation]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <dc:creator><![CDATA[Yahor Urbanovich]]></dc:creator>
            <pubDate>Mon, 23 Aug 2021 15:40:08 GMT</pubDate>
            <atom:updated>2021-08-23T19:15:03.805Z</atom:updated>
            <content:encoded><![CDATA[<h3>Kotlin delegated property for Datastore Preferences library</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v1XjLG1sVEICOwZI.jpg" /></figure><p>Recently AndroidX <a href="https://developer.android.com/topic/libraries/architecture/datastore">Datastore</a> 1.0 was released. The moment has come, it’s time to migrate away from SharedPreferences.</p><p>As for me, the key benefit is the built-in support of Kotlin Flow and Coroutines.</p><p>Previously we had to write our own wrapper under <em>SharedPreferences.OnSharedPreferenceChangeListener</em>, emit changes into <em>ConflatedBroadcastChannel</em> and then convert it into Flow.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5410ce9df08d9b73427a2138a6b0a8d/href">https://medium.com/media/b5410ce9df08d9b73427a2138a6b0a8d/href</a></iframe><p>Firstly, this approach produces a lot of intermediate variables. Secondly, <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.channels/-conflated-broadcast-channel/"><em>ConflatedBroadcastChannel</em></a><em> </em>deprecated and should be replaced with StateFlow. In this case, DataStore comes out as the winner.</p><p>The migrated to DataStore version looks clean and simple.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cce0d485e2af9941e677dc7973a54c6f/href">https://medium.com/media/cce0d485e2af9941e677dc7973a54c6f/href</a></iframe><h3>Read/write single value using SharedPreferences</h3><p>Let’s imagine, we need to store the current App theme as String. For this purpose, we need to initialize SharedPreferences, then make two functions to read and write these values.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3bc9760a22ebd1071e4dcb21eaf8d4ba/href">https://medium.com/media/3bc9760a22ebd1071e4dcb21eaf8d4ba/href</a></iframe><p>Well, two functions it is not so bad, but we can try to merge this into single Property.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3babbf2b6c55bb18172f66ddc825b06/href">https://medium.com/media/c3babbf2b6c55bb18172f66ddc825b06/href</a></iframe><p>To make it fully clear and supportable we can use the Kotlin <a href="https://kotlinlang.org/docs/delegated-properties.html">delegation feature</a>. As we want to read and write simultaneously, <em>ReadWriteProperty</em> will suit our goal.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/80f370a5a5735b911c75d3a0f1d22b21/href">https://medium.com/media/80f370a5a5735b911c75d3a0f1d22b21/href</a></iframe><p>Please take a look at the final compact version, where all logic is encapsulated inside the delegate.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39b5311b04373b1f31d3030b8b083587/href">https://medium.com/media/39b5311b04373b1f31d3030b8b083587/href</a></iframe><h3>DataStore Preferences and missing API</h3><p>During migration, it turned out that the library doesn’t provide an API for reading a single property.</p><p>DataStore proposes to use Flow for <strong>all cases</strong>. Developers are now required to read/write the value in the scope of a suspend function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e7c4e45e239e11bc5082f3997e5280dd/href">https://medium.com/media/e7c4e45e239e11bc5082f3997e5280dd/href</a></iframe><p>What was easy in SharedPreferences like <em>getString(key, defaultValue)</em> became impossible in DataStore. I just wanna read a single value 😅</p><h3>Let’s make a small crutch</h3><p>As DataStore returns only<em> Flow&lt;T&gt; </em>we have to work with that. We want to read a single value from Flow. Coroutines library already contains necessary extensions and <a href="https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/first.html"><em>Flow&lt;T&gt;.first()</em></a> perfect for our purpose.</p><blockquote>The terminal operator that returns the first element emitted by the flow and then cancels flow’s collection. Throws NoSuchElementException if the flow was empty.</blockquote><p>And as <em>first() </em>is suspend function, we can use the <strong>runBlocking{}<em> </em></strong>block.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e8a77ac3b26fe4e9b05371f670b1506/href">https://medium.com/media/2e8a77ac3b26fe4e9b05371f670b1506/href</a></iframe><p>Now let’s wrap this functionality into old delegates, replace SharedPreferences with DataStore and change the key.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/971393a84a5800b070e22698d05d8906/href">https://medium.com/media/971393a84a5800b070e22698d05d8906/href</a></iframe><blockquote>Note: DataStore has special wrapper under Key, in this case we can use generics. For SharedPreferences delegates it is necessary to create separate delegation class for each privitive type as we need to use typed functions <em>getString()/putString(), getInt()/putInt() and etc.</em></blockquote><p>The final result with datastore delegates will look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/992f2babc1db0b476866dfd0a598e5bb/href">https://medium.com/media/992f2babc1db0b476866dfd0a598e5bb/href</a></iframe><p>Full listing available on:</p><p><a href="https://github.com/egorikftp/Lady-happy-Android/blob/6643b39fd84ec04b029f18880f5f62fb9411d812/app/src/main/java/com/egoriku/ladyhappy/tools/AppPreferences.kt#L25">https://github.com/egorikftp/Lady-happy-Android/blob/6643b39fd84ec04b029f18880f5f62fb9411d812/app/src/main/java/com/egoriku/ladyhappy/tools/AppPreferences.kt#L25</a></p><p>Please don’t forget to start the project:</p><p><a href="https://github.com/egorikftp/Lady-happy-Android">GitHub - egorikftp/Lady-happy-Android: Open Source multi-module app for Handmade Hats company with modern approaches under the hood.</a></p><p>Link to delegates source code:</p><p><a href="https://github.com/egorikftp/Lady-happy-Android/tree/active_development/sources/libraries/datastoreDelegates/src/main/kotlin/com/egoriku/ladyhappy/datastoredelegates">Lady-happy-Android/sources/libraries/datastoreDelegates/src/main/kotlin/com/egoriku/ladyhappy/datastoredelegates at active_development · egorikftp/Lady-happy-Android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d4e1cdb609b" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/kotlin-property-delegates-for-datastore-preferences-library-5d4e1cdb609b">Kotlin property delegates for Datastore Preferences library</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to animate BottomSheet content using Jetpack Compose]]></title>
            <link>https://proandroiddev.com/how-to-animate-bottomsheet-content-using-jetpack-compose-3eab972b3bdc?source=rss-e93d234beac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eab972b3bdc</guid>
            <category><![CDATA[experience]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[bottomsheet]]></category>
            <category><![CDATA[jetpack-compose]]></category>
            <dc:creator><![CDATA[Yahor Urbanovich]]></dc:creator>
            <pubDate>Mon, 09 Aug 2021 13:10:56 GMT</pubDate>
            <atom:updated>2021-08-09T13:10:56.855Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Note: Everything in this post related to Compose 1.0.1 and maybe in the future Google will introduce a new API and approaches like Compose MotionLayout 🐰</blockquote><p>Early this year I started a new pet project for listening to random radio from over the world. The UI at the beginning was very simple and clear, just a logo with the station name and necessary controls. The main functionality is integration with Android Auto, but it is a topic for a separate story (just ask in the comments if you are interested in this theme).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/0*oiXKbuIZQcqYE1Iz.png" /><figcaption>First app iteration</figcaption></figure><p>Using the application, it became necessary to see user liked stations, other categories separated by genre and country. The idea is to make a Home screen with a list of different information and player which can be shown and hidden on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*b8H1im_iRmFe-wg2.gif" /><figcaption>Final result</figcaption></figure><h3>Find available solutions</h3><p>As a normal developer, I started to research existing compose projects to find already implemented functionality.</p><p>The official and community samples contain only the UI part and don’t include any interaction.</p><p>For example, the Spotify UI demo application for me implies a presence player screen, but in source code, it’s just a <em>Row</em> with content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/228/0*1qCYGnSYvSHmM2z2" /><figcaption><a href="https://github.com/Gurupreet/ComposeCookBook">https://github.com/Gurupreet/ComposeCookBook</a></figcaption></figure><p>Another interesting repository I found is a Podcast App. According to the gif looks like what I was looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/243/0*RAE23aE7KJKK5hIA.gif" /><figcaption><a href="https://github.com/fabirt/podcast-app">https://github.com/fabirt/podcast-app</a></figcaption></figure><p>After inspecting the source code I understood how it works. The <em>PodcastPlayerScreen </em>is a Root composable for the player and it added to the composition of the main screen. By default, it’s not visible for users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6e3wnDSivcbPczvPvKlbg.png" /><figcaption><a href="https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/MainActivity.kt#L57">https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/MainActivity.kt#L57</a></figcaption></figure><p>Then if the user clicks on some podcast item it changes the <em>showPlayerFullScreen</em> boolean. Recomposition triggers the <em>AnimatedVisibility </em>logic and the player appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mI2R-lYKtUuPb9rA5MFJ7A.png" /><figcaption><a href="https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/podcast/PodcastPlayerScreen.kt#L50">https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/podcast/PodcastPlayerScreen.kt#L50</a></figcaption></figure><p>Further interaction refers to listening swipe offset and move the player along the Y-axis on the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRQEAlCMLiCPMNvwSJ9X1Q.png" /><figcaption><a href="https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/podcast/PodcastPlayerScreen.kt#L116">https://github.com/fabirt/podcast-app/blob/6b4876fd007c54e3f10160c091d3c29147b20211/android/app/src/main/java/com/fabirt/podcastapp/ui/podcast/PodcastPlayerScreen.kt#L116</a></figcaption></figure><p>From my perspective, it&#39;s not an ideal solution, because it is tied to the ViewModel state, the unobvious <em>showPlayerFullScreen</em> variable which can be changed in different places, also we need manually operate with offset, and so on.</p><p>Let’s stop research and try to make a more simple and clear solution.</p><h3>BottomSheet story</h3><p>Out of the box, Compose contains two types of BottomSheet implementations:</p><ol><li><a href="https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#ModalBottomSheetLayout(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.material.ModalBottomSheetState,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Function0)">ModalBottomSheetLayout</a></li><li><a href="https://developer.android.com/reference/kotlin/androidx/compose/material/package-summary#BottomSheetScaffold(kotlin.Function1,androidx.compose.ui.Modifier,androidx.compose.material.BottomSheetScaffoldState,kotlin.Function0,kotlin.Function1,kotlin.Function0,androidx.compose.material.FabPosition,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.unit.Dp,kotlin.Function1,kotlin.Boolean,androidx.compose.ui.graphics.Shape,androidx.compose.ui.unit.Dp,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Function1)">BottomSheetScaffold</a></li></ol><p>To make a simple screen with ModalBottomSheetLayout we just need to initialize <em>rememberModalBottomSheetState </em>with initial Hidden state, create coroutine scope for future interaction with visibility and that&#39;s all.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4b02ee32acdd45f1c05f3f74845f6436/href">https://medium.com/media/4b02ee32acdd45f1c05f3f74845f6436/href</a></iframe><p>Unfortunately, <em>ModalBottomSheetLayout</em> doesn’t have the ability to set <em>peekHeight.</em></p><blockquote><strong>peekHeight</strong> — he height of the bottom sheet when it is collapsed. Simply speaking bottom sheet will be on the screen permanently, but in the collapsed state.</blockquote><p>BottomSheetScaffold is trying to solve this issue and introduce this customization. The simple screen setup is pretty the same, but we are able to set <em>peekHeight</em> as a parameter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5624d262c732b0aafbc95ad96799a783/href">https://medium.com/media/5624d262c732b0aafbc95ad96799a783/href</a></iframe><blockquote><strong><em>Important note</em></strong><em>: <br>In different posts I saw wrong initialization of </em>rememberBottomSheetScaffoldState<em> without remember block for </em>bottomSheetState.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/548b2ec14afa92e0bb554f9f44f3420f/href">https://medium.com/media/548b2ec14afa92e0bb554f9f44f3420f/href</a></iframe><blockquote><em>It can lead unexpected bottomsheet behaviour after recomposition like non responding to touches, able to drag in different direction and so on. <br><br>The correct one should be:</em></blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/74f6792d42033141b635d87895df9987/href">https://medium.com/media/74f6792d42033141b635d87895df9987/href</a></iframe><h3>Working with BottomSheetScaffold</h3><p>In the <a href="https://github.com/egorikftp/compose-animated-bottomsheet">sample project</a>, I have added the demo UI for the radio player with collapsed and expanded state. The main goal now is to animate from one state to another one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*mipXrASEWQv7OnLbHqs4yg.jpeg" /><figcaption>collapsed and enabled state</figcaption></figure><p>At the first step, we need to know the current BottomSheet state.</p><p>The good news for us is that <em>BottomSheetState</em> inherited from <em>SwipeableState</em> and we can try to access fields <strong><em>currentValue </em></strong><em>and</em><strong><em> </em>targetValue</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/67912488cba58e4ed9c23cb701038af2/href">https://medium.com/media/67912488cba58e4ed9c23cb701038af2/href</a></iframe><p>The code will look pretty simple, we just read the necessary data from <em>bottomSheetState</em> and show it on the screen.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce80c1a2db679cf9984c999a13009cbf/href">https://medium.com/media/ce80c1a2db679cf9984c999a13009cbf/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*jjRqpvBSQGriGToF.gif" /><figcaption>Target and current values</figcaption></figure><p>Well, now we know the state of our screen and animation direction. But that’s not enough for animation, we need intermediate values between <em>Collapsed</em> and <em>Expanded</em> states.</p><p>Digging through the source code I found that <em>Swipeable</em> storing information about the ongoing swipe or animation in a special <strong>progress </strong>field.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3731980fd6c1205dd63636a20a62f72/href">https://medium.com/media/f3731980fd6c1205dd63636a20a62f72/href</a></iframe><p>SwipeProgress is a class with <strong><em>from/to</em></strong> parameters and <strong><em>fraction</em></strong><em>. </em>The fraction represents the current position between <em>from</em> and <em>to</em>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7964ad2a1b905246260b97e35ffbb194/href">https://medium.com/media/7964ad2a1b905246260b97e35ffbb194/href</a></iframe><p>Let’s use this. Updated DebugScreen will look like this.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9796a7400115626dd19b61558049e9d6/href">https://medium.com/media/9796a7400115626dd19b61558049e9d6/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*BkazrCBWnpVH2-Ig.gif" /><figcaption>DebugSceen with fraction</figcaption></figure><p>Looks nice, but unusable now. If you look closely you will see that fraction starts from 0 every time and finishes with 1.</p><p>For beautiful animation, we should definitely assign <em>fraction</em> for states:</p><ul><li>Expanded → 1f</li><li>Collapsed → 0f</li></ul><p>A little math and we get this extension.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e04a56f0029c12d0eea018cdf3d56e4/href">https://medium.com/media/7e04a56f0029c12d0eea018cdf3d56e4/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*biS_Of5zJKeSf0RH.gif" /><figcaption>New calculated fraction</figcaption></figure><p>Super, this is already 90% of the result. Now we can apply the calculated fraction to any composable function and dynamically change the alpha.</p><p>In this code snippet, I change the alpha of the root collapsed element relatively to a fraction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0bb2a272175cb4fe6ded1e06e14dc59f/href">https://medium.com/media/0bb2a272175cb4fe6ded1e06e14dc59f/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*fhRopmkow6TjdAc2.gif" /><figcaption>Content animation inside BottomSheet</figcaption></figure><p>Looks pretty, doesn’t it?</p><h3>Bonus</h3><p>We can try to animate BottomSheet corner radius relatively to a fraction.</p><p>For example, for the Collapsed state, we won’t have any rounding, but for Expanded we want to have <strong>30.dp</strong>.</p><p>The below code allows achieving dynamic corner radius change.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25bfe3e8df541c7cae5b81abf60d0f5a/href">https://medium.com/media/25bfe3e8df541c7cae5b81abf60d0f5a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*pn2nmfC-ZISlgITb.gif" /><figcaption>Dynamic corner radius</figcaption></figure><p>The source code of the sample:</p><p><a href="https://github.com/egorikftp/compose-animated-bottomsheet">GitHub - egorikftp/compose-animated-bottomsheet: A sample implementation Compose BottomSheet with animation different states</a></p><p>The RadioTok app:</p><p><a href="https://github.com/egorikftp/RadioTok">GitHub - egorikftp/RadioTok: Random radio from the whole world with Jetpack Compose and Media API. Full support Android Auto.</a></p><p>________________</p><p>Why Android?</p><p><a href="https://t.me/whydroid">https://t.me/whydroid</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eab972b3bdc" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/how-to-animate-bottomsheet-content-using-jetpack-compose-3eab972b3bdc">How to animate BottomSheet content using Jetpack Compose</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I made beautiful screenshots for Google Play (Developer experience)]]></title>
            <link>https://proandroiddev.com/how-i-made-beautiful-screenshots-for-google-play-developer-experience-61ce108fa6b4?source=rss-e93d234beac6------2</link>
            <guid isPermaLink="false">https://medium.com/p/61ce108fa6b4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[personal-experience]]></category>
            <category><![CDATA[photoshop]]></category>
            <category><![CDATA[play-store]]></category>
            <category><![CDATA[screenshots]]></category>
            <dc:creator><![CDATA[Yahor Urbanovich]]></dc:creator>
            <pubDate>Sat, 10 Jul 2021 11:24:12 GMT</pubDate>
            <atom:updated>2021-07-17T23:24:57.864Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZdIhQXo5tKwwm8jOQQ4K7A.jpeg" /><figcaption>Comparison of the initial and final result</figcaption></figure><p>Every developer who has an application in Play Store worries about user engagement before the application install. This metric can be simply improved by adding beautiful and informative screenshots. I want to share my own experience of how I made it for my pet project.</p><h3>Let’s begin.</h3><p>Originally I prepared screenshots for Google Play using a simple approach:</p><ol><li>Make a screenshot of the application</li><li>Add it into Device Mockup to make it more natural</li><li>Publish to Google Play</li></ol><p>For this purpose, I used <strong>Screener:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/0*mCYt21j12acbQbeI" /><figcaption><a href="https://play.google.com/store/apps/details?id=de.toastcode.screener&amp;hl=en_US"><em>https://play.google.com/store/apps/details?id=de.toastcode.screener&amp;hl=en_US</em></a></figcaption></figure><p>The tool is useful, contains a different amount of phone frames and manufacturers, and fully customizable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*UTTwO8IHCTRByIkQHuUgGQ.jpeg" /><figcaption>Screenshot after rendering</figcaption></figure><p>The main lack for me that the application didn’t update since 2018 and doesn’t contain new Android devices, especially Google Pixel&#39;s latest model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jZjwH51u5YCncAZiCUtndg.png" /><figcaption>Screener app info from Google Play</figcaption></figure><h3>Find the other solutions.</h3><p>If you are lazy and don’t want to spend your free time, the best way to organize screenshots is through online services.</p><p>Few of them, which I have tried:</p><ol><li><a href="https://mockups.pixeltrue.com/">https://mockups.pixeltrue.com/</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Utkgny8cOvVR1RRGaQYNHw.png" /></figure><p>2. <a href="https://previewed.app/">https://previewed.app/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKIhH0v-11GxsjS79cxmNA.png" /></figure><p>3. <a href="https://theapplaunchpad.com/">https://theapplaunchpad.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvfRAF7_jN3N-xl57ELKhw.png" /></figure><p>4. <a href="https://screen.traction.one/">https://screen.traction.one/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*syeERL-X4w85oDMRtmBUdw.png" /></figure><p>5. <a href="https://www.launchmatic.app/">https://www.launchmatic.app/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i8V4os1tzRFlSisP8Y6WUg.png" /></figure><p>The main drawbacks of online services for me:</p><ol><li>To unlock more themes and functionalities you need to have paid subscription</li><li>Limited customization</li><li>Can’t adjust the screenshot for mockup, the content cropped unexpectedly from different sides</li><li>Some services focus only on iPhone or several Android devices</li></ol><p>How to deal with a problem?</p><h3>Do It Yourself!</h3><p>What we need:</p><ol><li>Official guidelines</li><li>Adobe Photoshop and basic editing skills</li><li>Creativity and inspiration</li></ol><p>Official Google Play guidelines: <a href="https://support.google.com/googleplay/android-developer/answer/9866151?hl=en">https://support.google.com/googleplay/android-developer/answer/9866151?hl=en</a></p><p>The most important for us from the <em>Screenshots </em>section:</p><blockquote>Edit excess elements in the notification bar before submitting. Do not show service providers or notifications. The battery, WiFi, and cell service logos should be full.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/0*b2FLLoWCiWc0pHY1" /></figure><h3>Preparing screenshots like a pro 📱</h3><p>Using mobile device only:</p><ul><li>Use the “Screenshot” feature from the context menu</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ecg8AOa1wFXFkY2IBY_MWQ.png" /></figure><p>Using this approach we can take a screenshot without any icons in the status bar at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6SpvHWp5Cj5fqy7LYAGXIw.png" /><figcaption>Absence of a status bar</figcaption></figure><ul><li>Use the System UI demo mode from Developer options</li></ul><p>A simple approach to remove annoying notification icons and other information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSWG6wuRgCCbb0KC6qliXg.png" /><figcaption>General mode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YxjW9ZcXUvW7S8j7OAenNA.png" /><figcaption>System UI demo mode</figcaption></figure><p>Using Android Studio + System UI demo mode:</p><p>This embedded tool able to make basic capture things and can put them into the device frame. But the functionality is slightly stripped down 🙁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QVDrskuPBBLV6xhr0eDYFQ.png" /><figcaption>Android Studio screen capture feature</figcaption></figure><p>Also important for us from guidelines page info about image size and resolution.</p><blockquote>For apps, you must provide at least four screenshots with minimum 1080px resolution. These should be 9:16 for portrait screenshots (minimum 1080x1920px).</blockquote><blockquote>Stylized screenshots that break UI across multiple uploaded images are allowed, but prioritize UI in the first three screenshots as much as possible.</blockquote><p>And small image example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/0*lAivc6EpC9yxKpkX" /></figure><p>According to this information, let&#39;s create a new PSD document and put a preferred device mockup. In my case Google Pixel 3a (source will be at the end of the post).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*KmjkzOtqM-CVETIoGFmqKA.png" /></figure><p>Then, we will use <strong>Slice Tool </strong>to simplify the future collage and export.</p><p>Choose an instrument from the panel, then open the menu and select <em>Divide Slice.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sZw8uvUK9ODL3BU3k-YGaQ.png" /></figure><p>For my purpose, I decided to make 5 screenshots. In this case, we need to divide the canvas into 5 identical vertical layouts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oOaMlcftLBs3xtC0g6O6Ow.png" /></figure><p>Then duplicate the device frame several times, arrange as you like, and add a short description about each screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V5_pZFy9njp5LF5enYvpMA.png" /></figure><p>To make your screenshots inside a phone put the image below the <em>Mask </em>layer and apply it as a <strong>Clipping mask</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*Qcta5onUlSDDQu1t2XZhbg.jpeg" /></figure><p>The final result after all manipulations will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tu5nWMpMM5n_zXlvChQV9A.png" /></figure><p>Now, it only remains to export screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*okOBWg32yqaOCtDSfiGsTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A-TxiQZgTJKFIpamMgj1Dw.png" /></figure><p>Slice tool automatically split PSD into separate image files, which are ready to publish on the Google Play console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xUZxBNOMTa5Y2ZnqZ44Yfg.png" /></figure><h3><strong>Summary</strong></h3><ul><li>Own solution allows you to be independent of online services</li><li>Completely free</li><li>Fully customizable any time, you are limited only by imagination</li></ul><p>I suppose this post can help other developers don’t be afraid to experiment with the Google Play application page and encourage them constantly increase the quality.</p><h3>Useful links and PSD</h3><p>Lady Happy app: <a href="https://play.google.com/store/apps/details?id=com.egoriku.ladyhappy&amp;hl=en">https://play.google.com/store/apps/details?id=com.egoriku.ladyhappy&amp;hl=en</a></p><p>Source code: <a href="https://github.com/egorikftp/Lady-happy-Android">https://github.com/egorikftp/Lady-happy-Android</a></p><p>Template PSD file: <em>assets</em> folder on Github</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61ce108fa6b4" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/how-i-made-beautiful-screenshots-for-google-play-developer-experience-61ce108fa6b4">How I made beautiful screenshots for Google Play (Developer experience)</a> was originally published in <a href="https://proandroiddev.com/">ProAndroidDev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>