public class SomePagerAdapter extends FragmentStatePagerAdapter {
private ArrayList<Tab> tabs;
public ProfilePagerAdapter(FragmentManager fm) {
super(fm);
}
public ProfilePagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
if (tabs == null) return new LoadingFragment();
return tabs.get(position);
}
public void setTabs(ArrayList<Tab> tabs) {
this.tabs= tabs;
notifyDataSetChanged();
}
@Override
public int getItemPosition(Object object) {
return POSITION_NONE;
}
@Override
public int getCount() {
if (tabs == null) return 1;
return tabs.size();
}
@Override
public CharSequence getPageTitle(int position) {
return tabs.get(position).title;
}
}
@BindingAdapter("android:history")
public static void setHistory(RecyclerView recyclerView, ArrayList<History> history) {
((HistoryAdapter)recyclerView.getAdapter()).setHistory(history);
}
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:history="@{тут_твой_список_с_историей}"/>