<?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 Kunal Raghav on Medium]]></title>
        <description><![CDATA[Stories by Kunal Raghav on Medium]]></description>
        <link>https://medium.com/@KunalRaghav?source=rss-c90364444e29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*sNtUPCVPCWgf2pnPhOavMQ.jpeg</url>
            <title>Stories by Kunal Raghav on Medium</title>
            <link>https://medium.com/@KunalRaghav?source=rss-c90364444e29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 26 Apr 2026 22:29:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@KunalRaghav/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[Building YAL: Yet Another Launcher, a rudimentary app launcher.]]></title>
            <link>https://proandroiddev.com/building-yal-yet-another-launcher-a-rudimentary-app-launcher-1b3164c2f473?source=rss-c90364444e29------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b3164c2f473</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Kunal Raghav]]></dc:creator>
            <pubDate>Tue, 12 May 2020 14:52:47 GMT</pubDate>
            <atom:updated>2020-05-14T13:56:29.771Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iVf6uafTlxg0_EVcZUOGEQ.png" /><figcaption><strong>YAL </strong>: Yet Another Launcher</figcaption></figure><p>In a sea of abundant app launcher and home screen replacements, let’s see how you build one from scratch.</p><h3>Initial Setup</h3><h4>Allow YAL to be set as the home screen</h4><p>We begin with creating a new project and choosing the empty activity template. We add the following lines to the AndroidManifest.xml to the intent filters of the MainActivity:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f27cfdea4c8d88f209915269e3f0f34/href">https://medium.com/media/2f27cfdea4c8d88f209915269e3f0f34/href</a></iframe><p>The above lines allow this activity to be set as the default home screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Eo7SLbt9jHpsdzlyyLsuUA.png" /><figcaption><strong>YAL</strong>’s existence is acknowledged by Android</figcaption></figure><p>While our app can be set as the default home screen, it is long way away from becoming a rudimentary home screen replacement.</p><h4>Personalizing home screen: Wallpapers</h4><p>Something that most home screen replacements have in common is a <em>transparent statusBar</em> and <em>background</em> for our wallpapers to shine through.</p><p>We also need to remove the big <em>actionbar </em>that comes by default in the activity.</p><p>This is done by making a few changes to the default app theme defined in styles.xml .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/776b7dab32ae5e4c5d85c446603cd095/href">https://medium.com/media/776b7dab32ae5e4c5d85c446603cd095/href</a></iframe><p>The above statements:</p><ul><li>Remove the the default <em>actionbar</em></li><li>Show the wallpaper behind the <em>app window</em></li><li>Make the app <em>window background</em> transparent allowing the wallpaper to be visible</li><li>Make <em>Navigation Bar</em> translucent</li><li>Allow the app to draw behind the <em>systembars </em>(i.e.<em> navbar </em>&amp;<em> statusbar</em>)</li><li>Set the default statusbar color to be transparent.</li></ul><p>We add android:fitsSystemWindows=&quot;true&quot; to the root constraintlayout of activity_main.xml. This ensures that system windows do not overlap with the view. Delete the default hello world <em>TextView </em>and the end result should be something like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iivY4Q2GQfk9CEboU3O-hA.png" /><figcaption><strong>YAL</strong> home screen</figcaption></figure><p>After all that work we have managed to remove the clutter, now we can start building our app drawer.</p><h3>App Drawer</h3><h4>Building the app list</h4><p>Now that our home screen is ready, we’ll get apps that will be shown in our app drawer for us to launch. We get our apps by querying the packageManager for <em>activities</em> which can be launched using a launcher.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d310e34d5f6aec3e6d78dfcade0b772b/href">https://medium.com/media/d310e34d5f6aec3e6d78dfcade0b772b/href</a></iframe><p>The above statement returns a list of all user launch-able apps in the form of ResolveInfo. This class has loads of information that we don’t need hence we create our own data class called <strong>AppBlock </strong>for easier handling of data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/506bc9aab2ef49b8345c78f054875459/href">https://medium.com/media/506bc9aab2ef49b8345c78f054875459/href</a></iframe><p>Now we parse resolvedApplist to an instance of List&lt;AppBlock&gt;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9016cc8d40b76956e118eb55ef4e3963/href">https://medium.com/media/9016cc8d40b76956e118eb55ef4e3963/href</a></iframe><p>Notice the if condition, it filters out itself, as we wouldn’t use an app launcher to launch the app launcher.</p><p>Now we have all the applications that should be displayed in an app launcher.</p><p><strong>Setting up the layout</strong></p><p>For the simplicity of this article <strong>YAL, </strong>our rudimentary home screen replacement will just have a scrollable alphabetical list of apps that can be launched on tap. <strong>YAL</strong> uses <a href="https://developer.android.com/topic/libraries/view-binding">View Bindings</a> to refer to its layouts.</p><p>Our activity_main.xml is simple and has a <em>TextView </em>and a<em> RecyclerView</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7ed14fdb21336d33e86dd5eff58413da/href">https://medium.com/media/7ed14fdb21336d33e86dd5eff58413da/href</a></iframe><p>The Apps displayed in the <em>recycler view </em>have their layout described in item_app.xml. It comprises of an <em>ImageView</em> and a <em>TextView</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ffb8192ad83628dadfabd594dceb9e8a/href">https://medium.com/media/ffb8192ad83628dadfabd594dceb9e8a/href</a></iframe><h4>Populating apps in the list</h4><p>To populate the <em>recycler view w</em>ith apps, a simple recycler view adapter has been written in Adapter.kt.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2164f9f1db1c72af73017f2ee72ed06c/href">https://medium.com/media/2164f9f1db1c72af73017f2ee72ed06c/href</a></iframe><p>A few things to take note of:</p><ul><li>The Adapter has context passed to it as a parameter, this is to simplify tasks that require a context parameter.</li><li>Function passAppList() is used to pass a List&lt;AppBlock&gt; to the adapter.</li></ul><p>With the adapter ready we now have to set up the <em>recycler view </em>in MainActivity.kt and pass the list of apps to its adapter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/351a7193b19bbdb3143f947be6e19a6a/href">https://medium.com/media/351a7193b19bbdb3143f947be6e19a6a/href</a></iframe><p>My personal preference is the <strong>StaggeredGridLayout </strong>, but any <em>layout manager </em>would do.</p><p>Next the Adapter is initialized and the list of apps is passed to it using the function passAppList().</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2fc99fa17dd12b15ac37b10b33cf7a9a/href">https://medium.com/media/2fc99fa17dd12b15ac37b10b33cf7a9a/href</a></iframe><p>If all goes nicely, we should see an app list populated with launchable apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mx3hWijJ1iHJznnNhiNmWQ.png" /><figcaption><strong>YAL</strong>: The App Drawer Works</figcaption></figure><p>Yay, our app drawer is getting populated. Is this it ?</p><p>Well on closer inspection one might notice there are two faults in the current app list.</p><ol><li>It isn’t alphabetical, making it hard to look for apps.</li><li>We can’t actually launch the app we want just yet.</li></ol><p>We solve the first issue by sorting our app list while passing it to the adapter.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f718ea75c05911c0ef637bde7979c184/href">https://medium.com/media/f718ea75c05911c0ef637bde7979c184/href</a></iframe><p>The applist is sorted by passing Comparator&lt;AppBlock&gt; as a lambda to the sortedWith() function.</p><p>We solve the next issue by setting an OnClickListener to the item view inside the onBindViewHolder() method</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9be2549a1536bb980f3677eea73d1c4/href">https://medium.com/media/e9be2549a1536bb980f3677eea73d1c4/href</a></iframe><p>Notice the that the context passed to the adapter before is used launch the app that is clicked.</p><p>Now <strong>YAL </strong>can launch apps on click. ✅</p><p>Now that we have fixed these two faults, our rudimentary home screen replacement is ready. Observe it in its full glory!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8ir9nhfP69OCUXH6_7sZA.png" /><figcaption><strong>YAL </strong>in its full glory 🔥</figcaption></figure><h3>Whats Next?</h3><p>While our custom home screen replacement is ready, it is far from a complete and usable app launcher. It needs some polish before it is ready for prime time. Some suggested improvements include:</p><ul><li>Use multi-threading to query and populate the list of apps, current implementation does all the work on UI thread.</li><li>A Fast Scrollbar to quickly scroll through the list of apps.</li><li>An app icon, ironically <strong>YAL</strong>, an app launcher, doesn’t have an icon.</li><li>Search functionality</li><li>Widget support</li></ul><p><strong>YAL</strong> is open source and is available for anyone to use or refer to.</p><p><a href="https://github.com/KunalRaghav/YAL">KunalRaghav/YAL</a></p><p>I hope to write many such articles in #30DaysOfKotlin Challenge.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b3164c2f473" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/building-yal-yet-another-launcher-a-rudimentary-app-launcher-1b3164c2f473">Building YAL: Yet Another Launcher, a rudimentary app launcher.</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>