Select "timeline" tab in profiles by default
This commit is contained in:
parent
d3fe7857b7
commit
cfabe47e10
|
@ -57,8 +57,6 @@ public class AccountTimelineFragment extends StatusListFragment{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doLoadData(int offset, int count){
|
protected void doLoadData(int offset, int count){
|
||||||
if(user==null) // TODO figure out why this happens
|
|
||||||
return;
|
|
||||||
currentRequest=new GetAccountStatuses(user.id, offset>0 ? getMaxID() : null, null, count, filter)
|
currentRequest=new GetAccountStatuses(user.id, offset>0 ? getMaxID() : null, null, count, filter)
|
||||||
.setCallback(new SimpleCallback<>(this){
|
.setCallback(new SimpleCallback<>(this){
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -355,6 +355,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||||
args.putString("account", accountID);
|
args.putString("account", accountID);
|
||||||
args.putParcelable("profileAccount", Parcels.wrap(account));
|
args.putParcelable("profileAccount", Parcels.wrap(account));
|
||||||
args.putBoolean("__is_tab", true);
|
args.putBoolean("__is_tab", true);
|
||||||
|
args.putBoolean("noAutoLoad", true);
|
||||||
featuredFragment.setArguments(args);
|
featuredFragment.setArguments(args);
|
||||||
timelineFragment=AccountTimelineFragment.newInstance(accountID, account, true);
|
timelineFragment=AccountTimelineFragment.newInstance(accountID, account, true);
|
||||||
aboutFragment=new ProfileAboutFragment();
|
aboutFragment=new ProfileAboutFragment();
|
||||||
|
@ -376,10 +377,8 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||||
pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback(){
|
pager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback(){
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position){
|
public void onPageSelected(int position){
|
||||||
if(position==0)
|
|
||||||
return;
|
|
||||||
Fragment _page=getFragmentForPage(position);
|
Fragment _page=getFragmentForPage(position);
|
||||||
if(_page instanceof BaseRecyclerFragment<?> page){
|
if(_page instanceof BaseRecyclerFragment<?> page && page.isAdded()){
|
||||||
if(!page.loaded && !page.isDataLoading())
|
if(!page.loaded && !page.isDataLoading())
|
||||||
page.loadData();
|
page.loadData();
|
||||||
}
|
}
|
||||||
|
@ -392,6 +391,8 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||||
refreshLayout.setEnabled(state!=ViewPager2.SCROLL_STATE_DRAGGING);
|
refreshLayout.setEnabled(state!=ViewPager2.SCROLL_STATE_DRAGGING);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
pager.setCurrentItem(1, false);
|
||||||
|
tabbar.selectTab(tabbar.getTabAt(1));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1002,6 +1003,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
||||||
holder.itemView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
|
holder.itemView.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener(){
|
||||||
@Override
|
@Override
|
||||||
public boolean onPreDraw(){
|
public boolean onPreDraw(){
|
||||||
|
getChildFragmentManager().executePendingTransactions();
|
||||||
if(fragment.isAdded()){
|
if(fragment.isAdded()){
|
||||||
holder.itemView.getViewTreeObserver().removeOnPreDrawListener(this);
|
holder.itemView.getViewTreeObserver().removeOnPreDrawListener(this);
|
||||||
applyChildWindowInsets();
|
applyChildWindowInsets();
|
||||||
|
|
Loading…
Reference in New Issue