Skip to content

Commit

Permalink
Apply default back behavior when a navigationBar object is missing in…
Browse files Browse the repository at this point in the history
… the arguments
  • Loading branch information
deepueg committed Sep 8, 2020
1 parent ccc0bc2 commit f962d96
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,13 @@ private boolean updateNavBar(@Nullable Bundle arguments) {
NavigationBar navigationBar = NavUtils.getNavBar(arguments);
if (navigationBar != null) {
updateNavBar(navigationBar);
return true;
} else {
return false;
ActionBar actionBar = getSupportActionBar();
if(actionBar != null) {
applyDefaultUpNavigation(actionBar);
}
}
return true;
}
return false;
}
Expand Down Expand Up @@ -379,7 +382,7 @@ public interface OnOptionsMenuUpdatedListener {
void onOptionsMenuUpdated(@NonNull Menu menu, @NonNull MenuInflater inflater);
}

private void updateNavBar(@NonNull NavigationBar navigationBar) {
private void updateNavBar(@Nullable NavigationBar navigationBar) {
Logger.d(TAG, "Updating nav bar: %s", navigationBar);
ActionBar actionBar = getSupportActionBar();
if (actionBar == null) {
Expand Down Expand Up @@ -430,6 +433,10 @@ private void updateHomeAsUpIndicator(@Nullable NavigationBarLeftButton leftButto
}

//Default action
applyDefaultUpNavigation(actionBar);
}

private void applyDefaultUpNavigation(@NonNull ActionBar actionBar) {
if (mFragment.getArguments() != null) {
if (mFragment.getArguments().getBoolean(ActivityDelegateConstants.KEY_MINI_APP_FRAGMENT_SHOW_UP_ENABLED)) {
Logger.d(TAG, "Enabling up indicator for component: %s", getReactComponentName());
Expand Down

0 comments on commit f962d96

Please sign in to comment.