Browse Source

BottomNavBar: update deprecated method calls

renovate/org.robolectric-robolectric-4.x
Ammar Githam 4 years ago
parent
commit
7797ca3205
  1. 4
      app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java

4
app/src/main/java/awais/instagrabber/utils/NavigationExtensions.java

@ -63,7 +63,7 @@ public class NavigationExtensions {
selectedItemTag = graphIdToTagMap.get(bottomNavigationView.getSelectedItemId()); selectedItemTag = graphIdToTagMap.get(bottomNavigationView.getSelectedItemId());
final String firstFragmentTag = graphIdToTagMap.get(firstFragmentGraphId); final String firstFragmentTag = graphIdToTagMap.get(firstFragmentGraphId);
isOnFirstFragment = selectedItemTag != null && selectedItemTag.equals(firstFragmentTag); isOnFirstFragment = selectedItemTag != null && selectedItemTag.equals(firstFragmentTag);
bottomNavigationView.setOnNavigationItemSelectedListener(item -> {
bottomNavigationView.setOnItemSelectedListener(item -> {
if (fragmentManager.isStateSaved()) { if (fragmentManager.isStateSaved()) {
return false; return false;
} }
@ -169,7 +169,7 @@ public class NavigationExtensions {
private static void setupItemReselected(final BottomNavigationView bottomNavigationView, private static void setupItemReselected(final BottomNavigationView bottomNavigationView,
final SparseArray<String> graphIdToTagMap, final SparseArray<String> graphIdToTagMap,
final FragmentManager fragmentManager) { final FragmentManager fragmentManager) {
bottomNavigationView.setOnNavigationItemReselectedListener(item -> {
bottomNavigationView.setOnItemReselectedListener(item -> {
final String newlySelectedItemTag = graphIdToTagMap.get(item.getItemId()); final String newlySelectedItemTag = graphIdToTagMap.get(item.getItemId());
final Fragment fragmentByTag = fragmentManager.findFragmentByTag(newlySelectedItemTag); final Fragment fragmentByTag = fragmentManager.findFragmentByTag(newlySelectedItemTag);
if (fragmentByTag == null) { if (fragmentByTag == null) {

Loading…
Cancel
Save