Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ece1e0ac47be4572d97afef494a24827c014af57
Author: Nader Jawad <njawad@google.com>
Date: Mon Aug 24 20:47:20 2020
Fixed wrong constructor parameter order for Rect
Relnote: "Fixed issue where Rect function constructor
with Offset and radius would create the Rect in the
order of left, right, top, bottom instead of
left, top, right, bottom.
Removed deprecated companion methods on Rect in
favor of function constructors.
Added tests to verify methods in Rect.kt"
Change-Id: I0846006bd0ec7f1a0effd90490c93002b42e132b
Fixes: 165822356
Test: Added tests to RectTest
M compose/ui/ui-geometry/api/current.txt
M compose/ui/ui-geometry/api/public_plus_experimental_current.txt
M compose/ui/ui-geometry/api/restricted_current.txt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Rect.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RectTest.kt
https://android-review.googlesource.com/1409488
Branch: androidx-master-dev
commit ece1e0ac47be4572d97afef494a24827c014af57
Author: Nader Jawad <njawad@google.com>
Date: Mon Aug 24 20:47:20 2020
Fixed wrong constructor parameter order for Rect
Relnote: "Fixed issue where Rect function constructor
with Offset and radius would create the Rect in the
order of left, right, top, bottom instead of
left, top, right, bottom.
Removed deprecated companion methods on Rect in
favor of function constructors.
Added tests to verify methods in Rect.kt"
Change-Id: I0846006bd0ec7f1a0effd90490c93002b42e132b
Fixes: 165822356
Test: Added tests to RectTest
M compose/ui/ui-geometry/api/current.txt
M compose/ui/ui-geometry/api/public_plus_experimental_current.txt
M compose/ui/ui-geometry/api/restricted_current.txt
M compose/ui/ui-geometry/src/commonMain/kotlin/androidx/compose/ui/geometry/Rect.kt
M compose/ui/ui-geometry/src/test/kotlin/androidx/compose/ui/geometry/RectTest.kt
il...@google.com <il...@google.com> #3
Given that:
1) Most NavController usage is via a NavHostFragment with app:navGraph set, ensuring that the graph is already set
2) Programmatically constructed graphs will result in developers always calling setGraph before using the NavController
Calling getGraph() before a call to setGraph() is almost always a developer error that needs to be corrected, so throwing an IllegalStateException is acceptable.
Please file a new bug if you have a specific use case that would benefit from a maybeGetGraph() / hasGraph() type of API.
1) Most NavController usage is via a NavHostFragment with app:navGraph set, ensuring that the graph is already set
2) Programmatically constructed graphs will result in developers always calling setGraph before using the NavController
Calling getGraph() before a call to setGraph() is almost always a developer error that needs to be corrected, so throwing an IllegalStateException is acceptable.
Please file a new bug if you have a specific use case that would benefit from a maybeGetGraph() / hasGraph() type of API.
Description
NavController.getGraph is marked as @Nullable, though it seems that in default case it is @NonNull.
As Jake suggested, we probably should reshape API expose two versions Null/NonNull