Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
wo...@gmail.com <wo...@gmail.com> #3
Project: platform/frameworks/support
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: b/264018028
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
https://android-review.googlesource.com/2373449
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
pa...@gmail.com <pa...@gmail.com> #4
deleted
yb...@google.com <yb...@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
ya...@gmail.com <ya...@gmail.com> #6
I would like to implement this. I already started analysis and will come back with a rough design idea in a couple of days.
ya...@gmail.com <ya...@gmail.com> #7
After spending some time on analysis I created a design doc with API proposal. I described how an implementation could work as well. I've probably missed some cases so please take a look and comment.
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 7bd7c652fdb061d643b80f09ed3a2f1da8b12e23
Author: mzgreen <yairobbe@gmail.com>
Date: Sat Sep 19 06:02:23 2020
[GH] Add Provided Type Converter feature
This change introduces a new `@ProvidedTypeConverter` annotation that gives developers control over type converter instantiation so they can use external dependencies inside type converters. A type converter class annotated with `@ProvidedTypeConverter` won't be instantiated by Room. Room will expect such converters to be passed at runtime using new `builder.addTypeConverter()` method.
Design doc:https://docs.google.com/document/d/1nmXZUsSlH6WWsT3Duxnkd4LcAPZGcyVCwJe5scnh7HU/edit?usp=sharing
Test: Added `ProvidedTypeConverterTest`
Fixes: b/121067210
RelNote: Room can have provided type converter annotation which allow developers to take control over type converters instantiation
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/75 .
Resolves #75
Github-Pr-Head-Sha: 7977774c1e06737ef3de88b6a57f54cda1196030
GitOrigin-RevId: c9a9d960cf95ac6cb329d8509b11d992cc034350
Change-Id: Ie4fa505b36f8aa3c98091f60af9cbbdb10ca3f33
M room/common/api/current.txt
M room/common/api/public_plus_experimental_current.txt
M room/common/api/restricted_current.txt
A room/common/src/main/java/androidx/room/ProvidedTypeConverter.java
M room/compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/solver/types/CustomTypeConverterWrapper.kt
M room/compiler/src/main/kotlin/androidx/room/vo/CustomTypeConverter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
A room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ProvidedTypeConverterTest.java
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
M room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java
https://android-review.googlesource.com/1420128
Branch: androidx-master-dev
commit 7bd7c652fdb061d643b80f09ed3a2f1da8b12e23
Author: mzgreen <yairobbe@gmail.com>
Date: Sat Sep 19 06:02:23 2020
[GH] Add Provided Type Converter feature
This change introduces a new `@ProvidedTypeConverter` annotation that gives developers control over type converter instantiation so they can use external dependencies inside type converters. A type converter class annotated with `@ProvidedTypeConverter` won't be instantiated by Room. Room will expect such converters to be passed at runtime using new `builder.addTypeConverter()` method.
Design doc:
Test: Added `ProvidedTypeConverterTest`
Fixes:
RelNote: Room can have provided type converter annotation which allow developers to take control over type converters instantiation
This is an imported pull request from
Resolves #75
Github-Pr-Head-Sha: 7977774c1e06737ef3de88b6a57f54cda1196030
GitOrigin-RevId: c9a9d960cf95ac6cb329d8509b11d992cc034350
Change-Id: Ie4fa505b36f8aa3c98091f60af9cbbdb10ca3f33
M room/common/api/current.txt
M room/common/api/public_plus_experimental_current.txt
M room/common/api/restricted_current.txt
A room/common/src/main/java/androidx/room/ProvidedTypeConverter.java
M room/compiler/src/main/kotlin/androidx/room/processor/CustomConverterProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/processor/ProcessorErrors.kt
M room/compiler/src/main/kotlin/androidx/room/solver/types/CustomTypeConverterWrapper.kt
M room/compiler/src/main/kotlin/androidx/room/vo/CustomTypeConverter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/ClassWriter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DaoWriter.kt
M room/compiler/src/main/kotlin/androidx/room/writer/DatabaseWriter.kt
M room/compiler/src/test/data/daoWriter/output/ComplexDao.java
M room/compiler/src/test/data/daoWriter/output/DeletionDao.java
M room/compiler/src/test/data/daoWriter/output/UpdateDao.java
M room/compiler/src/test/data/daoWriter/output/WriterDao.java
M room/compiler/src/test/data/databasewriter/output/ComplexDatabase.java
A room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/test/ProvidedTypeConverterTest.java
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/DatabaseConfiguration.java
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
M room/testing/src/main/java/androidx/room/testing/MigrationTestHelper.java
Description
These converters of cause need an instance of moshi.
It would be great if you could let the room builder take converters so one can properly inject the converters dependencies.
Right now the "hack" that you see on many stackoverflow posts is that people use a static reference to the dagger component.
The api could look like this:
@Provides
@JvmStatic
@Singleton
fun provideAppDb(context: Context, migrations: List<@JvmSuppressWildcards Migration>, xConverter : XConverter): AppDb {
return Room.databaseBuilder(context, AppDb::class.java, "repo")
.addMigrations(*migrations.toTypedArray())
.addConverter(xConverter)
.build()
}