<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ui on Haoxiqiang&#39;s Blog</title>
    <link>https://blog.substitute.tech/en/tags/ui/</link>
    <description>Recent content in Ui on Haoxiqiang&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Wed, 16 Dec 2015 18:15:33 +0000</lastBuildDate>
    <atom:link href="https://blog.substitute.tech/en/tags/ui/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Tree View Menu with RecyclerView</title>
      <link>https://blog.substitute.tech/en/posts/treeview%E6%A0%91%E5%BD%A2%E8%8F%9C%E5%8D%95/</link>
      <pubDate>Wed, 16 Dec 2015 18:15:33 +0000</pubDate>
      <guid>https://blog.substitute.tech/en/posts/treeview%E6%A0%91%E5%BD%A2%E8%8F%9C%E5%8D%95/</guid>
      <description>&lt;p&gt;I had long wanted to write a tree view demo. Previously, I used &lt;code&gt;TreeViewList&lt;/code&gt; (a &lt;code&gt;ListView&lt;/code&gt; wrapper) or &lt;code&gt;ExpandableListView&lt;/code&gt; for multi-level menus. Eventually I realized there is no need for custom views &amp;ndash; just use &lt;code&gt;RecyclerView&lt;/code&gt; and manage the data flattening yourself.&lt;/p&gt;
&lt;p&gt;The core idea: recursively flatten a nested data structure into a linear list, then use &lt;code&gt;notifyItemRangeInserted&lt;/code&gt; / &lt;code&gt;notifyItemRangeRemoved&lt;/code&gt; to handle expand and collapse.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
