You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you may check these method:
1.public void selectTab(int newPosition, boolean callListener){ selectTabInternal(newPosition, false, callListener, callListener); }
2. private void selectTabInternal(int newPosition, boolean firstTab, boolean callListener, boolean forcedSelection) { ... if (callListener) { sendListenerCall(oldPosition, newPosition, forcedSelection); } }
3.private void sendListenerCall(int oldPosition, int newPosition, boolean forcedSelection) { if (mTabSelectedListener != null) { if (forcedSelection) { mTabSelectedListener.onTabSelected(newPosition); } else { if (oldPosition == newPosition) { mTabSelectedListener.onTabReselected(newPosition); } else { mTabSelectedListener.onTabSelected(newPosition); if (oldPosition != -1) { mTabSelectedListener.onTabUnselected(oldPosition); } } } } }
selectTab(xxx,true) call sendListenerCall(xxx,xxx,true), that only callback
onTabSelected
selectTab(xxx,false) cannot access sendListenerCall().only if call sendListenerCall(xx,xx,false) that callback onTabSelected, onTabUnselected, onTabReselected.
you seems to not figure out my last issues,
The text was updated successfully, but these errors were encountered:
you may add this method in BottomNavigationBar.java
public void selectTab(int newPosition, boolean callListener, boolean forcedSelection) {
selectTabInternal(newPosition, false, callListener, forcedSelection);
}
and call this method selectTab(position,true,false);
you may check these method:
1.
public void selectTab(int newPosition, boolean callListener){ selectTabInternal(newPosition, false, callListener, callListener); }
2.
private void selectTabInternal(int newPosition, boolean firstTab, boolean callListener, boolean forcedSelection) { ... if (callListener) { sendListenerCall(oldPosition, newPosition, forcedSelection); } }
3.
private void sendListenerCall(int oldPosition, int newPosition, boolean forcedSelection) { if (mTabSelectedListener != null) { if (forcedSelection) { mTabSelectedListener.onTabSelected(newPosition); } else { if (oldPosition == newPosition) { mTabSelectedListener.onTabReselected(newPosition); } else { mTabSelectedListener.onTabSelected(newPosition); if (oldPosition != -1) { mTabSelectedListener.onTabUnselected(oldPosition); } } } } }
selectTab(xxx,true) call sendListenerCall(xxx,xxx,true), that only callback
onTabSelected
selectTab(xxx,false) cannot access sendListenerCall().only if call sendListenerCall(xx,xx,false) that callback onTabSelected, onTabUnselected, onTabReselected.
you seems to not figure out my last issues,
The text was updated successfully, but these errors were encountered: