/** * create data-binding adapter for target data. * * @param list the list data to show in {@linkplain RecyclerView}. * @param mayRemoveOrAddItem true if you may want to remove/add item. false otherwise. * this is help of data-binding, if you really want to remove/add item. */ public DataBindingRecyclerAdapter(List<T> list, boolean mayRemoveOrAddItem) { this.mItemManager = new AdapterItemManager<T>(this, this, list); if (mayRemoveOrAddItem) { mItemManager.setAdapterDataObserver2(new InternalDataObserver()); } Gps gps = DataMediatorFactory.createGps(getActuallyParameterClass()); this.mGDM = gps == null ? null : GroupDataManager.of(mBinderMap, gps.getGroupProperties()); } @SuppressWarnings("unchecked")