<?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 filipe alves on Medium]]></title>
        <description><![CDATA[Stories by filipe alves on Medium]]></description>
        <link>https://medium.com/@filiperamosalves?source=rss-6a161dd3c9c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gYi88LaPJ6Ce2afD</url>
            <title>Stories by filipe alves on Medium</title>
            <link>https://medium.com/@filiperamosalves?source=rss-6a161dd3c9c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 02:38:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@filiperamosalves/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[Android Edge to Edge 101]]></title>
            <link>https://proandroiddev.com/android-edge-to-edge-101-7e1336b90e84?source=rss-6a161dd3c9c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e1336b90e84</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[fullscreen]]></category>
            <category><![CDATA[edge-to-edge]]></category>
            <dc:creator><![CDATA[filipe alves]]></dc:creator>
            <pubDate>Thu, 27 Jan 2022 22:30:01 GMT</pubDate>
            <atom:updated>2022-01-27T22:30:01.811Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*bJF8jPa5HdJ6VOXz-s1KmA.png" /></figure><p>Typically apps go from the navigation bar to the status bar. With the release of Gesture Navigation in Android 10, drawing behind them became more practical and visually appealing.</p><p>The <a href="https://developer.android.com/training/gestures/edge-to-edge">official documentation</a> for this feature is detailed and useful, we even borrowed a few images for this guide. But we noted it lacked a few key points and details we had to figure out along the way. So we decided to write our <strong>Edge to Edge 101.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*eAVZzT1HSXWyN4UJKtblOw.gif" /></figure><h3>101 — Types of Navigation</h3><p>Since this is article is 101, let’s start with the very basics of the 3 existing system navigation systems. While edge-to-edge is not exclusive to any type of navigation it is most often associated with Gesture Navigation, <em>feel free to skip if you are only interested in Gesture Navigation and Edge to Edge.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*dKUFOPVa_txeSjvj6i2WBg.png" /><figcaption>System Types of Android Navigation</figcaption></figure><p>Gesture Navigation, gesture navigation frees the screen by simplifying the navigation. We can make use of that space to actually display more information. This simplification comes at the cost of 2 buttons, replaced with gesture detection at the following zones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*lWPa75aPrJ7lV2LP4aViAQ.png" /></figure><h3>Edge to Edge implementation</h3><p>Let’s take a quick look at our app <a href="https://play.google.com/store/apps/details?id=io.bloco.largetext">Large Text</a> in all navigation variants, before making any changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*wkSjOEcPmPtIuFWG7YbTJg.png" /><figcaption>Before edge to edge</figcaption></figure><p>After using other apps like Android Messages, this black navigation bar starts to call attention and look ugly, maybe even a bit sloppy. Above, we already made the status bar color match our AppBar. It’s not being draw behind, it simply has the same color.</p><p>Following the documentation, we used WindowCompat.setDecorFitsSystemWindows(window, false) on all our screens, made the recommended themes.xml changes below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f78530b65a098b5b11ccfe1eb69d824f/href">https://medium.com/media/f78530b65a098b5b11ccfe1eb69d824f/href</a></iframe><p>And here’s the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*XTF2flO_hsi6H4nsuJRpxA.png" /><figcaption>After System Decor and Official Suggested Theme Changes</figcaption></figure><p>Our app now looks great on our Pixel 4a running Android 11 (API 30), on any navigation mode. But let’s check an older but still popular API / Device, like our Redmi 7A, running Android 8.1, still using our configuration above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ErAM6eXIIAZswxwEb2Hwhw.png" /></figure><p>Here we can see a few <strong>nuances</strong> between API’s. While we could expect this behavior after reading the documentation more in defail, it’s still a bit annoying.</p><ul><li>The navigation bar buttons’ contrast is simply not right.</li><li>The status bar is drawn on top of our AppBar.</li><li>The feedback is so close to the navigation that a user will probably misclick it.</li></ul><p>Should we just use edge-to-edge for APIs above 29 (Android 10)? Well, we could, but we feel like we can achieve a similar result on all APIs, and offer a better experience regardless of them having the latest Android device.</p><p>To save you the time of reading through various StackOverflow threads and Github repositories, we will give you everything you could need here (just below). If you feel something is still missing, feel free to leave a comment.</p><h3>Nuances and solutions</h3><p>So, we now understand Edge to Edge, read the documentation, made a few line changes on our theme. Our work is done right?</p><p>Maybe an Hello World app. But in real apps, like our Large Text, there were some important nuances we had to tackle. Let’s describe them one by one.</p><h4>Translucence</h4><p>This is one of the nuances we talked about above. It happens with devices with API level 28 or lower using the button mode navigation system.</p><p><strong>Button modes:</strong> The system applies a translucent scrim behind the system bars (for API level 29 or higher) or a <strong>transparent system bar (for API level 28 or lower)</strong>.” — <a href="https://developer.android.com/training/gestures/edge-to-edge#change-color">Documentation</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*S7NO2eZOhKL1eEr9zZC83g.png" /></figure><p>I believe most of us will target API levels below 28 for a while, and it would be great to support a better UI there as well. Taking a look again at our <strong>Large Text</strong> app on Android 8.1 (API level 27).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*8VCrz5CQSvRQPS83iQ65QQ.png" /></figure><p>Here the UX is bad, you can barely see the navigation buttons, and they overlap with our feedback button and with our Themes grid. A user can easily press the back button instead of the action they intended.</p><h4>Solution</h4><p>First, let’s deal with the visibility. The documentation says that this only happens on API levels 28 and below. So the solution is simple, have 2 different themes.xml for 2 API targets.</p><p>theme.xml targeting API&#39;s 29 and above (recommended in the documentation)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7014fbf216b85b4bec57ad08842ca71/href">https://medium.com/media/b7014fbf216b85b4bec57ad08842ca71/href</a></iframe><p>theme.xml targeting all other API&#39;s (to have a similar feel)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2c6ae7d3966953a02b144ec0be6f542e/href">https://medium.com/media/2c6ae7d3966953a02b144ec0be6f542e/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*gc7IMAiCNpmBaBPmtcp2og.png" /></figure><p>The translucency is solved. Now let’s tackled the overlap.</p><h3>Handle overlaps using insets</h3><p>With our application drawing behind both the navigation and the status bar, some views need to be repositioned. But we need to consider that the navigation bar height is variable, depending on the Gesture Navigation mode selected. So it’s not as simple as adding static paddings or margins to your views.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*t8GtZ2LxFfcHT3H-jFARkA.png" /></figure><p>The official documentation discusses this issue and offers a solution on how to solve them. But here we want to go a bit further and talk about a few specific cases:</p><ul><li>AppBar</li><li>Floating Views / Navigation Bars</li><li>Scrollable Views</li></ul><p>And while the documentation solution talks about using the setOnApplyWindowInsetsListener, we will be using the simpler <a href="https://github.com/chrisbanes/insetter">Insetter</a> library, developed by <a href="https://github.com/chrisbanes">Chris Banes</a>. You can read more about this library in our <a href="https://www.bloco.io/blog/insetter-a-library-to-simplify-windowinsets">blog post</a>.</p><h4>AppBar</h4><p>The app is now drawing behind the status bar, but the status bar <em>content</em> will still draw over our content. This can create issues with our AppBar appearing to be cut.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*ErAM6eXIIAZswxwEb2Hwhw.png" /></figure><p>To fix it we should apply a bit of <strong>padding.</strong></p><p>Using the <a href="https://github.com/chrisbanes/insetter">Insetter</a> with Java:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e49b656d89ae7b9f85eb7e8e1533d93c/href">https://medium.com/media/e49b656d89ae7b9f85eb7e8e1533d93c/href</a></iframe><p>or Kotlin</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8117c9e2182243d255dbf13a55670c23/href">https://medium.com/media/8117c9e2182243d255dbf13a55670c23/href</a></iframe><p>We get a clean App bar behind the status bar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*WL3b_ohKyQ8Um-WQUngneQ.png" /></figure><p>Note that we’re using padding. If you use margin instead the status bar would show the color of the activity background, since the AppBar is pushed down.</p><h4>Floating Views / Navigation Bars</h4><p>Views can also appear behind the navigation bar, a problem similar to the AppBar one we tackled above. Let’s take a look at our feedback button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*gc7IMAiCNpmBaBPmtcp2og.png" /></figure><p>Like on the AppBar, we just use Insetter:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8352402dcd71808f8bae6afcaa9567e0/href">https://medium.com/media/8352402dcd71808f8bae6afcaa9567e0/href</a></iframe><p>Problem solved:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*8eN8W8zdA73Z1qGXNZiBFw.png" /></figure><h4>Scrollable Views</h4><p>Lastly, scrollable views. What’s the difference? Clipping.</p><p>By default, a ViewGroup clips its children. That means, if we just add padding, your elements won’t really appear behind the navigation bar. Take a look at the difference between the two behaviours side by side:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*18d9ecr5trt3aWVxiBsRvA.gif" /><figcaption>RecyclerView with bottom padding</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*k7QB6-OcES3IokyHPnrCAQ.gif" /><figcaption>RecyclerView with bottom padding, but disabling clipping</figcaption></figure><h4>Solution</h4><p>Add padding with Insetter and disable clipping:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06feb57dc64001eb8cf75747b1e674fe/href">https://medium.com/media/06feb57dc64001eb8cf75747b1e674fe/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6858e1272ca956688be5a1e6115a5dbf/href">https://medium.com/media/6858e1272ca956688be5a1e6115a5dbf/href</a></iframe><h3>Conclusion</h3><p>While Edge to Edge support is not complex, it has its tricks. Reading the documentation alone might leave you with the feeling that it’s only a few line changes, and everything will work on all APIs.</p><p>We wrote this article to go beyond the official documentation. To provide the best Edge-to-Edge experiences for all your users, regardless of API level their phone supports. To cover nuances that you most likely will encounter, and how to solve them.</p><p>In summary, here are the changes for a full Edge to Edge support:</p><ul><li>Add WindowCompat.setDecorFitsSystemWindows on the activities you want to support;</li><li>Different Themes for different API levels (One for 29+ and one default for all others);</li><li>Margins and Paddings according to insets to avoid overlaps with the status and navigation bars;</li><li>And lastly, Scrollable Views may need attention with clipping.</li></ul><p>Our <a href="https://github.com/blocoio/android-template">Android Template</a> also comes pre-configured with this and other things we find useful. If you want to jump straight into development, take a look at it.</p><p>📲 We are a studio specialized in designing and developing Android products. Keep up with us through <a href="https://twitter.com/blocoio">Twitter</a>, <a href="https://www.facebook.com/bloco.io/">Facebook</a>, and <a href="https://www.instagram.com/bloco.io/">Instagram</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e1336b90e84" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/android-edge-to-edge-101-7e1336b90e84">Android Edge to Edge 101</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[Edge-to-edge support for your Android app with Insetter]]></title>
            <link>https://proandroiddev.com/edge-to-edge-support-for-your-android-app-with-insetter-3ec5c43532a7?source=rss-6a161dd3c9c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ec5c43532a7</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[gesture-navigation]]></category>
            <category><![CDATA[fullscreen]]></category>
            <dc:creator><![CDATA[filipe alves]]></dc:creator>
            <pubDate>Fri, 25 Jun 2021 14:52:41 GMT</pubDate>
            <atom:updated>2021-06-28T15:02:15.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e-sKH9pAYiEw5_VuQ6C3RQ.png" /></figure><p>With the appearance of <a href="https://developer.android.com/training/gestures/gesturenav">edge-to-edge screens and gesture navigation</a>, it can be frustrating to implement behaviours for all cases and combinations. While developing we tend to use adjustWindowInsets, but to provide a good fullscreen support by adding space between navigation bar and status bar may not always be the only way to go.</p><p>We <a href="https://www.bloco.io/blog/2020/android-app-starter-update">wrote before</a> about Android’s Gesture Navigation support, how to handle conflicting gestures and extending app content from edge-to-edge. That said we discovered an amazing library that makes the latter even easier!</p><p><a href="https://chrisbanes.github.io/insetter/"><strong>Insetter</strong></a> can be used in multiple ways. There are even two extension libraries adding to the main library. Bellow you can find some examples we found useful. And we also recommend taking a look at the <a href="https://chrisbanes.github.io/insetter/">official documentation</a>.</p><h3>Main Library</h3><p>The main library provides simple APIs for handling WindowInsets. To use the Library you can use its main entry point, the <a href="https://chrisbanes.github.io/insetter/api/library/library/dev.chrisbanes.insetter/-insetter/-builder/">Builder</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a293417898b46a933f093d5485ddfcd/href">https://medium.com/media/0a293417898b46a933f093d5485ddfcd/href</a></iframe><p>or with Kotlin extensions you can also</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1fe9e94db6eee28dec720b8e728dd111/href">https://medium.com/media/1fe9e94db6eee28dec720b8e728dd111/href</a></iframe><h3>Example</h3><p>At this point you may be wondering.</p><blockquote>This is all great, but what does this really solve? — you</blockquote><p>As good developers we are supporting Edge to Edge and making sure we are using most of our users’ screens.</p><p>We used both WindowCompact.setDecorFitsSystemWindows(window, false) and themes.xml for full support. We tested our screen with both Gesture Navigation and traditional navigation and we got this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lqMPORQvyx_ZjBGKnZ7KLw.png" /><figcaption>Edge to Edge Overlap Demonstration</figcaption></figure><p>Overlap! Well according to the official documentation we can make use of the view listener setOnApplyWindowInsetsListener and update the padding or margin as we see fit. It will end up being something like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/074d89795c4d0d9dd4fecefc67a1930a/href">https://medium.com/media/074d89795c4d0d9dd4fecefc67a1930a/href</a></iframe><p>It looks “OK-ish”, but this does not take into account current margins or paddings by default. It also only applies the insets when the system lifecycle calls it, meaning if you add a view programmatically afterwards you run the risk of weird behaviours. And who will remember to mark it as CONSUMED?</p><p>With Insetter Library, all this is automatically handled and simpler.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b5d98f9a299b227e4c2ea8bd56636095/href">https://medium.com/media/b5d98f9a299b227e4c2ea8bd56636095/href</a></iframe><p>and the end result is what we expected to happen on the old navigation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JyXw87fnXtghtojtPqL7bg.png" /><figcaption>Overlap fixed with Insetter</figcaption></figure><p>This library offers a lot more functionality, below we go over another quick example, Data Binding but we recommend you to take a look at the official documentation.</p><h3>Data Binding extension</h3><p>Provides Data Binding-specific functionality that works with any view and makes the codebase cleaner. Using data binding, all you need is to modify your xml’s where you intend to</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9cfa450385e697d2d741d9c16cecab0/href">https://medium.com/media/d9cfa450385e697d2d741d9c16cecab0/href</a></iframe><p>And to have a better full screen support you can also use the attribute app:layout_edgeToEdge that sets this view’s System UI visibility with the flags required.</p><p>📲 <em>I am Filipe, an Android Developer at </em><a href="http://bloco.io/"><em>Bloco</em></a><em>, a studio specialized in Android Products, there you can find other posts like our </em><a href="https://www.bloco.io/blog/2020/android-app-starter-update"><em>Android Template.</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ec5c43532a7" width="1" height="1" alt=""><hr><p><a href="https://proandroiddev.com/edge-to-edge-support-for-your-android-app-with-insetter-3ec5c43532a7">Edge-to-edge support for your Android app with Insetter</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>