Fix refresh

This commit is contained in:
Grishka 2024-11-07 14:04:40 +03:00
parent ff5e281db7
commit 8ea049c956
1 changed files with 12 additions and 10 deletions

View File

@ -442,16 +442,18 @@ public class ProfileFragment extends LoaderFragment implements ScrollableToTop,
if(savedFragment==null && isOwnProfile){
savedFragment=SavedPostsTimelineFragment.newInstance(accountID, account, false);
}
pager.getAdapter().notifyDataSetChanged();
pager.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
@Override
public boolean onPreDraw(){
pager.getViewTreeObserver().removeOnPreDrawListener(this);
pager.setCurrentItem(1, false);
tabbar.selectTab(tabbar.getTabAt(1));
return true;
}
});
if(!refreshing){
pager.getAdapter().notifyDataSetChanged();
pager.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
@Override
public boolean onPreDraw(){
pager.getViewTreeObserver().removeOnPreDrawListener(this);
pager.setCurrentItem(1, false);
tabbar.selectTab(tabbar.getTabAt(1));
return true;
}
});
}
super.dataLoaded();
}