<?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 Jeremy Walker on Medium]]></title>
        <description><![CDATA[Stories by Jeremy Walker on Medium]]></description>
        <link>https://medium.com/@codingjeremy?source=rss-73335236659e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*_8ON0cKK0Qd0vO-OjUWILw.png</url>
            <title>Stories by Jeremy Walker on Medium</title>
            <link>https://medium.com/@codingjeremy?source=rss-73335236659e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:02:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@codingjeremy/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[Improvements and Changes to Compose’s Pointer Input]]></title>
            <link>https://medium.com/androiddevelopers/improvements-and-changes-to-composes-pointer-input-6026904ac972?source=rss-73335236659e------2</link>
            <guid isPermaLink="false">https://medium.com/p/6026904ac972</guid>
            <category><![CDATA[android-compose]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[compose]]></category>
            <category><![CDATA[compose-ui]]></category>
            <dc:creator><![CDATA[Jeremy Walker]]></dc:creator>
            <pubDate>Mon, 17 Apr 2023 17:02:14 GMT</pubDate>
            <atom:updated>2023-04-17T17:02:14.552Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eXTuoYBwVMt_iAg-xB_a0A.png" /><figcaption>Pointer Input in Compose</figcaption></figure><p>We’ve finished refactoring <strong>Modifier.pointerInput{ … }</strong> to use the new <strong>Modifier.Node</strong> implementation (as of <a href="https://developer.android.com/jetpack/androidx/releases/compose-ui#1.5.0-alpha02">version compose-ui 1.5.0-alpha02</a>), which is part of a larger project to <a href="https://www.youtube.com/watch?v=BjGX2RftXsU">reduce memory and improve performance in Compose</a>.</p><p>A majority of you should see improvements with no changes to your codebase (other than bumping up the library version).</p><p>However, if you are writing your own custom gesture detectors or using <strong>pointerInput(), </strong>you may be impacted by the change. Let me explain.</p><h3>Previous implementation of pointerInput()</h3><p>The previous iteration (<a href="https://developer.android.com/jetpack/androidx/releases/compose-ui#1.5.0-alpha01">Version 1.5.0-alpha01</a> and everything before) of <strong>pointerInput()</strong> worked by executing the whole block of code up to <strong>awaitPointerEvent()</strong> (in the <strong>AwaitPointerEventScope</strong> block).</p><p>Here’s an example:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6bf5eee0bb92ad620fc14118ccda265/href">https://medium.com/media/b6bf5eee0bb92ad620fc14118ccda265/href</a></iframe><p>Everything before <strong>awaitPointerEvent()</strong> executes right away (see comments).</p><p>Once the code gets to <strong>awaitPointerEvent()</strong>, it will suspend until an event comes in.</p><h3>Current implementation of pointerInput()</h3><p>In the new implementation (<a href="https://developer.android.com/jetpack/androidx/releases/compose-ui#1.5.0-alpha02">compose-ui 1.5.0-alpha02</a>), <strong>pointerInput()</strong> lazily executes.</p><p>That means nothing will happen until the first pointer event is fired — for example, when a user presses down on the screen.</p><p>Why would we make such a significant change? Performance! 🙂</p><p>Similar to <strong>LazyColumn</strong>, we don’t want to execute work until it is needed.</p><p>The previous implementation executed each pointer input block of code up to the <strong>awaitPointerEvent()</strong> regardless of whether a user ever interacted with the composable or not.</p><p>The Compose gesture detectors, for example, <a href="https://developer.android.com/jetpack/compose/touch-input/gestures#tapping">tapping/pressing</a>, <a href="https://developer.android.com/jetpack/compose/touch-input/gestures#dragging">dragging</a>, and <a href="https://developer.android.com/jetpack/compose/touch-input/gestures#multitouch">multi-touch</a>, are actually built on top of <strong>pointerInput()</strong> as well, which means that anytime anyone uses a gesture detector, a good chunk of code is executed. Well, in many cases, that code might never be needed, for instance, if the user never interacts with your composable.</p><p>The new implementation avoids that. We never execute any of the code until it is needed because a user is interacting with your composable.</p><p>Let’s revisit the example above to see how it has changed in the new implementation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fda210d002cfcdd8c4219e670fda48c6/href">https://medium.com/media/fda210d002cfcdd8c4219e670fda48c6/href</a></iframe><p>Now, the entire block (see comments) will not execute until the first event comes in, and, if there is no pointer event, it will never execute.</p><p>Once an event is triggered, the block will be executed (including the first <strong>awaitPointerEvent() </strong>call). The code will suspend once again on any following <strong>awaitPointerEvent() </strong>calls until the next event is triggered.</p><p>If you have a custom gesture handler (or any code using <strong>pointerInput()</strong>) where you rely on code in that block executing right away (before an event or even if there isn’t an event), you will want to adjust your code to take this new change into account.</p><p>This is probably a pretty rare occurrence for most of you, but it is something to keep in mind as you get the improvements.</p><p>Happy coding!</p><p>-Jeremy</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6026904ac972" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/improvements-and-changes-to-composes-pointer-input-6026904ac972">Improvements and Changes to Compose’s Pointer Input</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free Samples!]]></title>
            <link>https://medium.com/androiddevelopers/free-samples-1db256ac8217?source=rss-73335236659e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1db256ac8217</guid>
            <category><![CDATA[androiddev]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Jeremy Walker]]></dc:creator>
            <pubDate>Tue, 17 Sep 2019 17:08:35 GMT</pubDate>
            <atom:updated>2020-04-28T00:08:55.199Z</atom:updated>
            <content:encoded><![CDATA[<h3>Free samples!</h3><p>Android samples apps are moving to a pull-request friendly location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-y9eu5ScQaFFIpsAgA-VVA.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@aideal?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Aideal Hwa</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><h3>TL;DR</h3><ul><li>All Android samples will be available at <a href="https://github.com/android"><strong>github.com/android</strong></a></li><li>We’ll now accept pull requests on <strong>all</strong> repos</li></ul><h3>Details</h3><p>You may have noticed that while some Github Android repos accept pull requests (<a href="https://github.com/googlesamples/android-architecture">android-architecture</a>, <a href="https://github.com/googlesamples/android-sunflower">android-sunflower</a>, etc.), others do not (<a href="https://github.com/googlesamples/android-RecyclerView">android-RecyclerView</a>, <a href="https://github.com/googlesamples/android-WatchFace">android-WatchFace</a>, etc.).</p><h3>Why?</h3><p>The origin of repositories that don’t accept pull requests is within <a href="https://source.android.com/">AOSP</a>, and GitHub acts as mirror.</p><p>This system was made some time ago to help us easily update library versions across all samples and separate UI code in those samples (mainly around <a href="https://android-developers.googleblog.com/2012/01/holo-everywhere.html">Holo</a>). While it made our lives easier when we launched it, it now restricts us more than it helps.</p><p>I mean… we can’t accept pull requests! :O</p><p>We decided earlier this year it was time to move away from that system, audit all existing Android samples, and move them to a central location (<a href="https://github.com/android"><strong>github.com/android</strong></a>).</p><p>As part of the audit, we are bundling simple, related samples together into single repositories.</p><p>For the larger, established repositories, we will simply transfer them as they are to <a href="https://github.com/android"><strong>github.com/android</strong></a>.</p><h3>Changes to the old repos</h3><ul><li>For repos migrating to group repos, we will provide information in the README pointing you to the new location.</li><li>For larger repos, you will redirect from old location to the new location after they have been transferred.</li></ul><h3>Conclusion</h3><p>We’ve migrated many repos already (<a href="https://github.com/android/camera">camera</a>, <a href="https://github.com/android/animation">animation</a>, etc.). Feel free to make your first PR against those repos now! (Make sure you review the project’s <a href="https://github.com/android/plaid/blob/master/CONTRIBUTING.md">CONTRIBUTING</a> file first.) :)</p><p>For the rest, expect to see the changes rolling out this month.</p><p>Thank you for your contributions over the years! We look forward to many more! :)</p><p>-Jeremy</p><h3>Resources</h3><ul><li>New Android repo location: <a href="https://github.com/android">github.com/android</a></li><li><a href="https://help.github.com/en/articles/creating-a-pull-request">Creating a pull request in GitHub</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1db256ac8217" width="1" height="1" alt=""><hr><p><a href="https://medium.com/androiddevelopers/free-samples-1db256ac8217">Free Samples!</a> was originally published in <a href="https://medium.com/androiddevelopers">Android Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>