Status Update
Comments
do...@google.com <do...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #3
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
ap...@google.com <ap...@google.com> #4
ap...@google.com <ap...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
cl...@google.com <cl...@google.com> #6
Fixed internally and available in navigation-2.8.0-rc01
.
Note that Android Bundle is deeply integrated into the parsing of arguments by NavType and cannot be removed, hence non-instrumented tests will require robolectric in order to properly support bundles.
ap...@google.com <ap...@google.com> #7
Branch: androidx-main
commit df6f97f72af9fa61365b44af75905ddd9039bb26
Author: Clara Fok <clarafok@google.com>
Date: Tue Jun 18 10:47:42 2024
Update SavedStateHandleFactory kdoc
Clarify that android Bundles cannot be avoided at this stage and non-instrumented tests need to be run with robolectric.
Test: TH
Bug: 340966212
Relnote: "To use SavedStateHandle test factory in non-instrumented tests, robolectric is required. This is because android Bundle is necessarily integrated into the parsing of nav arguments."
Change-Id: I8047c1a2d2dff4cb2efd0452407287738f2ce157
M navigation/navigation-testing/src/main/java/androidx/navigation/testing/SavedStateHandleFactory.kt
do...@google.com <do...@google.com> #8
Thanks for doing this. Whilst this is technically an improvement, the fact remains that if you want to test a ViewModel which accepts navigation arguments you now need to introduce a dependency on Robolectric which is a fairly major blocker for many developers. Robolectric slows down tests and reduces test fidelity.
Is there no way of removing the Bundle
dependency? Or perhaps moving Bundle
into AndroidX?
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.8.0-beta04
androidx.navigation:navigation-testing:2.8.0-beta04
do...@google.com <do...@google.com> #10
I created a follow up bug to track the Android dependency forcing unit->instrumented tests for ViewModels.
Description
Component used: Navigation Version used: 2.8.0-beta01 Devices/Android versions reproduced on: all
aosp/3073537 introduced a new API for creating a
SavedStateHandle
using an object for the route parameter e.g.SavedStateHandle(route = MyDestination)
.Internally, this constructor relies on
android.net.Uri
which means that you can only call it from an instrumented test, not a unit test.This is undesirable since one of the use cases for this API is to be able to unit test ViewModels by passing them a
SavedStateHandle
containing a route.Example:https://github.com/android/nowinandroid/pull/1413/files#diff-bbcd9ff3a5be72096922a84b290125441e34d8183492cd27536e343a903579a8R57