<?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>Recyclerview on Haoxiqiang&#39;s Blog</title>
    <link>https://blog.substitute.tech/tags/recyclerview/</link>
    <description>Recent content in Recyclerview on Haoxiqiang&#39;s Blog</description>
    <generator>Hugo</generator>
    <language>zh</language>
    <lastBuildDate>Wed, 16 Dec 2015 18:15:33 +0000</lastBuildDate>
    <atom:link href="https://blog.substitute.tech/tags/recyclerview/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>RecyclerView 实现树形菜单</title>
      <link>https://blog.substitute.tech/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/posts/treeview%E6%A0%91%E5%BD%A2%E8%8F%9C%E5%8D%95/</guid>
      <description>&lt;p&gt;很早想写这样一个 Demo。以前实现树形菜单使用 &lt;code&gt;TreeViewList&lt;/code&gt;（继承 &lt;code&gt;ListView&lt;/code&gt; 的封装），或者用 &lt;code&gt;ExpandableListView&lt;/code&gt; 实现多级菜单。后来发现根本不需要自定义控件——直接使用 &lt;code&gt;RecyclerView&lt;/code&gt;，只需要控制数据源的展平转换即可。&lt;/p&gt;
&lt;p&gt;核心思路：以递归方式将嵌套数据结构展平为线性列表，通过 &lt;code&gt;notifyItemRangeInserted&lt;/code&gt; / &lt;code&gt;notifyItemRangeRemoved&lt;/code&gt; 控制展开和收起。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
