<?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 Jon F Hancock on Medium]]></title>
        <description><![CDATA[Stories by Jon F Hancock on Medium]]></description>
        <link>https://medium.com/@jonfhancock?source=rss-4c3e591d8822------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KE3fH44z_-QC3whUdHQqow.jpeg</url>
            <title>Stories by Jon F Hancock on Medium</title>
            <link>https://medium.com/@jonfhancock?source=rss-4c3e591d8822------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 16:53:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jonfhancock/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[I had a fundamental misunderstanding of what racism is]]></title>
            <link>https://medium.com/@jonfhancock/i-had-a-fundamental-misunderstanding-of-what-racism-is-e612b70a978?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/e612b70a978</guid>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 19:06:05 GMT</pubDate>
            <atom:updated>2020-07-07T19:06:05.090Z</atom:updated>
            <content:encoded><![CDATA[<p>I thought racism meant hate, fear, and intolerance based on skin color. I was wrong about that.</p><p>I thought racism meant saying offensive things. I was wrong about that too.</p><p>So what is racism?</p><p>It’s old. It’s about power. It’s about money. It’s about sowing prejudice.</p><p>In 1453, Gomes de Zarura wrote a commissioned biography of Prince Henry of Portugal. The book doubled as marketing material for Portugal’s very profitable human trafficking. Henry was the first to kidnap and traffic exclusively people from Africa with black skin. So Zarura ignored all of the different cultures of African people, and grouped them all together as Black people, then lied about them. He described them as beasts who live in sloth. For money, he divided humans into black and white, and told everyone that a life captured, beaten, and enslaved is an improvement over a free life in Africa. He used racist ideas to justify treating human beings like cattle.</p><p>In the US, the Naturalization Act of 1790 restricted citizenship to “any alien, being a free white person”. From the beginning, the US has used skin color to enforce the idea that white people are superior. That’s not a controversial thing to say. It’s written. It’s in our history. And its purpose was to justify the continued enslavement of Black people. It didn’t change until 1870. It has been followed up by other legislation and practices that use racist ideas to justify keeping Black people away from power and money held by white people.</p><p>It still happens today. It happens when Kentucky closes hundreds of polling locations, making it impossible for all of its Black residents to vote. Then people in power use racist ideas to justify it, saying that Black voters aren’t informed enough to vote. Saying they weren’t going to vote anyway. Claiming — without evidence — that they will commit voter fraud if given mail-in ballots.</p><p>Racism is prejudice PLUS power. Specifically, it is prejudice applied to gain or uphold power. Racism is selling the idea of the inferiority of Black people for the profit and power of white people.</p><p>Racism LEADS TO hate. Racism LEADS TO intolerance. Racism LEADS TO fear. Racism still has nothing to do with being offended.</p><p>But what if I don’t hate or fear Black people? What if I tolerate Black people? Is it possible that I’m still racist?</p><p>Yes. Yes it is possible. Because racism is an action not an identity.</p><p>Because if I do nothing to reverse the racist ideas that I’ve learned from 500 years of history, and I do nothing to reverse the power that has been held up by those racist ideas, that means I’m comfortable living with racism.</p><p>Being accused of racism isn’t so bad. Living with racism, and ignoring its actual impact on my neighbors… that’s bad.</p><p>Having hurt feelings isn’t so bad. Living with a society that still treats white skin as superior to black skin, and uses that lie to justify harm to Black people… that’s bad.</p><p>There’s a lot more history to this. A lot more truth. A lot more depth.</p><p>If you want to learn more, an excellent, broad look at the history of racism is available in the <a href="https://www.sceneonradio.org/seeing-white/">Seeing White series (Season 2)</a> of the <a href="https://twitter.com/SceneOnRadio">SceneOn Radio</a> podcast.</p><p>For an in-depth dive into the history, see <a href="https://twitter.com/DrIbram">Dr. Ibram X. Kendi</a>’s book <a href="https://www.ibramxkendi.com/stamped-from-the-beginning">Stamped From The Beginning</a>. Take some of Kendi’s words with a grain of salt though. Kendi holds that Black individuals can be racist against Black people, but <a href="https://twitter.com/b_tynes/status/1277412194867650569">other experts disagree</a>. They say that a Black individual can be anti-Black, but that racism requires power, and a Black individual is only loaned that power as long as it serves white supremacy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e612b70a978" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Distraction Cycle]]></title>
            <link>https://medium.com/@jonfhancock/the-distraction-cycle-d06ec2009ae0?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/d06ec2009ae0</guid>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[adhd]]></category>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Thu, 17 Jan 2019 22:14:32 GMT</pubDate>
            <atom:updated>2019-01-17T22:18:36.572Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ACd-4wVowrwHoJ0yoUkZdg.jpeg" /></figure><p>I can feel the teeming tendrils inside<br>Sometimes pressing, sometimes resting<br>Always waiting</p><p>They burst free, and I unfold. A flower in spring<br>The tendrils fly forth like the tongues of frogs<br>Grasping at their goals<br>Some take hold<br>Some fall short<br>Some overshoot and grasp something entirely other</p><p>Those with a prize reel them in<br>They bring to me bits of knowledge<br>Half actions<br>Even as I pull them in, some wither away<br>Some cling so tightly they shatter their trophies<br>Shamefully limping back to me</p><p>Some precious few bring back the whole of their prize<br>They bring music<br>They bring deep thought and the blueprints of things<br>They bring love and touch<br>They bring sustenance, not bland, but delightful and delicious</p><p>These I cherish<br>And even these I fail to keep <br>Even these I smother <br>Even these I let slide away</p><p>As I fold back up, a desiccated husk<br>I sleep with many seeds in my arms<br>The seeds of the tendrils that will writhe again</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d06ec2009ae0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Threading Right with DiffUtil]]></title>
            <link>https://medium.com/jon-f-hancock/get-threading-right-with-diffutil-423378e126d2?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/423378e126d2</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[recyclerview]]></category>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Tue, 21 Feb 2017 18:51:13 GMT</pubDate>
            <atom:updated>2017-02-21T18:51:13.454Z</atom:updated>
            <content:encoded><![CDATA[<h4>Use DiffUtil for rich animations in RecyclerView with a tiny amount of code</h4><p>Now this is a story all about how<br>My dataset changed, turned upside down<br>And it might take a second<br>Just sit right there<br>I’ll tell you how to DiffUtil on a background thread and apply the results on the main thread correctly</p><p>Yeah. That fell apart on me. Seriously though, in my <a href="https://jonfhancock.com/your-viewholders-are-dumb-make-em-not-dumb-82e6f73f630c#.tag6kfgaf">post about making your ViewHolders smarter</a>, I advised that you always use <a href="https://developer.android.com/reference/android/support/v7/util/DiffUtil.html">DiffUtil</a> to update your RecyclerView rather than calling notifyDatasetChanged(). For the sake of simplicity, I processed the diff on the main thread. That worked fine because my list had two items in it. But what about 100 items? What about 1,000 items? What about 100,000 items? What if processing the diff takes so long that I drop frames? What if it takes so long that I ANR? How can I keep these bad things from affecting my users?</p><p>The answer is to move the diff calculation to the background thread. However, there are some serious gotchas.</p><h3>The DiffUtil gotchas are</h3><ul><li>When you change your backing data, you must notify your adapter immediately to maintain data consistency</li><li>You must handle concurrent changes to your data.</li></ul><h4>How to maintain data consistency</h4><p>The first item took me an embarrassingly long time to understand. My instinct was to update the backing data for my adapter, then process the diff on a background thread, then notify the adapter back on the main thread. That. Does. Not. Work. What ends up happening is that the user can very easily scroll to a point where the adapter thinks data exists because it hasn’t been notified of the change. So it asks the backing data collection for the 10th item, but the collection only had five items. So you end up crashing with an IndexOutOfBoundsException. Not what you wanted at all.</p><p>The important thing to understand is that you must do things in this order:</p><ol><li>Process the diff on a background thread</li><li>Return to the main thread</li><li>Update the backing data</li><li>Notify the adapter of the changes.</li></ol><h4>How to handle concurrent changes</h4><p>Handling concurrent changes is less straightforward and depends on how your data matters to the user. In any case, you can’t run concurrent updates on the adapter. You must choose between three options:</p><ol><li>Process the current update and ignore all others</li><li>Stack the updates, and apply only the latest once the current one is finished.</li><li>Queue the updates, and apply them in the order received.</li></ol><h4>So let’s get into the code</h4><p>Let’s take the DiffUtil from the DumbViewHolder example, and improve it. First, let’s see what happens when we make the diff take a long time to run. We’ll take a really simple approach to that and just introduce a Thread.sleep(random.nextInt(3000))in one of the methods. That will make the diff <em>get stuck</em> for some random amount of time up to three seconds.</p><h4>Alter a method of DiffUtil to be long running</h4><p>We’ll create a <a href="https://github.com/jonfhancock/DumbViewHolder/blob/master/DumbViewHolder/app/src/main/java/com/jonfhancock/dumbviewholder/DiffCb.java">DiffUtill.Callback subclass for our use called DiffCb</a>, pick one of the methods arbitrarily, and make it slow. So now every time we use this DiffUtil callback, it will take up to 3 seconds to finish.</p><pre><strong>class </strong>DiffCb <strong>extends </strong>DiffUtil.Callback {<br>  <strong>...</strong><br>  @Override<br>  <strong>public int </strong>getNewListSize() {<br>    <em>// Simulate a really long running diff calculation.<br>    </em><strong>try </strong>{<br>      Thread.<em>sleep</em>(<strong>new </strong>Random().nextInt(3000));<br>    } <strong>catch </strong>(InterruptedException e) {<br>      e.printStackTrace();<br>    }<br>    <strong>return newItems</strong>.size();<br>  }<br>  ...<br>}</pre><p>So let’s use this new callback in an adapter</p><pre><strong>public class </strong>MainThreadAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();<br><br>  <strong>public void </strong>updateItems(List&lt;Item&gt; newItems) {<br>    List&lt;Item&gt; oldItems = <strong>new </strong>ArrayList&lt;&gt;(<strong>items</strong>);<br>    DiffUtil.DiffResult diffResult =<br>      DiffUtil.<em>calculateDiff</em>(<strong>new </strong>DiffCb(oldItems, newItems));<br>    <strong>items</strong>.clear();<br>    <strong>items</strong>.addAll(newItems);<br>    diffResult.dispatchUpdatesTo(<strong>this</strong>);<br>  }<br>  ...<br>}</pre><p>The results are not pretty. The main thread is blocked. The user cannot interact with the app at all until the diff processing is finished. The user will get impatient and stop using your app. So we have to use a background thread, but here is where data consistency gets tricky.</p><h3>Keeping our data consistent</h3><p>On our quest to avoid blocking the main thread, let’s introduce three new methods to our adapter: updateItemsInternal, applyDiffResult, and dispatchUpdates.</p><p>In the following class, we use the updateItemsInternal method to kick off a background thread where we can run the diff and get a DiffResult object back. Then we use a Handler to call applyDiffResult back on the main thread. In applyDiffResult we call through to dispatchUpdates. It might seem a little contrived in this example because these methods just call straight through. But in the following examples the abstraction becomes important.</p><pre><strong>public class </strong>ConcurrencyFailAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();</pre><pre><strong>  </strong>// The Fragment or Activity will call this method <br>  // when new data becomes available<strong><br>  public void </strong>updateItems(<strong>final </strong>List&lt;Item&gt; newItems) {<br>   updateItemsInternal(newItems);<br>  }</pre><pre><strong>  </strong>// This method does the heavy lifting of <br>  // pushing the work to the background thread<strong><br>  void </strong>updateItemsInternal(<strong>final </strong>List&lt;Item&gt; newItems) {<br>    <strong>final </strong>List&lt;Item&gt; oldItems = <strong>new </strong>ArrayList&lt;&gt;(<strong>this</strong>.<strong>items</strong>);</pre><pre><strong>    final </strong>Handler handler = <strong>new </strong>Handler();<br>    <strong>new </strong>Thread(<strong>new </strong>Runnable() {<br>      @Override<br>      <strong>public void </strong>run() {<br>        <strong>final </strong>DiffUtil.DiffResult diffResult =<br>          DiffUtil.<em>calculateDiff</em>(<strong>new </strong>DiffCb(oldItems, newItems));<br>        handler.post(<strong>new </strong>Runnable() {<br>          @Override<br>          <strong>public void </strong>run() {<br>            applyDiffResult(newItems, diffResult);<br>          }<br>        });</pre><pre>      }<br>    }).start();<br>  }</pre><pre><strong>  </strong>// This method is called when the background work is done<strong><br>  protected void </strong>applyDiffResult(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    dispatchUpdates(newItems, diffResult);<br>  }</pre><pre><strong>  </strong>// This method does the work of actually updating <br>  // the backing data and notifying the adapter<strong><br>  protected void </strong>dispatchUpdates(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    diffResult.dispatchUpdatesTo(<strong>this</strong>);<br>    <strong>items</strong>.clear();<br>    <strong>items</strong>.addAll(newItems);<br>  }<br>  ...<br>}</pre><p>Now we process the diff on the background thread, and we both update our backing data and notify our adapter on the main after everything is done. Our list animates nicely once the diff is finished. We have no crashes. BUT! We have another problem now. What if the list changes again while we’re busy processing the current diff? Yeah… That’s going to be a problem.</p><h3>Handling concurrent updates</h3><p>For the next three demonstrations the important work will be done in two methods: updateItems and applyDiffResult. updateItems takes a List of new items to use. It gives us a chance to do any prep work, then it kicks off the background thread by calling updateItemsInternal. When the background thread completes, it calls applyDiffResult passing the new items, and the DiffResult to apply. applyDiffResult lets us do some work, then it dispatches to the adapter by calling dispatchUpdates. dispatchUpdates and updateItemsInternal will all be identical to the ConcurrencyFailAdapter’s implementation. So for the sake of brevity, I’ll omit those as such:</p><pre><strong>public class </strong>ConcurrencyFailAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();<br><br>  <strong>public void </strong>updateItems(<strong>final </strong>List&lt;Item&gt; newItems) {<br>   updateItemsInternal(newItems);<br>  }<br>  <strong>...</strong><br>  <strong>protected void </strong>applyDiffResult(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    dispatchUpdates(newItems, diffResult);<br>  }<br>  ...<br>}</pre><h4>Let’s start with the simplest approach: I’m busy, leave me alone</h4><p>We’ll keep track of a boolean variable that lets us know that we’re currently processing an update. If that variable is true, then we’ll just ignore all other updates. This prevents crashes and data inconsistencies, but it probably doesn’t represent what the user actually needs.</p><pre><strong>public class </strong>FirstWinsAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();<br>  <strong>boolean operationPending</strong>;<br><br>  <strong>public void </strong>updateItems(<strong>final </strong>List&lt;Item&gt; newItems) {<br>    <strong>if </strong>(<strong>operationPending</strong>) {<br>      <strong>return</strong>;<br>    }<br>    <strong>operationPending </strong>= <strong>true</strong>;<br>    updateItemsInternal(newItems);<br>  }<br>  <strong>...</strong><br>  <strong>protected void </strong>applyDiffResult(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    dispatchUpdates(newItems, diffResult);<br>    <strong>operationPending </strong>= <strong>false</strong>;<br>  }<br>  ...<br>}</pre><h4>Next approach: Latest update wins</h4><p>Now this one is probably more useful if the data is entirely server driven. This will finish processing the current update, storing up pending updates that come in. Then once it finishes the current one, it discards all but the most recent update, and processes that one.</p><pre><strong>public class </strong>LatestWinsAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();<br>  <strong>private </strong>Deque&lt;List&lt;Item&gt;&gt; <strong>pendingUpdates </strong>=<br>    <strong>new </strong>ArrayDeque&lt;&gt;();<br><br>  <strong>public void </strong>updateItems(<strong>final </strong>List&lt;Item&gt; newItems) {<br>    <strong>pendingUpdates</strong>.push(newItems);<br>    <strong>if </strong>(<strong>pendingUpdates</strong>.size() &gt; 1) {<br>      <strong>return</strong>;<br>    }<br>    updateItemsInternal(newItems);<br>  }<br>  <strong>...</strong><br>  <strong>protected void </strong>applyDiffResult(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    <strong>pendingUpdates</strong>.remove(newItems);<br>    dispatchUpdates(newItems, diffResult);<br>    <strong>if </strong>(<strong>pendingUpdates</strong>.size() &gt; 0) {<br>      List&lt;Item&gt; latest = <strong>pendingUpdates</strong>.pop();<br>      <strong>pendingUpdates</strong>.clear();<br>      updateItemsInternal(latest);<br>    }<br>  }<br>  <strong>...</strong><br>}</pre><h4>Final Approach: Queue them up, apply them in order</h4><p>This one would work well for pagination, or any processing where each update matters, and none should be discarded.</p><pre><strong>public class </strong>QueueAdapter <strong>extends </strong>RecyclerView.Adapter {<br>  <strong>protected </strong>List&lt;Item&gt; <strong>items </strong>= <strong>new </strong>ArrayList&lt;&gt;();<br>  <strong>private </strong>Queue&lt;List&lt;Item&gt;&gt; <strong>pendingUpdates </strong>=<br>    <strong>new </strong>ArrayDeque&lt;&gt;();<br><br>  <strong>public void </strong>updateItems(<strong>final </strong>List&lt;Item&gt; newItems) {<br>    <strong>pendingUpdates</strong>.add(newItems);<br>    <strong>if </strong>(<strong>pendingUpdates</strong>.size() &gt; 1) {<br>      <strong>return</strong>;<br>    }<br>    updateItemsInternal(newItems);<br>  }<br>  <strong>...</strong><br>  <strong>protected void </strong>applyDiffResult(List&lt;Item&gt; newItems,<br>                                 DiffUtil.DiffResult diffResult) {<br>    <strong>pendingUpdates</strong>.remove();<br>    dispatchUpdates(newItems, diffResult);<br>    <strong>if </strong>(<strong>pendingUpdates</strong>.size() &gt; 0) {<br>      updateItemsInternal(<strong>pendingUpdates</strong>.peek());<br>    }<br>  }<br>  <strong>...</strong><br>}</pre><p>Now from here, I’m sure we could devise other ideas. We could also use RxJava for thread handling. We could even let Rx do the queueing for us. What other improvements can you think of?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=423378e126d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jon-f-hancock/get-threading-right-with-diffutil-423378e126d2">Get Threading Right with DiffUtil</a> was originally published in <a href="https://medium.com/jon-f-hancock">Jon F Hancock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your ViewHolders Could Be Doing So Much More]]></title>
            <link>https://medium.com/jon-f-hancock/your-viewholders-are-dumb-make-em-not-dumb-82e6f73f630c?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/82e6f73f630c</guid>
            <category><![CDATA[software-design-patterns]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[recyclerview]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Tue, 29 Nov 2016 18:30:31 GMT</pubDate>
            <atom:updated>2019-04-19T21:00:11.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Note from the author: This blog post uses the word “dumb” in a way that I regret because it demonstrates ignorance and ableism on my part. I have changed the title, but not the content of this post because I feel that erasing mistakes is less valuable than apologizing for them. So let me do that here. I apologize for my ableism in this post. I regret it, and I have worked to remove ableist language from my vocabulary.</p><p>I can’t decide if it is a holdover from ListView, or just a paradigm that people can’t shift away from, but I see RecyclerView ViewHolders that do absolutely nothing other than hold references to some views. These are dumb ViewHolders. They know nothing about the data they display. They know nothing about the ways users can interact with the data. They know nothing about how to communicate with code around them. But they can do so much more! They can be <em>Not</em> Dumb!</p><blockquote>Let’s learn by example! -- Somebody probably</blockquote><p>The best way to work through this paradigm shift is by example. Let’s start with a dumb ViewHolder and an Adapter that has too much work to do. Then we’ll refactor it step by step.</p><p>First of all, let’s look at our data model. It’s a simple, immutable class with a handful of fields. Some are for display, and some are for building Uris. There’s only one potentially new concept here. The era field is a String, but it may only be “BC” or “AD”. That’s exactly what StringDef does for us.</p><pre><strong>public class </strong>ExcellentAdventure {<br>    ...<br>}</pre><p>For the full data model class, <a href="https://gist.github.com/jonfhancock/9534f5b05d28d1a4234fa4329243f188">visit this gist</a>.</p><p>Now our DumbViewHolder is really simple. Probably too simple. Its only purpose is to make all of those findViewById calls not be in our adapter.</p><pre><strong>public class </strong>DumbViewHolder <strong>extends </strong>RecyclerView.ViewHolder {<br>    TextView <strong>textTitle</strong>;<br>    TextView <strong>textLocation</strong>;<br>    TextView <strong>textDate</strong>;<br>    ImageView <strong>mapIcon</strong>;<br><br>    <strong>public </strong>DumbViewHolder(View itemView) {<br>        <strong>super</strong>(itemView);<br>        <strong>textTitle </strong>= (TextView) itemView.findViewById(R.id.<strong><em>text_title</em></strong>);<br>        <strong>textLocation </strong>= (TextView) itemView.findViewById(R.id.<strong><em>text_location</em></strong>);<br>        <strong>textDate </strong>= (TextView) itemView.findViewById(R.id.<strong><em>text_date</em></strong>);<br>        <strong>mapIcon </strong>= (ImageView) itemView.findViewById(R.id.<strong><em>map_icon</em></strong>);<br><br>    }<br>}</pre><p>Now our poor OverworkedAdapter has a whole lot to do. It must bind the fields to each individual view in the ViewHolder, then handle the click events on two separate views. Then it even has to start activities!</p><p>Something new in the Adapter below is <a href="https://developer.android.com/reference/android/support/v7/util/DiffUtil.html">DiffUtil</a>. (<a href="https://gist.github.com/jonfhancock/9534f5b05d28d1a4234fa4329243f188">Full code in the gist</a>) If you’ve been using <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#notifyDataSetChanged%28%29">notifyDatasetChanged</a> to let your Adapter know that it’s underlying data has been refreshed, you should stop now. Use DiffUtil to compare the old data to the new data and let it call <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#notifyItemRangeInserted%28int,%20int%29">notifyItemRangeInserted</a>, <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#notifyItemRangeRemoved%28int,%20int%29">notifyItemRangeRemoved</a>, and <a href="https://developer.android.com/reference/android/support/v7/widget/RecyclerView.Adapter.html#notifyItemRangeChanged%28int,%20int%29">notifyItemRangeChanged</a> for you. One very important thing to note though is that although it looks like an asynchronous callback, it is not. In this example DiffUtil processes and notifies on the main thread, and it will block until it is done. If your list is very large, the calculation can take a long time. In that case, you should call calculateDiff on a background thread. Then when the calculation is complete, and returns a DiffResult, you can update your adapter data, and dispatch changes on the main thread.</p><pre><strong>public class </strong>OverworkedAdapter <strong>extends </strong>RecyclerView.Adapter {<br>    <br>    ...<br><br>    @Override<br>    <strong>public void </strong>onBindViewHolder(RecyclerView.ViewHolder holder, <strong>int </strong>position) {<br>        DumbViewHolder vh = (DumbViewHolder) holder;<br>        <strong>final </strong>ExcellentAdventure item = <strong>items</strong>.get(position);<br>        vh.<strong>textTitle</strong>.setText(item.getTitle());<br>        vh.<strong>textLocation</strong>.setText(item.getLocationName());<br>        vh.<strong>textDate</strong>.setText(getFormattedDate(item));<br>        vh.<strong>textTitle</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchWikipedia(item);<br>            }<br>        });<br>        vh.<strong>mapIcon</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchGoogleMaps(item);<br>            }<br>        });<br>    }<br><br>    <strong>private </strong>String getFormattedDate(ExcellentAdventure item) {<br>        String date = item.getYear() + <strong>&quot; &quot; </strong>+ item.getEra();<br>        <strong>return </strong>date;<br>    }<br><br>    ...<br>}</pre><p>All right! So how can we improve the <a href="https://en.wikipedia.org/wiki/Cohesion_(computer_science)">cohesion</a> of these classes? First of all, let’s make the ViewHolder a little smarter. Let’s inform it about the kind of data it’s holding. We don’t want to use the constructor to pass in an ExcellentAdventure to the ViewHolder because the adapter can create ViewHolders before it needs to use them. Creation and binding are separate steps. So let’s add a field to our ViewHolder, and a setter to fill it.</p><pre><strong>public class </strong>DumbViewHolder <strong>extends </strong>RecyclerView.ViewHolder {<br>    TextView <strong>textTitle</strong>;<br>    TextView <strong>textLocation</strong>;<br>    TextView <strong>textDate</strong>;<br>    ImageView <strong>mapIcon</strong>;<br><br>    ExcellentAdventure <strong>item</strong>;<br><br>    ...<br><br>    <strong>public void </strong>setItem(ExcellentAdventure item) {<br>        <strong>this</strong>.<strong>item </strong>= item;<br>    }<br>}</pre><p>Woohoo! Now let’s rip all that setText code out of the adapter, and move it to our new method!</p><pre><strong>public class </strong>DumbViewHolder <strong>extends </strong>RecyclerView.ViewHolder {</pre><pre>    ...</pre><pre>    <strong>public void </strong>setItem(ExcellentAdventure item) {<br>        <strong>this</strong>.<strong>item </strong>= item;<br>        <strong>textTitle</strong>.setText(item.getTitle());<br>        <strong>textLocation</strong>.setText(item.getLocationName());<br>        <strong>textDate</strong>.setText(getFormattedDate(item));<br>    }</pre><pre>    <strong>private </strong>String getFormattedDate(ExcellentAdventure item) {<br>        String date = item.getYear() + <strong>&quot; &quot; </strong>+ item.getEra();<br>        <strong>return </strong>date;<br>    }<br><br>}</pre><p>That makes our Adapter a <em>little</em> simpler, but not a whole lot.</p><pre><strong>public class </strong>OverworkedAdapter <strong>extends </strong>RecyclerView.Adapter {<br>    ....</pre><pre>    @Override<br>    <strong>public void </strong>onBindViewHolder(RecyclerView.ViewHolder holder, <strong>int </strong>position) {<br>        DumbViewHolder vh = (DumbViewHolder) holder;<br>        <strong>final </strong>ExcellentAdventure item = <strong>items</strong>.get(position);<br>        vh.setItem(item);<br>        vh.<strong>textTitle</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchWikipedia(item);<br>            }<br>        });<br>        vh.<strong>mapIcon</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchGoogleMaps(item);<br>            }<br>        });<br>    }</pre><pre>    ...<br>}</pre><p>That’s still a lot of code that is very specific to this view type. We can do better. Let’s move those onClickListeners to the ViewHolder too! Now this is especially nice. We can set the onClickListeners once in the constructor rather than over and over again at bind time. We can save a few microseconds for each bind and get us just a little closer to perfectly jank-free scrolling.</p><p>It may seem counterintuitive to set click listeners that will use the item’s data before we even have an item. “Wouldn’t the item be null?!” you might exclaim. Only if your users can click faster than your adapter can bind (unlikely). You see, the onClick methods are not evaluated until the user clicks the view. By that time, setItem will have been called, and we will have data to work with.</p><pre><strong>public class </strong>DumbViewHolder <strong>extends </strong>RecyclerView.ViewHolder {<br>    ...<br><br>    <strong>public </strong>DumbViewHolder(View itemView) {<br>        <strong>super</strong>(itemView);<br>        <strong>...</strong><br>        <strong>textTitle</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchWikipedia(item);<br>            }<br>        });<br>        <strong>mapIcon</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                launchGoogleMaps(item);<br>            }<br>        });<br>    }<br><br>    <strong>...</strong><br><br>}</pre><p>Now we’ll see a massive improvement in our Adapter. <a href="https://gist.github.com/jonfhancock/c3adc35d39f4473a398005dd40e17e4a#file-superchilladapter-java">Just look how concise this Adapter is now</a>! Our whole Adapter in just 70 lines. Complete with animations when items are deleted, inserted, or changed.</p><pre><strong>public class </strong>OverworkedAdapter <strong>extends </strong>RecyclerView.Adapter {<br>    <strong>...</strong><br><br>    @Override<br>    <strong>public void </strong>onBindViewHolder(RecyclerView.ViewHolder holder, <strong>int </strong>position) {<br>        DumbViewHolder vh = (DumbViewHolder) holder;<br>        vh.setItem(<strong>items</strong>.get(position));<br>    }<br><br>    ...<br>}</pre><p>Now this is great already. We can improve things even more by having our ViewHolder define an Interface that the Activity or Fragment can implement, and the Adapter can pass to the ViewHolder. Now we can let the Activity decide what to do with the information instead of always having the ViewHolder or Adapter worry about it. Perhaps in our tablet layout, we have a map fragment in a separate pane, and we want to update that instead of launching google maps directly when the map icon is clicked. It really doesn’t matter because our ViewHolder just doesn’t care anymore.</p><pre><strong>public class </strong>DumbViewHolder <strong>extends </strong>RecyclerView.ViewHolder {<br>    ...<br>    ExcellentAdventureListener <strong>listener</strong>;<br><br>    <strong>public interface </strong>ExcellentAdventureListener{<br>        <strong>void </strong>onMapClicked(ExcellentAdventure item);<br>        <strong>void </strong>onTitleClicked(ExcellentAdventure item);<br>    }<br><br>    <strong>public </strong>DumbViewHolder(View itemView, <strong>final </strong>ExcellentAdventureListener listener) {<br>        <strong>super</strong>(itemView);<br>        <strong>this</strong>.<strong>listener </strong>= listener;<br>        ...<br>        <strong>textTitle</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                listener.onTitleClicked(<strong>item</strong>);<br>            }<br>        });<br>        <strong>mapIcon</strong>.setOnClickListener(<strong>new </strong>View.OnClickListener() {<br>            @Override<br>            <strong>public void </strong>onClick(View view) {<br>                listener.onMapClicked(<strong>item</strong>);<br>            }<br>        });<br>    }<br><br>    <strong>...</strong><br><br>}</pre><p>Then our Adapter just needs an updated Constructor so it can pass the listener through.</p><pre><strong>public class </strong>OverworkedAdapter <strong>extends </strong>RecyclerView.Adapter {<br>    <strong>...</strong><br>    <strong>private </strong>ExcellentAdventureListener <strong>adventureListener</strong>;<br><br>    <strong>public </strong>OverworkedAdapter(LayoutInflater inflater, <br>           ExcellentAdventureListener adventureListener) {<br>        <strong>...<br>        this</strong>.<strong>adventureListener </strong>= adventureListener;<br>    }<br><br>    ...<br><br>    @Override<br>    <strong>public </strong>RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, <strong>int </strong>viewType) {<br>        View v = <strong>inflater</strong>.inflate(R.layout.<strong><em>item_excellent_adventure</em></strong>, parent, <strong>false</strong>);<br>        <strong>return new </strong>DumbViewHolder(v,<strong>adventureListener</strong>);<br>    }<br>    ...<br>}</pre><p>Now this is a Smart ViewHolder. It’s also a Super Chill Adapter now. It does what it needs to do, and delegates stuff that it shouldn’t know or care about to the appropriate places.</p><p>This works wonderfully with a simple case like this, but it really shines when you have a very complex data set with different types that have different views, and different user interactions. Each type can have a separate ViewHolder, and each ViewHolder knows how to display its data, and how to pass click events up the chain. Furthermore your Adapter can focus on what it does best: adapting list items to view holders. It doesn’t have to bind each individual field. It can pass the whole item to the respective ViewHolder, and call it a day.</p><p>Oh and one more thing. Another really awesome thing you can do now is reuse your ViewHolders. Perhaps you have a few different Activities that display the same kinds of data, but in different formats. This ViewHolder can pull double duty as long as it has the same view ids to work with.</p><p><a href="https://gist.github.com/jonfhancock/c3adc35d39f4473a398005dd40e17e4a">Have a look at the finished code here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82e6f73f630c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jon-f-hancock/your-viewholders-are-dumb-make-em-not-dumb-82e6f73f630c">Your ViewHolders Could Be Doing So Much More</a> was originally published in <a href="https://medium.com/jon-f-hancock">Jon F Hancock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bash your way to better Android Development]]></title>
            <link>https://medium.com/jon-f-hancock/bash-your-way-to-better-android-development-1169bc3e0424?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/1169bc3e0424</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Mon, 24 Oct 2016 21:39:52 GMT</pubDate>
            <atom:updated>2016-10-25T16:44:45.660Z</atom:updated>
            <content:encoded><![CDATA[<p>When I work on Android projects, I usually have multiple devices connected. A blend of emulators and physical devices is great for checking app behavior. It also makes most of the <em>adb</em> command line actions useless. A few bash snippets can really save the day.</p><h3>Using adb -s</h3><p>For all of the commands we care about here, <em>adb</em> can easily perform the action on one device at a time if you supply the <em>-s</em> option and the identifier for the device you want to operate on. We want to operate on all devices, so we have to get the list of identifiers to work with. That takes a lot of ugly looking code, so let’s work through all of that first. Let’s start with the command we know: <em>adb</em>.</p><pre>$ adb devices<br>List of devices attached<br>ZY2222NP55 device<br>192.168.56.101:5555 device</pre><p>When we run <em>adb devices</em>, we can see the list of attached devices and a little bit of detail about them. Here I have a physical device, and a Genymotion emulator. This output is not ideal for looping over with a bash command though because of that extra data e.g. “device” and “List of devices attached” Let’s deal with these problems one at a time.</p><h3>Using tail -n</h3><p>First up is “List of Attached devices”. We can’t use that for anything. It’s just informational. So we’ll use <em>tail</em> to remove the first line. Actually two lines. The first one is just a newline. The second is “List of devices attached.”</p><pre>$ adb devices | tail -n +2<br>ZY2222NP55 device<br>192.168.56.101:5555 device</pre><h3>Using cut -sf</h3><p>Better already! Now we need to get rid of those pesky “ device” bits. For that, we’ll use <em>cut</em>. <em>Cut</em> let’s us loop over the lines provided, and remove certain parts of each line. We’ll cut the last word and any white space off the end of each line.</p><pre>$ adb devices | tail -n +2 | cut -sf -1<br>ZY2222NP55<br>192.168.56.101:5555</pre><p>Now that looks like something we can use! We now have a list of nothing but identifiers that <em>adb</em> can work with given the <em>-s</em> option. We can do stuff like:</p><pre>adb -s ZY2222NP55 install -r MyAppRelease.apk</pre><p>So now let’s figure out the best way to loop over this list of devices and operate on each of them with a single command. For that, <em>xargs</em> is the way to go.</p><h3>Using xargs -I</h3><p>Given the <em>-I</em> option, <em>xargs</em> will perform an action for each line of text that we feed into it. We can give the line a variable name to use in commands that <em>xargs</em> can execute.</p><pre>$ adb devices | tail -n +2 | cut -sf -1 | xargs -I X echo X aw yiss<br>ZY2222NP55 aw yiss<br>192.168.56.101:5555 aw yiss</pre><p>We can see here that we have told <em>xargs</em> to take each line of text (each identifier), and refer to it as <em>X</em>. Then execute the <em>echo</em> command with the identifier and the string “ aw yiss”. And <em>xargs</em> happily obliges.</p><h3>Bringing it all together</h3><p>Now that we understand how <em>xargs</em> works, we can use it in combination with <em>adb -s</em> to get some information about each device. Let’s use the <em>adb shell getprop ro.build.version.release</em> command to find the Android version of each device.</p><pre>$ adb devices | tail -n +2 | cut -sf -1 | xargs -I X adb -s X shell getprop ro.build.version.release<br>6.0<br>6.0</pre><p>Nice! We can see that they’re both running Marshmallow. Now we’re ready to execute any arbitrary command on every attached device! We just need two more things to make this user friendly.</p><h3>Using alias</h3><p>First, we need a shorthand for executing all this tail/cut/xargs nonsense. For that we use <em>alias</em>. Alias is really simple to use. It lets you define a new command, and have that command execute whatever comes after the <em>=</em> operator.</p><pre>$ alias tellMeMore=echo<br>$ tellMeMore &quot;hi there&quot;<br>hi there</pre><p>Now on my system, <em>tellMeMore</em> works exactly like <em>echo</em>.</p><h3>Using bash command line arguments</h3><p>Now we need a way to pass extra data to the command like the file name of an apk to install. Fortunately bash takes care of that for us. You can just use <em>$1</em> to reference the first non-whitespace string after the command itself as a variable.</p><p>That brings us to our first fully formed alias!</p><h3>Install an apk on all devices</h3><pre>alias apkinstall=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X install -r $1&quot;</pre><p>Android Studio makes it easy enough to deploy to multiple attached devices, but what if you have some other apk to install? Something you downloaded from a third party? After creating the alias above, you can invoke your new command, passing a path to an apk, and it will install it onto all attached devices. e.g.</p><pre>$ apkinstall ~/Downloads/MyAppRelease.apk</pre><p>Pretty painless!</p><h3>Uninstall a package from all devices</h3><p>Now what if we want to <em>uninstall</em> that app? Well annoyingly enough we have to know the package name, but that’s no different from using <em>adb uninstall </em>anyway.</p><pre>alias rmapp=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X uninstall $1&quot;</pre><p>This command will remove the supplied application from all attached devices. e.g.</p><pre>$ rmapp com.example.myapp</pre><h3>Clear data on all devices</h3><p>Sometimes you want to leave the app installed but clear all of its data. Here’s a handy one for that.</p><pre>alias clearapp=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell pm clear $1&quot;</pre><p>Now you can launch the app as if it were a fresh install really quickly after running:</p><pre>$ clearapp com.example.myapp</pre><h3>Launch a deep link on all devices</h3><p>Now the next one is my favorite when I want to launch a deep link on all attached devices.</p><pre>alias startintent=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell am start $1&quot;</pre><p>I often find when I’m testing out intent filters for urls, I want to launch urls frequently and not bother with clicking a link in the browser on all of these devices. So I supply the url to the command, and watch it go. e.g.</p><pre>$ startintent https://twitter.com/JonFHancock</pre><h3>Setting up your .bash_profile</h3><p>Finally, to make this all reusable even after rebooting your computer (aliases only last through the current session), we have to add these to your <em>.bash_profile. </em>You might or might not already have a .bash_profile, so let’s make sure we append to it rather than overwriting it. Just open a terminal, and run the following command</p><pre>touch .bash_profile &amp;&amp; open .bash_profile</pre><p>This will create it if it doesn’t already exist, and open it in a text editor either way. Now just copy and paste all of the aliases into it, save, and close.</p><pre>alias startintent=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell am start $1&quot;<br>alias apkinstall=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X install -r $1&quot;<br>alias rmapp=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X uninstall $1&quot;<br>alias clearapp=&quot;adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell pm clear $1&quot;</pre><p>So what shortcuts do you like to use from the command line? Share your aliases in the comments!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1169bc3e0424" width="1" height="1" alt=""><hr><p><a href="https://medium.com/jon-f-hancock/bash-your-way-to-better-android-development-1169bc3e0424">Bash your way to better Android Development</a> was originally published in <a href="https://medium.com/jon-f-hancock">Jon F Hancock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Speaking as an Introvert…]]></title>
            <link>https://medium.com/@jonfhancock/speaking-as-an-introvert-742f4c4218ca?source=rss-4c3e591d8822------2</link>
            <guid isPermaLink="false">https://medium.com/p/742f4c4218ca</guid>
            <category><![CDATA[introvert]]></category>
            <category><![CDATA[books]]></category>
            <dc:creator><![CDATA[Jon F Hancock]]></dc:creator>
            <pubDate>Wed, 28 Oct 2015 04:44:52 GMT</pubDate>
            <atom:updated>2015-10-28T04:44:52.429Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I like listening better than talking. I’m not sure that anybody cares about what I have to say. I don’t even <strong>have</strong> anything to say. I’m too anxious to even <strong>write</strong> something public, much less speak it aloud. I write comments on social media posts, and then delete them because it sounds stupid once I’m done. I’m way too introverted to speak publicly.</blockquote><p>Yeah. I’ve been there. I’m still there sometimes. Fear of Public Speaking is incredibly common in the United States, but that’s not really what I’m talking about. Introversion goes deeper than that. It underlies everything we do. Introversion can make you anxious about speaking to two people in a completely comfortable setting. Introversion can also make you listen carefully and consider what you want to say. It’s not all bad.</p><p>Introversion is treated like something that must be cured. Introverts are told to “break out of your shell,” and “show us who you really are.” We’re not in a shell. This <em>really is</em> who we are. It wasn’t easy for me to understand this. For a long time I thought something was wrong with me because I didn’t like to speak up in class, or because I avoided any kind of conflict. It wasn’t until I read <a href="http://amzn.com/0307352153"><em>Quiet: The Power of Introverts in a World That Can’t Stop Talking</em></a> that I realized that nothing is wrong with me. I’m useful and valuable just the way I am. I still have important knowledge to share, and it is unfair to the world if I keep it to myself.</p><p>I realize that last line sounds like egomania or at least <a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect">Dunning-Kruger Effect</a>. I think introversion lends itself to <a href="https://en.wikipedia.org/wiki/Impostor_syndrome">impostor syndrome</a>. I have found that a touch of egomania helps to combat my own impostor syndrome.</p><p>In <em>Quiet</em>, Susan Cain covers her own experiences, the American Civil Rights Movement, the beginnings of Apple Computer, Evangelical Churches, life at Harvard School of Business, and the public education system. She praises some of the world’s great introverts, and highlights the ways that their introversion helped them achieve greatness.</p><p>Finally Cain addresses public speaking from her own perspective. She admits to anxiety. She admits to needing a little alcohol to get through it. She admits to feeling intimidated by a task that is in the natural realm of extroverts. But she pushes through, and succeeds at presentations. She also succeeds at writing a powerful, and motivational book.</p><p><em>Quiet</em> is a must read for everyone. If you are an introvert, it will empower you. If you are an extrovert, it will help you understand the introverts around you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=742f4c4218ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>