Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 6bc825b3ce7715c6e244f2273cd2a442b96cd4bc
Author: Ian Lake <ilake@google.com>
Date: Wed Jun 02 16:06:46 2021
Hide ActionBar Up Icon on top level destinations
When using the setupActionBarWithNavController()
method, just setting the up indicator to null
isn't enough to remove the Up icon - we need
to specifically call setDisplayHomeAsUpEnabled(false).
This fixes a regression when this class
was moved to Kotlin.
As part of this, moved to checkNotNull() around
nullable properties to better match the
expectations that these should never be null.
Test: tested in NavigationAdvancedSample
BUG: 189868637
Relnote: "Fixed a regression introduced in
[Navigation `2.4.0-alpha01`](#2.4.0-alpha01) where
`setupActionBarWithNavController()` would not
properly remove the Up icon when you are on a
top level destination."
Change-Id: I5d4439021161f544d664a822e1c422ff60c91e1b
M navigation/navigation-ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.kt
https://android-review.googlesource.com/1726132
Branch: androidx-main
commit 6bc825b3ce7715c6e244f2273cd2a442b96cd4bc
Author: Ian Lake <ilake@google.com>
Date: Wed Jun 02 16:06:46 2021
Hide ActionBar Up Icon on top level destinations
When using the setupActionBarWithNavController()
method, just setting the up indicator to null
isn't enough to remove the Up icon - we need
to specifically call setDisplayHomeAsUpEnabled(false).
This fixes a regression when this class
was moved to Kotlin.
As part of this, moved to checkNotNull() around
nullable properties to better match the
expectations that these should never be null.
Test: tested in NavigationAdvancedSample
BUG: 189868637
Relnote: "Fixed a regression introduced in
[Navigation `2.4.0-alpha01`](#2.4.0-alpha01) where
`setupActionBarWithNavController()` would not
properly remove the Up icon when you are on a
top level destination."
Change-Id: I5d4439021161f544d664a822e1c422ff60c91e1b
M navigation/navigation-ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.kt
il...@google.com <il...@google.com> #3
This has been fixed internally and will be available in Navigation 2.4.0-alpha03. You can verify this with the instructions on using snapshot builds at
Description
Summary:
The Up button is displayed on the action bar for root destinations.
Library:
AndroidX Navigation 2.4.0-alpha01
Description:
When using the AndroidX navigation version 2.4.0-alpha01 with the navigation view (to enable support for multiple backstacks, one per each root destination), the app bar shows the Up button for the root destinations. The expectation is that root destinations would not show the Up button.
This issue is a regression from converting class ActionBarOnDestinationChangedListener from Java to Kotlin in this commit:
the method setDisplayHomeAsUpEnabled should be called with FALSE when the icon is null.
This can be reproduced by using the navigation advanced sample from the architecture components, available here: