Move logic for setting navigation_bar in layout