Fixed
Status Update
Comments
fs...@gmail.com <fs...@gmail.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
yb...@google.com <yb...@google.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
de...@gmail.com <de...@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
yb...@google.com <yb...@google.com> #7
had a revert the change for a downsteram breakage. working on it.
Description
Version used: 1.0
Devices/Android versions reproduced on: NA
I have one entity that contains a set of enums. For example:
@Entity
data class Person(
@field:PrimaryKey val id: Int,
val name: String,
val favouriteDays: Set<Day>)
enum class Day {
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY,
SUNDAY
}
I want to store this entity in a single table. In many cases, especially with enums, we could use a single bit mask to save the list as a number in the database.
Here's one example of what I wanted to do:
object DayCollectionTypeConverter {
@JvmStatic
@TypeConverter
fun daysConverter(days: Set<Day>): Int {
var value = 0
for (day in days) {
value += (1 shl day.ordinal)
}
return value
}
@JvmStatic
@TypeConverter
fun daysConverter(value: Int): Set<Day> {
val set = mutableSetOf<Day>()
for (day in Day.values()) {
if (value and 1 shl day.ordinal != 0) {
set.add(day)
}
}
return set
}
}
That code doesn't work as intended because @TypeConverter would allow me to convert one Day object, but not a collection (or set, list, etc) of Days.
I suggest a new annotation is created so the developer can specify how to save a Collection into a single column in the same table.