Status Update
Comments
al...@google.com <al...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
al...@google.com <al...@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
al...@google.com <al...@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
ia...@gmail.com <ia...@gmail.com> #6
Is there a reason you needed to change any part of the public API surface? Given that the annotation itself isn't part of the public API, couldn't you have just renamed the IntDef annotation class?
E.g.,
public object WatchFaceType {
/* The WatchFace has an analog time display. */
public const val ANALOG: Int = 0
/* The WatchFace has a digital time display. */
public const val DIGITAL: Int = 1
}
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
@IntDef(value = [WatchFaceType.DIGITAL, WatchFaceType.ANALOG])
public annotation class WatchFaceTypes
al...@google.com <al...@google.com> #7
OK if we can rename the IntDefs that does sound better.
al...@google.com <al...@google.com>
al...@google.com <al...@google.com> #8
Oops I'm probably going to confuse the tooling here. I landed a follow up patch:
ia...@gmail.com <ia...@gmail.com> #9
Thanks so much - that follow up change looks great! I'll be sure to test it once the next release comes out.
Description
Component used: Wear-Watchface
Version used: 1.2.0-alpha08 or higher
After upgrading to Wear Watchface 1.2.0-alpha08 or higher, I noticed an error in Android Studio on both the
WatchFaceType
andCanvasType
integers that they should only be used within the androidx.wear.watchface library:It appears this is an unintended side effect of this CL that marked those annotation classes as
@RestrictTo(RestrictTo.Scope.LIBRARY)
.Would it be possible to separate the constants (which really could just be on a regular Kotlin
object
, rather than as part of acompanion object
of a restricted class) from the restricted annotation class (which it doesn't matter what the class name of that annotation actually is)?It is really annoying to have the red underlines in Android Studio and associated lint failures.
FWIW, I noticed that this does not apply to constants such as
WatchFaceStyle.PROTECT_STATUS_BAR
, but only to constants within apublic annotation class
that is restricted.From this search , it appears this issue affects:
WatchFaceType
constantsCanvasType
constantsTapType
constantsComplicationsSlotBoundsType
constants