/**
* Notify any registered observers that the data set has changed.
//通知所有的注册观察者数据已经发生改变
*
* <p>There are two different classes of data change events, item changes and structural
* changes. Item changes are when a single item has its data updated but no positional
* changes have occurred. Structural changes are when items are inserted, removed or moved
* within the data set.</p>
//指出两种不同的数据变更事件,item变更 和 结构变更,其中item变更只涉及item数据的更新不会发生位置的·变化; 结构变更指当item被插入,移除或移动的事件
*
* <p>This event does not specify what about the data set has changed, forcing
* any observers to assume that all existing items and structure may no longer be valid.
* LayoutManagers will be forced to fully rebind and relayout all visible views.</p>
*
//但是在notifyDataSetChanged中并不指定发生的是哪种数据变更事件,因此所有的观察者将认为当前所有存在的items和结构不在有效,LayoutManagers将被迫重新绑定和放松所有可见的视图
* <p><code>RecyclerView</code> will attempt to synthesize visible structural change events
* for adapters that report that they have {@link #hasStableIds() stable IDs} when
* this method is used. This can help for the purposes of animation and visual
* object persistence but individual item views will still need to be rebound
* and relaid out.</p>
*
* <p>If you are writing an adapter it will always be more efficient to use the more
* specific change events if you can. Rely on <code>notifyDataSetChanged()</code>
* as a last resort.</p>
//当你写一个适配器时,你能更有效的针对事件改变写出对应的的事件处理,notifyDataSetChanged时最后的选择
*
* @see #notifyItemChanged(int)
* @see #notifyItemInserted(int)
* @see #notifyItemRemoved(int)
* @see #notifyItemRangeChanged(int, int)
* @see #notifyItemRangeInserted(int, int)
* @see #notifyItemRangeRemoved(int, int)
*/
public final void notifyDataSetChanged() {
mObservable.notifyChanged();
}
/** * Notify any registered observers that the data set has changed.//通知所有的注册观察者数据已经发生改变 * * &lt;p&gt;There are two different classes of data change events, item changes and structural * changes....