Fixed
Status Update
Comments
il...@google.com <il...@google.com>
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #2
I have the same issue. There should be a built in method for setting title dynamically.
le...@gmail.com <le...@gmail.com> #3
I would expect a simple API inside the navigation architecture as this is quite a common design requirement
le...@gmail.com <le...@gmail.com> #4
To me, it is perfectly reasonable to remove the `android:label` attribute from the nav_graph.xml and set the title manually based on the arguments bundle.
le...@gmail.com <le...@gmail.com> #5
I'm currently working around this limitation by adding an "onNavigatedListener" to my root Activity and using the "destination.id " property against a lookup mapping to a desired title:
private val onNavigatedListener: (NavController, NavDestination) -> Unit = { _, destination ->
this.title = titleLookup[destination.id ]
}
private val onNavigatedListener: (NavController, NavDestination) -> Unit = { _, destination ->
this.title = titleLookup[
}
le...@gmail.com <le...@gmail.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit a958e3d36aeca8767d1c3cb53caa55ba3dd1c65d
Author: Ian Lake <ilake@google.com>
Date: Wed Nov 28 16:06:01 2018
Allow {argName} parameterized labels
Support parameterized labels similarly
to how ActivityNavigator uses dataPattern by
using {argName} blocks in the label.
Test: testapp works
BUG: 80267266
Change-Id: I923f3a6e11662c4364d4b3f0757361edea016cec
M navigation/integration-tests/testapp/src/main/res/navigation/nav_main.xml
M navigation/integration-tests/testapp/src/main/res/values/strings.xml
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnNavigatedListener.java
https://android-review.googlesource.com/837143
https://goto.google.com/android-sha1/a958e3d36aeca8767d1c3cb53caa55ba3dd1c65d
Branch: androidx-master-dev
commit a958e3d36aeca8767d1c3cb53caa55ba3dd1c65d
Author: Ian Lake <ilake@google.com>
Date: Wed Nov 28 16:06:01 2018
Allow {argName} parameterized labels
Support parameterized labels similarly
to how ActivityNavigator uses dataPattern by
using {argName} blocks in the label.
Test: testapp works
BUG: 80267266
Change-Id: I923f3a6e11662c4364d4b3f0757361edea016cec
M navigation/integration-tests/testapp/src/main/res/navigation/nav_main.xml
M navigation/integration-tests/testapp/src/main/res/values/strings.xml
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnNavigatedListener.java
Description
Component used: SavedState
Version used: 1.2.0-alpha02
The docs on do not explain the responsibilities and contract that the owner has on how they should implement .
SavedStateRegistryOwner
SavedStateRegistryOwner
or when they should call the methods onSavedStateRegistryController
Ideally the class docs should talk through:
performAttach()
should be called only once, usually as part of the initialization of the owner. It must be called on the main thread.performRestore
should be called unconditionally (either withnull
if no state is being restored or theBundle
of state to restore) either directly before moving theLifecycle
toCREATED
or as part of aLifecycleObserver
that is added as part of the initialization of the owner.performSave()
must be called. The Bundle saved there should be what is later sent toperformRestore()
.