Fixed
Status Update
Comments
ib...@google.com <ib...@google.com>
ju...@gmail.com <ju...@gmail.com> #2
Activity destinations should be considered exit points for your navigation graph - they are not part of the NavController's back stack and therefore not being sent to OnNavigatedListeners is working as intended.
ib...@google.com <ib...@google.com> #3
Thank you for your explanation, but although that is the intended behavior, it is still confusing.
In my opinion, the developer expects to be notified when any navigation action defined in the graph is performed, regardless the destination.
Although that action is considered an exit point, it is an action defined within the graph and it is indeed a navigation action happening in that graph, so I don't understand why it is not notified to the "OnNavigated" listener when it has indeed navigated, regardless if it affects or not the back stack.
I that is the intended behaviour, then it should be rather called something like "NavController.OnBackStackChangedListener".
In my opinion, the developer expects to be notified when any navigation action defined in the graph is performed, regardless the destination.
Although that action is considered an exit point, it is an action defined within the graph and it is indeed a navigation action happening in that graph, so I don't understand why it is not notified to the "OnNavigated" listener when it has indeed navigated, regardless if it affects or not the back stack.
I that is the intended behaviour, then it should be rather called something like "NavController.OnBackStackChangedListener".
ju...@gmail.com <ju...@gmail.com> #4
Yeah, naming is hard :)
Right now, NavController.OnNavigatedListener gives you a NavDestination that always equals navController.getCurrentDestination(). It doesn't give you what action you triggered, arguments, or anything else (including operations that don't change getCurrentDestination(), such as singleTop actions or activity destinations), so I could definitely see this more as a OnDestinationChangedListener.
I'll reopen this to track renaming the listener to something more appropriate to what it actually is doing or updating the documentation to make its role more clear.
Right now, NavController.OnNavigatedListener gives you a NavDestination that always equals navController.getCurrentDestination(). It doesn't give you what action you triggered, arguments, or anything else (including operations that don't change getCurrentDestination(), such as singleTop actions or activity destinations), so I could definitely see this more as a OnDestinationChangedListener.
I'll reopen this to track renaming the listener to something more appropriate to what it actually is doing or updating the documentation to make its role more clear.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit fcc0c6059e31f7e53396db8cce0ac62d76a1c2d8
Author: Ian Lake <ilake@google.com>
Date: Fri Nov 30 13:14:58 2018
Rename OnNavigatedListener
The callback to onNavigated() is not only
called in result to a navigate() call, but
is actually called whenever any navigation
event happens, be it single top navigation
events or popBackStack events.
Therefore the name should reflect what is
actually happening.
Test: existing tests still pass
BUG: 118670572
Change-Id: Iad45d646e859428a4f744992821916906ca2d34f
M navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
M navigation/runtime/api/1.0.0-alpha08.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
M navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
https://android-review.googlesource.com/838931
https://goto.google.com/android-sha1/fcc0c6059e31f7e53396db8cce0ac62d76a1c2d8
Branch: androidx-master-dev
commit fcc0c6059e31f7e53396db8cce0ac62d76a1c2d8
Author: Ian Lake <ilake@google.com>
Date: Fri Nov 30 13:14:58 2018
Rename OnNavigatedListener
The callback to onNavigated() is not only
called in result to a navigate() call, but
is actually called whenever any navigation
event happens, be it single top navigation
events or popBackStack events.
Therefore the name should reflect what is
actually happening.
Test: existing tests still pass
BUG: 118670572
Change-Id: Iad45d646e859428a4f744992821916906ca2d34f
M navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
M navigation/runtime/api/1.0.0-alpha08.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/ActionBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
M navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
ib...@google.com <ib...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 1a5551e0e3145b1e309577a1282d28fa1b14e956
Author: Ian Lake <ilake@google.com>
Date: Mon Dec 03 13:22:31 2018
Correct naming of add/removeOnDestinationChangedListener
Ensure that the add and remove methods
use the same naming convention as the
listener class itself
Test: ./gradlew bOS
BUG: 118670572
Change-Id: I71dd174f7abd3a870c12b26c0aef64ff1512ceea
M navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
M navigation/runtime/api/1.0.0-alpha08.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
M navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
https://android-review.googlesource.com/839441
https://goto.google.com/android-sha1/1a5551e0e3145b1e309577a1282d28fa1b14e956
Branch: androidx-master-dev
commit 1a5551e0e3145b1e309577a1282d28fa1b14e956
Author: Ian Lake <ilake@google.com>
Date: Mon Dec 03 13:22:31 2018
Correct naming of add/removeOnDestinationChangedListener
Ensure that the add and remove methods
use the same naming convention as the
listener class itself
Test: ./gradlew bOS
BUG: 118670572
Change-Id: I71dd174f7abd3a870c12b26c0aef64ff1512ceea
M navigation/integration-tests/testapp/src/main/java/androidx/navigation/testapp/NavigationActivity.kt
M navigation/runtime/api/1.0.0-alpha08.txt
M navigation/runtime/api/current.txt
M navigation/runtime/src/main/java/androidx/navigation/NavController.java
M navigation/ui/src/main/java/androidx/navigation/ui/AbstractAppBarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/CollapsingToolbarOnDestinationChangedListener.java
M navigation/ui/src/main/java/androidx/navigation/ui/NavigationUI.java
M navigation/ui/src/main/java/androidx/navigation/ui/ToolbarOnDestinationChangedListener.java
ap...@google.com <ap...@google.com> #7
We've renamed the listener to OnDestinationChangedListener to make it more clear that it is only called when NavController's getCurrentDestination() or its arguments change, precluding activity destinations.
na...@google.com <na...@google.com> #8
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.exifinterface:exifinterface:1.4.0-alpha01
67...@gmail.com <67...@gmail.com> #9
Comment has been deleted.
Description
Summary:
Using ExifInterface to call saveAttributes on a WebP file corrupts the WebP file, causing it to become invalid.
Steps to Reproduce:
Use ExifInterface to load a WebP file that does not contain a VP8X header. Call saveAttributes on the ExifInterface object. Attempt to open the resulting WebP file. Expected Result: The WebP file should remain valid and openable after saving attributes.
Actual Result: The WebP file becomes corrupted and cannot be opened properly.
Root Cause Analysis:
If the WebP file does not have a VP8X header, ExifInterface writes a new VP8X header.
When the WebP file's width or height is greater than 8191, the issue arises.
The following code causes the problem:
If the width or height is greater than 8191, left-shifting causes the sign bit to be lost, turning a '1' into a '0', which results in an incorrect width or height.
Environment