Merge "Fix issue with ClassName when simple name contains '$'" into androidx-main
diff --git a/.github/workflows/update_prebuilts.yml b/.github/workflows/update_prebuilts.yml
index 0eff299..e6c5cde 100644
--- a/.github/workflows/update_prebuilts.yml
+++ b/.github/workflows/update_prebuilts.yml
@@ -23,6 +23,8 @@
uses: actions/checkout@v2
- name: "Run update prebuilt snapshot ids script"
shell: bash
+ # this does not update metalava because it needs to match the
+ # metalava buildId used by androidx
run: development/update_playground.sh
- name: "Check if anything changed"
shell: bash
diff --git a/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateCall.kt b/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateCall.kt
index ce28be8..0d4fe97 100644
--- a/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateCall.kt
+++ b/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateCall.kt
@@ -34,10 +34,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME: String = "actions.intent.CREATE_CALL"
-
/** A capability corresponding to actions.intent.CREATE_CALL */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = CreateCall.CAPABILITY_NAME)
class CreateCall private constructor() {
internal enum class SlotMetadata(val path: String) {
CALL_FORMAT("call.callFormat"),
@@ -178,6 +176,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [CreateCall] capability. */
+ const val CAPABILITY_NAME: String = "actions.intent.CREATE_CALL"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateMessage.kt b/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateMessage.kt
index 23f7b24..967a905 100644
--- a/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateMessage.kt
+++ b/appactions/interaction/interaction-capabilities-communication/src/main/java/androidx/appactions/interaction/capabilities/communication/CreateMessage.kt
@@ -35,10 +35,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME: String = "actions.intent.CREATE_MESSAGE"
-
/** A capability corresponding to actions.intent.CREATE_MESSAGE */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = CreateMessage.CAPABILITY_NAME)
class CreateMessage private constructor() {
internal enum class SlotMetadata(val path: String) {
TEXT("message.text"),
@@ -176,6 +174,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [CreateMessage] capability. */
+ const val CAPABILITY_NAME: String = "actions.intent.CREATE_MESSAGE"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetExerciseObservation.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetExerciseObservation.kt
index 103466c..8323ad5 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetExerciseObservation.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetExerciseObservation.kt
@@ -24,10 +24,8 @@
import androidx.appactions.interaction.capabilities.core.properties.Property
import java.time.LocalTime
-private const val CAPABILITY_NAME = "actions.intent.GET_EXERCISE_OBSERVATION"
-
/** A capability corresponding to actions.intent.GET_EXERCISE_OBSERVATION */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = GetExerciseObservation.CAPABILITY_NAME)
class GetExerciseObservation private constructor() {
internal enum class SlotMetadata(val path: String) {
START_TIME("exerciseObservation.startTime"),
@@ -98,6 +96,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [GetExerciseObservation] capability. */
+ const val CAPABILITY_NAME = "actions.intent.GET_EXERCISE_OBSERVATION"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetHealthObservation.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetHealthObservation.kt
index 5f93001..6c1975a 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetHealthObservation.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/GetHealthObservation.kt
@@ -24,10 +24,8 @@
import androidx.appactions.interaction.capabilities.core.properties.Property
import java.time.LocalTime
-private const val CAPABILITY_NAME = "actions.intent.GET_HEALTH_OBSERVATION"
-
/** A capability corresponding to actions.intent.GET_HEALTH_OBSERVATION */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = GetHealthObservation.CAPABILITY_NAME)
class GetHealthObservation private constructor() {
internal enum class SlotMetadata(val path: String) {
@@ -103,6 +101,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [GetHealthObservation] capability */
+ const val CAPABILITY_NAME = "actions.intent.GET_HEALTH_OBSERVATION"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/PauseExercise.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/PauseExercise.kt
index 51856a7..c641d2b 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/PauseExercise.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/PauseExercise.kt
@@ -24,10 +24,8 @@
import androidx.appactions.interaction.capabilities.core.properties.Property
import androidx.appactions.interaction.capabilities.core.properties.StringValue
-private const val CAPABILITY_NAME = "actions.intent.PAUSE_EXERCISE"
-
/** A capability corresponding to actions.intent.PAUSE_EXERCISE */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = PauseExercise.CAPABILITY_NAME)
class PauseExercise private constructor() {
internal enum class SlotMetadata(val path: String) {
NAME("exercise.name")
@@ -87,6 +85,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [PauseExercise] capability */
+ const val CAPABILITY_NAME = "actions.intent.PAUSE_EXERCISE"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/ResumeExercise.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/ResumeExercise.kt
index 2321ea7..2aa6b15 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/ResumeExercise.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/ResumeExercise.kt
@@ -24,10 +24,8 @@
import androidx.appactions.interaction.capabilities.core.properties.Property
import androidx.appactions.interaction.capabilities.core.properties.StringValue
-private const val CAPABILITY_NAME = "actions.intent.RESUME_EXERCISE"
-
/** A capability corresponding to actions.intent.RESUME_EXERCISE */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = ResumeExercise.CAPABILITY_NAME)
class ResumeExercise private constructor() {
internal enum class SlotMetadata(val path: String) {
NAME("exercise.name")
@@ -87,6 +85,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [ResumeExercise] capability */
+ const val CAPABILITY_NAME = "actions.intent.RESUME_EXERCISE"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StartExercise.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StartExercise.kt
index fe45625..fe43281 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StartExercise.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StartExercise.kt
@@ -25,10 +25,8 @@
import androidx.appactions.interaction.capabilities.core.properties.StringValue
import java.time.Duration
-private const val CAPABILITY_NAME = "actions.intent.START_EXERCISE"
-
/** A capability corresponding to actions.intent.START_EXERCISE */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StartExercise.CAPABILITY_NAME)
class StartExercise private constructor() {
internal enum class SlotMetadata(val path: String) {
NAME("exercise.name"),
@@ -103,6 +101,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StartExercise] capability */
+ const val CAPABILITY_NAME = "actions.intent.START_EXERCISE"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StopExercise.kt b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StopExercise.kt
index 31c7fe9..5ebdedd 100644
--- a/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StopExercise.kt
+++ b/appactions/interaction/interaction-capabilities-fitness/src/main/java/androidx/appactions/interaction/capabilities/fitness/fitness/StopExercise.kt
@@ -24,10 +24,8 @@
import androidx.appactions.interaction.capabilities.core.properties.Property
import androidx.appactions.interaction.capabilities.core.properties.StringValue
-private const val CAPABILITY_NAME = "actions.intent.STOP_EXERCISE"
-
/** A capability corresponding to actions.intent.STOP_EXERCISE */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StopExercise.CAPABILITY_NAME)
class StopExercise private constructor() {
internal enum class SlotMetadata(val path: String) {
NAME("exercise.name")
@@ -87,6 +85,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StopExercise] capability */
+ const val CAPABILITY_NAME = "actions.intent.STOP_EXERCISE"
// TODO(b/273602015): Update to use Name property from builtintype library.
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/CreateAlarm.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/CreateAlarm.kt
index b449a2c..1f69695 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/CreateAlarm.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/CreateAlarm.kt
@@ -36,10 +36,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.CREATE_ALARM"
-
/** A capability corresponding to actions.intent.CREATE_ALARM */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = CreateAlarm.CAPABILITY_NAME)
class CreateAlarm private constructor() {
internal enum class SlotMetadata(val path: String) {
SCHEDULE("alarm.alarmSchedule"),
@@ -214,6 +212,8 @@
class Confirmation internal constructor()
companion object {
+ /** Canonical name for [CreateAlarm] capability */
+ const val CAPABILITY_NAME = "actions.intent.CREATE_ALARM"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/DismissAlarm.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/DismissAlarm.kt
index 9b5d1da..bae20f5 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/DismissAlarm.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/DismissAlarm.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.DISMISS_ALARM"
-
/** A capability corresponding to actions.intent.DISMISS_ALARM */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = DismissAlarm.CAPABILITY_NAME)
class DismissAlarm private constructor() {
internal enum class SlotMetadata(val path: String) {
ALARM("alarm")
@@ -143,6 +141,8 @@
class Confirmation internal constructor()
companion object {
+ /** Canonical name for [DismissAlarm] capability */
+ const val CAPABILITY_NAME = "actions.intent.DISMISS_ALARM"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/PauseTimer.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/PauseTimer.kt
index 14f1cf4c..5619640 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/PauseTimer.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/PauseTimer.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.PAUSE_TIMER"
-
/** A capability corresponding to actions.intent.PAUSE_TIMER */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = PauseTimer.CAPABILITY_NAME)
class PauseTimer private constructor() {
internal enum class SlotMetadata(val path: String) {
TIMER("timer")
@@ -154,6 +152,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [PauseTimer] capability */
+ const val CAPABILITY_NAME = "actions.intent.PAUSE_TIMER"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResetTimer.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResetTimer.kt
index d4e20ed..709b970 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResetTimer.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResetTimer.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.RESET_TIMER"
-
/** A capability corresponding to actions.intent.RESET_TIMER */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = ResetTimer.CAPABILITY_NAME)
class ResetTimer private constructor() {
internal enum class SlotMetadata(val path: String) {
TIMER("timer")
@@ -151,6 +149,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [ResetTimer] capability */
+ const val CAPABILITY_NAME = "actions.intent.RESET_TIMER"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResumeTimer.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResumeTimer.kt
index d069208..63626e5 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResumeTimer.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/ResumeTimer.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.RESUME_TIMER"
-
/** A capability corresponding to actions.intent.RESUME_TIMER */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = ResumeTimer.CAPABILITY_NAME)
class ResumeTimer private constructor() {
internal enum class SlotMetadata(val path: String) {
TIMER("timer")
@@ -151,6 +149,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [ResumeTimer] capability */
+ const val CAPABILITY_NAME = "actions.intent.RESUME_TIMER"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/SnoozeAlarm.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/SnoozeAlarm.kt
index 2c98081..c2237a5 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/SnoozeAlarm.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/SnoozeAlarm.kt
@@ -32,10 +32,8 @@
import androidx.appactions.interaction.protobuf.Value
import java.time.Duration
-private const val CAPABILITY_NAME = "actions.intent.SNOOZE_ALARM"
-
/** A capability corresponding to actions.intent.SNOOZE_ALARM */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = SnoozeAlarm.CAPABILITY_NAME)
class SnoozeAlarm private constructor() {
internal enum class SlotMetadata(val path: String) {
DURATION("snoozeDuration"),
@@ -175,6 +173,8 @@
class Confirmation internal constructor()
companion object {
+ /** Canonical name for [SnoozeAlarm] capability */
+ const val CAPABILITY_NAME = "actions.intent.SNOOZE_ALARM"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java,
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StartTimer.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StartTimer.kt
index 3f1e930..fd95b6e 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StartTimer.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StartTimer.kt
@@ -30,10 +30,8 @@
import androidx.appactions.interaction.protobuf.Value
import java.time.Duration
-private const val CAPABILITY_NAME = "actions.intent.START_TIMER"
-
/** A capability corresponding to actions.intent.START_TIMER */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StartTimer.CAPABILITY_NAME)
class StartTimer private constructor() {
internal enum class SlotMetadata(val path: String) {
IDENTIFIER("timer.identifier"),
@@ -177,6 +175,8 @@
class Confirmation internal constructor()
companion object {
+ /** Canonical name for [StartTimer] capability */
+ const val CAPABILITY_NAME = "actions.intent.START_TIMER"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StopTimer.kt b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StopTimer.kt
index c41372e..5d123eb 100644
--- a/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StopTimer.kt
+++ b/appactions/interaction/interaction-capabilities-productivity/src/main/java/androidx/appactions/interaction/capabilities/productivity/StopTimer.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.STOP_TIMER"
-
/** A capability corresponding to actions.intent.STOP_TIMER */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StopTimer.CAPABILITY_NAME)
class StopTimer private constructor() {
internal enum class SlotMetadata(val path: String) {
TIMER("timer")
@@ -151,6 +149,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StopTimer] capability */
+ const val CAPABILITY_NAME = "actions.intent.STOP_TIMER"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartEmergencySharing.kt b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartEmergencySharing.kt
index 80e2583..3e86726 100644
--- a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartEmergencySharing.kt
+++ b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartEmergencySharing.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.START_EMERGENCY_SHARING"
-
/** A capability corresponding to actions.intent.START_EMERGENCY_SHARING */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StartEmergencySharing.CAPABILITY_NAME)
class StartEmergencySharing private constructor() {
class CapabilityBuilder :
Capability.Builder<
@@ -145,6 +143,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StartEmergencySharing] capability */
+ const val CAPABILITY_NAME = "actions.intent.START_EMERGENCY_SHARING"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(
diff --git a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartSafetyCheck.kt b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartSafetyCheck.kt
index e59813b..4dc3801 100644
--- a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartSafetyCheck.kt
+++ b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StartSafetyCheck.kt
@@ -38,10 +38,8 @@
import java.time.Duration
import java.time.ZonedDateTime
-private const val CAPABILITY_NAME = "actions.intent.START_SAFETY_CHECK"
-
/** A capability corresponding to actions.intent.START_SAFETY_CHECK */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StartSafetyCheck.CAPABILITY_NAME)
class StartSafetyCheck private constructor() {
internal enum class SlotMetadata(val path: String) {
DURATION("safetycheck.duration"),
@@ -225,6 +223,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StartSafetyCheck] capability */
+ const val CAPABILITY_NAME = "actions.intent.START_SAFETY_CHECK"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopEmergencySharing.kt b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopEmergencySharing.kt
index 7d1636a..2a77295 100644
--- a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopEmergencySharing.kt
+++ b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopEmergencySharing.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.STOP_EMERGENCY_SHARING"
-
/** A capability corresponding to actions.intent.STOP_EMERGENCY_SHARING */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StopEmergencySharing.CAPABILITY_NAME)
class StopEmergencySharing private constructor() {
class CapabilityBuilder :
Capability.Builder<
@@ -145,6 +143,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StopEmergencySharing] capability */
+ const val CAPABILITY_NAME = "actions.intent.STOP_EMERGENCY_SHARING"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(
diff --git a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopSafetyCheck.kt b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopSafetyCheck.kt
index cc29f26..47cbbaa 100644
--- a/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopSafetyCheck.kt
+++ b/appactions/interaction/interaction-capabilities-safety/src/main/java/androidx/appactions/interaction/capabilities/safety/StopSafetyCheck.kt
@@ -31,10 +31,8 @@
import androidx.appactions.interaction.protobuf.Struct
import androidx.appactions.interaction.protobuf.Value
-private const val CAPABILITY_NAME = "actions.intent.STOP_SAFETY_CHECK"
-
/** A capability corresponding to actions.intent.STOP_SAFETY_CHECK */
-@CapabilityFactory(name = CAPABILITY_NAME)
+@CapabilityFactory(name = StopSafetyCheck.CAPABILITY_NAME)
class StopSafetyCheck private constructor() {
class CapabilityBuilder :
Capability.Builder<
@@ -145,6 +143,8 @@
sealed interface ExecutionSession : BaseExecutionSession<Arguments, Output>
companion object {
+ /** Canonical name for [StopSafetyCheck] capability */
+ const val CAPABILITY_NAME = "actions.intent.STOP_SAFETY_CHECK"
private val ACTION_SPEC =
ActionSpecBuilder.ofCapabilityNamed(CAPABILITY_NAME)
.setArguments(Arguments::class.java, Arguments::Builder, Arguments.Builder::build)
diff --git a/benchmark/benchmark-common/build.gradle b/benchmark/benchmark-common/build.gradle
index 3c5a408..c5c342d 100644
--- a/benchmark/benchmark-common/build.gradle
+++ b/benchmark/benchmark-common/build.gradle
@@ -37,6 +37,19 @@
)
}
namespace "androidx.benchmark"
+ defaultConfig {
+ externalNativeBuild {
+ cmake {
+ cppFlags ''
+ }
+ }
+ }
+ externalNativeBuild {
+ cmake {
+ path file('src/main/cpp/CMakeLists.txt')
+ version libs.versions.cmake.get()
+ }
+ }
}
wire {
diff --git a/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/CpuCounterTest.kt b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/CpuCounterTest.kt
new file mode 100644
index 0000000..61f29ec
--- /dev/null
+++ b/benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/CpuCounterTest.kt
@@ -0,0 +1,183 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark
+
+import android.os.Build
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.MediumTest
+import androidx.test.filters.SdkSuppress
+import kotlin.test.assertFailsWith
+import kotlin.test.assertNotEquals
+import kotlin.test.assertTrue
+import org.junit.After
+import org.junit.Assume.assumeTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@MediumTest
+@RunWith(AndroidJUnit4::class)
+@SdkSuppress(minSdkVersion = 21)
+class CpuCounterTest {
+ private val perfHardenProp = PropOverride("security.perf_harden", "0")
+ private var shouldResetEnforce1 = false
+
+ @Before
+ fun before() {
+ // TODO: make this automatic
+ if (Build.VERSION.SDK_INT > 29) {
+ val blockedBySelinux = Shell.isSELinuxEnforced()
+ assumeTrue(
+ "blocked by selinux = $blockedBySelinux, rooted = ${DeviceInfo.isRooted}",
+ !blockedBySelinux || DeviceInfo.isRooted
+ )
+ if (blockedBySelinux && DeviceInfo.isRooted) {
+ Shell.executeScriptSilent("setenforce 0")
+ shouldResetEnforce1 = true
+ }
+ perfHardenProp.forceValue()
+ }
+ val error = CpuCounter.checkPerfEventSupport()
+ assumeTrue(error, error == null)
+ }
+
+ @After
+ fun after() {
+ perfHardenProp.resetIfOverridden()
+ if (shouldResetEnforce1) {
+ Shell.executeScriptSilent("setenforce 1")
+ }
+ }
+
+ /**
+ * Extremely basic validation of CPU counters.
+ *
+ * Note that we don't try and do more advanced validation (e.g. ensuring
+ * instructions != cycles != l1 misses), since this may be brittle.
+ */
+ @Test
+ fun basic() = CpuCounter().use { counter ->
+ val values = CpuCounter.Values()
+
+ counter.resetEvents(
+ listOf(
+ CpuCounter.Event.Instructions,
+ CpuCounter.Event.CpuCycles,
+ CpuCounter.Event.L1IReferences,
+ )
+ )
+ counter.reset()
+ counter.start()
+ repeat(100) {
+ System.nanoTime() // just something to do
+ }
+ counter.stop()
+
+ counter.read(values)
+
+ // NOTE: these expected number of counters may not be safe, will adjust as
+ // needed based on CI results
+ if (DeviceInfo.isEmulator) {
+ assertTrue(
+ values.numberOfCounters >= 1,
+ "expect at least one counter enabled on emulator," +
+ " saw ${values.numberOfCounters}"
+ )
+ } else {
+ assertTrue(
+ values.numberOfCounters >= 3,
+ "expect at least three counters on physical device," +
+ " saw ${values.numberOfCounters}"
+ )
+ }
+ assertNotEquals(0, values.timeEnabled)
+ assertNotEquals(0, values.timeRunning)
+ assertTrue(values.timeEnabled >= values.timeRunning)
+
+ // As counters are enabled in order of ID, these are in order of ID as well
+ if (values.numberOfCounters >= 1) {
+ assertNotEquals(0, values.getValue(CpuCounter.Event.Instructions))
+ }
+ if (values.numberOfCounters >= 2) {
+ assertNotEquals(0, values.getValue(CpuCounter.Event.CpuCycles))
+ }
+ if (values.numberOfCounters >= 3) {
+ assertNotEquals(0, values.getValue(CpuCounter.Event.L1IMisses))
+ }
+ }
+
+ @Test
+ fun instructions() = CpuCounter().use { counter ->
+ val values = CpuCounter.Values()
+
+ counter.resetEvents(
+ listOf(
+ CpuCounter.Event.Instructions,
+ CpuCounter.Event.CpuCycles,
+ CpuCounter.Event.L1IReferences
+ )
+ )
+
+ val instructions = List(4) {
+ counter.reset()
+ counter.start()
+
+ // factor chosen because small numbers will cause test to fail on an emulator,
+ // likely due to warmup
+ repeat(it * 100) {
+ // Simple work designed to have minimum amount of Java code
+ System.nanoTime()
+ }
+ counter.stop()
+ counter.read(values)
+ values.getValue(CpuCounter.Event.Instructions)
+ }
+
+ assertTrue(instructions.all { it != 0L })
+
+ // note, we don't validate 1st, in case there's some amount of warmup happening
+ assertTrue(
+ instructions[3] > instructions[2] && instructions[2] > instructions[1],
+ "expected increasing instruction counts (ignoring 1st): ${instructions.joinToString()}"
+ )
+ }
+
+ @Test
+ fun read_withoutReset(): Unit = CpuCounter().use { counter ->
+ val values = CpuCounter.Values()
+
+ // not yet reset, should fail...
+ assertFailsWith<IllegalStateException> {
+ counter.read(values)
+ }.also { ise ->
+ assertTrue(ise.message!!.contains("read counters without reset"))
+ }
+ }
+
+ @Test
+ fun read_afterClose(): Unit = CpuCounter().use { counter ->
+ val values = CpuCounter.Values()
+ // reset, but closed / deleted, should fail...
+ counter.resetEvents(listOf(CpuCounter.Event.Instructions))
+ counter.close()
+ assertFailsWith<IllegalStateException> {
+ counter.read(values)
+ }.also { ise ->
+ assertTrue(ise.message!!.contains("read counters after close"))
+ }
+ }
+}
diff --git a/benchmark/benchmark-common/src/main/cpp/CMakeLists.txt b/benchmark/benchmark-common/src/main/cpp/CMakeLists.txt
new file mode 100644
index 0000000..f61a216
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/cpp/CMakeLists.txt
@@ -0,0 +1,37 @@
+
+# For more information about using CMake with Android Studio, read the
+# documentation: https://d.android.com/studio/projects/add-native-code.html.
+# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
+
+# Sets the minimum CMake version required for this project.
+cmake_minimum_required(VERSION 3.22.1)
+
+# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
+# Since this is the top level CMakeLists.txt, the project name is also accessible
+# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
+# build script scope).
+project("benchmarkNative")
+
+# Creates and names a library, sets it as either STATIC
+# or SHARED, and provides the relative paths to its source code.
+# You can define multiple libraries, and CMake builds them for you.
+# Gradle automatically packages shared libraries with your APK.
+#
+# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
+# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
+# is preferred for the same purpose.
+#
+# In order to load a library into your app from Java/Kotlin, you must call
+# System.loadLibrary() and pass the name of the library defined here;
+# for GameActivity/NativeActivity derived applications, the same library name must be
+# used in the AndroidManifest.xml file.
+add_library(${CMAKE_PROJECT_NAME} SHARED
+ # List C/C++ source files with relative paths to this CMakeLists.txt.
+ androidx_benchmark_CpuCounter.cpp Profiler.cpp)
+
+# Specifies libraries CMake should link to your target library. You
+# can link libraries from various origins, such as libraries defined in this
+# build script, prebuilt third-party libraries, or Android system libraries.
+target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC log)
+target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE dl)
+target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC android)
diff --git a/benchmark/benchmark-common/src/main/cpp/Profiler.cpp b/benchmark/benchmark-common/src/main/cpp/Profiler.cpp
new file mode 100644
index 0000000..4db3859
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/cpp/Profiler.cpp
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Profiler.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#if !defined(WIN32)
+
+#include <unistd.h>
+
+#else
+# include <io.h>
+# define close _close
+#endif
+
+#include <algorithm>
+#include <iterator>
+#include <memory>
+
+#if defined(__linux__)
+
+#include <sys/syscall.h>
+
+#ifdef __ARM_ARCH
+enum ARMv8PmuPerfTypes{
+ // Common micro-architecture events
+ ARMV8_PMUV3_PERFCTR_L1_ICACHE_REFILL = 0x01,
+ ARMV8_PMUV3_PERFCTR_L1_ICACHE_ACCESS = 0x14,
+ ARMV8_PMUV3_PERFCTR_L2_CACHE_ACCESS = 0x16,
+ ARMV8_PMUV3_PERFCTR_L2_CACHE_REFILL = 0x17,
+ ARMV8_PMUV3_PERFCTR_L2_CACHE_WB = 0x18,
+};
+#endif
+
+#include <android/log.h>
+#include <errno.h>
+
+#define LOG_TAG "Benchmark"
+
+extern int errno;
+
+static int perf_event_open(perf_event_attr *hw_event, pid_t pid,
+ int cpu, int group_fd, unsigned long flags) {
+ return (int) syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, flags);
+}
+
+#endif // __linux__
+
+namespace utils {
+
+ Profiler::Profiler() noexcept {
+ std::uninitialized_fill(std::begin(mCountersFd), std::end(mCountersFd), -1);
+ }
+
+ Profiler::Profiler(uint32_t eventMask) noexcept: Profiler() {
+ Profiler::resetEvents(eventMask);
+ }
+
+ Profiler::~Profiler() noexcept {
+#pragma nounroll
+ for (int fd: mCountersFd) {
+ if (fd >= 0) {
+ close(fd);
+ }
+ }
+ }
+
+ uint32_t Profiler::resetEvents(uint32_t eventMask) noexcept {
+// close all counters
+#pragma nounroll
+ for (int &fd: mCountersFd) {
+ if (fd >= 0) {
+ close(fd);
+ fd = -1;
+ }
+ }
+ mEnabledEvents = 0;
+
+#if defined(__linux__)
+
+ perf_event_attr pe{};
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.size = sizeof(perf_event_attr);
+ pe.config = PERF_COUNT_HW_INSTRUCTIONS;
+ pe.disabled = 1;
+ pe.exclude_kernel = 1;
+ pe.exclude_hv = 1;
+ pe.read_format = PERF_FORMAT_GROUP |
+ PERF_FORMAT_ID |
+ PERF_FORMAT_TOTAL_TIME_ENABLED |
+ PERF_FORMAT_TOTAL_TIME_RUNNING;
+
+ int fd = perf_event_open(&pe, 0, -1, -1, 0);
+ if (fd == -1) {
+ __android_log_print(
+ ANDROID_LOG_ERROR,
+ LOG_TAG,
+ "perf_event_open failed: [%d]%s",
+ errno,
+ strerror(errno)
+ );
+ exit(EXIT_FAILURE);
+ }
+
+ uint8_t count = 0;
+ if (fd >= 0) {
+ const int groupFd = fd;
+ mIds[INSTRUCTIONS] = count++;
+ mCountersFd[INSTRUCTIONS] = fd;
+
+ pe.read_format = PERF_FORMAT_GROUP | PERF_FORMAT_ID;
+
+ if (eventMask & EV_CPU_CYCLES) {
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_CPU_CYCLES;
+ mCountersFd[CPU_CYCLES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[CPU_CYCLES] > 0) {
+ mIds[CPU_CYCLES] = count++;
+ mEnabledEvents |= EV_CPU_CYCLES;
+ }
+ }
+
+ if (eventMask & EV_L1D_REFS) {
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_CACHE_REFERENCES;
+ mCountersFd[DCACHE_REFS] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[DCACHE_REFS] > 0) {
+ mIds[DCACHE_REFS] = count++;
+ mEnabledEvents |= EV_L1D_REFS;
+ }
+ }
+
+ if (eventMask & EV_L1D_MISSES) {
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_CACHE_MISSES;
+ mCountersFd[DCACHE_MISSES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[DCACHE_MISSES] > 0) {
+ mIds[DCACHE_MISSES] = count++;
+ mEnabledEvents |= EV_L1D_MISSES;
+ }
+ }
+
+ if (eventMask & EV_BPU_REFS) {
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_BRANCH_INSTRUCTIONS;
+ mCountersFd[BRANCHES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[BRANCHES] > 0) {
+ mIds[BRANCHES] = count++;
+ mEnabledEvents |= EV_BPU_REFS;
+ }
+ }
+
+ if (eventMask & EV_BPU_MISSES) {
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.config = PERF_COUNT_HW_BRANCH_MISSES;
+ mCountersFd[BRANCH_MISSES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[BRANCH_MISSES] > 0) {
+ mIds[BRANCH_MISSES] = count++;
+ mEnabledEvents |= EV_BPU_MISSES;
+ }
+ }
+
+#ifdef __ARM_ARCH
+ if (eventMask & EV_L1I_REFS) {
+ pe.type = PERF_TYPE_RAW;
+ pe.config = ARMV8_PMUV3_PERFCTR_L1_ICACHE_ACCESS;
+ mCountersFd[ICACHE_REFS] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[ICACHE_REFS] > 0) {
+ mIds[ICACHE_REFS] = count++;
+ mEnabledEvents |= EV_L1I_REFS;
+ }
+ }
+
+ if (eventMask & EV_L1I_MISSES) {
+ pe.type = PERF_TYPE_RAW;
+ pe.config = ARMV8_PMUV3_PERFCTR_L1_ICACHE_REFILL;
+ mCountersFd[ICACHE_MISSES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[ICACHE_MISSES] > 0) {
+ mIds[ICACHE_MISSES] = count++;
+ mEnabledEvents |= EV_L1I_MISSES;
+ }
+ }
+#else
+ if (eventMask & EV_L1I_REFS) {
+ pe.type = PERF_TYPE_HW_CACHE;
+ pe.config = PERF_COUNT_HW_CACHE_L1I |
+ (PERF_COUNT_HW_CACHE_OP_READ << 8) |
+ (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16);
+ mCountersFd[ICACHE_REFS] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[ICACHE_REFS] > 0) {
+ mIds[ICACHE_REFS] = count++;
+ mEnabledEvents |= EV_L1I_REFS;
+ }
+ }
+
+ if (eventMask & EV_L1I_MISSES) {
+ pe.type = PERF_TYPE_HW_CACHE;
+ pe.config = PERF_COUNT_HW_CACHE_L1I |
+ (PERF_COUNT_HW_CACHE_OP_READ << 8) |
+ (PERF_COUNT_HW_CACHE_RESULT_MISS << 16);
+ mCountersFd[ICACHE_MISSES] = perf_event_open(&pe, 0, -1, groupFd, 0);
+ if (mCountersFd[ICACHE_MISSES] > 0) {
+ mIds[ICACHE_MISSES] = count++;
+ mEnabledEvents |= EV_L1I_MISSES;
+ }
+ }
+#endif
+ }
+#endif // __linux__
+ return mEnabledEvents;
+ }
+
+#if defined(__linux__)
+
+ Profiler::Counters Profiler::readCounters() noexcept {
+ Counters outCounters{};
+ Counters counters; // NOLINT
+ ssize_t n = read(mCountersFd[0], &counters, sizeof(Counters));
+ if (n == -1) {
+ __android_log_print(
+ ANDROID_LOG_ERROR,
+ LOG_TAG,
+ "read failed: [%d]%s",
+ errno,
+ strerror(errno)
+ );
+ exit(EXIT_FAILURE);
+ }
+ if (n > 0) {
+ outCounters.nr = counters.nr;
+ outCounters.time_enabled = counters.time_enabled;
+ outCounters.time_running = counters.time_running;
+ for (size_t i = 0; i < size_t(EVENT_COUNT); i++) {
+ // in theory we should check that mCountersFd[i] >= 0, but we don't to avoid
+ // a branch, mIds[] is initialized such we won't access past the counters array.
+ outCounters.counters[i] = counters.counters[mIds[i]];
+ }
+ }
+ return outCounters;
+ }
+
+#endif // __linux__
+
+} // namespace utils
diff --git a/benchmark/benchmark-common/src/main/cpp/Profiler.h b/benchmark/benchmark-common/src/main/cpp/Profiler.h
new file mode 100644
index 0000000..fdbf390
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/cpp/Profiler.h
@@ -0,0 +1,212 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TNT_UTILS_PROFILER_H
+#define TNT_UTILS_PROFILER_H
+
+#include <assert.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <chrono> // note: This is safe (only used inline)
+
+#if defined(__linux__)
+# include <unistd.h>
+# include <sys/ioctl.h>
+# include <linux/perf_event.h>
+#endif
+
+#include "compiler.h"
+
+namespace utils {
+
+ class Profiler {
+ public:
+ enum {
+ INSTRUCTIONS = 0, // must be zero
+ CPU_CYCLES = 1,
+ DCACHE_REFS = 2,
+ DCACHE_MISSES = 3,
+ BRANCHES = 4,
+ BRANCH_MISSES = 5,
+ ICACHE_REFS = 6,
+ ICACHE_MISSES = 7,
+
+ // Must be last one
+ EVENT_COUNT
+ };
+
+ enum {
+ EV_CPU_CYCLES = 1u << CPU_CYCLES,
+ EV_L1D_REFS = 1u << DCACHE_REFS,
+ EV_L1D_MISSES = 1u << DCACHE_MISSES,
+ EV_BPU_REFS = 1u << BRANCHES,
+ EV_BPU_MISSES = 1u << BRANCH_MISSES,
+ EV_L1I_REFS = 1u << ICACHE_REFS,
+ EV_L1I_MISSES = 1u << ICACHE_MISSES,
+ // helpers
+ EV_L1D_RATES = EV_L1D_REFS | EV_L1D_MISSES,
+ EV_L1I_RATES = EV_L1I_REFS | EV_L1I_MISSES,
+ EV_BPU_RATES = EV_BPU_REFS | EV_BPU_MISSES,
+ };
+
+ Profiler() noexcept; // must call resetEvents()
+ explicit Profiler(uint32_t eventMask) noexcept;
+ ~Profiler() noexcept;
+
+ Profiler(const Profiler& rhs) = delete;
+ Profiler(Profiler&& rhs) = delete;
+ Profiler& operator=(const Profiler& rhs) = delete;
+ Profiler& operator=(Profiler&& rhs) = delete;
+
+ // selects which events are enabled.
+ uint32_t resetEvents(uint32_t eventMask) noexcept;
+
+ uint32_t getEnabledEvents() const noexcept { return mEnabledEvents; }
+
+ // could return false if performance counters are not supported/enabled
+ bool isValid() const { return mCountersFd[0] >= 0; }
+
+ class Counters {
+ friend class Profiler;
+ uint64_t nr;
+ uint64_t time_enabled;
+ uint64_t time_running;
+ struct {
+ uint64_t value;
+ uint64_t id;
+ } counters[Profiler::EVENT_COUNT];
+
+ friend Counters operator-(Counters lhs, const Counters& rhs) noexcept {
+ lhs.nr -= rhs.nr;
+ lhs.time_enabled -= rhs.time_enabled;
+ lhs.time_running -= rhs.time_running;
+ for (size_t i = 0; i < EVENT_COUNT; ++i) {
+ lhs.counters[i].value -= rhs.counters[i].value;
+ }
+ return lhs;
+ }
+
+ public:
+ uint64_t getInstructions() const { return counters[INSTRUCTIONS].value; }
+ uint64_t getCpuCycles() const { return counters[CPU_CYCLES].value; }
+ uint64_t getL1DReferences() const { return counters[DCACHE_REFS].value; }
+ uint64_t getL1DMisses() const { return counters[DCACHE_MISSES].value; }
+ uint64_t getL1IReferences() const { return counters[ICACHE_REFS].value; }
+ uint64_t getL1IMisses() const { return counters[ICACHE_MISSES].value; }
+ uint64_t getBranchInstructions() const { return counters[BRANCHES].value; }
+ uint64_t getBranchMisses() const { return counters[BRANCH_MISSES].value; }
+
+ std::chrono::duration<uint64_t, std::nano> getWallTime() const {
+ return std::chrono::duration<uint64_t, std::nano>(time_enabled);
+ }
+
+ std::chrono::duration<uint64_t, std::nano> getRunningTime() const {
+ return std::chrono::duration<uint64_t, std::nano>(time_running);
+ }
+
+ double getIPC() const noexcept {
+ uint64_t cpuCycles = getCpuCycles();
+ uint64_t instructions = getInstructions();
+ return double(instructions) / double(cpuCycles);
+ }
+
+ double getCPI() const noexcept {
+ uint64_t cpuCycles = getCpuCycles();
+ uint64_t instructions = getInstructions();
+ return double(cpuCycles) / double(instructions);
+ }
+
+ double getL1DMissRate() const noexcept {
+ uint64_t cacheReferences = getL1DReferences();
+ uint64_t cacheMisses = getL1DMisses();
+ return double(cacheMisses) / double(cacheReferences);
+ }
+
+ double getL1DHitRate() const noexcept {
+ return 1.0 - getL1DMissRate();
+ }
+
+ double getL1IMissRate() const noexcept {
+ uint64_t cacheReferences = getL1IReferences();
+ uint64_t cacheMisses = getL1IMisses();
+ return double(cacheMisses) / double(cacheReferences);
+ }
+
+ double getL1IHitRate() const noexcept {
+ return 1.0 - getL1IMissRate();
+ }
+
+ double getBranchMissRate() const noexcept {
+ uint64_t branchReferences = getBranchInstructions();
+ uint64_t branchMisses = getBranchMisses();
+ return double(branchMisses) / double(branchReferences);
+ }
+
+ double getBranchHitRate() const noexcept {
+ return 1.0 - getBranchMissRate();
+ }
+
+ double getMPKI(uint64_t misses) const noexcept {
+ return (misses * 1000.0) / getInstructions();
+ }
+ };
+
+#if defined(__linux__)
+
+ void reset() noexcept {
+ int fd = mCountersFd[0];
+ ioctl(fd, PERF_EVENT_IOC_RESET, PERF_IOC_FLAG_GROUP);
+ }
+
+ void start() noexcept {
+ int fd = mCountersFd[0];
+ ioctl(fd, PERF_EVENT_IOC_ENABLE, PERF_IOC_FLAG_GROUP);
+ }
+
+ void stop() noexcept {
+ int fd = mCountersFd[0];
+ ioctl(fd, PERF_EVENT_IOC_DISABLE, PERF_IOC_FLAG_GROUP);
+ }
+
+ Counters readCounters() noexcept;
+
+#else // !__linux__
+
+ void reset() noexcept { }
+ void start() noexcept { }
+ void stop() noexcept { }
+ Counters readCounters() noexcept { return {}; }
+
+#endif // __linux__
+
+ bool hasBranchRates() const noexcept {
+ return (mCountersFd[BRANCHES] >= 0) && (mCountersFd[BRANCH_MISSES] >= 0);
+ }
+
+ bool hasICacheRates() const noexcept {
+ return (mCountersFd[ICACHE_REFS] >= 0) && (mCountersFd[ICACHE_MISSES] >= 0);
+ }
+
+ private:
+ UTILS_UNUSED uint8_t mIds[EVENT_COUNT] = {};
+ int mCountersFd[EVENT_COUNT];
+ uint32_t mEnabledEvents = 0;
+ };
+
+} // namespace utils
+
+#endif // TNT_UTILS_PROFILER_H
diff --git a/benchmark/benchmark-common/src/main/cpp/androidx_benchmark_CpuCounter.cpp b/benchmark/benchmark-common/src/main/cpp/androidx_benchmark_CpuCounter.cpp
new file mode 100644
index 0000000..447b877
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/cpp/androidx_benchmark_CpuCounter.cpp
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include <asm/unistd.h>
+#include <memory>
+#include <android/log.h>
+#include "Profiler.h"
+#include <iostream>
+#include <sys/syscall.h>
+
+#pragma clang diagnostic push
+#pragma ide diagnostic ignored "UnusedParameter"
+
+const int32_t CountersLongCount = sizeof(utils::Profiler::Counters) / sizeof(uint64_t);
+
+static_assert(
+ CountersLongCount == 19,
+ "Expected Counters to have consistent length, "
+ "may need to update Kotlin LongArray definition"
+);
+
+static int perf_event_open(perf_event_attr *hw_event, pid_t pid,
+ int cpu, int group_fd, unsigned long flags) {
+ return (int) syscall(__NR_perf_event_open, hw_event, pid, cpu, group_fd, flags);
+}
+
+#pragma clang diagnostic pop
+extern "C"
+JNIEXPORT jstring JNICALL
+Java_androidx_benchmark_CpuCounterJni_checkPerfEventSupport(
+ JNIEnv *env,
+ jobject thiz
+) {
+
+ // perf event group creation code copied from Profiler.cpp to allow us to
+ // return an error string on failure instead of killing process
+ perf_event_attr pe{};
+ pe.type = PERF_TYPE_HARDWARE;
+ pe.size = sizeof(perf_event_attr);
+ pe.config = PERF_COUNT_HW_INSTRUCTIONS;
+ pe.disabled = 1;
+ pe.exclude_kernel = 1;
+ pe.exclude_hv = 1;
+ pe.read_format = PERF_FORMAT_GROUP |
+ PERF_FORMAT_ID |
+ PERF_FORMAT_TOTAL_TIME_ENABLED |
+ PERF_FORMAT_TOTAL_TIME_RUNNING;
+ int fd = perf_event_open(&pe, 0, -1, -1, 0);
+ // TODO: implement checkPerfEventSupport()
+ if (fd == -1) {
+ char output[256];
+ sprintf(&output[0], "perf_event_open failed: [%d]%s", errno, strerror(errno));
+ return (jstring) env->NewStringUTF(&output[0]);
+ } else {
+ close(fd);
+ return (jstring) nullptr;
+ }
+}
+
+extern "C"
+JNIEXPORT jlong JNICALL
+Java_androidx_benchmark_CpuCounterJni_newProfiler(
+ JNIEnv *env,
+ jobject thiz
+) {
+ auto *pProfiler = new utils::Profiler();
+ return (long) pProfiler;
+}
+
+extern "C"
+JNIEXPORT void JNICALL
+Java_androidx_benchmark_CpuCounterJni_freeProfiler(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ delete pProfiler;
+}
+extern "C"
+JNIEXPORT jint JNICALL
+Java_androidx_benchmark_CpuCounterJni_resetEvents(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr,
+ jint event_mask
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ return (jint) pProfiler->resetEvents(event_mask);
+}
+extern "C"
+JNIEXPORT void JNICALL
+Java_androidx_benchmark_CpuCounterJni_reset(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ pProfiler->reset();
+}
+extern "C"
+JNIEXPORT void JNICALL
+Java_androidx_benchmark_CpuCounterJni_start(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ pProfiler->start();
+}
+extern "C"
+JNIEXPORT void JNICALL
+Java_androidx_benchmark_CpuCounterJni_stop(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ pProfiler->stop();
+}
+extern "C"
+JNIEXPORT void JNICALL
+Java_androidx_benchmark_CpuCounterJni_read(
+ JNIEnv *env,
+ jobject thiz,
+ jlong profiler_ptr,
+ jlongArray out_data
+) {
+ auto *pProfiler = (utils::Profiler *) profiler_ptr;
+ utils::Profiler::Counters counters = pProfiler->readCounters();
+ jsize longCount = sizeof(utils::Profiler::Counters) / sizeof(uint64_t);
+ env->SetLongArrayRegion(out_data, 0, longCount, reinterpret_cast<jlong *>(&counters));
+}
\ No newline at end of file
diff --git a/benchmark/benchmark-common/src/main/cpp/compiler.h b/benchmark/benchmark-common/src/main/cpp/compiler.h
new file mode 100644
index 0000000..c815266
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/cpp/compiler.h
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TNT_UTILS_COMPILER_H
+#define TNT_UTILS_COMPILER_H
+
+// compatibility with non-clang compilers...
+#ifndef __has_attribute
+#define __has_attribute(x) 0
+#endif
+
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
+
+#if __has_attribute(visibility)
+# define UTILS_PUBLIC __attribute__((visibility("default")))
+#else
+# define UTILS_PUBLIC
+#endif
+
+#if __has_attribute(deprecated)
+# define UTILS_DEPRECATED [[deprecated]]
+#else
+# define UTILS_DEPRECATED
+#endif
+
+#if __has_attribute(packed)
+# define UTILS_PACKED __attribute__((packed))
+#else
+# define UTILS_PACKED
+#endif
+
+#if __has_attribute(noreturn)
+# define UTILS_NORETURN __attribute__((noreturn))
+#else
+# define UTILS_NORETURN
+#endif
+
+#if __has_attribute(fallthrough)
+# define UTILS_FALLTHROUGH [[fallthrough]]
+#else
+# define UTILS_FALLTHROUGH
+#endif
+
+#if __has_attribute(visibility)
+# ifndef TNT_DEV
+# define UTILS_PRIVATE __attribute__((visibility("hidden")))
+# else
+# define UTILS_PRIVATE
+# endif
+#else
+# define UTILS_PRIVATE
+#endif
+
+#define UTILS_NO_SANITIZE_THREAD
+#if __has_feature(thread_sanitizer)
+#undef UTILS_NO_SANITIZE_THREAD
+#define UTILS_NO_SANITIZE_THREAD __attribute__((no_sanitize("thread")))
+#endif
+
+#define UTILS_HAS_SANITIZE_THREAD 0
+#if __has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__)
+#undef UTILS_HAS_SANITIZE_THREAD
+#define UTILS_HAS_SANITIZE_THREAD 1
+#endif
+
+#define UTILS_HAS_SANITIZE_MEMORY 0
+#if __has_feature(memory_sanitizer)
+#undef UTILS_HAS_SANITIZE_MEMORY
+#define UTILS_HAS_SANITIZE_MEMORY 1
+#endif
+
+/*
+ * helps the compiler's optimizer predicting branches
+ */
+#if __has_builtin(__builtin_expect)
+# ifdef __cplusplus
+# define UTILS_LIKELY( exp ) (__builtin_expect( !!(exp), true ))
+# define UTILS_UNLIKELY( exp ) (__builtin_expect( !!(exp), false ))
+# else
+# define UTILS_LIKELY( exp ) (__builtin_expect( !!(exp), 1 ))
+# define UTILS_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 ))
+# endif
+#else
+# define UTILS_LIKELY( exp ) (!!(exp))
+# define UTILS_UNLIKELY( exp ) (!!(exp))
+#endif
+
+#if __has_builtin(__builtin_prefetch)
+# define UTILS_PREFETCH( exp ) (__builtin_prefetch(exp))
+#else
+# define UTILS_PREFETCH( exp )
+#endif
+
+#if __has_builtin(__builtin_assume)
+# define UTILS_ASSUME( exp ) (__builtin_assume(exp))
+#else
+# define UTILS_ASSUME( exp )
+#endif
+
+#if (defined(__i386__) || defined(__x86_64__))
+# define UTILS_HAS_HYPER_THREADING 1 // on x86 we assume we have hyper-threading.
+#else
+# define UTILS_HAS_HYPER_THREADING 0
+#endif
+
+#if defined(FILAMENT_SINGLE_THREADED)
+# define UTILS_HAS_THREADING 0
+#elif defined(__EMSCRIPTEN__)
+# if defined(__EMSCRIPTEN_PTHREADS__) && defined(FILAMENT_WASM_THREADS)
+# define UTILS_HAS_THREADING 1
+# else
+# define UTILS_HAS_THREADING 0
+# endif
+#else
+# define UTILS_HAS_THREADING 1
+#endif
+
+#if __has_attribute(noinline)
+#define UTILS_NOINLINE __attribute__((noinline))
+#else
+#define UTILS_NOINLINE
+#endif
+
+#if __has_attribute(always_inline)
+#define UTILS_ALWAYS_INLINE __attribute__((always_inline))
+#else
+#define UTILS_ALWAYS_INLINE
+#endif
+
+#if __has_attribute(pure)
+#define UTILS_PURE __attribute__((pure))
+#else
+#define UTILS_PURE
+#endif
+
+#if __has_attribute(maybe_unused) || (defined(_MSC_VER) && _MSC_VER >= 1911)
+#define UTILS_UNUSED [[maybe_unused]]
+#define UTILS_UNUSED_IN_RELEASE [[maybe_unused]]
+#elif __has_attribute(unused)
+#define UTILS_UNUSED __attribute__((unused))
+#define UTILS_UNUSED_IN_RELEASE __attribute__((unused))
+#else
+#define UTILS_UNUSED
+#define UTILS_UNUSED_IN_RELEASE
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+# define UTILS_RESTRICT __restrict
+#elif (defined(__clang__) || defined(__GNUC__))
+# define UTILS_RESTRICT __restrict__
+#else
+# define UTILS_RESTRICT
+#endif
+
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+# define UTILS_HAS_FEATURE_CXX_THREAD_LOCAL 1
+#elif __has_feature(cxx_thread_local)
+# define UTILS_HAS_FEATURE_CXX_THREAD_LOCAL 1
+#else
+# define UTILS_HAS_FEATURE_CXX_THREAD_LOCAL 0
+#endif
+
+#if defined(_MSC_VER)
+// MSVC does not support loop unrolling hints
+# define UTILS_UNROLL
+# define UTILS_NOUNROLL
+#else
+// C++11 allows pragmas to be specified as part of defines using the _Pragma syntax.
+# define UTILS_UNROLL _Pragma("unroll")
+# define UTILS_NOUNROLL _Pragma("nounroll")
+#endif
+
+#if __has_feature(cxx_rtti) || defined(_CPPRTTI)
+# define UTILS_HAS_RTTI 1
+#else
+# define UTILS_HAS_RTTI 0
+#endif
+
+#ifdef __ARM_ACLE
+# include <arm_acle.h>
+# define UTILS_WAIT_FOR_INTERRUPT() __wfi()
+# define UTILS_WAIT_FOR_EVENT() __wfe()
+# define UTILS_BROADCAST_EVENT() __sev()
+# define UTILS_SIGNAL_EVENT() __sevl()
+# define UTILS_PAUSE() __yield()
+# define UTILS_PREFETCHW(addr) __pldx(1, 0, 0, addr)
+#else // !__ARM_ACLE
+# if (defined(__i386__) || defined(__x86_64__))
+# define UTILS_X86_PAUSE {__asm__ __volatile__( "rep; nop" : : : "memory" );}
+# define UTILS_WAIT_FOR_INTERRUPT() UTILS_X86_PAUSE
+# define UTILS_WAIT_FOR_EVENT() UTILS_X86_PAUSE
+# define UTILS_BROADCAST_EVENT()
+# define UTILS_SIGNAL_EVENT()
+# define UTILS_PAUSE() UTILS_X86_PAUSE
+# define UTILS_PREFETCHW(addr) UTILS_PREFETCH(addr)
+# else // !x86
+# define UTILS_WAIT_FOR_INTERRUPT()
+# define UTILS_WAIT_FOR_EVENT()
+# define UTILS_BROADCAST_EVENT()
+# define UTILS_SIGNAL_EVENT()
+# define UTILS_PAUSE()
+# define UTILS_PREFETCHW(addr) UTILS_PREFETCH(addr)
+# endif // x86
+#endif // __ARM_ACLE
+
+
+// ssize_t is a POSIX type.
+#if defined(WIN32) || defined(_WIN32)
+#include <Basetsd.h>
+typedef SSIZE_T ssize_t;
+#endif
+
+#ifdef _MSC_VER
+# define UTILS_EMPTY_BASES __declspec(empty_bases)
+#else
+# define UTILS_EMPTY_BASES
+#endif
+
+#if defined(WIN32) || defined(_WIN32)
+#define IMPORTSYMB __declspec(dllimport)
+#else
+#define IMPORTSYMB
+#endif
+
+#if defined(_MSC_VER) && !defined(__PRETTY_FUNCTION__)
+# define __PRETTY_FUNCTION__ __FUNCSIG__
+#endif
+
+
+#if defined(_MSC_VER)
+# define UTILS_WARNING_PUSH _Pragma("warning( push )")
+# define UTILS_WARNING_POP _Pragma("warning( pop )")
+# define UTILS_WARNING_ENABLE_PADDED _Pragma("warning(1: 4324)")
+#elif defined(__clang__)
+# define UTILS_WARNING_PUSH _Pragma("clang diagnostic push")
+# define UTILS_WARNING_POP _Pragma("clang diagnostic pop")
+# define UTILS_WARNING_ENABLE_PADDED _Pragma("clang diagnostic warning \"-Wpadded\"")
+#else
+# define UTILS_WARNING_PUSH
+# define UTILS_WARNING_POP
+# define UTILS_WARNING_ENABLE_PADDED
+#endif
+
+#endif // TNT_UTILS_COMPILER_H
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/CpuCounter.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/CpuCounter.kt
new file mode 100644
index 0000000..7e57ab5
--- /dev/null
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/CpuCounter.kt
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark
+
+import androidx.annotation.RestrictTo
+import java.io.Closeable
+
+/**
+ * Exposes CPU counters from perf_event_open based on libs/utils/src/Profiler.cpp from
+ * Google/Filament.
+ *
+ * This layer is extremely simple to reduce overhead, though it does not yet use
+ * fast/critical JNI.
+ *
+ * This counter must be closed to avoid leaking the associated native allocation.
+ *
+ * This class does not yet help callers with prerequisites to getting counter values on API 30+:
+ * - setenforce 0 (requires root)
+ * - security.perf_harden 0
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+class CpuCounter : Closeable {
+ private var profilerPtr = CpuCounterJni.newProfiler()
+ private var hasReset = false
+
+ fun resetEvents(events: List<Event>) {
+ hasReset = true
+ val flags = events.fold(0) { acc, event ->
+ acc.or(event.flag)
+ }
+ CpuCounterJni.resetEvents(profilerPtr, flags)
+ }
+
+ override fun close() {
+ CpuCounterJni.freeProfiler(profilerPtr)
+ profilerPtr = 0
+ }
+
+ fun reset() {
+ CpuCounterJni.reset(profilerPtr)
+ }
+ fun start() = CpuCounterJni.start(profilerPtr)
+ fun stop() = CpuCounterJni.stop(profilerPtr)
+
+ fun read(outValues: Values) {
+ check(profilerPtr != 0L) { "Error: attempted to read counters after close" }
+ check(hasReset) { "Error: attempted to read counters without reset" }
+ CpuCounterJni.read(profilerPtr, outValues.longArray)
+ }
+
+ enum class Event(
+ val id: Int
+ ) {
+ Instructions(0),
+ CpuCycles(1),
+ L1DReferences(2),
+ L1DMisses(3),
+ BranchInstructions(4),
+ BranchMisses(5),
+ L1IReferences(6),
+ L1IMisses(7);
+
+ val flag: Int
+ inline get() = 1 shl id
+ }
+
+ /**
+ * Holder class for querying all counter values at once out of native, to avoid multiple JNI
+ * transitions.
+ */
+ @JvmInline
+ @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+ value class Values(val longArray: LongArray = LongArray(19)) {
+ init {
+ // See CountersLongCount static_assert in native
+ require(longArray.size == 19)
+ }
+
+ inline val numberOfCounters: Long
+ get() = longArray[0]
+ inline val timeEnabled: Long
+ get() = longArray[1]
+ inline val timeRunning: Long
+ get() = longArray[2]
+
+ @Suppress("NOTHING_TO_INLINE")
+ inline fun getValue(spec: Event): Long = longArray[3 + (2 * spec.id)]
+ }
+
+ companion object {
+ fun checkPerfEventSupport(): String? = CpuCounterJni.checkPerfEventSupport()
+ }
+}
+
+private object CpuCounterJni {
+ init {
+ System.loadLibrary("benchmarkNative")
+ }
+
+ // Profiler methods
+ external fun checkPerfEventSupport(): String?
+ external fun newProfiler(): Long
+ external fun freeProfiler(profilerPtr: Long)
+ external fun resetEvents(profilerPtr: Long, mask: Int): Int
+ external fun reset(profilerPtr: Long)
+ external fun start(profilerPtr: Long)
+ external fun stop(profilerPtr: Long)
+ external fun read(profilerPtr: Long, outData: LongArray)
+}
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
index 19d5d66..81cad8c 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/DeviceInfo.kt
@@ -39,7 +39,7 @@
val isEngBuild = Build.FINGERPRINT.contains(":eng/")
- val isRooted =
+ val isRooted = Build.FINGERPRINT.contains(":userdebug/") ||
arrayOf(
"/system/app/Superuser.apk",
"/sbin/su",
diff --git a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
index 5df22dd..bcdd92e 100644
--- a/benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
+++ b/benchmark/benchmark-common/src/main/java/androidx/benchmark/Shell.kt
@@ -610,6 +610,16 @@
.trim()
.toIntOrNull()
}
+
+ @RequiresApi(21)
+ fun isSELinuxEnforced(): Boolean {
+ return when (val value = executeScriptCaptureStdout("getenforce").trim()) {
+ "Permissive" -> false
+ "Disabled" -> false
+ "Enforcing" -> true
+ else -> throw IllegalStateException("unexpected result from getenforce: $value")
+ }
+ }
}
@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
diff --git a/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/CpuCounterBenchmark.kt b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/CpuCounterBenchmark.kt
new file mode 100644
index 0000000..3ce5c8b
--- /dev/null
+++ b/benchmark/benchmark/src/androidTest/java/androidx/benchmark/benchmark/CpuCounterBenchmark.kt
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.benchmark.benchmark
+
+import android.os.Build
+import androidx.benchmark.CpuCounter
+import androidx.benchmark.DeviceInfo
+import androidx.benchmark.PropOverride
+import androidx.benchmark.Shell
+import androidx.benchmark.junit4.BenchmarkRule
+import androidx.benchmark.junit4.measureRepeated
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import androidx.test.filters.SdkSuppress
+import org.junit.After
+import org.junit.Assume
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@LargeTest
+@RunWith(AndroidJUnit4::class)
+@SdkSuppress(minSdkVersion = 21)
+class CpuCounterBenchmark {
+ @get:Rule
+ val benchmarkRule = BenchmarkRule()
+ private val values = CpuCounter.Values()
+
+ private val perfHardenProp = PropOverride("security.perf_harden", "0")
+ private var shouldResetEnforce1 = false
+
+ @Before
+ fun before() {
+ // TODO: make this automatic
+ if (Build.VERSION.SDK_INT > 29) {
+ val blockedBySelinux = Shell.isSELinuxEnforced()
+ Assume.assumeTrue(
+ "blocked by selinux = $blockedBySelinux, rooted = ${DeviceInfo.isRooted}",
+ !blockedBySelinux || DeviceInfo.isRooted
+ )
+ if (blockedBySelinux && DeviceInfo.isRooted) {
+ Shell.executeScriptSilent("setenforce 0")
+ shouldResetEnforce1 = true
+ }
+ perfHardenProp.forceValue()
+ }
+ val error = CpuCounter.checkPerfEventSupport()
+ Assume.assumeTrue(error, error == null)
+ }
+
+ @After
+ fun after() {
+ perfHardenProp.resetIfOverridden()
+ if (shouldResetEnforce1) {
+ Shell.executeScriptSilent("setenforce 1")
+ }
+ }
+
+ /**
+ * Measures overhead of starting and stopping
+ *
+ * We can expect to see some portion of this impact measurements directtly.
+ */
+ @Test
+ fun startStopOnly() = CpuCounter().use { counter ->
+ counter.resetEvents(
+ listOf(
+ CpuCounter.Event.CpuCycles,
+ CpuCounter.Event.L1IMisses,
+ CpuCounter.Event.Instructions,
+ )
+ )
+ benchmarkRule.measureRepeated {
+ runWithTimingDisabled {
+ counter.reset()
+ }
+ counter.start()
+ counter.stop()
+ }
+ }
+
+ /**
+ * Measures full per measurement iteration cost
+ *
+ * This is important not because of direct intrusiveness to timing measurements, but because it
+ * may correlate with other intrusiveness, e.g. cache interference from reset/reading values
+ */
+ @Test
+ fun perIterationCost() = CpuCounter().use { counter ->
+ counter.resetEvents(
+ listOf(
+ CpuCounter.Event.CpuCycles,
+ CpuCounter.Event.L1IMisses,
+ CpuCounter.Event.Instructions,
+ )
+ )
+ var out = 0L
+ benchmarkRule.measureRepeated {
+ counter.reset()
+ counter.start()
+ counter.stop()
+ counter.read(values)
+ out += values.getValue(CpuCounter.Event.CpuCycles)
+ out += values.getValue(CpuCounter.Event.L1IMisses)
+ out += values.getValue(CpuCounter.Event.Instructions)
+ }
+ }
+}
diff --git a/bluetooth/bluetooth/api/current.txt b/bluetooth/bluetooth/api/current.txt
index d682668..cdcca53 100644
--- a/bluetooth/bluetooth/api/current.txt
+++ b/bluetooth/bluetooth/api/current.txt
@@ -71,5 +71,19 @@
public static final class ScanFilter.Companion {
}
+ public final class ScanResult {
+ method public androidx.bluetooth.BluetoothDevice getDevice();
+ method public androidx.bluetooth.BluetoothAddress getDeviceAddress();
+ method public byte[]? getManufacturerSpecificData(int manufacturerId);
+ method public byte[]? getServiceData(java.util.UUID serviceUuid);
+ method public java.util.List<java.util.UUID> getServiceUuids();
+ method public long getTimestampNanos();
+ method public boolean isConnectable();
+ property public final androidx.bluetooth.BluetoothDevice device;
+ property public final androidx.bluetooth.BluetoothAddress deviceAddress;
+ property public final java.util.List<java.util.UUID> serviceUuids;
+ property public final long timestampNanos;
+ }
+
}
diff --git a/bluetooth/bluetooth/api/restricted_current.txt b/bluetooth/bluetooth/api/restricted_current.txt
index d682668..cdcca53 100644
--- a/bluetooth/bluetooth/api/restricted_current.txt
+++ b/bluetooth/bluetooth/api/restricted_current.txt
@@ -71,5 +71,19 @@
public static final class ScanFilter.Companion {
}
+ public final class ScanResult {
+ method public androidx.bluetooth.BluetoothDevice getDevice();
+ method public androidx.bluetooth.BluetoothAddress getDeviceAddress();
+ method public byte[]? getManufacturerSpecificData(int manufacturerId);
+ method public byte[]? getServiceData(java.util.UUID serviceUuid);
+ method public java.util.List<java.util.UUID> getServiceUuids();
+ method public long getTimestampNanos();
+ method public boolean isConnectable();
+ property public final androidx.bluetooth.BluetoothDevice device;
+ property public final androidx.bluetooth.BluetoothAddress deviceAddress;
+ property public final java.util.List<java.util.UUID> serviceUuids;
+ property public final long timestampNanos;
+ }
+
}
diff --git a/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/ScanResultTest.kt b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/ScanResultTest.kt
new file mode 100644
index 0000000..7f488d7
--- /dev/null
+++ b/bluetooth/bluetooth/src/androidTest/java/androidx/bluetooth/ScanResultTest.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.bluetooth
+
+import android.bluetooth.BluetoothAdapter
+import android.bluetooth.BluetoothManager
+import android.bluetooth.le.ScanResult as FwkScanResult
+import android.content.Context
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.rule.GrantPermissionRule
+import java.util.UUID
+import junit.framework.TestCase.assertEquals
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(JUnit4::class)
+class ScanResultTest {
+ @Rule
+ @JvmField
+ val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
+ android.Manifest.permission.BLUETOOTH_CONNECT)
+
+ private val context: Context = ApplicationProvider.getApplicationContext()
+ private val bluetoothManager: BluetoothManager =
+ context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager
+ private val bluetoothAdapter: BluetoothAdapter? = bluetoothManager.adapter
+
+ @Test
+ fun constructorWithFwkInstance() {
+ val address = "00:01:02:03:04:05"
+ val fwkBluetoothDevice = bluetoothAdapter!!.getRemoteDevice(address)
+ val timeStampNanos: Long = 1
+ val serviceUuid = UUID.randomUUID()
+
+ // TODO(kihongs) Find a way to create framework ScanRecord and use in test
+ val fwkScanResult = FwkScanResult(fwkBluetoothDevice, 1, 0, 0, 0, 0, 0, 0, null,
+ timeStampNanos)
+ val scanResult = ScanResult(fwkScanResult)
+
+ assertEquals(scanResult.device.name, BluetoothDevice(fwkBluetoothDevice).name)
+ assertEquals(scanResult.device.bondState, BluetoothDevice(fwkBluetoothDevice).bondState)
+ assertEquals(scanResult.deviceAddress.address, address)
+ assertEquals(scanResult.deviceAddress.addressType, AddressType.ADDRESS_TYPE_RANDOM)
+ assertEquals(scanResult.isConnectable(), true)
+ assertEquals(scanResult.timestampNanos, timeStampNanos)
+ assertEquals(scanResult.getManufacturerSpecificData(1), null)
+ assertEquals(scanResult.serviceUuids, emptyList<UUID>())
+ assertEquals(scanResult.getServiceData(serviceUuid), null)
+ }
+}
\ No newline at end of file
diff --git a/bluetooth/bluetooth/src/main/java/androidx/bluetooth/ScanResult.kt b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/ScanResult.kt
new file mode 100644
index 0000000..ac79d4a
--- /dev/null
+++ b/bluetooth/bluetooth/src/main/java/androidx/bluetooth/ScanResult.kt
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.bluetooth
+
+import android.bluetooth.le.ScanResult as FwkScanResult
+import android.os.ParcelUuid
+import java.util.UUID
+
+/**
+ * ScanResult for Bluetooth LE scan.
+ *
+ * The ScanResult class is used by Bluetooth LE applications to scan for and discover Bluetooth LE
+ * devices. When a Bluetooth LE application scans for devices, it will receive a list of ScanResult
+ * objects that contain information about the scanned devices. The application can then use this
+ * information to determine which devices it wants to connect to.
+ *
+ * @property device Remote device found
+ * @property deviceAddress Bluetooth address for the remote device found
+ * @property timestampNanos Device timestamp when the result was last seen
+ * @property serviceUuids A list of service UUIDs within advertisement that are used to identify the
+ * bluetooth GATT services.
+ *
+ */
+class ScanResult internal constructor(private val fwkScanResult: FwkScanResult) {
+ /** Remote Bluetooth device found. */
+ val device: BluetoothDevice
+ get() = BluetoothDevice(fwkScanResult.device)
+
+ // TODO(kihongs) Find a way to get address type from framework scan result
+ /** Bluetooth address for the remote device found. */
+ val deviceAddress: BluetoothAddress
+ get() = BluetoothAddress(fwkScanResult.device.address, AddressType.ADDRESS_TYPE_RANDOM)
+
+ /** Device timestamp when the advertisement was last seen. */
+ val timestampNanos: Long
+ get() = fwkScanResult.timestampNanos
+
+ /**
+ * Returns the manufacturer specific data associated with the manufacturer id.
+ *
+ * @param manufacturerId The manufacturer id of the scanned device
+ * @return the manufacturer specific data associated with the manufacturer id, or null if the
+ * manufacturer specific data is not present
+ */
+ fun getManufacturerSpecificData(manufacturerId: Int): ByteArray? {
+ return fwkScanResult.scanRecord?.getManufacturerSpecificData(manufacturerId)
+ }
+
+ /**
+ * A list of service UUIDs within advertisement that are used to identify the bluetooth GATT
+ * services.
+ */
+ val serviceUuids: List<UUID>
+ get() = fwkScanResult.scanRecord?.serviceUuids?.map { it.uuid }.orEmpty()
+
+ /**
+ * Returns the service data associated with the service UUID.
+ *
+ * @param serviceUuid The service UUID of the service data
+ * @return the service data associated with the specified service UUID, or null if the service
+ * UUID is not found
+ */
+ fun getServiceData(serviceUuid: UUID): ByteArray? {
+ return fwkScanResult.scanRecord?.getServiceData(ParcelUuid(serviceUuid))
+ }
+
+ /**
+ * Checks if this object represents connectable scan result.
+ *
+ * @return true if the scanned device is connectable; false otherwise
+ */
+ fun isConnectable(): Boolean {
+ return fwkScanResult.isConnectable
+ }
+}
\ No newline at end of file
diff --git a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/DeviceConnection.kt b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/DeviceConnection.kt
index 7f8eb2c..53e105e 100644
--- a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/DeviceConnection.kt
+++ b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/DeviceConnection.kt
@@ -31,7 +31,7 @@
var job: Job? = null
var onClickReadCharacteristic: OnClickCharacteristic? = null
var onClickWriteCharacteristic: OnClickCharacteristic? = null
- var status = Status.NOT_CONNECTED
+ var status = Status.DISCONNECTED
var services = emptyList<BluetoothGattService>()
private val values = mutableMapOf<UUID, ByteArray?>()
diff --git a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/Status.kt b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/Status.kt
index 4087921..a2dc3c71 100644
--- a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/Status.kt
+++ b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/data/connection/Status.kt
@@ -17,8 +17,7 @@
package androidx.bluetooth.integration.testapp.data.connection
enum class Status {
- NOT_CONNECTED,
+ DISCONNECTED,
CONNECTING,
- CONNECTED,
- CONNECTION_FAILED
+ CONNECTED
}
diff --git a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/ui/scanner/ScannerFragment.kt b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/ui/scanner/ScannerFragment.kt
index 209e95a..6b5a1c23 100644
--- a/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/ui/scanner/ScannerFragment.kt
+++ b/bluetooth/integration-tests/testapp/src/main/java/androidx/bluetooth/integration/testapp/ui/scanner/ScannerFragment.kt
@@ -343,7 +343,7 @@
Log.d(TAG, "connectGatt() CancellationException")
} else {
Log.e(TAG, "connectGatt() exception", exception)
- deviceConnection.status = Status.CONNECTION_FAILED
+ deviceConnection.status = Status.DISCONNECTED
launch(Dispatchers.Main) {
updateDeviceUI(deviceConnection)
}
@@ -357,7 +357,7 @@
deviceConnection.job?.cancel(MANUAL_DISCONNECT)
deviceConnection.job = null
- deviceConnection.status = Status.NOT_CONNECTED
+ deviceConnection.status = Status.DISCONNECTED
updateDeviceUI(deviceConnection)
}
@@ -368,8 +368,8 @@
binding.buttonDisconnect.isVisible = false
when (deviceConnection.status) {
- Status.NOT_CONNECTED -> {
- binding.textViewDeviceConnectionStatus.text = getString(R.string.not_connected)
+ Status.DISCONNECTED -> {
+ binding.textViewDeviceConnectionStatus.text = getString(R.string.disconnected)
binding.textViewDeviceConnectionStatus.setTextColor(getColor(R.color.green_500))
binding.buttonReconnect.isVisible = true
}
@@ -383,11 +383,6 @@
binding.textViewDeviceConnectionStatus.setTextColor(getColor(R.color.indigo_500))
binding.buttonDisconnect.isVisible = true
}
- Status.CONNECTION_FAILED -> {
- binding.textViewDeviceConnectionStatus.text = getString(R.string.connection_failed)
- binding.textViewDeviceConnectionStatus.setTextColor(getColor(R.color.red_500))
- binding.buttonReconnect.isVisible = true
- }
}
deviceServicesAdapter?.deviceConnection = deviceConnection
deviceServicesAdapter?.notifyDataSetChanged()
diff --git a/bluetooth/integration-tests/testapp/src/main/res/layout/fragment_scanner.xml b/bluetooth/integration-tests/testapp/src/main/res/layout/fragment_scanner.xml
index 674759b..021dc5d 100644
--- a/bluetooth/integration-tests/testapp/src/main/res/layout/fragment_scanner.xml
+++ b/bluetooth/integration-tests/testapp/src/main/res/layout/fragment_scanner.xml
@@ -87,7 +87,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
- android:text="@string/not_connected"
+ android:text="@string/disconnected"
android:textAllCaps="true"
android:textColor="@color/green_500"
android:textSize="16sp" />
diff --git a/bluetooth/integration-tests/testapp/src/main/res/values/donottranslate-strings.xml b/bluetooth/integration-tests/testapp/src/main/res/values/donottranslate-strings.xml
index 8c164df..7c47b75 100644
--- a/bluetooth/integration-tests/testapp/src/main/res/values/donottranslate-strings.xml
+++ b/bluetooth/integration-tests/testapp/src/main/res/values/donottranslate-strings.xml
@@ -33,10 +33,9 @@
<string name="reconnect">Reconnect</string>
<string name="disconnect">Disconnect</string>
<string name="scan_results">Scan Results</string>
- <string name="not_connected">Not Connected</string>
+ <string name="disconnected">Disconnected</string>
<string name="connecting">Connecting…</string>
<string name="connected">Connected</string>
- <string name="connection_failed">Connection Failed</string>
<string name="generic_attribute">Generic Attribute</string>
<string name="uuid">uuid</string>
<string name="properties">Properties</string>
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/AndroidXImplPluginTest.kt b/buildSrc-tests/src/test/java/androidx/build/AndroidXImplPluginTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/AndroidXImplPluginTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/AndroidXImplPluginTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/KmpPlatformsTest.kt b/buildSrc-tests/src/test/java/androidx/build/KmpPlatformsTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/KmpPlatformsTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/KmpPlatformsTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/LibraryVersionsServiceTest.kt b/buildSrc-tests/src/test/java/androidx/build/LibraryVersionsServiceTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/LibraryVersionsServiceTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/LibraryVersionsServiceTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/MavenUploadHelperTest.kt b/buildSrc-tests/src/test/java/androidx/build/MavenUploadHelperTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/MavenUploadHelperTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/MavenUploadHelperTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/SdkResourceGeneratorTest.kt b/buildSrc-tests/src/test/java/androidx/build/SdkResourceGeneratorTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/SdkResourceGeneratorTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/SdkResourceGeneratorTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/SettingsParserTest.kt b/buildSrc-tests/src/test/java/androidx/build/SettingsParserTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/SettingsParserTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/SettingsParserTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/VersionTest.kt b/buildSrc-tests/src/test/java/androidx/build/VersionTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/VersionTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/VersionTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/buildInfo/CreateLibraryBuildInfoFileTaskTest.kt b/buildSrc-tests/src/test/java/androidx/build/buildInfo/CreateLibraryBuildInfoFileTaskTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/buildInfo/CreateLibraryBuildInfoFileTaskTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/buildInfo/CreateLibraryBuildInfoFileTaskTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/checkapi/CheckApiTest.kt b/buildSrc-tests/src/test/java/androidx/build/checkapi/CheckApiTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/checkapi/CheckApiTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/checkapi/CheckApiTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/AffectedModuleDetectorImplTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/AttachLogsTestRule.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/AttachLogsTestRule.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/AttachLogsTestRule.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/AttachLogsTestRule.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/BuildPropParserTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/BuildPropParserTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/BuildPropParserTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/BuildPropParserTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/ChangeInfoGitClientTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/ChangeInfoGitClientTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/ChangeInfoGitClientTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/ChangeInfoGitClientTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/GitRunnerGitClientTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/GitRunnerGitClientTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/GitRunnerGitClientTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/GitRunnerGitClientTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/ProjectGraphTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyTracker/ProjectGraphTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyTracker/ProjectGraphTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyTracker/ProjectGraphTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/dependencyallowlist/DependencyAllowlistTest.kt b/buildSrc-tests/src/test/java/androidx/build/dependencyallowlist/DependencyAllowlistTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/dependencyallowlist/DependencyAllowlistTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/dependencyallowlist/DependencyAllowlistTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/metalava/CheckApiCompatibilityTaskTest.kt b/buildSrc-tests/src/test/java/androidx/build/metalava/CheckApiCompatibilityTaskTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/metalava/CheckApiCompatibilityTaskTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/metalava/CheckApiCompatibilityTaskTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/metalava/UpdateApiTaskTest.kt b/buildSrc-tests/src/test/java/androidx/build/metalava/UpdateApiTaskTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/metalava/UpdateApiTaskTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/metalava/UpdateApiTaskTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/playground/VerifyPlaygroundGradleConfigurationTaskTest.kt b/buildSrc-tests/src/test/java/androidx/build/playground/VerifyPlaygroundGradleConfigurationTaskTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/playground/VerifyPlaygroundGradleConfigurationTaskTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/playground/VerifyPlaygroundGradleConfigurationTaskTest.kt
diff --git a/buildSrc-tests/src/test/kotlin/androidx/build/testConfiguration/AndroidTestConfigBuilderTest.kt b/buildSrc-tests/src/test/java/androidx/build/testConfiguration/AndroidTestConfigBuilderTest.kt
similarity index 100%
rename from buildSrc-tests/src/test/kotlin/androidx/build/testConfiguration/AndroidTestConfigBuilderTest.kt
rename to buildSrc-tests/src/test/java/androidx/build/testConfiguration/AndroidTestConfigBuilderTest.kt
diff --git a/camera/camera-camera2-pipe-integration/build.gradle b/camera/camera-camera2-pipe-integration/build.gradle
index 76c6696..e1f8d7c 100644
--- a/camera/camera-camera2-pipe-integration/build.gradle
+++ b/camera/camera-camera2-pipe-integration/build.gradle
@@ -52,6 +52,7 @@
testImplementation(libs.mockitoKotlin4)
testImplementation(libs.robolectric)
testImplementation(libs.kotlinCoroutinesTest)
+ testImplementation(libs.kotlinTestJunit)
testImplementation(project(":camera:camera-camera2-pipe-testing"))
testImplementation(project(":camera:camera-testing"))
testImplementation(project(":internal-testutils-ktx"))
diff --git a/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/testing/VerifyResultListener.kt b/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/testing/VerifyResultListener.kt
index f88ee43..80eed7d 100644
--- a/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/testing/VerifyResultListener.kt
+++ b/camera/camera-camera2-pipe-integration/src/androidTest/java/androidx/camera/camera2/pipe/testing/VerifyResultListener.kt
@@ -36,8 +36,10 @@
private val waitingCount = atomic(capturesCount)
private val failureException =
TimeoutException("Test doesn't complete after waiting for $capturesCount frames.")
- @Volatile private var startReceiving = false
- @Volatile private var _verifyBlock: (
+ @Volatile
+ private var startReceiving = false
+ @Volatile
+ private var _verifyBlock: (
captureRequest: RequestMetadata,
captureResult: FrameInfo
) -> Boolean = { _, _ -> false }
@@ -77,6 +79,10 @@
}
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
override fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/quirk/FlashTooSlowQuirk.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/quirk/FlashTooSlowQuirk.kt
index 6f591d2..a29057b5 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/quirk/FlashTooSlowQuirk.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/compat/quirk/FlashTooSlowQuirk.kt
@@ -38,16 +38,24 @@
class FlashTooSlowQuirk : UseTorchAsFlashQuirk {
companion object {
-
- // List of devices with the issue. See b/181966663.
- private val AFFECTED_MODELS = listOf(
+ private val AFFECTED_MODEL_PREFIXES = listOf(
"PIXEL 3A",
- "PIXEL 3A XL"
+ "PIXEL 3A XL",
+ "SM-A320"
)
fun isEnabled(cameraMetadata: CameraMetadata): Boolean {
- return AFFECTED_MODELS.contains(Build.MODEL.uppercase()) &&
+ return isAffectedModel() &&
cameraMetadata[LENS_FACING] == LENS_FACING_BACK
}
+
+ private fun isAffectedModel(): Boolean {
+ for (modelPrefix in AFFECTED_MODEL_PREFIXES) {
+ if (Build.MODEL.uppercase().startsWith(modelPrefix)) {
+ return true
+ }
+ }
+ return false
+ }
}
-}
\ No newline at end of file
+}
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CameraCallbackMap.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CameraCallbackMap.kt
index 6929c99..dfb4e41 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CameraCallbackMap.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CameraCallbackMap.kt
@@ -118,6 +118,10 @@
}
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
override fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CapturePipeline.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CapturePipeline.kt
index 146f2b4..484cd54 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CapturePipeline.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/CapturePipeline.kt
@@ -256,6 +256,12 @@
completeSignal.complete(null)
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of " +
+ "CaptureFailure",
+ level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("onFailed")
+ )
@SuppressLint("ClassVerificationFailure")
override fun onFailed(
requestMetadata: RequestMetadata,
@@ -283,7 +289,8 @@
} catch (_: CancellationException) {
info {
"CapturePipeline#submitRequestInternal:" +
- " CameraGraph.Session could not be acquired, requests may need re-submission"
+ " CameraGraph.Session could not be acquired, requests may need " +
+ "re-submission"
}
// completing the requests exceptionally so that they are retried with next camera
@@ -324,6 +331,7 @@
CaptureResult.CONTROL_AE_STATE
) == CONTROL_AE_STATE_FLASH_REQUIRED
}
+
FLASH_MODE_OFF -> false
else -> throw AssertionError(flashMode)
}
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/ComboRequestListener.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/ComboRequestListener.kt
index 4f1c06d..6f98ef1 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/ComboRequestListener.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/ComboRequestListener.kt
@@ -84,11 +84,16 @@
}
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
override fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
captureFailure: CaptureFailure
) {
+ @Suppress("DEPRECATION")
listeners.forEach { (listener, executor) ->
executor.execute { listener.onFailed(requestMetadata, frameNumber, captureFailure) }
}
diff --git a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/UseCaseCameraState.kt b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/UseCaseCameraState.kt
index dadbc05..75a210e 100644
--- a/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/UseCaseCameraState.kt
+++ b/camera/camera-camera2-pipe-integration/src/main/java/androidx/camera/camera2/pipe/integration/impl/UseCaseCameraState.kt
@@ -308,7 +308,7 @@
key: CaptureRequest.Key<*>
): Int? = this?.get(key) as? Int
- inner class RequestListener() : Request.Listener {
+ inner class RequestListener : Request.Listener {
override fun onTotalCaptureResult(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
@@ -324,11 +324,16 @@
}
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
override fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
captureFailure: CaptureFailure,
) {
+ @Suppress("DEPRECATION")
super.onFailed(requestMetadata, frameNumber, captureFailure)
completeExceptionally(requestMetadata, captureFailure)
}
diff --git a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/CapturePipelineTest.kt b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/CapturePipelineTest.kt
index ab80d78..a98c7d5 100644
--- a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/CapturePipelineTest.kt
+++ b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/CapturePipelineTest.kt
@@ -59,24 +59,29 @@
import androidx.camera.core.ImageCapture
import androidx.camera.core.ImageCaptureException
import androidx.camera.core.impl.utils.futures.Futures
+import androidx.testutils.MainDispatcherRule
import com.google.common.truth.Truth.assertThat
import java.util.concurrent.ExecutionException
-import java.util.concurrent.Executors
-import java.util.concurrent.ScheduledFuture
import java.util.concurrent.Semaphore
import java.util.concurrent.TimeUnit
+import kotlin.test.assertFailsWith
import kotlinx.coroutines.CompletableDeferred
-import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
-import kotlinx.coroutines.asCoroutineDispatcher
+import kotlinx.coroutines.asExecutor
import kotlinx.coroutines.awaitAll
-import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.test.StandardTestDispatcher
+import kotlinx.coroutines.test.TestScope
+import kotlinx.coroutines.test.advanceUntilIdle
+import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.withTimeoutOrNull
import org.junit.After
-import org.junit.AfterClass
import org.junit.Assert
import org.junit.Before
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.mock
@@ -85,29 +90,23 @@
import org.robolectric.shadows.StreamConfigurationMapBuilder
import org.robolectric.util.ReflectionHelpers
+@OptIn(ExperimentalCoroutinesApi::class)
@RunWith(RobolectricCameraPipeTestRunner::class)
@DoNotInstrument
@Config(minSdk = Build.VERSION_CODES.LOLLIPOP)
class CapturePipelineTest {
+ private val testScope = TestScope()
+ private val testDispatcher = StandardTestDispatcher(testScope.testScheduler)
- companion object {
- private val executor = Executors.newSingleThreadScheduledExecutor()
- private val fakeUseCaseThreads by lazy {
- val dispatcher = executor.asCoroutineDispatcher()
- val cameraScope = CoroutineScope(Job() + dispatcher)
+ @get:Rule
+ val mainDispatcherRule = MainDispatcherRule(testDispatcher)
- UseCaseThreads(
- cameraScope,
- executor,
- dispatcher
- )
- }
-
- @JvmStatic
- @AfterClass
- fun close() {
- executor.shutdown()
- }
+ private val fakeUseCaseThreads by lazy {
+ UseCaseThreads(
+ testScope,
+ testDispatcher.asExecutor(),
+ testDispatcher
+ )
}
private val fakeRequestControl = object : FakeUseCaseCameraRequestControl() {
@@ -197,9 +196,9 @@
surfaceToStreamMap = emptyMap(),
cameraStateAdapter = CameraStateAdapter(),
)
- private var runningRepeatingStream: ScheduledFuture<*>? = null
+ private var runningRepeatingJob: Job? = null
set(value) {
- runningRepeatingStream?.cancel(false)
+ runningRepeatingJob?.cancel()
field = value
}
@@ -238,7 +237,7 @@
// Ensure the control is updated after the UseCaseCamera been set.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(testScope)
).isTrue()
fakeRequestControl.torchUpdateEventList.clear()
}
@@ -261,20 +260,20 @@
@After
fun tearDown() {
- runningRepeatingStream = null
+ runningRepeatingJob = null
}
@Test
- fun miniLatency_flashOn_shouldTriggerAePreCapture(): Unit = runBlocking {
+ fun miniLatency_flashOn_shouldTriggerAePreCapture(): Unit = runTest {
flashOn_shouldTriggerAePreCapture(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
}
@Test
- fun maxQuality_flashOn_shouldTriggerAePreCapture(): Unit = runBlocking {
+ fun maxQuality_flashOn_shouldTriggerAePreCapture(): Unit = runTest {
flashOn_shouldTriggerAePreCapture(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
}
- private suspend fun flashOn_shouldTriggerAePreCapture(imageCaptureMode: Int) {
+ private suspend fun TestScope.flashOn_shouldTriggerAePreCapture(imageCaptureMode: Int) {
// Arrange.
val requestList = mutableListOf<Request>()
fakeCameraGraphSession.requestHandler = { requests ->
@@ -291,30 +290,32 @@
// Assert.
assertThat(
- fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(this)
).isTrue()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
// Assert 2, unlock3APostCapture should be called.
assertThat(
- fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(this)
).isTrue()
}
@Test
- fun miniLatency_flashAutoFlashRequired_shouldTriggerAePreCapture(): Unit = runBlocking {
+ fun miniLatency_flashAutoFlashRequired_shouldTriggerAePreCapture(): Unit = runTest {
flashAutoFlashRequired_shouldTriggerAePreCapture(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
}
@Test
- fun maxQuality_flashAutoFlashRequired_shouldTriggerAePreCapture(): Unit = runBlocking {
+ fun maxQuality_flashAutoFlashRequired_shouldTriggerAePreCapture(): Unit = runTest {
flashAutoFlashRequired_shouldTriggerAePreCapture(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
}
- private suspend fun flashAutoFlashRequired_shouldTriggerAePreCapture(imageCaptureMode: Int) {
+ private suspend fun TestScope.flashAutoFlashRequired_shouldTriggerAePreCapture(
+ imageCaptureMode: Int
+ ) {
// Arrange.
comboRequestListener.simulateRepeatingResult(
resultParameters = mapOf(
@@ -337,33 +338,33 @@
// Assert 1, lock3AForCapture should be called, but not call unlock3APostCapture
// (before capturing is finished).
assertThat(
- fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(this)
).isTrue()
assertThat(
- fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(2, TimeUnit.SECONDS)
+ fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(this)
).isFalse()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
// Assert 2, unlock3APostCapture should be called.
assertThat(
- fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.unlock3APostCaptureSemaphore.tryAcquire(this)
).isTrue()
}
@Test
- fun miniLatency_withTorchAsFlashQuirk_shouldOpenTorch(): Unit = runBlocking {
+ fun miniLatency_withTorchAsFlashQuirk_shouldOpenTorch(): Unit = runTest {
withTorchAsFlashQuirk_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
}
@Test
- fun maxQuality_withTorchAsFlashQuirk_shouldOpenTorch(): Unit = runBlocking {
+ fun maxQuality_withTorchAsFlashQuirk_shouldOpenTorch(): Unit = runTest {
withTorchAsFlashQuirk_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
}
- private suspend fun withTorchAsFlashQuirk_shouldOpenTorch(imageCaptureMode: Int) {
+ private suspend fun TestScope.withTorchAsFlashQuirk_shouldOpenTorch(imageCaptureMode: Int) {
// Arrange.
capturePipeline = CapturePipelineImpl(
cameraProperties = fakeCameraProperties,
@@ -390,34 +391,34 @@
// Assert 1, torch should be turned on.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isTrue()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
// Assert 2, torch should be turned off.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isFalse()
}
@Test
- fun miniLatency_withTemplateRecord_shouldOpenTorch(): Unit = runBlocking {
+ fun miniLatency_withTemplateRecord_shouldOpenTorch(): Unit = runTest {
withTemplateRecord_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
}
@Test
- fun maxQuality_withTemplateRecord_shouldOpenTorch(): Unit = runBlocking {
+ fun maxQuality_withTemplateRecord_shouldOpenTorch(): Unit = runTest {
withTemplateRecord_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
}
- private suspend fun withTemplateRecord_shouldOpenTorch(imageCaptureMode: Int) {
+ private suspend fun TestScope.withTemplateRecord_shouldOpenTorch(imageCaptureMode: Int) {
// Arrange.
capturePipeline.template = CameraDevice.TEMPLATE_RECORD
@@ -436,34 +437,34 @@
// Assert 1, torch should be turned on.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isTrue()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
// Assert 2, torch should be turned off.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isFalse()
}
@Test
- fun miniLatency_withFlashTypeTorch_shouldOpenTorch(): Unit = runBlocking {
+ fun miniLatency_withFlashTypeTorch_shouldOpenTorch(): Unit = runTest {
withFlashTypeTorch_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY)
}
@Test
- fun maxQuality_withFlashTypeTorch_shouldOpenTorch(): Unit = runBlocking {
+ fun maxQuality_withFlashTypeTorch_shouldOpenTorch(): Unit = runTest {
withFlashTypeTorch_shouldOpenTorch(ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY)
}
- private suspend fun withFlashTypeTorch_shouldOpenTorch(imageCaptureMode: Int) {
+ private suspend fun TestScope.withFlashTypeTorch_shouldOpenTorch(imageCaptureMode: Int) {
// Arrange.
val requestList = mutableListOf<Request>()
fakeCameraGraphSession.requestHandler = { requests ->
@@ -480,25 +481,25 @@
// Assert 1, torch should be turned on.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isTrue()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
// Assert 2, torch should be turned off.
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(1)
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst()).isFalse()
}
@Test
- fun miniLatency_flashRequired_withFlashTypeTorch_shouldLock3A(): Unit = runBlocking {
+ fun miniLatency_flashRequired_withFlashTypeTorch_shouldLock3A(): Unit = runTest {
withFlashTypeTorch_shouldLock3A(
ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY,
ImageCapture.FLASH_MODE_ON
@@ -506,14 +507,17 @@
}
@Test
- fun maxQuality_withFlashTypeTorch_shouldLock3A(): Unit = runBlocking {
+ fun maxQuality_withFlashTypeTorch_shouldLock3A(): Unit = runTest {
withFlashTypeTorch_shouldLock3A(
ImageCapture.CAPTURE_MODE_MAXIMIZE_QUALITY,
ImageCapture.FLASH_MODE_OFF
)
}
- private suspend fun withFlashTypeTorch_shouldLock3A(imageCaptureMode: Int, flashMode: Int) {
+ private suspend fun TestScope.withFlashTypeTorch_shouldLock3A(
+ imageCaptureMode: Int,
+ flashMode: Int
+ ) {
// Arrange.
val requestList = mutableListOf<Request>()
fakeCameraGraphSession.requestHandler = { requests ->
@@ -530,24 +534,25 @@
// Assert 1, should call lock3A, but not call unlock3A (before capturing is finished).
assertThat(
- fakeCameraGraphSession.lock3ASemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.lock3ASemaphore.tryAcquire(this)
).isTrue()
assertThat(
- fakeCameraGraphSession.unlock3ASemaphore.tryAcquire(1, TimeUnit.SECONDS)
+ fakeCameraGraphSession.unlock3ASemaphore.tryAcquire(this)
).isFalse()
// Complete the capture request.
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
requestList.complete()
+ advanceUntilIdle()
// Assert 2, should call unlock3A.
assertThat(
- fakeCameraGraphSession.unlock3ASemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.unlock3ASemaphore.tryAcquire(this)
).isTrue()
}
@Test
- fun miniLatency_withFlashTypeTorch_shouldNotLock3A(): Unit = runBlocking {
+ fun miniLatency_withFlashTypeTorch_shouldNotLock3A(): Unit = runTest {
// Act.
capturePipeline.submitStillCaptures(
requests = listOf(singleRequest),
@@ -558,17 +563,17 @@
// Assert, there is no invocation on lock3A().
assertThat(
- fakeCameraGraphSession.lock3ASemaphore.tryAcquire(1, TimeUnit.SECONDS)
+ fakeCameraGraphSession.lock3ASemaphore.tryAcquire(this)
).isFalse()
}
@Test
- fun withFlashTypeTorch_torchAlreadyOn_skipTurnOnTorch(): Unit = runBlocking {
+ fun withFlashTypeTorch_torchAlreadyOn_skipTurnOnTorch(): Unit = runTest {
// Arrange.
// Ensure the torch is already turned on before capturing.
torchControl.setTorchAsync(true)
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(2, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
// Act.
@@ -581,12 +586,12 @@
// Assert, there is no invocation on setTorch().
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(1, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isFalse()
}
@Test
- fun miniLatency_shouldNotAePreCapture(): Unit = runBlocking {
+ fun miniLatency_shouldNotAePreCapture(): Unit = runTest {
// Act.
capturePipeline.submitStillCaptures(
requests = listOf(singleRequest),
@@ -597,16 +602,17 @@
// Assert, there is only 1 single capture request.
assertThat(
- fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(1, TimeUnit.SECONDS)
+ fakeCameraGraphSession.lock3AForCaptureSemaphore.tryAcquire(this)
).isFalse()
}
@Test
- fun captureFailure_taskShouldFailure(): Unit = runBlocking {
+ fun captureFailure_taskShouldFailure(): Unit = runTest {
// Arrange.
fakeCameraGraphSession.requestHandler = { requests ->
requests.forEach { request ->
// Callback capture fail immediately.
+ @Suppress("DEPRECATION")
request.listeners.forEach {
it.onFailed(
requestMetadata = FakeRequestMetadata(),
@@ -626,14 +632,15 @@
)
// Assert.
- val exception = Assert.assertThrows(ImageCaptureException::class.java) {
- runBlocking { resultDeferredList.awaitAllWithTimeout() }
+ advanceUntilIdle()
+ val exception = assertFailsWith(ImageCaptureException::class) {
+ resultDeferredList.awaitAllWithTimeout()
}
assertThat(exception.imageCaptureError).isEqualTo(ImageCapture.ERROR_CAPTURE_FAILED)
}
@Test
- fun captureCancel_taskShouldFailureWithCAMERA_CLOSED(): Unit = runBlocking {
+ fun captureCancel_taskShouldFailureWithCAMERA_CLOSED(): Unit = runTest {
// Arrange.
fakeCameraGraphSession.requestHandler = { requests ->
requests.forEach { request ->
@@ -655,6 +662,7 @@
)
// Assert.
+ advanceUntilIdle()
val exception = Assert.assertThrows(ExecutionException::class.java) {
Futures.allAsList(resultDeferredList.map {
it.asListenableFuture()
@@ -667,7 +675,7 @@
}
@Test
- fun stillCaptureWithFlashStopRepeatingQuirk_shouldStopRepeatingTemporarily() = runBlocking {
+ fun stillCaptureWithFlashStopRepeatingQuirk_shouldStopRepeatingTemporarily() = runTest {
// Arrange
ReflectionHelpers.setStaticField(Build::class.java, "MANUFACTURER", "SAMSUNG")
ReflectionHelpers.setStaticField(Build::class.java, "MODEL", "SM-A716")
@@ -680,11 +688,13 @@
// Act.
capturePipeline.submitStillCaptures(
- requests = listOf(Request(
- streams = emptyList(),
- parameters = mapOf(CONTROL_AE_MODE to CONTROL_AE_MODE_ON_ALWAYS_FLASH),
- template = RequestTemplate(CameraDevice.TEMPLATE_STILL_CAPTURE)
- )),
+ requests = listOf(
+ Request(
+ streams = emptyList(),
+ parameters = mapOf(CONTROL_AE_MODE to CONTROL_AE_MODE_ON_ALWAYS_FLASH),
+ template = RequestTemplate(CameraDevice.TEMPLATE_STILL_CAPTURE)
+ )
+ ),
captureMode = ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY,
flashMode = ImageCapture.FLASH_MODE_ON,
flashType = ImageCapture.FLASH_TYPE_ONE_SHOT_FLASH,
@@ -692,23 +702,23 @@
// Assert, stopRepeating -> submit -> startRepeating flow should be used.
assertThat(
- fakeCameraGraphSession.stopRepeatingSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.stopRepeatingSemaphore.tryAcquire(this)
).isTrue()
assertThat(
- fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.submitSemaphore.tryAcquire(this)
).isTrue()
// Completing the submitted capture request.
submittedRequestList.complete()
assertThat(
- fakeCameraGraphSession.repeatingRequestSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.repeatingRequestSemaphore.tryAcquire(this)
).isTrue()
}
@Test
- fun stillCaptureWithFlashStopRepeatingQuirkNotEnabled_shouldNotStopRepeating() = runBlocking {
+ fun stillCaptureWithFlashStopRepeatingQuirkNotEnabled_shouldNotStopRepeating() = runTest {
// Arrange
val submittedRequestList = mutableListOf<Request>()
fakeCameraGraphSession.requestHandler = { requests ->
@@ -718,11 +728,13 @@
// Act.
capturePipeline.submitStillCaptures(
- requests = listOf(Request(
- streams = emptyList(),
- parameters = mapOf(CONTROL_AE_MODE to CONTROL_AE_MODE_ON_ALWAYS_FLASH),
- template = RequestTemplate(CameraDevice.TEMPLATE_STILL_CAPTURE)
- )),
+ requests = listOf(
+ Request(
+ streams = emptyList(),
+ parameters = mapOf(CONTROL_AE_MODE to CONTROL_AE_MODE_ON_ALWAYS_FLASH),
+ template = RequestTemplate(CameraDevice.TEMPLATE_STILL_CAPTURE)
+ )
+ ),
captureMode = ImageCapture.CAPTURE_MODE_MINIMIZE_LATENCY,
flashMode = ImageCapture.FLASH_MODE_ON,
flashType = ImageCapture.FLASH_TYPE_ONE_SHOT_FLASH,
@@ -730,11 +742,11 @@
// Assert, repeating should not be stopped when quirk not enabled.
assertThat(
- fakeCameraGraphSession.stopRepeatingSemaphore.tryAcquire(2, TimeUnit.SECONDS)
+ fakeCameraGraphSession.stopRepeatingSemaphore.tryAcquire(this)
).isFalse()
assertThat(
- fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeCameraGraphSession.submitSemaphore.tryAcquire(this)
).isTrue()
// Resetting repeatingRequestSemaphore because startRepeating can be called before
@@ -744,21 +756,21 @@
submittedRequestList.complete()
assertThat(
- fakeCameraGraphSession.repeatingRequestSemaphore.tryAcquire(2, TimeUnit.SECONDS)
+ fakeCameraGraphSession.repeatingRequestSemaphore.tryAcquire(this)
).isFalse()
}
@Test
- fun torchAsFlash_torchCorrection_shouldTurnsTorchOffOn(): Unit = runBlocking {
+ fun torchAsFlash_torchCorrection_shouldTurnsTorchOffOn(): Unit = runTest {
torchStateCorrectionTest(ImageCapture.FLASH_TYPE_USE_TORCH_AS_FLASH)
}
@Test
- fun defaultCapture_torchCorrection_shouldTurnsTorchOffOn(): Unit = runBlocking {
+ fun defaultCapture_torchCorrection_shouldTurnsTorchOffOn(): Unit = runTest {
torchStateCorrectionTest(ImageCapture.FLASH_TYPE_ONE_SHOT_FLASH)
}
- private suspend fun torchStateCorrectionTest(flashType: Int) {
+ private suspend fun TestScope.torchStateCorrectionTest(flashType: Int) {
// Arrange.
torchControl.setTorchAsync(torch = true).join()
verifyTorchState(true)
@@ -781,8 +793,8 @@
flashType = flashType,
)
- assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(5, TimeUnit.SECONDS)).isTrue()
- assertThat(fakeRequestControl.setTorchSemaphore.tryAcquire(1, TimeUnit.SECONDS)).isFalse()
+ assertThat(fakeCameraGraphSession.submitSemaphore.tryAcquire(this)).isTrue()
+ assertThat(fakeRequestControl.setTorchSemaphore.tryAcquire(this)).isFalse()
// Complete the capture request.
requestList.complete()
@@ -793,9 +805,9 @@
assertThat(fakeRequestControl.torchUpdateEventList.size).isEqualTo(0)
}
- private fun verifyTorchState(state: Boolean) {
+ private fun TestScope.verifyTorchState(state: Boolean) {
assertThat(
- fakeRequestControl.setTorchSemaphore.tryAcquire(5, TimeUnit.SECONDS)
+ fakeRequestControl.setTorchSemaphore.tryAcquire(this)
).isTrue()
assertThat(fakeRequestControl.torchUpdateEventList.removeFirst() == state).isTrue()
}
@@ -824,20 +836,30 @@
requestParameters: Map<CaptureRequest.Key<*>, Any> = mutableMapOf(),
resultParameters: Map<CaptureResult.Key<*>, Any> = mutableMapOf(),
) {
- executor.schedule({
- runningRepeatingStream = executor.scheduleAtFixedRate({
- val fakeRequestMetadata = FakeRequestMetadata(requestParameters = requestParameters)
- val fakeFrameMetadata = FakeFrameMetadata(resultMetadata = resultParameters)
- val fakeFrameInfo = FakeFrameInfo(
- metadata = fakeFrameMetadata, requestMetadata = fakeRequestMetadata,
- )
- this.onTotalCaptureResult(
- requestMetadata = fakeRequestMetadata,
- frameNumber = FrameNumber(101L),
- totalCaptureResult = fakeFrameInfo,
- )
- }, 0, period, TimeUnit.MILLISECONDS)
- }, initialDelay, TimeUnit.MILLISECONDS)
+ let { listener ->
+ runningRepeatingJob = fakeUseCaseThreads.scope.launch {
+ delay(initialDelay)
+
+ // the counter uses 1000 frames for repeating request instead of infinity so that
+ // coroutine can complete and lead to an idle state, should be sufficient for all
+ // our testing purposes here
+ var counter = 1000
+ while (counter-- > 0) {
+ val fakeRequestMetadata =
+ FakeRequestMetadata(requestParameters = requestParameters)
+ val fakeFrameMetadata = FakeFrameMetadata(resultMetadata = resultParameters)
+ val fakeFrameInfo = FakeFrameInfo(
+ metadata = fakeFrameMetadata, requestMetadata = fakeRequestMetadata,
+ )
+ listener.onTotalCaptureResult(
+ requestMetadata = fakeRequestMetadata,
+ frameNumber = FrameNumber(101L),
+ totalCaptureResult = fakeFrameInfo,
+ )
+ delay(period)
+ }
+ }
+ }
}
private suspend fun <T> Collection<Deferred<T>>.awaitAllWithTimeout(
@@ -845,4 +867,15 @@
) = checkNotNull(withTimeoutOrNull(timeMillis) {
awaitAll()
}) { "Cannot complete the Deferred within $timeMillis" }
+
+ /**
+ * Advances TestScope coroutine to idle state (i.e. all tasks completed) before trying to
+ * acquire semaphore immediately.
+ *
+ * This saves time by not having to explicitly wait for a semaphore status to be updated.
+ */
+ private fun Semaphore.tryAcquire(testScope: TestScope): Boolean {
+ testScope.advanceUntilIdle()
+ return tryAcquire()
+ }
}
diff --git a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/StillCaptureRequestTest.kt b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/StillCaptureRequestTest.kt
index 63e023a..baa17cc 100644
--- a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/StillCaptureRequestTest.kt
+++ b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/impl/StillCaptureRequestTest.kt
@@ -201,6 +201,7 @@
fakeCameraGraphSession.submittedRequests.first().let { request ->
request.listeners.forEach { listener ->
+ @Suppress("DEPRECATION")
listener.onFailed(
FakeRequestMetadata(),
FrameNumber(0),
diff --git a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/FakeCameraGraphSession.kt b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/FakeCameraGraphSession.kt
index 806a400..c3d481e 100644
--- a/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/FakeCameraGraphSession.kt
+++ b/camera/camera-camera2-pipe-integration/src/test/java/androidx/camera/camera2/pipe/integration/testing/FakeCameraGraphSession.kt
@@ -51,6 +51,7 @@
FAILED,
ABORTED
}
+
var startRepeatingSignal = CompletableDeferred(TOTAL_CAPTURE_DONE) // already completed
val submittedRequests = mutableListOf<Request>()
@@ -173,9 +174,11 @@
TOTAL_CAPTURE_DONE -> listener.onTotalCaptureResult(
FakeRequestMetadata(request = request), FrameNumber(0), FakeFrameInfo()
)
- FAILED -> listener.onFailed(
+
+ FAILED -> @Suppress("DEPRECATION") listener.onFailed(
FakeRequestMetadata(request = request), FrameNumber(0), getFakeCaptureFailure()
)
+
ABORTED -> listener.onRequestSequenceAborted(
FakeRequestMetadata(request = request)
)
diff --git a/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/CameraGraphSimulator.kt b/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/CameraGraphSimulator.kt
index a301e01..bf2264c 100644
--- a/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/CameraGraphSimulator.kt
+++ b/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/CameraGraphSimulator.kt
@@ -18,7 +18,6 @@
import android.content.Context
import android.graphics.SurfaceTexture
-import android.hardware.camera2.CaptureFailure
import android.hardware.camera2.CaptureResult
import android.view.Surface
import androidx.annotation.RequiresApi
@@ -34,6 +33,7 @@
import androidx.camera.camera2.pipe.GraphState.GraphStateError
import androidx.camera.camera2.pipe.Metadata
import androidx.camera.camera2.pipe.Request
+import androidx.camera.camera2.pipe.RequestFailureWrapper
import androidx.camera.camera2.pipe.StreamId
import kotlinx.atomicfu.atomic
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -283,9 +283,9 @@
}
}
- fun simulateFailure(captureFailure: CaptureFailure) {
+ fun simulateFailure(requestFailureWrapper: RequestFailureWrapper) {
requestSequence.invokeOnRequest(requestMetadata) {
- it.onFailed(requestMetadata, frameNumber, captureFailure)
+ it.onFailed(requestMetadata, frameNumber, requestFailureWrapper)
}
}
diff --git a/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/FakeRequestListener.kt b/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/FakeRequestListener.kt
index a3ca0db..e097dc3 100644
--- a/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/FakeRequestListener.kt
+++ b/camera/camera-camera2-pipe-testing/src/main/java/androidx/camera/camera2/pipe/testing/FakeRequestListener.kt
@@ -37,7 +37,7 @@
* to be sent.
*/
@Suppress("ListenerInterface")
-public class FakeRequestListener(private val replayBuffer: Int = 10) : Request.Listener {
+class FakeRequestListener(private val replayBuffer: Int = 10) : Request.Listener {
private val _onStartedFlow = MutableSharedFlow<OnStarted>(replay = replayBuffer)
val onStartedFlow = _onStartedFlow.asSharedFlow()
@@ -148,6 +148,10 @@
"($replayBuffer) may need to be increased."
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
override fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Requests.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Requests.kt
index 359e98d..1c98dad 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Requests.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/Requests.kt
@@ -141,6 +141,17 @@
) {
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING
+ )
+ fun onFailed(
+ requestMetadata: RequestMetadata,
+ frameNumber: FrameNumber,
+ captureFailure: CaptureFailure
+ ) {
+ }
+
/**
* onFailed occurs when a CaptureRequest failed in some way and the frame will not receive
* the [onTotalCaptureResult] callback.
@@ -149,13 +160,13 @@
*
* @param requestMetadata the data about the camera2 request that was sent to the camera.
* @param frameNumber the android frame number for this exposure
- * @param captureFailure the android [CaptureFailure] data
+ * @param requestFailureWrapper the android [RequestFailureWrapper] data wrapper
* @see android.hardware.camera2.CameraCaptureSession.CaptureCallback.onCaptureFailed
*/
fun onFailed(
requestMetadata: RequestMetadata,
frameNumber: FrameNumber,
- captureFailure: CaptureFailure
+ requestFailureWrapper: RequestFailureWrapper
) {
}
@@ -239,6 +250,23 @@
}
/**
+ * Interface wrapper for [CaptureFailure].
+ *
+ * This interface should be used instead of [CaptureFailure] because its package-private
+ * constructor prevents directly creating an instance of it.
+ */
+@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
+interface RequestFailureWrapper {
+ val requestMetadata: RequestMetadata
+
+ val frameNumber: FrameNumber
+
+ val reason: Int
+
+ val wasImageCaptured: Boolean
+}
+
+/**
* A [RequestTemplate] indicates which preset set list of parameters will be applied to a request by
* default. These values are defined by camera2.
*/
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/AndroidCaptureFailure.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/AndroidCaptureFailure.kt
new file mode 100644
index 0000000..7b22375
--- /dev/null
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/AndroidCaptureFailure.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@file:RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
+
+package androidx.camera.camera2.pipe.compat
+
+import android.hardware.camera2.CaptureFailure
+import android.os.Build
+import androidx.annotation.RequiresApi
+import androidx.camera.camera2.pipe.FrameNumber
+import androidx.camera.camera2.pipe.RequestFailureWrapper
+import androidx.camera.camera2.pipe.RequestMetadata
+
+/**
+ * This class implements the [RequestFailureWrapper] interface to create a
+ * CaptureFailure object that can be used instead of the package-private [CaptureFailure]
+ */
+@RequiresApi(Build.VERSION_CODES.LOLLIPOP)
+internal class AndroidCaptureFailure(
+ override val requestMetadata: RequestMetadata,
+ override val wasImageCaptured: Boolean,
+ override val frameNumber: FrameNumber,
+ override val reason: Int
+) : RequestFailureWrapper
\ No newline at end of file
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureCallback.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureCallback.kt
new file mode 100644
index 0000000..4fbaac1
--- /dev/null
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureCallback.kt
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.camera.camera2.pipe.compat
+
+import android.hardware.camera2.CameraCaptureSession
+import android.hardware.camera2.CameraExtensionSession
+import android.hardware.camera2.CaptureRequest
+import android.hardware.camera2.CaptureResult
+import android.hardware.camera2.TotalCaptureResult
+import androidx.camera.camera2.pipe.FrameNumber
+
+/**
+ * Interface for merging functionality of [CameraCaptureSession.CaptureCallback] and
+ * [CameraExtensionSession.ExtensionCaptureCallback].
+ *
+ * [CameraCaptureSession.CaptureCallback] and [CameraExtensionSession.ExtensionCaptureCallback]
+ * are abstract classes, so a class cannot extend both of them. This interface prevents duplication
+ * of code and developer facing endpoints because it is agnostic of which session type it is
+ * used for.
+ */
+internal interface Camera2CaptureCallback {
+ fun onCaptureStarted(
+ captureRequest: CaptureRequest,
+ captureFrameNumber: Long,
+ captureTimestamp: Long
+ )
+
+ fun onCaptureProgressed(captureRequest: CaptureRequest, partialCaptureResult: CaptureResult)
+
+ fun onCaptureCompleted(
+ captureRequest: CaptureRequest,
+ captureResult: TotalCaptureResult,
+ frameNumber: FrameNumber
+ )
+
+ fun onCaptureFailed(
+ captureRequest: CaptureRequest,
+ frameNumber: FrameNumber
+ )
+
+ fun onCaptureSequenceCompleted(captureSequenceId: Int, captureFrameNumber: Long)
+
+ fun onCaptureSequenceAborted(captureSequenceId: Int)
+}
\ No newline at end of file
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequence.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequence.kt
index c58f0f6..f0ad932a 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequence.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequence.kt
@@ -50,7 +50,8 @@
override val sequenceListener: CaptureSequence.CaptureSequenceListener,
private val requestNumberMap: Map<RequestNumber, RequestMetadata>,
private val surfaceMap: Map<Surface, StreamId>,
-) : CameraCaptureSession.CaptureCallback(), CaptureSequence<CaptureRequest> {
+) : Camera2CaptureCallback, CameraCaptureSession.CaptureCallback(),
+ CaptureSequence<CaptureRequest> {
private val debugId = captureSequenceDebugIds.incrementAndGet()
private val hasStarted = CompletableDeferred<Unit>()
@@ -85,6 +86,12 @@
captureRequest: CaptureRequest,
captureTimestamp: Long,
captureFrameNumber: Long
+ ) = onCaptureStarted(captureRequest, captureTimestamp, captureFrameNumber)
+
+ override fun onCaptureStarted(
+ captureRequest: CaptureRequest,
+ captureFrameNumber: Long,
+ captureTimestamp: Long
) {
val requestNumber = readRequestNumber(captureRequest)
val timestamp = CameraTimestamp(captureTimestamp)
@@ -102,6 +109,11 @@
captureSession: CameraCaptureSession,
captureRequest: CaptureRequest,
partialCaptureResult: CaptureResult
+ ) = onCaptureProgressed(captureRequest, partialCaptureResult)
+
+ override fun onCaptureProgressed(
+ captureRequest: CaptureRequest,
+ partialCaptureResult: CaptureResult
) {
val requestNumber = readRequestNumber(captureRequest)
val frameNumber = FrameNumber(partialCaptureResult.frameNumber)
@@ -118,11 +130,16 @@
captureSession: CameraCaptureSession,
captureRequest: CaptureRequest,
captureResult: TotalCaptureResult
+ ) = onCaptureCompleted(captureRequest, captureResult, FrameNumber(captureResult.frameNumber))
+
+ override fun onCaptureCompleted(
+ captureRequest: CaptureRequest,
+ captureResult: TotalCaptureResult,
+ frameNumber: FrameNumber
) {
sequenceListener.onCaptureSequenceComplete(this)
val requestNumber = readRequestNumber(captureRequest)
- val frameNumber = FrameNumber(captureResult.frameNumber)
// Load the request and throw if we are not able to find an associated request. Under
// normal circumstances this should never happen.
@@ -137,21 +154,42 @@
invokeOnRequest(request) { it.onComplete(request, frameNumber, frameInfo) }
}
+ @Deprecated(
+ message = "Migrating to using RequestFailureWrapper instead of CaptureFailure",
+ level = DeprecationLevel.WARNING,
+ replaceWith = ReplaceWith("onFailed")
+ )
override fun onCaptureFailed(
captureSession: CameraCaptureSession,
captureRequest: CaptureRequest,
captureFailure: CaptureFailure
+ ) = onCaptureFailed(
+ captureRequest,
+ FrameNumber(captureFailure.frameNumber)
+ )
+
+ override fun onCaptureFailed(
+ captureRequest: CaptureRequest,
+ frameNumber: FrameNumber
) {
sequenceListener.onCaptureSequenceComplete(this)
val requestNumber = readRequestNumber(captureRequest)
- val frameNumber = FrameNumber(captureFailure.frameNumber)
// Load the request and throw if we are not able to find an associated request. Under
// normal circumstances this should never happen.
val request = readRequestMetadata(requestNumber)
- invokeOnRequest(request) { it.onFailed(request, frameNumber, captureFailure) }
+ val androidCaptureFailure = AndroidCaptureFailure(
+ request,
+ false,
+ frameNumber,
+ CaptureFailure.REASON_ERROR
+ )
+
+ invokeOnRequest(request) {
+ it.onFailed(request, frameNumber, androidCaptureFailure)
+ }
}
override fun onCaptureBufferLost(
@@ -178,6 +216,11 @@
captureSession: CameraCaptureSession,
captureSequenceId: Int,
captureFrameNumber: Long
+ ) = onCaptureSequenceCompleted(captureSequenceId, captureFrameNumber)
+
+ override fun onCaptureSequenceCompleted(
+ captureSequenceId: Int,
+ captureFrameNumber: Long
) {
sequenceListener.onCaptureSequenceComplete(this)
@@ -195,7 +238,9 @@
override fun onCaptureSequenceAborted(
captureSession: CameraCaptureSession,
captureSequenceId: Int
- ) {
+ ) = onCaptureSequenceAborted(captureSequenceId)
+
+ override fun onCaptureSequenceAborted(captureSequenceId: Int) {
sequenceListener.onCaptureSequenceComplete(this)
check(sequenceNumber == captureSequenceId) {
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequenceProcessor.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequenceProcessor.kt
index 9a9bd8ac..212b808 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequenceProcessor.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/Camera2CaptureSequenceProcessor.kt
@@ -277,23 +277,15 @@
if (shouldWaitForRepeatingRequest) {
lastSingleRepeatingRequestSequence = captureSequence
}
- session.setRepeatingRequest(
- captureSequence.captureRequestList[0], captureCallback, threads.camera2Handler
- )
+ session.setRepeatingRequest(captureSequence.captureRequestList[0], captureCallback)
} else {
- session.capture(
- captureSequence.captureRequestList[0], captureSequence, threads.camera2Handler
- )
+ session.capture(captureSequence.captureRequestList[0], captureSequence)
}
} else {
if (captureSequence.repeating) {
- session.setRepeatingBurst(
- captureSequence.captureRequestList, captureSequence, threads.camera2Handler
- )
+ session.setRepeatingBurst(captureSequence.captureRequestList, captureSequence)
} else {
- session.captureBurst(
- captureSequence.captureRequestList, captureSequence, threads.camera2Handler
- )
+ session.captureBurst(captureSequence.captureRequestList, captureSequence)
}
}
}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CameraDeviceWrapper.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CameraDeviceWrapper.kt
index 8981549..6a4b1eb 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CameraDeviceWrapper.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CameraDeviceWrapper.kt
@@ -26,7 +26,6 @@
import android.hardware.camera2.params.InputConfiguration
import android.hardware.camera2.params.OutputConfiguration
import android.os.Build
-import android.os.Handler
import android.view.Surface
import androidx.annotation.GuardedBy
import androidx.annotation.RequiresApi
@@ -37,6 +36,7 @@
import androidx.camera.camera2.pipe.core.Debug
import androidx.camera.camera2.pipe.core.Log
import androidx.camera.camera2.pipe.core.SystemTimeSource
+import androidx.camera.camera2.pipe.core.Threads
import androidx.camera.camera2.pipe.core.Timestamps
import androidx.camera.camera2.pipe.core.Timestamps.formatMs
import androidx.camera.camera2.pipe.internal.CameraErrorListener
@@ -64,8 +64,7 @@
/** @see CameraDevice.createCaptureSession */
fun createCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean
/** @see CameraDevice.createReprocessableCaptureSession */
@@ -73,24 +72,21 @@
fun createReprocessableCaptureSession(
input: InputConfiguration,
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean
/** @see CameraDevice.createConstrainedHighSpeedCaptureSession */
@RequiresApi(Build.VERSION_CODES.M)
fun createConstrainedHighSpeedCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean
/** @see CameraDevice.createCaptureSessionByOutputConfigurations */
@RequiresApi(Build.VERSION_CODES.N)
fun createCaptureSessionByOutputConfigurations(
outputConfigurations: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean
/** @see CameraDevice.createReprocessableCaptureSessionByConfigurations */
@@ -98,8 +94,7 @@
fun createReprocessableCaptureSessionByConfigurations(
inputConfig: InputConfigData,
outputs: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean
/** @see CameraDevice.createCaptureSession */
@@ -133,13 +128,13 @@
private val cameraErrorListener: CameraErrorListener,
private val interopSessionStateCallback: StateCallback? = null,
private val interopExtensionSessionStateCallback: CameraExtensionSession.StateCallback? = null,
+ private val threads: Threads
) : CameraDeviceWrapper {
private val _lastStateCallback = atomic<OnSessionFinalized?>(null)
override fun createCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean = catchAndReportCameraExceptions(cameraId, cameraErrorListener) {
val previousStateCallback = _lastStateCallback.value
check(_lastStateCallback.compareAndSet(previousStateCallback, stateCallback))
@@ -154,9 +149,10 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
),
- handler
+ threads.camera2Handler
)
} != null
@@ -183,7 +179,8 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopExtensionSessionStateCallback
+ interopExtensionSessionStateCallback,
+ config.executor
),
)
Api31Compat.createExtensionCaptureSession(cameraDevice, sessionConfig)
@@ -193,8 +190,7 @@
override fun createReprocessableCaptureSession(
input: InputConfiguration,
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean = catchAndReportCameraExceptions(cameraId, cameraErrorListener) {
val previousStateCallback = _lastStateCallback.value
check(_lastStateCallback.compareAndSet(previousStateCallback, stateCallback))
@@ -210,17 +206,17 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
),
- handler
+ threads.camera2Handler
)
} != null
@RequiresApi(23)
override fun createConstrainedHighSpeedCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean = catchAndReportCameraExceptions(cameraId, cameraErrorListener) {
val previousStateCallback = _lastStateCallback.value
check(_lastStateCallback.compareAndSet(previousStateCallback, stateCallback))
@@ -235,17 +231,17 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
),
- handler
+ threads.camera2Handler
)
} != null
@RequiresApi(24)
override fun createCaptureSessionByOutputConfigurations(
outputConfigurations: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean = catchAndReportCameraExceptions(cameraId, cameraErrorListener) {
val previousStateCallback = _lastStateCallback.value
check(_lastStateCallback.compareAndSet(previousStateCallback, stateCallback))
@@ -260,9 +256,10 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
),
- handler
+ threads.camera2Handler
)
} != null
@@ -270,8 +267,7 @@
override fun createReprocessableCaptureSessionByConfigurations(
inputConfig: InputConfigData,
outputs: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean = catchAndReportCameraExceptions(cameraId, cameraErrorListener) {
val previousStateCallback = _lastStateCallback.value
check(_lastStateCallback.compareAndSet(previousStateCallback, stateCallback))
@@ -289,9 +285,10 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
),
- handler
+ threads.camera2Handler
)
} != null
@@ -312,7 +309,8 @@
stateCallback,
previousStateCallback,
cameraErrorListener,
- interopSessionStateCallback
+ interopSessionStateCallback,
+ threads.camera2Handler
)
)
@@ -387,15 +385,14 @@
override fun createCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
) = synchronized(lock) {
if (disconnected) {
Log.warn { "createCaptureSession failed: Virtual device disconnected" }
stateCallback.onSessionFinalized()
false
} else {
- androidCameraDevice.createCaptureSession(outputs, stateCallback, handler)
+ androidCameraDevice.createCaptureSession(outputs, stateCallback)
}
}
@@ -403,8 +400,7 @@
override fun createReprocessableCaptureSession(
input: InputConfiguration,
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
) = synchronized(lock) {
if (disconnected) {
Log.warn { "createReprocessableCaptureSession failed: Virtual device disconnected" }
@@ -414,8 +410,7 @@
androidCameraDevice.createReprocessableCaptureSession(
input,
outputs,
- stateCallback,
- handler
+ stateCallback
)
}
}
@@ -423,8 +418,7 @@
@RequiresApi(23)
override fun createConstrainedHighSpeedCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
) = synchronized(lock) {
if (disconnected) {
Log.warn {
@@ -435,8 +429,7 @@
} else {
androidCameraDevice.createConstrainedHighSpeedCaptureSession(
outputs,
- stateCallback,
- handler
+ stateCallback
)
}
}
@@ -444,8 +437,7 @@
@RequiresApi(24)
override fun createCaptureSessionByOutputConfigurations(
outputConfigurations: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
) = synchronized(lock) {
if (disconnected) {
Log.warn {
@@ -456,8 +448,7 @@
} else {
androidCameraDevice.createCaptureSessionByOutputConfigurations(
outputConfigurations,
- stateCallback,
- handler
+ stateCallback
)
}
}
@@ -466,8 +457,7 @@
override fun createReprocessableCaptureSessionByConfigurations(
inputConfig: InputConfigData,
outputs: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
) = synchronized(lock) {
if (disconnected) {
Log.warn {
@@ -480,8 +470,7 @@
androidCameraDevice.createReprocessableCaptureSessionByConfigurations(
inputConfig,
outputs,
- stateCallback,
- handler
+ stateCallback
)
}
}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactory.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactory.kt
index c13f8c6..694c257 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactory.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactory.kt
@@ -106,7 +106,7 @@
captureSessionState: CaptureSessionState
): Map<StreamId, OutputConfigurationWrapper> {
if (!cameraDevice.createCaptureSession(
- surfaces.map { it.value }, captureSessionState, threads.camera2Handler
+ surfaces.map { it.value }, captureSessionState
)
) {
Log.warn {
@@ -137,8 +137,7 @@
outputConfig.format.value
),
surfaces.map { it.value },
- captureSessionState,
- threads.camera2Handler
+ captureSessionState
)
) {
Log.warn {
@@ -149,7 +148,7 @@
}
} else {
if (!cameraDevice.createCaptureSession(
- surfaces.map { it.value }, captureSessionState, threads.camera2Handler
+ surfaces.map { it.value }, captureSessionState
)
) {
Log.warn {
@@ -171,7 +170,7 @@
captureSessionState: CaptureSessionState
): Map<StreamId, OutputConfigurationWrapper> {
if (!cameraDevice.createConstrainedHighSpeedCaptureSession(
- surfaces.map { it.value }, captureSessionState, threads.camera2Handler
+ surfaces.map { it.value }, captureSessionState
)
) {
Log.warn {
@@ -213,7 +212,7 @@
val result = if (graphConfig.input == null) {
cameraDevice.createCaptureSessionByOutputConfigurations(
- outputs.all, captureSessionState, threads.camera2Handler
+ outputs.all, captureSessionState
)
} else {
val outputConfig = graphConfig.input.stream.outputs.single()
@@ -224,8 +223,7 @@
outputConfig.format.value
),
outputs.all,
- captureSessionState,
- threads.camera2Handler
+ captureSessionState
)
}
if (!result) {
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionWrapper.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionWrapper.kt
index 47b388f..93fb66d 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionWrapper.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/CaptureSessionWrapper.kt
@@ -66,59 +66,47 @@
/**
* @param request The settings for this exposure
* @param listener The callback object to notify once this request has been processed.
- * @param handler The handler on which the listener should be invoked, or null to use the
- * current thread's looper.
* @return An unique capture sequence id.
* @see [CameraCaptureSession.capture].
*/
fun capture(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int?
/**
* @param requests A list of CaptureRequest(s) for this sequence of exposures
* @param listener A callback object to notify each time one of the requests in the burst has
* been processed.
- * @param handler The handler on which the listener should be invoked, or null to use the
- * current thread's looper.
* @return An unique capture sequence id.
* @see [CameraCaptureSession.captureBurst].
*/
fun captureBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int?
/**
* @param requests A list of settings to cycle through indefinitely.
* @param listener A callback object to notify each time one of the requests in the repeating
* bursts has finished processing.
- * @param handler The handler on which the listener should be invoked, or null to use the
- * current thread's looper.
* @return An unique capture sequence ID.
* @see [CameraCaptureSession.setRepeatingBurst]
*/
fun setRepeatingBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int?
/**
* @param request The request to repeat indefinitely.
* @param listener The callback object to notify every time the request finishes processing.
- * @param handler The handler on which the listener should be invoked, or null to use the
- * current thread's looper.
* @return An unique capture sequence ID.
* @see [CameraCaptureSession.setRepeatingRequest].
*/
fun setRepeatingRequest(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int?
/** @see [CameraCaptureSession.stopRepeating]. */
@@ -166,7 +154,8 @@
private val stateCallback: CameraCaptureSessionWrapper.StateCallback,
lastStateCallback: OnSessionFinalized?,
private val cameraErrorListener: CameraErrorListener,
- private val interopSessionStateCallback: CameraCaptureSession.StateCallback? = null
+ private val interopSessionStateCallback: CameraCaptureSession.StateCallback? = null,
+ private val callbackHandler: Handler
) : CameraCaptureSession.StateCallback() {
private val _lastStateCallback = atomic(lastStateCallback)
private val captureSession = atomic<CameraCaptureSessionWrapper?>(null)
@@ -237,9 +226,11 @@
return if (Build.VERSION.SDK_INT >= 23 &&
session is CameraConstrainedHighSpeedCaptureSession
) {
- AndroidCameraConstrainedHighSpeedCaptureSession(device, session, cameraErrorListener)
+ AndroidCameraConstrainedHighSpeedCaptureSession(
+ device, session, cameraErrorListener, callbackHandler
+ )
} else {
- AndroidCameraCaptureSession(device, session, cameraErrorListener)
+ AndroidCameraCaptureSession(device, session, cameraErrorListener, callbackHandler)
}
}
@@ -272,6 +263,7 @@
override val device: CameraDeviceWrapper,
private val cameraCaptureSession: CameraCaptureSession,
private val cameraErrorListener: CameraErrorListener,
+ private val callbackHandler: Handler
) : CameraCaptureSessionWrapper {
override fun abortCaptures(): Boolean =
catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
@@ -280,38 +272,34 @@
override fun capture(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
cameraCaptureSession.capture(
request,
listener,
- handler
+ callbackHandler
)
}
override fun captureBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
- cameraCaptureSession.captureBurst(requests, listener, handler)
+ cameraCaptureSession.captureBurst(requests, listener, callbackHandler)
}
override fun setRepeatingBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
- cameraCaptureSession.setRepeatingBurst(requests, listener, handler)
+ cameraCaptureSession.setRepeatingBurst(requests, listener, callbackHandler)
}
override fun setRepeatingRequest(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
- cameraCaptureSession.setRepeatingRequest(request, listener, handler)
+ cameraCaptureSession.setRepeatingRequest(request, listener, callbackHandler)
}
override fun stopRepeating(): Boolean =
@@ -377,7 +365,8 @@
device: CameraDeviceWrapper,
private val session: CameraConstrainedHighSpeedCaptureSession,
private val cameraErrorListener: CameraErrorListener,
-) : AndroidCameraCaptureSession(device, session, cameraErrorListener),
+ private val callbackHandler: Handler
+) : AndroidCameraCaptureSession(device, session, cameraErrorListener, callbackHandler),
CameraConstrainedHighSpeedCaptureSessionWrapper {
@Throws(ObjectUnavailableException::class)
override fun createHighSpeedRequestList(request: CaptureRequest): List<CaptureRequest> {
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/ExtensionSessionWrapper.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/ExtensionSessionWrapper.kt
index e75ce9a..d3b8f17 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/ExtensionSessionWrapper.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/ExtensionSessionWrapper.kt
@@ -18,13 +18,21 @@
package androidx.camera.camera2.pipe.compat
+import android.hardware.camera2.CameraCaptureSession
import android.hardware.camera2.CameraExtensionSession
import android.hardware.camera2.CaptureRequest
+import android.hardware.camera2.TotalCaptureResult
+import android.view.Surface
import androidx.annotation.RequiresApi
+import androidx.camera.camera2.pipe.FrameNumber
import androidx.camera.camera2.pipe.UnsafeWrapper
+import androidx.camera.camera2.pipe.core.Log
import androidx.camera.camera2.pipe.internal.CameraErrorListener
+import java.util.LinkedList
+import java.util.Queue
import java.util.concurrent.Executor
import kotlin.reflect.KClass
+import kotlinx.atomicfu.AtomicLong
import kotlinx.atomicfu.atomic
/**
@@ -33,44 +41,17 @@
* This interface has been modified to correct nullness, adjust exceptions, and to return or produce
* wrapper interfaces instead of the native Camera2 types.
*/
-internal interface CameraExtensionSessionWrapper : UnsafeWrapper, AutoCloseable {
+internal interface CameraExtensionSessionWrapper : CameraCaptureSessionWrapper, UnsafeWrapper,
+ AutoCloseable {
/**
* @return The [CameraDeviceWrapper] that created this CameraExtensionSession
* @see [CameraExtensionSession.getDevice]
*/
- val device: CameraDeviceWrapper
-
- /**
- * @param request The settings for this exposure
- * @param listener The callback object to notify once this request has been processed.
- * @param executor The executor on which the listener should be invoked, or null to use the
- * current thread's looper.
- * @return An unique capture sequence id.
- * @see [CameraExtensionSession.capture].
- */
- fun capture(
- request: CaptureRequest,
- executor: Executor,
- listener: CameraExtensionSession.ExtensionCaptureCallback
- ): Int?
-
- /**
- * @param request The request to repeat indefinitely.
- * @param executor The executor on which the listener should be invoked, or null to use the
- * current thread's looper.
- * @param listener The callback object to notify every time the request finishes processing.
- * @return An unique capture sequence ID.
- * @see [CameraExtensionSession.setRepeatingRequest].
- */
- fun setRepeatingRequest(
- request: CaptureRequest,
- executor: Executor,
- listener: CameraExtensionSession.ExtensionCaptureCallback
- ): Int?
+ override val device: CameraDeviceWrapper
/** @see [CameraExtensionSession.stopRepeating]. */
- fun stopRepeating(): Boolean
+ override fun stopRepeating(): Boolean
/** @see CameraExtensionSession.StateCallback */
interface StateCallback : OnSessionFinalized {
@@ -91,7 +72,8 @@
private val stateCallback: CameraExtensionSessionWrapper.StateCallback,
lastStateCallback: OnSessionFinalized?,
private val cameraErrorListener: CameraErrorListener,
- private val interopSessionStateCallback: CameraExtensionSession.StateCallback? = null
+ private val interopSessionStateCallback: CameraExtensionSession.StateCallback? = null,
+ private val callbackExecutor: Executor
) : CameraExtensionSession.StateCallback() {
private val _lastStateCallback = atomic(lastStateCallback)
private val extensionSession = atomic<CameraExtensionSessionWrapper?>(null)
@@ -139,7 +121,7 @@
session: CameraExtensionSession,
cameraErrorListener: CameraErrorListener,
): CameraExtensionSessionWrapper {
- return AndroidCameraExtensionSession(device, session, cameraErrorListener)
+ return AndroidCameraExtensionSession(device, session, cameraErrorListener, callbackExecutor)
}
private fun finalizeSession() {
@@ -159,25 +141,40 @@
override val device: CameraDeviceWrapper,
private val cameraExtensionSession: CameraExtensionSession,
private val cameraErrorListener: CameraErrorListener,
+ private val callbackExecutor: Executor
) : CameraExtensionSessionWrapper {
+
+ private val frameNumbers: AtomicLong = atomic(0L)
+ private val frameNumbersMap: MutableMap<CameraExtensionSession, Long> = HashMap()
+
override fun capture(
request: CaptureRequest,
- executor: Executor,
- listener: CameraExtensionSession.ExtensionCaptureCallback
+ listener: CameraCaptureSession.CaptureCallback
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
+ val frameQueue = LinkedList<Long>()
cameraExtensionSession.capture(
request,
- executor,
- listener,
+ callbackExecutor,
+ Camera2CaptureSessionCallbackToExtensionCaptureCallback(
+ listener as Camera2CaptureCallback,
+ frameQueue
+ )
)
}
override fun setRepeatingRequest(
request: CaptureRequest,
- executor: Executor,
- listener: CameraExtensionSession.ExtensionCaptureCallback,
+ listener: CameraCaptureSession.CaptureCallback,
): Int? = catchAndReportCameraExceptions(device.cameraId, cameraErrorListener) {
- cameraExtensionSession.setRepeatingRequest(request, executor, listener)
+ val frameQueue = LinkedList<Long>()
+ cameraExtensionSession.setRepeatingRequest(
+ request,
+ callbackExecutor,
+ Camera2CaptureSessionCallbackToExtensionCaptureCallback(
+ listener as Camera2CaptureCallback,
+ frameQueue
+ )
+ )
}
override fun stopRepeating(): Boolean =
@@ -185,6 +182,40 @@
cameraExtensionSession.stopRepeating()
} != null
+ override val isReprocessable: Boolean
+ get() = false
+
+ override val inputSurface: Surface?
+ get() = null
+
+ override fun abortCaptures(): Boolean = false
+
+ override fun captureBurst(
+ requests: List<CaptureRequest>,
+ listener: CameraCaptureSession.CaptureCallback
+ ): Int? {
+ requests.forEach { captureRequest -> capture(captureRequest, listener) }
+ return null
+ }
+
+ override fun setRepeatingBurst(
+ requests: List<CaptureRequest>,
+ listener: CameraCaptureSession.CaptureCallback
+ ): Int? {
+ check(requests.size == 1) {
+ "CameraExtensionSession does not support setRepeatingBurst for more than one" +
+ "CaptureRequest"
+ }
+ return setRepeatingRequest(requests.single(), listener)
+ }
+
+ override fun finalizeOutputConfigurations(
+ outputConfigs: List<OutputConfigurationWrapper>
+ ): Boolean {
+ Log.warn { "CameraExtensionSession does not support finalizeOutputConfigurations()" }
+ return false
+ }
+
@Suppress("UNCHECKED_CAST")
override fun <T : Any> unwrapAs(type: KClass<T>): T? =
when (type) {
@@ -195,4 +226,57 @@
override fun close() {
return cameraExtensionSession.close()
}
+
+ inner class Camera2CaptureSessionCallbackToExtensionCaptureCallback(
+ private val captureCallback: Camera2CaptureCallback,
+ private val frameQueue: Queue<Long>
+ ) : CameraExtensionSession.ExtensionCaptureCallback() {
+
+ override fun onCaptureStarted(
+ session: CameraExtensionSession,
+ request: CaptureRequest,
+ timestamp: Long
+ ) {
+ val frameNumber = frameNumbers.incrementAndGet()
+ frameNumbersMap.getOrDefault(session, frameNumber)
+ frameQueue.add(frameNumber)
+ captureCallback.onCaptureStarted(
+ request,
+ frameNumber,
+ timestamp
+ )
+ }
+
+ override fun onCaptureProcessStarted(
+ session: CameraExtensionSession,
+ request: CaptureRequest
+ ) {
+ }
+
+ override fun onCaptureFailed(session: CameraExtensionSession, request: CaptureRequest) {
+ val frameNumber = frameQueue.remove()
+ captureCallback.onCaptureFailed(
+ request,
+ FrameNumber(frameNumber)
+ )
+ }
+
+ override fun onCaptureSequenceCompleted(session: CameraExtensionSession, sequenceId: Int) {
+ val frameNumber = frameNumbersMap[session]
+ captureCallback.onCaptureSequenceCompleted(sequenceId, frameNumber!!)
+ }
+
+ override fun onCaptureSequenceAborted(session: CameraExtensionSession, sequenceId: Int) {
+ captureCallback.onCaptureSequenceAborted(sequenceId)
+ }
+
+ override fun onCaptureResultAvailable(
+ session: CameraExtensionSession,
+ request: CaptureRequest,
+ result: TotalCaptureResult
+ ) {
+ val frameNumber = frameQueue.remove()
+ captureCallback.onCaptureCompleted(request, result, FrameNumber(frameNumber))
+ }
+ }
}
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpener.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpener.kt
index a5d46ea..c12e597 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpener.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpener.kt
@@ -166,7 +166,8 @@
private val cameraErrorListener: CameraErrorListener,
private val camera2DeviceCloser: Camera2DeviceCloser,
private val timeSource: TimeSource,
- private val cameraInteropConfig: CameraPipe.CameraInteropConfig?
+ private val cameraInteropConfig: CameraPipe.CameraInteropConfig?,
+ private val threads: Threads
) {
internal suspend fun tryOpenCamera(
cameraId: CameraId,
@@ -183,6 +184,7 @@
timeSource,
cameraErrorListener,
camera2DeviceCloser,
+ threads,
cameraInteropConfig?.cameraDeviceStateCallback,
cameraInteropConfig?.cameraSessionStateCallback
)
diff --git a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/VirtualCamera.kt b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/VirtualCamera.kt
index 05cc5eb..456e87f 100644
--- a/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/VirtualCamera.kt
+++ b/camera/camera-camera2-pipe/src/main/java/androidx/camera/camera2/pipe/compat/VirtualCamera.kt
@@ -31,6 +31,7 @@
import androidx.camera.camera2.pipe.core.DurationNs
import androidx.camera.camera2.pipe.core.Log
import androidx.camera.camera2.pipe.core.SystemTimeSource
+import androidx.camera.camera2.pipe.core.Threads
import androidx.camera.camera2.pipe.core.TimeSource
import androidx.camera.camera2.pipe.core.TimestampNs
import androidx.camera.camera2.pipe.core.Timestamps
@@ -248,6 +249,7 @@
private val timeSource: TimeSource,
private val cameraErrorListener: CameraErrorListener,
private val camera2DeviceCloser: Camera2DeviceCloser,
+ private val threads: Threads,
private val interopDeviceStateCallback: CameraDevice.StateCallback? = null,
private val interopSessionStateCallback: StateCallback? = null,
private val interopExtensionSessionStateCallback: CameraExtensionSession.StateCallback? = null
@@ -347,7 +349,8 @@
cameraId,
cameraErrorListener,
interopSessionStateCallback,
- interopExtensionSessionStateCallback
+ interopExtensionSessionStateCallback,
+ threads
)
)
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/AndroidCaptureSessionStateCallbackTest.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/AndroidCaptureSessionStateCallbackTest.kt
index 6b0573a..9ed1ce8 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/AndroidCaptureSessionStateCallbackTest.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/AndroidCaptureSessionStateCallbackTest.kt
@@ -18,6 +18,7 @@
import android.hardware.camera2.CameraCaptureSession
import android.os.Build
+import android.os.Handler
import androidx.camera.camera2.pipe.internal.CameraErrorListener
import androidx.camera.camera2.pipe.testing.RobolectricCameraPipeTestRunner
import org.junit.Test
@@ -37,12 +38,14 @@
private val previousStateCallback: CameraCaptureSessionWrapper.StateCallback = mock()
private val captureSession: CameraCaptureSession = mock()
private val cameraErrorListener: CameraErrorListener = mock()
+ private val callbackHandler: Handler = mock()
private val androidStateCallback =
AndroidCaptureSessionStateCallback(
device = camera,
stateCallback = stateCallback,
lastStateCallback = previousStateCallback,
cameraErrorListener = cameraErrorListener,
+ callbackHandler = callbackHandler
)
@Test
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactoryTest.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactoryTest.kt
index 7cafd66..dcf8a14 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactoryTest.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/CaptureSessionFactoryTest.kt
@@ -47,6 +47,7 @@
import androidx.camera.camera2.pipe.testing.FakeCaptureSequence
import androidx.camera.camera2.pipe.testing.FakeCaptureSequenceProcessor
import androidx.camera.camera2.pipe.testing.FakeGraphProcessor
+import androidx.camera.camera2.pipe.testing.FakeThreads
import androidx.camera.camera2.pipe.testing.RobolectricCameraPipeTestRunner
import androidx.camera.camera2.pipe.testing.RobolectricCameras
import androidx.test.core.app.ApplicationProvider
@@ -116,7 +117,8 @@
testCamera.metadata,
testCamera.cameraDevice,
testCamera.cameraId,
- cameraErrorListener
+ cameraErrorListener,
+ threads = FakeThreads.fromTestScope(this)
),
mapOf(stream1.id to surface),
captureSessionState =
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpenerTest.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpenerTest.kt
index c6f20ef..7c5d185 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpenerTest.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/RetryingCameraStateOpenerTest.kt
@@ -35,12 +35,14 @@
import androidx.camera.camera2.pipe.internal.CameraErrorListener
import androidx.camera.camera2.pipe.testing.FakeCamera2DeviceCloser
import androidx.camera.camera2.pipe.testing.FakeCameraMetadata
+import androidx.camera.camera2.pipe.testing.FakeThreads
import androidx.camera.camera2.pipe.testing.FakeTimeSource
import androidx.camera.camera2.pipe.testing.RobolectricCameraPipeTestRunner
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
+import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
@@ -101,6 +103,7 @@
cameraDeviceCloser,
fakeTimeSource,
cameraInteropConfig = null,
+ FakeThreads.fromTestScope(TestScope())
)
private val cameraAvailabilityMonitor =
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/VirtualCameraTest.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/VirtualCameraTest.kt
index a77eec4..eda65e8 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/VirtualCameraTest.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/compat/VirtualCameraTest.kt
@@ -31,6 +31,7 @@
import androidx.camera.camera2.pipe.graph.GraphListener
import androidx.camera.camera2.pipe.internal.CameraErrorListener
import androidx.camera.camera2.pipe.testing.FakeCamera2DeviceCloser
+import androidx.camera.camera2.pipe.testing.FakeThreads
import androidx.camera.camera2.pipe.testing.RobolectricCameraPipeTestRunner
import androidx.camera.camera2.pipe.testing.RobolectricCameras
import com.google.common.truth.Truth.assertThat
@@ -41,6 +42,7 @@
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
+import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceUntilIdle
import kotlinx.coroutines.test.runTest
import org.junit.After
@@ -105,6 +107,7 @@
testCamera.cameraDevice,
testCamera.cameraId,
cameraErrorListener,
+ threads = FakeThreads.fromTestScope(this)
)
)
)
@@ -137,6 +140,7 @@
testCamera.cameraDevice,
testCamera.cameraId,
cameraErrorListener,
+ threads = FakeThreads.fromTestScope(this)
)
val cameraStateClosing = CameraStateClosing()
val cameraStateClosed =
@@ -190,6 +194,7 @@
testCamera.cameraDevice,
testCamera.cameraId,
cameraErrorListener,
+ threads = FakeThreads.fromTestScope(this)
)
)
)
@@ -227,6 +232,7 @@
testCamera.cameraDevice,
testCamera.cameraId,
cameraErrorListener,
+ threads = FakeThreads.fromTestScope(this)
)
)
)
@@ -251,7 +257,7 @@
val surfaceTexture = SurfaceTexture(0).also { it.setDefaultBufferSize(640, 480) }
val surface = Surface(surfaceTexture)
val callback: CameraCaptureSessionWrapper.StateCallback = mock()
- val result = virtualAndroidCameraState.createCaptureSession(listOf(surface), callback, null)
+ val result = virtualAndroidCameraState.createCaptureSession(listOf(surface), callback)
assertThat(result).isFalse()
verify(callback, times(1)).onSessionFinalized()
surface.release()
@@ -261,6 +267,7 @@
@RunWith(RobolectricCameraPipeTestRunner::class)
@Config(minSdk = Build.VERSION_CODES.LOLLIPOP)
+@OptIn(ExperimentalCoroutinesApi::class)
internal class AndroidCameraDeviceTest {
private val mainLooper = shadowOf(getMainLooper())
private val cameraId = RobolectricCameras.create()
@@ -299,6 +306,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
assertThat(listener.state.value).isInstanceOf(CameraStateUnopened.javaClass)
@@ -346,6 +354,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.onDisconnected(testCamera.cameraDevice)
@@ -369,6 +378,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.close()
@@ -389,6 +399,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.closeWith(IllegalArgumentException("Test Exception"))
@@ -409,6 +420,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.onError(testCamera.cameraDevice, CameraDevice.StateCallback.ERROR_CAMERA_SERVICE)
@@ -431,6 +443,7 @@
timeSource,
cameraErrorListener,
cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.onOpened(testCamera.cameraDevice)
@@ -453,7 +466,8 @@
attemptTimestampNanos = now,
timeSource,
cameraErrorListener,
- cameraDeviceCloser
+ cameraDeviceCloser,
+ FakeThreads.fromTestScope(TestScope())
)
listener.onError(testCamera.cameraDevice, CameraDevice.StateCallback.ERROR_CAMERA_SERVICE)
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCameraDeviceWrapper.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCameraDeviceWrapper.kt
index f46885f..0fdd447 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCameraDeviceWrapper.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCameraDeviceWrapper.kt
@@ -21,7 +21,6 @@
import android.hardware.camera2.TotalCaptureResult
import android.hardware.camera2.params.InputConfiguration
import android.os.Build
-import android.os.Handler
import android.view.Surface
import androidx.annotation.RequiresApi
import androidx.camera.camera2.pipe.CameraId
@@ -63,8 +62,7 @@
override fun createCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean {
createFakeCaptureSession(stateCallback)
return true
@@ -78,8 +76,7 @@
override fun createReprocessableCaptureSession(
input: InputConfiguration,
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean {
createFakeCaptureSession(stateCallback)
return true
@@ -87,8 +84,7 @@
override fun createConstrainedHighSpeedCaptureSession(
outputs: List<Surface>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean {
createFakeCaptureSession(stateCallback)
return true
@@ -96,8 +92,7 @@
override fun createCaptureSessionByOutputConfigurations(
outputConfigurations: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean {
createFakeCaptureSession(stateCallback)
return true
@@ -106,8 +101,7 @@
override fun createReprocessableCaptureSessionByConfigurations(
inputConfig: InputConfigData,
outputs: List<OutputConfigurationWrapper>,
- stateCallback: CameraCaptureSessionWrapper.StateCallback,
- handler: Handler?
+ stateCallback: CameraCaptureSessionWrapper.StateCallback
): Boolean {
createFakeCaptureSession(stateCallback)
return true
diff --git a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCaptureSessionWrapper.kt b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCaptureSessionWrapper.kt
index bc4d75d..1b63efa 100644
--- a/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCaptureSessionWrapper.kt
+++ b/camera/camera-camera2-pipe/src/test/java/androidx/camera/camera2/pipe/testing/FakeCaptureSessionWrapper.kt
@@ -18,7 +18,6 @@
import android.hardware.camera2.CameraCaptureSession
import android.hardware.camera2.CaptureRequest
-import android.os.Handler
import android.view.Surface
import androidx.camera.camera2.pipe.compat.CameraCaptureSessionWrapper
import androidx.camera.camera2.pipe.compat.CameraDeviceWrapper
@@ -50,8 +49,7 @@
override fun capture(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int {
lastCapture = listOf(request)
lastCaptureCallback = listener
@@ -62,8 +60,7 @@
override fun captureBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int {
lastCapture = requests.toList()
lastCaptureCallback = listener
@@ -74,8 +71,7 @@
override fun setRepeatingBurst(
requests: List<CaptureRequest>,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int {
lastRepeating = requests.toList()
lastRepeatingCallback = listener
@@ -86,8 +82,7 @@
override fun setRepeatingRequest(
request: CaptureRequest,
- listener: CameraCaptureSession.CaptureCallback,
- handler: Handler?
+ listener: CameraCaptureSession.CaptureCallback
): Int {
lastRepeating = listOf(request)
lastRepeatingCallback = listener
diff --git a/camera/camera-camera2/api/1.3.0-beta01.txt b/camera/camera-camera2/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..ea5cacc
--- /dev/null
+++ b/camera/camera-camera2/api/1.3.0-beta01.txt
@@ -0,0 +1,54 @@
+// Signature format: 4.0
+package androidx.camera.camera2 {
+
+ @RequiresApi(21) public final class Camera2Config {
+ method public static androidx.camera.core.CameraXConfig defaultConfig();
+ }
+
+}
+
+package androidx.camera.camera2.interop {
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2CameraControl {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> addCaptureRequestOptions(androidx.camera.camera2.interop.CaptureRequestOptions);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> clearCaptureRequestOptions();
+ method public static androidx.camera.camera2.interop.Camera2CameraControl from(androidx.camera.core.CameraControl);
+ method public androidx.camera.camera2.interop.CaptureRequestOptions getCaptureRequestOptions();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setCaptureRequestOptions(androidx.camera.camera2.interop.CaptureRequestOptions);
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2CameraInfo {
+ method public static androidx.camera.camera2.interop.Camera2CameraInfo from(androidx.camera.core.CameraInfo);
+ method public <T> T? getCameraCharacteristic(android.hardware.camera2.CameraCharacteristics.Key<T!>);
+ method public String getCameraId();
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2Interop {
+ }
+
+ @RequiresApi(21) public static final class Camera2Interop.Extender<T> {
+ ctor public Camera2Interop.Extender(androidx.camera.core.ExtendableBuilder<T!>);
+ method public <ValueT> androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>, ValueT);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setDeviceStateCallback(android.hardware.camera2.CameraDevice.StateCallback);
+ method @RequiresApi(28) public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setPhysicalCameraId(String);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setSessionCaptureCallback(android.hardware.camera2.CameraCaptureSession.CaptureCallback);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setSessionStateCallback(android.hardware.camera2.CameraCaptureSession.StateCallback);
+ method @RequiresApi(33) public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setStreamUseCase(long);
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public class CaptureRequestOptions {
+ method public <ValueT> ValueT? getCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>);
+ }
+
+ @RequiresApi(21) public static final class CaptureRequestOptions.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.camera2.interop.CaptureRequestOptions> {
+ ctor public CaptureRequestOptions.Builder();
+ method public androidx.camera.camera2.interop.CaptureRequestOptions build();
+ method public <ValueT> androidx.camera.camera2.interop.CaptureRequestOptions.Builder clearCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>);
+ method public <ValueT> androidx.camera.camera2.interop.CaptureRequestOptions.Builder setCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>, ValueT);
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalCamera2Interop {
+ }
+
+}
+
diff --git a/camera/camera-camera2/api/res-1.3.0-beta01.txt b/camera/camera-camera2/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-camera2/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-camera2/api/restricted_1.3.0-beta01.txt b/camera/camera-camera2/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..ea5cacc
--- /dev/null
+++ b/camera/camera-camera2/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,54 @@
+// Signature format: 4.0
+package androidx.camera.camera2 {
+
+ @RequiresApi(21) public final class Camera2Config {
+ method public static androidx.camera.core.CameraXConfig defaultConfig();
+ }
+
+}
+
+package androidx.camera.camera2.interop {
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2CameraControl {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> addCaptureRequestOptions(androidx.camera.camera2.interop.CaptureRequestOptions);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> clearCaptureRequestOptions();
+ method public static androidx.camera.camera2.interop.Camera2CameraControl from(androidx.camera.core.CameraControl);
+ method public androidx.camera.camera2.interop.CaptureRequestOptions getCaptureRequestOptions();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setCaptureRequestOptions(androidx.camera.camera2.interop.CaptureRequestOptions);
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2CameraInfo {
+ method public static androidx.camera.camera2.interop.Camera2CameraInfo from(androidx.camera.core.CameraInfo);
+ method public <T> T? getCameraCharacteristic(android.hardware.camera2.CameraCharacteristics.Key<T!>);
+ method public String getCameraId();
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public final class Camera2Interop {
+ }
+
+ @RequiresApi(21) public static final class Camera2Interop.Extender<T> {
+ ctor public Camera2Interop.Extender(androidx.camera.core.ExtendableBuilder<T!>);
+ method public <ValueT> androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>, ValueT);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setDeviceStateCallback(android.hardware.camera2.CameraDevice.StateCallback);
+ method @RequiresApi(28) public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setPhysicalCameraId(String);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setSessionCaptureCallback(android.hardware.camera2.CameraCaptureSession.CaptureCallback);
+ method public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setSessionStateCallback(android.hardware.camera2.CameraCaptureSession.StateCallback);
+ method @RequiresApi(33) public androidx.camera.camera2.interop.Camera2Interop.Extender<T!> setStreamUseCase(long);
+ }
+
+ @RequiresApi(21) @androidx.camera.camera2.interop.ExperimentalCamera2Interop public class CaptureRequestOptions {
+ method public <ValueT> ValueT? getCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>);
+ }
+
+ @RequiresApi(21) public static final class CaptureRequestOptions.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.camera2.interop.CaptureRequestOptions> {
+ ctor public CaptureRequestOptions.Builder();
+ method public androidx.camera.camera2.interop.CaptureRequestOptions build();
+ method public <ValueT> androidx.camera.camera2.interop.CaptureRequestOptions.Builder clearCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>);
+ method public <ValueT> androidx.camera.camera2.interop.CaptureRequestOptions.Builder setCaptureRequestOption(android.hardware.camera2.CaptureRequest.Key<ValueT!>, ValueT);
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalCamera2Interop {
+ }
+
+}
+
diff --git a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirk.java b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirk.java
index 45ec2c0..be2a547 100644
--- a/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirk.java
+++ b/camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirk.java
@@ -40,14 +40,23 @@
*/
@RequiresApi(21) // TODO(b/200306659): Remove and replace with annotation on package-info.java
public class FlashTooSlowQuirk implements UseTorchAsFlashQuirk {
- // List of devices with the issue. See b/181966663.
- private static final List<String> AFFECTED_MODELS = Arrays.asList(
+ private static final List<String> AFFECTED_MODEL_PREFIXES = Arrays.asList(
"PIXEL 3A",
- "PIXEL 3A XL"
+ "PIXEL 3A XL",
+ "SM-A320"
);
static boolean load(@NonNull CameraCharacteristicsCompat cameraCharacteristics) {
- return AFFECTED_MODELS.contains(Build.MODEL.toUpperCase(Locale.US))
+ return isAffectedModel()
&& cameraCharacteristics.get(CameraCharacteristics.LENS_FACING) == LENS_FACING_BACK;
}
+
+ private static boolean isAffectedModel() {
+ for (String modelPrefix : AFFECTED_MODEL_PREFIXES) {
+ if (Build.MODEL.toUpperCase(Locale.US).startsWith(modelPrefix)) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirkTest.kt b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirkTest.kt
index a2a1f13..999e095 100644
--- a/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirkTest.kt
+++ b/camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/compat/quirk/FlashTooSlowQuirkTest.kt
@@ -48,6 +48,8 @@
arrayOf("Pixel 3a", CameraCharacteristics.LENS_FACING_FRONT, false),
arrayOf("Pixel 3a XL", CameraCharacteristics.LENS_FACING_BACK, true),
arrayOf("Pixel 4", CameraCharacteristics.LENS_FACING_BACK, false),
+ arrayOf("sm-a320f", CameraCharacteristics.LENS_FACING_BACK, true),
+ arrayOf("SM-A320FL", CameraCharacteristics.LENS_FACING_BACK, true),
arrayOf("Samsung S7", CameraCharacteristics.LENS_FACING_BACK, false),
)
}
@@ -79,4 +81,4 @@
// Verify
assertThat(cameraQuirks.contains(FlashTooSlowQuirk::class.java)).isEqualTo(enabled)
}
-}
\ No newline at end of file
+}
diff --git a/camera/camera-core/api/1.3.0-beta01.txt b/camera/camera-core/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..5cda9c6
--- /dev/null
+++ b/camera/camera-core/api/1.3.0-beta01.txt
@@ -0,0 +1,612 @@
+// Signature format: 4.0
+package androidx.camera.core {
+
+ @RequiresApi(21) public class AspectRatio {
+ field public static final int RATIO_16_9 = 1; // 0x1
+ field public static final int RATIO_4_3 = 0; // 0x0
+ field public static final int RATIO_DEFAULT = -1; // 0xffffffff
+ }
+
+ @RequiresApi(21) public interface Camera {
+ method public androidx.camera.core.CameraControl getCameraControl();
+ method public androidx.camera.core.CameraInfo getCameraInfo();
+ }
+
+ @RequiresApi(21) public interface CameraControl {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> cancelFocusAndMetering();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> setExposureCompensationIndex(int);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.camera.core.FocusMeteringResult!> startFocusAndMetering(androidx.camera.core.FocusMeteringAction);
+ }
+
+ public static final class CameraControl.OperationCanceledException extends java.lang.Exception {
+ }
+
+ @RequiresApi(21) public abstract class CameraEffect {
+ ctor protected CameraEffect(int, java.util.concurrent.Executor, androidx.camera.core.ImageProcessor, androidx.core.util.Consumer<java.lang.Throwable!>);
+ ctor protected CameraEffect(int, java.util.concurrent.Executor, androidx.camera.core.SurfaceProcessor, androidx.core.util.Consumer<java.lang.Throwable!>);
+ method public androidx.core.util.Consumer<java.lang.Throwable!> getErrorListener();
+ method public java.util.concurrent.Executor getExecutor();
+ method public androidx.camera.core.SurfaceProcessor? getSurfaceProcessor();
+ method public int getTargets();
+ field public static final int IMAGE_CAPTURE = 4; // 0x4
+ field public static final int PREVIEW = 1; // 0x1
+ field public static final int VIDEO_CAPTURE = 2; // 0x2
+ }
+
+ @RequiresApi(21) public interface CameraFilter {
+ method public java.util.List<androidx.camera.core.CameraInfo!> filter(java.util.List<androidx.camera.core.CameraInfo!>);
+ }
+
+ @RequiresApi(21) public interface CameraInfo {
+ method public androidx.camera.core.CameraSelector getCameraSelector();
+ method public androidx.lifecycle.LiveData<androidx.camera.core.CameraState!> getCameraState();
+ method public androidx.camera.core.ExposureState getExposureState();
+ method @FloatRange(from=0, fromInclusive=false) public default float getIntrinsicZoomRatio();
+ method public default int getLensFacing();
+ method public int getSensorRotationDegrees();
+ method public int getSensorRotationDegrees(int);
+ method public default java.util.Set<android.util.Range<java.lang.Integer!>!> getSupportedFrameRateRanges();
+ method public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+ method public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
+ method public boolean hasFlashUnit();
+ method public default boolean isFocusMeteringSupported(androidx.camera.core.FocusMeteringAction);
+ method @androidx.camera.core.ExperimentalZeroShutterLag public default boolean isZslSupported();
+ }
+
+ @RequiresApi(21) public final class CameraInfoUnavailableException extends java.lang.Exception {
+ }
+
+ @RequiresApi(21) public interface CameraProvider {
+ method public java.util.List<androidx.camera.core.CameraInfo!> getAvailableCameraInfos();
+ method public boolean hasCamera(androidx.camera.core.CameraSelector) throws androidx.camera.core.CameraInfoUnavailableException;
+ }
+
+ @RequiresApi(21) public final class CameraSelector {
+ method public java.util.List<androidx.camera.core.CameraInfo!> filter(java.util.List<androidx.camera.core.CameraInfo!>);
+ field public static final androidx.camera.core.CameraSelector DEFAULT_BACK_CAMERA;
+ field public static final androidx.camera.core.CameraSelector DEFAULT_FRONT_CAMERA;
+ field public static final int LENS_FACING_BACK = 1; // 0x1
+ field @androidx.camera.core.ExperimentalLensFacing public static final int LENS_FACING_EXTERNAL = 2; // 0x2
+ field public static final int LENS_FACING_FRONT = 0; // 0x0
+ field public static final int LENS_FACING_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static final class CameraSelector.Builder {
+ ctor public CameraSelector.Builder();
+ method public androidx.camera.core.CameraSelector.Builder addCameraFilter(androidx.camera.core.CameraFilter);
+ method public androidx.camera.core.CameraSelector build();
+ method public androidx.camera.core.CameraSelector.Builder requireLensFacing(int);
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class CameraState {
+ ctor public CameraState();
+ method public static androidx.camera.core.CameraState create(androidx.camera.core.CameraState.Type);
+ method public static androidx.camera.core.CameraState create(androidx.camera.core.CameraState.Type, androidx.camera.core.CameraState.StateError?);
+ method public abstract androidx.camera.core.CameraState.StateError? getError();
+ method public abstract androidx.camera.core.CameraState.Type getType();
+ field public static final int ERROR_CAMERA_DISABLED = 5; // 0x5
+ field public static final int ERROR_CAMERA_FATAL_ERROR = 6; // 0x6
+ field public static final int ERROR_CAMERA_IN_USE = 2; // 0x2
+ field public static final int ERROR_DO_NOT_DISTURB_MODE_ENABLED = 7; // 0x7
+ field public static final int ERROR_MAX_CAMERAS_IN_USE = 1; // 0x1
+ field public static final int ERROR_OTHER_RECOVERABLE_ERROR = 3; // 0x3
+ field public static final int ERROR_STREAM_CONFIG = 4; // 0x4
+ }
+
+ public enum CameraState.ErrorType {
+ enum_constant public static final androidx.camera.core.CameraState.ErrorType CRITICAL;
+ enum_constant public static final androidx.camera.core.CameraState.ErrorType RECOVERABLE;
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class CameraState.StateError {
+ ctor public CameraState.StateError();
+ method public static androidx.camera.core.CameraState.StateError create(int);
+ method public static androidx.camera.core.CameraState.StateError create(int, Throwable?);
+ method public abstract Throwable? getCause();
+ method public abstract int getCode();
+ method public androidx.camera.core.CameraState.ErrorType getType();
+ }
+
+ public enum CameraState.Type {
+ enum_constant public static final androidx.camera.core.CameraState.Type CLOSED;
+ enum_constant public static final androidx.camera.core.CameraState.Type CLOSING;
+ enum_constant public static final androidx.camera.core.CameraState.Type OPEN;
+ enum_constant public static final androidx.camera.core.CameraState.Type OPENING;
+ enum_constant public static final androidx.camera.core.CameraState.Type PENDING_OPEN;
+ }
+
+ @RequiresApi(21) public class CameraUnavailableException extends java.lang.Exception {
+ ctor public CameraUnavailableException(int);
+ ctor public CameraUnavailableException(int, String?);
+ ctor public CameraUnavailableException(int, String?, Throwable?);
+ ctor public CameraUnavailableException(int, Throwable?);
+ method public int getReason();
+ field public static final int CAMERA_DISABLED = 1; // 0x1
+ field public static final int CAMERA_DISCONNECTED = 2; // 0x2
+ field public static final int CAMERA_ERROR = 3; // 0x3
+ field public static final int CAMERA_IN_USE = 4; // 0x4
+ field public static final int CAMERA_MAX_IN_USE = 5; // 0x5
+ field public static final int CAMERA_UNAVAILABLE_DO_NOT_DISTURB = 6; // 0x6
+ field public static final int CAMERA_UNKNOWN_ERROR = 0; // 0x0
+ }
+
+ @RequiresApi(21) public final class CameraXConfig {
+ method public androidx.camera.core.CameraSelector? getAvailableCamerasLimiter(androidx.camera.core.CameraSelector?);
+ method public java.util.concurrent.Executor? getCameraExecutor(java.util.concurrent.Executor?);
+ method public int getMinimumLoggingLevel();
+ method public android.os.Handler? getSchedulerHandler(android.os.Handler?);
+ }
+
+ public static final class CameraXConfig.Builder {
+ method public androidx.camera.core.CameraXConfig build();
+ method public static androidx.camera.core.CameraXConfig.Builder fromConfig(androidx.camera.core.CameraXConfig);
+ method public androidx.camera.core.CameraXConfig.Builder setAvailableCamerasLimiter(androidx.camera.core.CameraSelector);
+ method public androidx.camera.core.CameraXConfig.Builder setCameraExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.CameraXConfig.Builder setMinimumLoggingLevel(@IntRange(from=android.util.Log.DEBUG, to=android.util.Log.ERROR) int);
+ method public androidx.camera.core.CameraXConfig.Builder setSchedulerHandler(android.os.Handler);
+ }
+
+ public static interface CameraXConfig.Provider {
+ method public androidx.camera.core.CameraXConfig getCameraXConfig();
+ }
+
+ @RequiresApi(21) public class ConcurrentCamera {
+ ctor public ConcurrentCamera(java.util.List<androidx.camera.core.Camera!>);
+ method public java.util.List<androidx.camera.core.Camera!> getCameras();
+ }
+
+ public static final class ConcurrentCamera.SingleCameraConfig {
+ ctor public ConcurrentCamera.SingleCameraConfig(androidx.camera.core.CameraSelector, androidx.camera.core.UseCaseGroup, androidx.lifecycle.LifecycleOwner);
+ method public androidx.camera.core.CameraSelector getCameraSelector();
+ method public androidx.lifecycle.LifecycleOwner getLifecycleOwner();
+ method public androidx.camera.core.UseCaseGroup getUseCaseGroup();
+ }
+
+ @RequiresApi(21) public final class DisplayOrientedMeteringPointFactory extends androidx.camera.core.MeteringPointFactory {
+ ctor public DisplayOrientedMeteringPointFactory(android.view.Display, androidx.camera.core.CameraInfo, float, float);
+ }
+
+ @RequiresApi(21) public final class DynamicRange {
+ ctor public DynamicRange(int, int);
+ method public int getBitDepth();
+ method public int getEncoding();
+ field public static final int BIT_DEPTH_10_BIT = 10; // 0xa
+ field public static final int BIT_DEPTH_8_BIT = 8; // 0x8
+ field public static final int BIT_DEPTH_UNSPECIFIED = 0; // 0x0
+ field public static final androidx.camera.core.DynamicRange DOLBY_VISION_10_BIT;
+ field public static final androidx.camera.core.DynamicRange DOLBY_VISION_8_BIT;
+ field public static final int ENCODING_DOLBY_VISION = 6; // 0x6
+ field public static final int ENCODING_HDR10 = 4; // 0x4
+ field public static final int ENCODING_HDR10_PLUS = 5; // 0x5
+ field public static final int ENCODING_HDR_UNSPECIFIED = 2; // 0x2
+ field public static final int ENCODING_HLG = 3; // 0x3
+ field public static final int ENCODING_SDR = 1; // 0x1
+ field public static final int ENCODING_UNSPECIFIED = 0; // 0x0
+ field public static final androidx.camera.core.DynamicRange HDR10_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HDR10_PLUS_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HDR_UNSPECIFIED_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HLG_10_BIT;
+ field public static final androidx.camera.core.DynamicRange SDR;
+ field public static final androidx.camera.core.DynamicRange UNSPECIFIED;
+ }
+
+ @RequiresApi(21) @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalGetImage {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalLensFacing {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalUseCaseApi {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalZeroShutterLag {
+ }
+
+ @RequiresApi(21) public interface ExposureState {
+ method public int getExposureCompensationIndex();
+ method public android.util.Range<java.lang.Integer!> getExposureCompensationRange();
+ method public android.util.Rational getExposureCompensationStep();
+ method public boolean isExposureCompensationSupported();
+ }
+
+ @RequiresApi(21) public interface ExtendableBuilder<T> {
+ method public T build();
+ }
+
+ @RequiresApi(21) public final class FocusMeteringAction {
+ method public long getAutoCancelDurationInMillis();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAe();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAf();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAwb();
+ method public boolean isAutoCancelEnabled();
+ field public static final int FLAG_AE = 2; // 0x2
+ field public static final int FLAG_AF = 1; // 0x1
+ field public static final int FLAG_AWB = 4; // 0x4
+ }
+
+ public static class FocusMeteringAction.Builder {
+ ctor public FocusMeteringAction.Builder(androidx.camera.core.MeteringPoint);
+ ctor public FocusMeteringAction.Builder(androidx.camera.core.MeteringPoint, int);
+ method public androidx.camera.core.FocusMeteringAction.Builder addPoint(androidx.camera.core.MeteringPoint);
+ method public androidx.camera.core.FocusMeteringAction.Builder addPoint(androidx.camera.core.MeteringPoint, int);
+ method public androidx.camera.core.FocusMeteringAction build();
+ method public androidx.camera.core.FocusMeteringAction.Builder disableAutoCancel();
+ method public androidx.camera.core.FocusMeteringAction.Builder setAutoCancelDuration(@IntRange(from=1) long, java.util.concurrent.TimeUnit);
+ }
+
+ @RequiresApi(21) public final class FocusMeteringResult {
+ method public boolean isFocusSuccessful();
+ }
+
+ @RequiresApi(21) public final class ImageAnalysis extends androidx.camera.core.UseCase {
+ method public void clearAnalyzer();
+ method @androidx.camera.core.ExperimentalUseCaseApi public java.util.concurrent.Executor? getBackgroundExecutor();
+ method public int getBackpressureStrategy();
+ method public int getImageQueueDepth();
+ method public int getOutputImageFormat();
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public int getTargetRotation();
+ method public boolean isOutputImageRotationEnabled();
+ method public void setAnalyzer(java.util.concurrent.Executor, androidx.camera.core.ImageAnalysis.Analyzer);
+ method public void setTargetRotation(int);
+ field public static final int COORDINATE_SYSTEM_ORIGINAL = 0; // 0x0
+ field public static final int OUTPUT_IMAGE_FORMAT_RGBA_8888 = 2; // 0x2
+ field public static final int OUTPUT_IMAGE_FORMAT_YUV_420_888 = 1; // 0x1
+ field public static final int STRATEGY_BLOCK_PRODUCER = 1; // 0x1
+ field public static final int STRATEGY_KEEP_ONLY_LATEST = 0; // 0x0
+ }
+
+ public static interface ImageAnalysis.Analyzer {
+ method public void analyze(androidx.camera.core.ImageProxy);
+ method public default android.util.Size? getDefaultTargetResolution();
+ method public default int getTargetCoordinateSystem();
+ method public default void updateTransform(android.graphics.Matrix?);
+ }
+
+ public static final class ImageAnalysis.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.ImageAnalysis> {
+ ctor public ImageAnalysis.Builder();
+ method public androidx.camera.core.ImageAnalysis build();
+ method public androidx.camera.core.ImageAnalysis.Builder setBackgroundExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.ImageAnalysis.Builder setBackpressureStrategy(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setImageQueueDepth(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setOutputImageFormat(int);
+ method @RequiresApi(23) public androidx.camera.core.ImageAnalysis.Builder setOutputImageRotationEnabled(boolean);
+ method public androidx.camera.core.ImageAnalysis.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.ImageAnalysis.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.ImageAnalysis.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.ImageAnalysis.Builder setTargetRotation(int);
+ }
+
+ @RequiresApi(21) public final class ImageCapture extends androidx.camera.core.UseCase {
+ method public int getCaptureMode();
+ method public int getFlashMode();
+ method @IntRange(from=1, to=100) public int getJpegQuality();
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public int getTargetRotation();
+ method public void setCropAspectRatio(android.util.Rational);
+ method public void setFlashMode(int);
+ method public void setTargetRotation(int);
+ method public void takePicture(androidx.camera.core.ImageCapture.OutputFileOptions, java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageSavedCallback);
+ method public void takePicture(java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageCapturedCallback);
+ field public static final int CAPTURE_MODE_MAXIMIZE_QUALITY = 0; // 0x0
+ field public static final int CAPTURE_MODE_MINIMIZE_LATENCY = 1; // 0x1
+ field @androidx.camera.core.ExperimentalZeroShutterLag public static final int CAPTURE_MODE_ZERO_SHUTTER_LAG = 2; // 0x2
+ field public static final int ERROR_CAMERA_CLOSED = 3; // 0x3
+ field public static final int ERROR_CAPTURE_FAILED = 2; // 0x2
+ field public static final int ERROR_FILE_IO = 1; // 0x1
+ field public static final int ERROR_INVALID_CAMERA = 4; // 0x4
+ field public static final int ERROR_UNKNOWN = 0; // 0x0
+ field public static final int FLASH_MODE_AUTO = 0; // 0x0
+ field public static final int FLASH_MODE_OFF = 2; // 0x2
+ field public static final int FLASH_MODE_ON = 1; // 0x1
+ }
+
+ public static final class ImageCapture.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.ImageCapture> {
+ ctor public ImageCapture.Builder();
+ method public androidx.camera.core.ImageCapture build();
+ method public androidx.camera.core.ImageCapture.Builder setCaptureMode(int);
+ method public androidx.camera.core.ImageCapture.Builder setFlashMode(int);
+ method public androidx.camera.core.ImageCapture.Builder setIoExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.ImageCapture.Builder setJpegQuality(@IntRange(from=1, to=100) int);
+ method public androidx.camera.core.ImageCapture.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.ImageCapture.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.ImageCapture.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.ImageCapture.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.ImageCapture.Builder setTargetRotation(int);
+ }
+
+ public static final class ImageCapture.Metadata {
+ ctor public ImageCapture.Metadata();
+ method public android.location.Location? getLocation();
+ method public boolean isReversedHorizontal();
+ method public boolean isReversedVertical();
+ method public void setLocation(android.location.Location?);
+ method public void setReversedHorizontal(boolean);
+ method public void setReversedVertical(boolean);
+ }
+
+ public abstract static class ImageCapture.OnImageCapturedCallback {
+ ctor public ImageCapture.OnImageCapturedCallback();
+ method public void onCaptureSuccess(androidx.camera.core.ImageProxy);
+ method public void onError(androidx.camera.core.ImageCaptureException);
+ }
+
+ public static interface ImageCapture.OnImageSavedCallback {
+ method public void onError(androidx.camera.core.ImageCaptureException);
+ method public void onImageSaved(androidx.camera.core.ImageCapture.OutputFileResults);
+ }
+
+ public static final class ImageCapture.OutputFileOptions {
+ }
+
+ public static final class ImageCapture.OutputFileOptions.Builder {
+ ctor public ImageCapture.OutputFileOptions.Builder(android.content.ContentResolver, android.net.Uri, android.content.ContentValues);
+ ctor public ImageCapture.OutputFileOptions.Builder(java.io.File);
+ ctor public ImageCapture.OutputFileOptions.Builder(java.io.OutputStream);
+ method public androidx.camera.core.ImageCapture.OutputFileOptions build();
+ method public androidx.camera.core.ImageCapture.OutputFileOptions.Builder setMetadata(androidx.camera.core.ImageCapture.Metadata);
+ }
+
+ public static class ImageCapture.OutputFileResults {
+ method public android.net.Uri? getSavedUri();
+ }
+
+ @RequiresApi(21) public class ImageCaptureException extends java.lang.Exception {
+ ctor public ImageCaptureException(int, String, Throwable?);
+ method public int getImageCaptureError();
+ }
+
+ @RequiresApi(21) public interface ImageInfo {
+ method public int getRotationDegrees();
+ method public default android.graphics.Matrix getSensorToBufferTransformMatrix();
+ method public long getTimestamp();
+ }
+
+ public interface ImageProcessor {
+ method public androidx.camera.core.ImageProcessor.Response process(androidx.camera.core.ImageProcessor.Request) throws androidx.camera.core.ProcessingException;
+ }
+
+ public static interface ImageProcessor.Request {
+ method public androidx.camera.core.ImageProxy getInputImage();
+ method public int getOutputFormat();
+ }
+
+ public static interface ImageProcessor.Response {
+ method public androidx.camera.core.ImageProxy getOutputImage();
+ }
+
+ @RequiresApi(21) public interface ImageProxy extends java.lang.AutoCloseable {
+ method public void close();
+ method public android.graphics.Rect getCropRect();
+ method public int getFormat();
+ method public int getHeight();
+ method @androidx.camera.core.ExperimentalGetImage public android.media.Image? getImage();
+ method public androidx.camera.core.ImageInfo getImageInfo();
+ method public androidx.camera.core.ImageProxy.PlaneProxy![] getPlanes();
+ method public int getWidth();
+ method public void setCropRect(android.graphics.Rect?);
+ method public default android.graphics.Bitmap toBitmap();
+ }
+
+ public static interface ImageProxy.PlaneProxy {
+ method public java.nio.ByteBuffer getBuffer();
+ method public int getPixelStride();
+ method public int getRowStride();
+ }
+
+ @RequiresApi(21) public class InitializationException extends java.lang.Exception {
+ ctor public InitializationException(String?);
+ ctor public InitializationException(String?, Throwable?);
+ ctor public InitializationException(Throwable?);
+ }
+
+ @RequiresApi(21) public class MeteringPoint {
+ method public float getSize();
+ }
+
+ @RequiresApi(21) public abstract class MeteringPointFactory {
+ method public final androidx.camera.core.MeteringPoint createPoint(float, float);
+ method public final androidx.camera.core.MeteringPoint createPoint(float, float, float);
+ method public static float getDefaultPointSize();
+ }
+
+ @RequiresApi(21) public class MirrorMode {
+ field public static final int MIRROR_MODE_OFF = 0; // 0x0
+ field public static final int MIRROR_MODE_ON = 1; // 0x1
+ field public static final int MIRROR_MODE_ON_FRONT_ONLY = 2; // 0x2
+ }
+
+ @RequiresApi(21) public final class Preview extends androidx.camera.core.UseCase {
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public android.util.Range<java.lang.Integer!> getTargetFrameRate();
+ method public int getTargetRotation();
+ method @UiThread public void setSurfaceProvider(androidx.camera.core.Preview.SurfaceProvider?);
+ method @UiThread public void setSurfaceProvider(java.util.concurrent.Executor, androidx.camera.core.Preview.SurfaceProvider?);
+ method public void setTargetRotation(int);
+ }
+
+ public static final class Preview.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.Preview> {
+ ctor public Preview.Builder();
+ method public androidx.camera.core.Preview build();
+ method public androidx.camera.core.Preview.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.Preview.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.Preview.Builder setTargetFrameRate(android.util.Range<java.lang.Integer!>);
+ method public androidx.camera.core.Preview.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.Preview.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.Preview.Builder setTargetRotation(int);
+ }
+
+ public static interface Preview.SurfaceProvider {
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ }
+
+ public class ProcessingException extends java.lang.Exception {
+ ctor public ProcessingException();
+ }
+
+ @RequiresApi(21) public class ResolutionInfo {
+ ctor public ResolutionInfo(android.util.Size, android.graphics.Rect, int);
+ method public android.graphics.Rect getCropRect();
+ method public android.util.Size getResolution();
+ method public int getRotationDegrees();
+ }
+
+ @RequiresApi(21) public class SurfaceOrientedMeteringPointFactory extends androidx.camera.core.MeteringPointFactory {
+ ctor public SurfaceOrientedMeteringPointFactory(float, float);
+ ctor public SurfaceOrientedMeteringPointFactory(float, float, androidx.camera.core.UseCase);
+ }
+
+ public interface SurfaceOutput extends java.io.Closeable {
+ method public void close();
+ method public android.util.Size getSize();
+ method public android.view.Surface getSurface(java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.core.SurfaceOutput.Event!>);
+ method public int getTargets();
+ method public void updateTransformMatrix(float[], float[]);
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceOutput.Event {
+ method public abstract int getEventCode();
+ method public abstract androidx.camera.core.SurfaceOutput getSurfaceOutput();
+ field public static final int EVENT_REQUEST_CLOSE = 0; // 0x0
+ }
+
+ public interface SurfaceProcessor {
+ method public void onInputSurface(androidx.camera.core.SurfaceRequest) throws androidx.camera.core.ProcessingException;
+ method public void onOutputSurface(androidx.camera.core.SurfaceOutput) throws androidx.camera.core.ProcessingException;
+ }
+
+ @RequiresApi(21) public final class SurfaceRequest {
+ method public void addRequestCancellationListener(java.util.concurrent.Executor, Runnable);
+ method public void clearTransformationInfoListener();
+ method public androidx.camera.core.DynamicRange getDynamicRange();
+ method public android.util.Size getResolution();
+ method public boolean invalidate();
+ method public void provideSurface(android.view.Surface, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.core.SurfaceRequest.Result!>);
+ method public void setTransformationInfoListener(java.util.concurrent.Executor, androidx.camera.core.SurfaceRequest.TransformationInfoListener);
+ method public boolean willNotProvideSurface();
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceRequest.Result {
+ method public abstract int getResultCode();
+ method public abstract android.view.Surface getSurface();
+ field public static final int RESULT_INVALID_SURFACE = 2; // 0x2
+ field public static final int RESULT_REQUEST_CANCELLED = 1; // 0x1
+ field public static final int RESULT_SURFACE_ALREADY_PROVIDED = 3; // 0x3
+ field public static final int RESULT_SURFACE_USED_SUCCESSFULLY = 0; // 0x0
+ field public static final int RESULT_WILL_NOT_PROVIDE_SURFACE = 4; // 0x4
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceRequest.TransformationInfo {
+ method public abstract android.graphics.Rect getCropRect();
+ method public abstract int getRotationDegrees();
+ }
+
+ public static interface SurfaceRequest.TransformationInfoListener {
+ method public void onTransformationInfoUpdate(androidx.camera.core.SurfaceRequest.TransformationInfo);
+ }
+
+ @RequiresApi(21) public class TorchState {
+ field public static final int OFF = 0; // 0x0
+ field public static final int ON = 1; // 0x1
+ }
+
+ @RequiresApi(21) public abstract class UseCase {
+ method public static int snapToSurfaceRotation(@IntRange(from=0, to=359) int);
+ }
+
+ @RequiresApi(21) public final class UseCaseGroup {
+ method public java.util.List<androidx.camera.core.CameraEffect!> getEffects();
+ method public java.util.List<androidx.camera.core.UseCase!> getUseCases();
+ method public androidx.camera.core.ViewPort? getViewPort();
+ }
+
+ public static final class UseCaseGroup.Builder {
+ ctor public UseCaseGroup.Builder();
+ method public androidx.camera.core.UseCaseGroup.Builder addEffect(androidx.camera.core.CameraEffect);
+ method public androidx.camera.core.UseCaseGroup.Builder addUseCase(androidx.camera.core.UseCase);
+ method public androidx.camera.core.UseCaseGroup build();
+ method public androidx.camera.core.UseCaseGroup.Builder setViewPort(androidx.camera.core.ViewPort);
+ }
+
+ @RequiresApi(21) public final class ViewPort {
+ method public android.util.Rational getAspectRatio();
+ method public int getLayoutDirection();
+ method public int getRotation();
+ method public int getScaleType();
+ field public static final int FILL_CENTER = 1; // 0x1
+ field public static final int FILL_END = 2; // 0x2
+ field public static final int FILL_START = 0; // 0x0
+ field public static final int FIT = 3; // 0x3
+ }
+
+ public static final class ViewPort.Builder {
+ ctor public ViewPort.Builder(android.util.Rational, int);
+ method public androidx.camera.core.ViewPort build();
+ method public androidx.camera.core.ViewPort.Builder setLayoutDirection(int);
+ method public androidx.camera.core.ViewPort.Builder setScaleType(int);
+ }
+
+ @RequiresApi(21) public interface ZoomState {
+ method public float getLinearZoom();
+ method public float getMaxZoomRatio();
+ method public float getMinZoomRatio();
+ method public float getZoomRatio();
+ }
+
+}
+
+package androidx.camera.core.resolutionselector {
+
+ @RequiresApi(21) public final class AspectRatioStrategy {
+ ctor public AspectRatioStrategy(int, int);
+ method public int getFallbackRule();
+ method public int getPreferredAspectRatio();
+ field public static final int FALLBACK_RULE_AUTO = 1; // 0x1
+ field public static final int FALLBACK_RULE_NONE = 0; // 0x0
+ field public static final androidx.camera.core.resolutionselector.AspectRatioStrategy RATIO_16_9_FALLBACK_AUTO_STRATEGY;
+ field public static final androidx.camera.core.resolutionselector.AspectRatioStrategy RATIO_4_3_FALLBACK_AUTO_STRATEGY;
+ }
+
+ @RequiresApi(21) public interface ResolutionFilter {
+ method public java.util.List<android.util.Size!> filter(java.util.List<android.util.Size!>, int);
+ }
+
+ @RequiresApi(21) public final class ResolutionSelector {
+ method public int getAllowedResolutionMode();
+ method public androidx.camera.core.resolutionselector.AspectRatioStrategy getAspectRatioStrategy();
+ method public androidx.camera.core.resolutionselector.ResolutionFilter? getResolutionFilter();
+ method public androidx.camera.core.resolutionselector.ResolutionStrategy? getResolutionStrategy();
+ field public static final int PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION = 0; // 0x0
+ field public static final int PREFER_HIGHER_RESOLUTION_OVER_CAPTURE_RATE = 1; // 0x1
+ }
+
+ public static final class ResolutionSelector.Builder {
+ ctor public ResolutionSelector.Builder();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector build();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setAllowedResolutionMode(int);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setAspectRatioStrategy(androidx.camera.core.resolutionselector.AspectRatioStrategy);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setResolutionFilter(androidx.camera.core.resolutionselector.ResolutionFilter);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setResolutionStrategy(androidx.camera.core.resolutionselector.ResolutionStrategy);
+ }
+
+ @RequiresApi(21) public final class ResolutionStrategy {
+ ctor public ResolutionStrategy(android.util.Size, int);
+ method public android.util.Size? getBoundSize();
+ method public int getFallbackRule();
+ field public static final int FALLBACK_RULE_CLOSEST_HIGHER = 2; // 0x2
+ field public static final int FALLBACK_RULE_CLOSEST_HIGHER_THEN_LOWER = 1; // 0x1
+ field public static final int FALLBACK_RULE_CLOSEST_LOWER = 4; // 0x4
+ field public static final int FALLBACK_RULE_CLOSEST_LOWER_THEN_HIGHER = 3; // 0x3
+ field public static final int FALLBACK_RULE_NONE = 0; // 0x0
+ field public static final androidx.camera.core.resolutionselector.ResolutionStrategy HIGHEST_AVAILABLE_STRATEGY;
+ }
+
+}
+
diff --git a/camera/camera-core/api/res-1.3.0-beta01.txt b/camera/camera-core/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-core/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-core/api/restricted_1.3.0-beta01.txt b/camera/camera-core/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..5cda9c6
--- /dev/null
+++ b/camera/camera-core/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,612 @@
+// Signature format: 4.0
+package androidx.camera.core {
+
+ @RequiresApi(21) public class AspectRatio {
+ field public static final int RATIO_16_9 = 1; // 0x1
+ field public static final int RATIO_4_3 = 0; // 0x0
+ field public static final int RATIO_DEFAULT = -1; // 0xffffffff
+ }
+
+ @RequiresApi(21) public interface Camera {
+ method public androidx.camera.core.CameraControl getCameraControl();
+ method public androidx.camera.core.CameraInfo getCameraInfo();
+ }
+
+ @RequiresApi(21) public interface CameraControl {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> cancelFocusAndMetering();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> setExposureCompensationIndex(int);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.camera.core.FocusMeteringResult!> startFocusAndMetering(androidx.camera.core.FocusMeteringAction);
+ }
+
+ public static final class CameraControl.OperationCanceledException extends java.lang.Exception {
+ }
+
+ @RequiresApi(21) public abstract class CameraEffect {
+ ctor protected CameraEffect(int, java.util.concurrent.Executor, androidx.camera.core.ImageProcessor, androidx.core.util.Consumer<java.lang.Throwable!>);
+ ctor protected CameraEffect(int, java.util.concurrent.Executor, androidx.camera.core.SurfaceProcessor, androidx.core.util.Consumer<java.lang.Throwable!>);
+ method public androidx.core.util.Consumer<java.lang.Throwable!> getErrorListener();
+ method public java.util.concurrent.Executor getExecutor();
+ method public androidx.camera.core.SurfaceProcessor? getSurfaceProcessor();
+ method public int getTargets();
+ field public static final int IMAGE_CAPTURE = 4; // 0x4
+ field public static final int PREVIEW = 1; // 0x1
+ field public static final int VIDEO_CAPTURE = 2; // 0x2
+ }
+
+ @RequiresApi(21) public interface CameraFilter {
+ method public java.util.List<androidx.camera.core.CameraInfo!> filter(java.util.List<androidx.camera.core.CameraInfo!>);
+ }
+
+ @RequiresApi(21) public interface CameraInfo {
+ method public androidx.camera.core.CameraSelector getCameraSelector();
+ method public androidx.lifecycle.LiveData<androidx.camera.core.CameraState!> getCameraState();
+ method public androidx.camera.core.ExposureState getExposureState();
+ method @FloatRange(from=0, fromInclusive=false) public default float getIntrinsicZoomRatio();
+ method public default int getLensFacing();
+ method public int getSensorRotationDegrees();
+ method public int getSensorRotationDegrees(int);
+ method public default java.util.Set<android.util.Range<java.lang.Integer!>!> getSupportedFrameRateRanges();
+ method public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+ method public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
+ method public boolean hasFlashUnit();
+ method public default boolean isFocusMeteringSupported(androidx.camera.core.FocusMeteringAction);
+ method @androidx.camera.core.ExperimentalZeroShutterLag public default boolean isZslSupported();
+ }
+
+ @RequiresApi(21) public final class CameraInfoUnavailableException extends java.lang.Exception {
+ }
+
+ @RequiresApi(21) public interface CameraProvider {
+ method public java.util.List<androidx.camera.core.CameraInfo!> getAvailableCameraInfos();
+ method public boolean hasCamera(androidx.camera.core.CameraSelector) throws androidx.camera.core.CameraInfoUnavailableException;
+ }
+
+ @RequiresApi(21) public final class CameraSelector {
+ method public java.util.List<androidx.camera.core.CameraInfo!> filter(java.util.List<androidx.camera.core.CameraInfo!>);
+ field public static final androidx.camera.core.CameraSelector DEFAULT_BACK_CAMERA;
+ field public static final androidx.camera.core.CameraSelector DEFAULT_FRONT_CAMERA;
+ field public static final int LENS_FACING_BACK = 1; // 0x1
+ field @androidx.camera.core.ExperimentalLensFacing public static final int LENS_FACING_EXTERNAL = 2; // 0x2
+ field public static final int LENS_FACING_FRONT = 0; // 0x0
+ field public static final int LENS_FACING_UNKNOWN = -1; // 0xffffffff
+ }
+
+ public static final class CameraSelector.Builder {
+ ctor public CameraSelector.Builder();
+ method public androidx.camera.core.CameraSelector.Builder addCameraFilter(androidx.camera.core.CameraFilter);
+ method public androidx.camera.core.CameraSelector build();
+ method public androidx.camera.core.CameraSelector.Builder requireLensFacing(int);
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class CameraState {
+ ctor public CameraState();
+ method public static androidx.camera.core.CameraState create(androidx.camera.core.CameraState.Type);
+ method public static androidx.camera.core.CameraState create(androidx.camera.core.CameraState.Type, androidx.camera.core.CameraState.StateError?);
+ method public abstract androidx.camera.core.CameraState.StateError? getError();
+ method public abstract androidx.camera.core.CameraState.Type getType();
+ field public static final int ERROR_CAMERA_DISABLED = 5; // 0x5
+ field public static final int ERROR_CAMERA_FATAL_ERROR = 6; // 0x6
+ field public static final int ERROR_CAMERA_IN_USE = 2; // 0x2
+ field public static final int ERROR_DO_NOT_DISTURB_MODE_ENABLED = 7; // 0x7
+ field public static final int ERROR_MAX_CAMERAS_IN_USE = 1; // 0x1
+ field public static final int ERROR_OTHER_RECOVERABLE_ERROR = 3; // 0x3
+ field public static final int ERROR_STREAM_CONFIG = 4; // 0x4
+ }
+
+ public enum CameraState.ErrorType {
+ enum_constant public static final androidx.camera.core.CameraState.ErrorType CRITICAL;
+ enum_constant public static final androidx.camera.core.CameraState.ErrorType RECOVERABLE;
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class CameraState.StateError {
+ ctor public CameraState.StateError();
+ method public static androidx.camera.core.CameraState.StateError create(int);
+ method public static androidx.camera.core.CameraState.StateError create(int, Throwable?);
+ method public abstract Throwable? getCause();
+ method public abstract int getCode();
+ method public androidx.camera.core.CameraState.ErrorType getType();
+ }
+
+ public enum CameraState.Type {
+ enum_constant public static final androidx.camera.core.CameraState.Type CLOSED;
+ enum_constant public static final androidx.camera.core.CameraState.Type CLOSING;
+ enum_constant public static final androidx.camera.core.CameraState.Type OPEN;
+ enum_constant public static final androidx.camera.core.CameraState.Type OPENING;
+ enum_constant public static final androidx.camera.core.CameraState.Type PENDING_OPEN;
+ }
+
+ @RequiresApi(21) public class CameraUnavailableException extends java.lang.Exception {
+ ctor public CameraUnavailableException(int);
+ ctor public CameraUnavailableException(int, String?);
+ ctor public CameraUnavailableException(int, String?, Throwable?);
+ ctor public CameraUnavailableException(int, Throwable?);
+ method public int getReason();
+ field public static final int CAMERA_DISABLED = 1; // 0x1
+ field public static final int CAMERA_DISCONNECTED = 2; // 0x2
+ field public static final int CAMERA_ERROR = 3; // 0x3
+ field public static final int CAMERA_IN_USE = 4; // 0x4
+ field public static final int CAMERA_MAX_IN_USE = 5; // 0x5
+ field public static final int CAMERA_UNAVAILABLE_DO_NOT_DISTURB = 6; // 0x6
+ field public static final int CAMERA_UNKNOWN_ERROR = 0; // 0x0
+ }
+
+ @RequiresApi(21) public final class CameraXConfig {
+ method public androidx.camera.core.CameraSelector? getAvailableCamerasLimiter(androidx.camera.core.CameraSelector?);
+ method public java.util.concurrent.Executor? getCameraExecutor(java.util.concurrent.Executor?);
+ method public int getMinimumLoggingLevel();
+ method public android.os.Handler? getSchedulerHandler(android.os.Handler?);
+ }
+
+ public static final class CameraXConfig.Builder {
+ method public androidx.camera.core.CameraXConfig build();
+ method public static androidx.camera.core.CameraXConfig.Builder fromConfig(androidx.camera.core.CameraXConfig);
+ method public androidx.camera.core.CameraXConfig.Builder setAvailableCamerasLimiter(androidx.camera.core.CameraSelector);
+ method public androidx.camera.core.CameraXConfig.Builder setCameraExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.CameraXConfig.Builder setMinimumLoggingLevel(@IntRange(from=android.util.Log.DEBUG, to=android.util.Log.ERROR) int);
+ method public androidx.camera.core.CameraXConfig.Builder setSchedulerHandler(android.os.Handler);
+ }
+
+ public static interface CameraXConfig.Provider {
+ method public androidx.camera.core.CameraXConfig getCameraXConfig();
+ }
+
+ @RequiresApi(21) public class ConcurrentCamera {
+ ctor public ConcurrentCamera(java.util.List<androidx.camera.core.Camera!>);
+ method public java.util.List<androidx.camera.core.Camera!> getCameras();
+ }
+
+ public static final class ConcurrentCamera.SingleCameraConfig {
+ ctor public ConcurrentCamera.SingleCameraConfig(androidx.camera.core.CameraSelector, androidx.camera.core.UseCaseGroup, androidx.lifecycle.LifecycleOwner);
+ method public androidx.camera.core.CameraSelector getCameraSelector();
+ method public androidx.lifecycle.LifecycleOwner getLifecycleOwner();
+ method public androidx.camera.core.UseCaseGroup getUseCaseGroup();
+ }
+
+ @RequiresApi(21) public final class DisplayOrientedMeteringPointFactory extends androidx.camera.core.MeteringPointFactory {
+ ctor public DisplayOrientedMeteringPointFactory(android.view.Display, androidx.camera.core.CameraInfo, float, float);
+ }
+
+ @RequiresApi(21) public final class DynamicRange {
+ ctor public DynamicRange(int, int);
+ method public int getBitDepth();
+ method public int getEncoding();
+ field public static final int BIT_DEPTH_10_BIT = 10; // 0xa
+ field public static final int BIT_DEPTH_8_BIT = 8; // 0x8
+ field public static final int BIT_DEPTH_UNSPECIFIED = 0; // 0x0
+ field public static final androidx.camera.core.DynamicRange DOLBY_VISION_10_BIT;
+ field public static final androidx.camera.core.DynamicRange DOLBY_VISION_8_BIT;
+ field public static final int ENCODING_DOLBY_VISION = 6; // 0x6
+ field public static final int ENCODING_HDR10 = 4; // 0x4
+ field public static final int ENCODING_HDR10_PLUS = 5; // 0x5
+ field public static final int ENCODING_HDR_UNSPECIFIED = 2; // 0x2
+ field public static final int ENCODING_HLG = 3; // 0x3
+ field public static final int ENCODING_SDR = 1; // 0x1
+ field public static final int ENCODING_UNSPECIFIED = 0; // 0x0
+ field public static final androidx.camera.core.DynamicRange HDR10_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HDR10_PLUS_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HDR_UNSPECIFIED_10_BIT;
+ field public static final androidx.camera.core.DynamicRange HLG_10_BIT;
+ field public static final androidx.camera.core.DynamicRange SDR;
+ field public static final androidx.camera.core.DynamicRange UNSPECIFIED;
+ }
+
+ @RequiresApi(21) @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalGetImage {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalLensFacing {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalUseCaseApi {
+ }
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalZeroShutterLag {
+ }
+
+ @RequiresApi(21) public interface ExposureState {
+ method public int getExposureCompensationIndex();
+ method public android.util.Range<java.lang.Integer!> getExposureCompensationRange();
+ method public android.util.Rational getExposureCompensationStep();
+ method public boolean isExposureCompensationSupported();
+ }
+
+ @RequiresApi(21) public interface ExtendableBuilder<T> {
+ method public T build();
+ }
+
+ @RequiresApi(21) public final class FocusMeteringAction {
+ method public long getAutoCancelDurationInMillis();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAe();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAf();
+ method public java.util.List<androidx.camera.core.MeteringPoint!> getMeteringPointsAwb();
+ method public boolean isAutoCancelEnabled();
+ field public static final int FLAG_AE = 2; // 0x2
+ field public static final int FLAG_AF = 1; // 0x1
+ field public static final int FLAG_AWB = 4; // 0x4
+ }
+
+ public static class FocusMeteringAction.Builder {
+ ctor public FocusMeteringAction.Builder(androidx.camera.core.MeteringPoint);
+ ctor public FocusMeteringAction.Builder(androidx.camera.core.MeteringPoint, int);
+ method public androidx.camera.core.FocusMeteringAction.Builder addPoint(androidx.camera.core.MeteringPoint);
+ method public androidx.camera.core.FocusMeteringAction.Builder addPoint(androidx.camera.core.MeteringPoint, int);
+ method public androidx.camera.core.FocusMeteringAction build();
+ method public androidx.camera.core.FocusMeteringAction.Builder disableAutoCancel();
+ method public androidx.camera.core.FocusMeteringAction.Builder setAutoCancelDuration(@IntRange(from=1) long, java.util.concurrent.TimeUnit);
+ }
+
+ @RequiresApi(21) public final class FocusMeteringResult {
+ method public boolean isFocusSuccessful();
+ }
+
+ @RequiresApi(21) public final class ImageAnalysis extends androidx.camera.core.UseCase {
+ method public void clearAnalyzer();
+ method @androidx.camera.core.ExperimentalUseCaseApi public java.util.concurrent.Executor? getBackgroundExecutor();
+ method public int getBackpressureStrategy();
+ method public int getImageQueueDepth();
+ method public int getOutputImageFormat();
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public int getTargetRotation();
+ method public boolean isOutputImageRotationEnabled();
+ method public void setAnalyzer(java.util.concurrent.Executor, androidx.camera.core.ImageAnalysis.Analyzer);
+ method public void setTargetRotation(int);
+ field public static final int COORDINATE_SYSTEM_ORIGINAL = 0; // 0x0
+ field public static final int OUTPUT_IMAGE_FORMAT_RGBA_8888 = 2; // 0x2
+ field public static final int OUTPUT_IMAGE_FORMAT_YUV_420_888 = 1; // 0x1
+ field public static final int STRATEGY_BLOCK_PRODUCER = 1; // 0x1
+ field public static final int STRATEGY_KEEP_ONLY_LATEST = 0; // 0x0
+ }
+
+ public static interface ImageAnalysis.Analyzer {
+ method public void analyze(androidx.camera.core.ImageProxy);
+ method public default android.util.Size? getDefaultTargetResolution();
+ method public default int getTargetCoordinateSystem();
+ method public default void updateTransform(android.graphics.Matrix?);
+ }
+
+ public static final class ImageAnalysis.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.ImageAnalysis> {
+ ctor public ImageAnalysis.Builder();
+ method public androidx.camera.core.ImageAnalysis build();
+ method public androidx.camera.core.ImageAnalysis.Builder setBackgroundExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.ImageAnalysis.Builder setBackpressureStrategy(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setImageQueueDepth(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setOutputImageFormat(int);
+ method @RequiresApi(23) public androidx.camera.core.ImageAnalysis.Builder setOutputImageRotationEnabled(boolean);
+ method public androidx.camera.core.ImageAnalysis.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.ImageAnalysis.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.ImageAnalysis.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.ImageAnalysis.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.ImageAnalysis.Builder setTargetRotation(int);
+ }
+
+ @RequiresApi(21) public final class ImageCapture extends androidx.camera.core.UseCase {
+ method public int getCaptureMode();
+ method public int getFlashMode();
+ method @IntRange(from=1, to=100) public int getJpegQuality();
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public int getTargetRotation();
+ method public void setCropAspectRatio(android.util.Rational);
+ method public void setFlashMode(int);
+ method public void setTargetRotation(int);
+ method public void takePicture(androidx.camera.core.ImageCapture.OutputFileOptions, java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageSavedCallback);
+ method public void takePicture(java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageCapturedCallback);
+ field public static final int CAPTURE_MODE_MAXIMIZE_QUALITY = 0; // 0x0
+ field public static final int CAPTURE_MODE_MINIMIZE_LATENCY = 1; // 0x1
+ field @androidx.camera.core.ExperimentalZeroShutterLag public static final int CAPTURE_MODE_ZERO_SHUTTER_LAG = 2; // 0x2
+ field public static final int ERROR_CAMERA_CLOSED = 3; // 0x3
+ field public static final int ERROR_CAPTURE_FAILED = 2; // 0x2
+ field public static final int ERROR_FILE_IO = 1; // 0x1
+ field public static final int ERROR_INVALID_CAMERA = 4; // 0x4
+ field public static final int ERROR_UNKNOWN = 0; // 0x0
+ field public static final int FLASH_MODE_AUTO = 0; // 0x0
+ field public static final int FLASH_MODE_OFF = 2; // 0x2
+ field public static final int FLASH_MODE_ON = 1; // 0x1
+ }
+
+ public static final class ImageCapture.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.ImageCapture> {
+ ctor public ImageCapture.Builder();
+ method public androidx.camera.core.ImageCapture build();
+ method public androidx.camera.core.ImageCapture.Builder setCaptureMode(int);
+ method public androidx.camera.core.ImageCapture.Builder setFlashMode(int);
+ method public androidx.camera.core.ImageCapture.Builder setIoExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.core.ImageCapture.Builder setJpegQuality(@IntRange(from=1, to=100) int);
+ method public androidx.camera.core.ImageCapture.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.ImageCapture.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.ImageCapture.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.ImageCapture.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.ImageCapture.Builder setTargetRotation(int);
+ }
+
+ public static final class ImageCapture.Metadata {
+ ctor public ImageCapture.Metadata();
+ method public android.location.Location? getLocation();
+ method public boolean isReversedHorizontal();
+ method public boolean isReversedVertical();
+ method public void setLocation(android.location.Location?);
+ method public void setReversedHorizontal(boolean);
+ method public void setReversedVertical(boolean);
+ }
+
+ public abstract static class ImageCapture.OnImageCapturedCallback {
+ ctor public ImageCapture.OnImageCapturedCallback();
+ method public void onCaptureSuccess(androidx.camera.core.ImageProxy);
+ method public void onError(androidx.camera.core.ImageCaptureException);
+ }
+
+ public static interface ImageCapture.OnImageSavedCallback {
+ method public void onError(androidx.camera.core.ImageCaptureException);
+ method public void onImageSaved(androidx.camera.core.ImageCapture.OutputFileResults);
+ }
+
+ public static final class ImageCapture.OutputFileOptions {
+ }
+
+ public static final class ImageCapture.OutputFileOptions.Builder {
+ ctor public ImageCapture.OutputFileOptions.Builder(android.content.ContentResolver, android.net.Uri, android.content.ContentValues);
+ ctor public ImageCapture.OutputFileOptions.Builder(java.io.File);
+ ctor public ImageCapture.OutputFileOptions.Builder(java.io.OutputStream);
+ method public androidx.camera.core.ImageCapture.OutputFileOptions build();
+ method public androidx.camera.core.ImageCapture.OutputFileOptions.Builder setMetadata(androidx.camera.core.ImageCapture.Metadata);
+ }
+
+ public static class ImageCapture.OutputFileResults {
+ method public android.net.Uri? getSavedUri();
+ }
+
+ @RequiresApi(21) public class ImageCaptureException extends java.lang.Exception {
+ ctor public ImageCaptureException(int, String, Throwable?);
+ method public int getImageCaptureError();
+ }
+
+ @RequiresApi(21) public interface ImageInfo {
+ method public int getRotationDegrees();
+ method public default android.graphics.Matrix getSensorToBufferTransformMatrix();
+ method public long getTimestamp();
+ }
+
+ public interface ImageProcessor {
+ method public androidx.camera.core.ImageProcessor.Response process(androidx.camera.core.ImageProcessor.Request) throws androidx.camera.core.ProcessingException;
+ }
+
+ public static interface ImageProcessor.Request {
+ method public androidx.camera.core.ImageProxy getInputImage();
+ method public int getOutputFormat();
+ }
+
+ public static interface ImageProcessor.Response {
+ method public androidx.camera.core.ImageProxy getOutputImage();
+ }
+
+ @RequiresApi(21) public interface ImageProxy extends java.lang.AutoCloseable {
+ method public void close();
+ method public android.graphics.Rect getCropRect();
+ method public int getFormat();
+ method public int getHeight();
+ method @androidx.camera.core.ExperimentalGetImage public android.media.Image? getImage();
+ method public androidx.camera.core.ImageInfo getImageInfo();
+ method public androidx.camera.core.ImageProxy.PlaneProxy![] getPlanes();
+ method public int getWidth();
+ method public void setCropRect(android.graphics.Rect?);
+ method public default android.graphics.Bitmap toBitmap();
+ }
+
+ public static interface ImageProxy.PlaneProxy {
+ method public java.nio.ByteBuffer getBuffer();
+ method public int getPixelStride();
+ method public int getRowStride();
+ }
+
+ @RequiresApi(21) public class InitializationException extends java.lang.Exception {
+ ctor public InitializationException(String?);
+ ctor public InitializationException(String?, Throwable?);
+ ctor public InitializationException(Throwable?);
+ }
+
+ @RequiresApi(21) public class MeteringPoint {
+ method public float getSize();
+ }
+
+ @RequiresApi(21) public abstract class MeteringPointFactory {
+ method public final androidx.camera.core.MeteringPoint createPoint(float, float);
+ method public final androidx.camera.core.MeteringPoint createPoint(float, float, float);
+ method public static float getDefaultPointSize();
+ }
+
+ @RequiresApi(21) public class MirrorMode {
+ field public static final int MIRROR_MODE_OFF = 0; // 0x0
+ field public static final int MIRROR_MODE_ON = 1; // 0x1
+ field public static final int MIRROR_MODE_ON_FRONT_ONLY = 2; // 0x2
+ }
+
+ @RequiresApi(21) public final class Preview extends androidx.camera.core.UseCase {
+ method public androidx.camera.core.ResolutionInfo? getResolutionInfo();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector? getResolutionSelector();
+ method public android.util.Range<java.lang.Integer!> getTargetFrameRate();
+ method public int getTargetRotation();
+ method @UiThread public void setSurfaceProvider(androidx.camera.core.Preview.SurfaceProvider?);
+ method @UiThread public void setSurfaceProvider(java.util.concurrent.Executor, androidx.camera.core.Preview.SurfaceProvider?);
+ method public void setTargetRotation(int);
+ }
+
+ public static final class Preview.Builder implements androidx.camera.core.ExtendableBuilder<androidx.camera.core.Preview> {
+ ctor public Preview.Builder();
+ method public androidx.camera.core.Preview build();
+ method public androidx.camera.core.Preview.Builder setResolutionSelector(androidx.camera.core.resolutionselector.ResolutionSelector);
+ method @Deprecated public androidx.camera.core.Preview.Builder setTargetAspectRatio(int);
+ method public androidx.camera.core.Preview.Builder setTargetFrameRate(android.util.Range<java.lang.Integer!>);
+ method public androidx.camera.core.Preview.Builder setTargetName(String);
+ method @Deprecated public androidx.camera.core.Preview.Builder setTargetResolution(android.util.Size);
+ method public androidx.camera.core.Preview.Builder setTargetRotation(int);
+ }
+
+ public static interface Preview.SurfaceProvider {
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ }
+
+ public class ProcessingException extends java.lang.Exception {
+ ctor public ProcessingException();
+ }
+
+ @RequiresApi(21) public class ResolutionInfo {
+ ctor public ResolutionInfo(android.util.Size, android.graphics.Rect, int);
+ method public android.graphics.Rect getCropRect();
+ method public android.util.Size getResolution();
+ method public int getRotationDegrees();
+ }
+
+ @RequiresApi(21) public class SurfaceOrientedMeteringPointFactory extends androidx.camera.core.MeteringPointFactory {
+ ctor public SurfaceOrientedMeteringPointFactory(float, float);
+ ctor public SurfaceOrientedMeteringPointFactory(float, float, androidx.camera.core.UseCase);
+ }
+
+ public interface SurfaceOutput extends java.io.Closeable {
+ method public void close();
+ method public android.util.Size getSize();
+ method public android.view.Surface getSurface(java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.core.SurfaceOutput.Event!>);
+ method public int getTargets();
+ method public void updateTransformMatrix(float[], float[]);
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceOutput.Event {
+ method public abstract int getEventCode();
+ method public abstract androidx.camera.core.SurfaceOutput getSurfaceOutput();
+ field public static final int EVENT_REQUEST_CLOSE = 0; // 0x0
+ }
+
+ public interface SurfaceProcessor {
+ method public void onInputSurface(androidx.camera.core.SurfaceRequest) throws androidx.camera.core.ProcessingException;
+ method public void onOutputSurface(androidx.camera.core.SurfaceOutput) throws androidx.camera.core.ProcessingException;
+ }
+
+ @RequiresApi(21) public final class SurfaceRequest {
+ method public void addRequestCancellationListener(java.util.concurrent.Executor, Runnable);
+ method public void clearTransformationInfoListener();
+ method public androidx.camera.core.DynamicRange getDynamicRange();
+ method public android.util.Size getResolution();
+ method public boolean invalidate();
+ method public void provideSurface(android.view.Surface, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.core.SurfaceRequest.Result!>);
+ method public void setTransformationInfoListener(java.util.concurrent.Executor, androidx.camera.core.SurfaceRequest.TransformationInfoListener);
+ method public boolean willNotProvideSurface();
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceRequest.Result {
+ method public abstract int getResultCode();
+ method public abstract android.view.Surface getSurface();
+ field public static final int RESULT_INVALID_SURFACE = 2; // 0x2
+ field public static final int RESULT_REQUEST_CANCELLED = 1; // 0x1
+ field public static final int RESULT_SURFACE_ALREADY_PROVIDED = 3; // 0x3
+ field public static final int RESULT_SURFACE_USED_SUCCESSFULLY = 0; // 0x0
+ field public static final int RESULT_WILL_NOT_PROVIDE_SURFACE = 4; // 0x4
+ }
+
+ @com.google.auto.value.AutoValue public abstract static class SurfaceRequest.TransformationInfo {
+ method public abstract android.graphics.Rect getCropRect();
+ method public abstract int getRotationDegrees();
+ }
+
+ public static interface SurfaceRequest.TransformationInfoListener {
+ method public void onTransformationInfoUpdate(androidx.camera.core.SurfaceRequest.TransformationInfo);
+ }
+
+ @RequiresApi(21) public class TorchState {
+ field public static final int OFF = 0; // 0x0
+ field public static final int ON = 1; // 0x1
+ }
+
+ @RequiresApi(21) public abstract class UseCase {
+ method public static int snapToSurfaceRotation(@IntRange(from=0, to=359) int);
+ }
+
+ @RequiresApi(21) public final class UseCaseGroup {
+ method public java.util.List<androidx.camera.core.CameraEffect!> getEffects();
+ method public java.util.List<androidx.camera.core.UseCase!> getUseCases();
+ method public androidx.camera.core.ViewPort? getViewPort();
+ }
+
+ public static final class UseCaseGroup.Builder {
+ ctor public UseCaseGroup.Builder();
+ method public androidx.camera.core.UseCaseGroup.Builder addEffect(androidx.camera.core.CameraEffect);
+ method public androidx.camera.core.UseCaseGroup.Builder addUseCase(androidx.camera.core.UseCase);
+ method public androidx.camera.core.UseCaseGroup build();
+ method public androidx.camera.core.UseCaseGroup.Builder setViewPort(androidx.camera.core.ViewPort);
+ }
+
+ @RequiresApi(21) public final class ViewPort {
+ method public android.util.Rational getAspectRatio();
+ method public int getLayoutDirection();
+ method public int getRotation();
+ method public int getScaleType();
+ field public static final int FILL_CENTER = 1; // 0x1
+ field public static final int FILL_END = 2; // 0x2
+ field public static final int FILL_START = 0; // 0x0
+ field public static final int FIT = 3; // 0x3
+ }
+
+ public static final class ViewPort.Builder {
+ ctor public ViewPort.Builder(android.util.Rational, int);
+ method public androidx.camera.core.ViewPort build();
+ method public androidx.camera.core.ViewPort.Builder setLayoutDirection(int);
+ method public androidx.camera.core.ViewPort.Builder setScaleType(int);
+ }
+
+ @RequiresApi(21) public interface ZoomState {
+ method public float getLinearZoom();
+ method public float getMaxZoomRatio();
+ method public float getMinZoomRatio();
+ method public float getZoomRatio();
+ }
+
+}
+
+package androidx.camera.core.resolutionselector {
+
+ @RequiresApi(21) public final class AspectRatioStrategy {
+ ctor public AspectRatioStrategy(int, int);
+ method public int getFallbackRule();
+ method public int getPreferredAspectRatio();
+ field public static final int FALLBACK_RULE_AUTO = 1; // 0x1
+ field public static final int FALLBACK_RULE_NONE = 0; // 0x0
+ field public static final androidx.camera.core.resolutionselector.AspectRatioStrategy RATIO_16_9_FALLBACK_AUTO_STRATEGY;
+ field public static final androidx.camera.core.resolutionselector.AspectRatioStrategy RATIO_4_3_FALLBACK_AUTO_STRATEGY;
+ }
+
+ @RequiresApi(21) public interface ResolutionFilter {
+ method public java.util.List<android.util.Size!> filter(java.util.List<android.util.Size!>, int);
+ }
+
+ @RequiresApi(21) public final class ResolutionSelector {
+ method public int getAllowedResolutionMode();
+ method public androidx.camera.core.resolutionselector.AspectRatioStrategy getAspectRatioStrategy();
+ method public androidx.camera.core.resolutionselector.ResolutionFilter? getResolutionFilter();
+ method public androidx.camera.core.resolutionselector.ResolutionStrategy? getResolutionStrategy();
+ field public static final int PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION = 0; // 0x0
+ field public static final int PREFER_HIGHER_RESOLUTION_OVER_CAPTURE_RATE = 1; // 0x1
+ }
+
+ public static final class ResolutionSelector.Builder {
+ ctor public ResolutionSelector.Builder();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector build();
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setAllowedResolutionMode(int);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setAspectRatioStrategy(androidx.camera.core.resolutionselector.AspectRatioStrategy);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setResolutionFilter(androidx.camera.core.resolutionselector.ResolutionFilter);
+ method public androidx.camera.core.resolutionselector.ResolutionSelector.Builder setResolutionStrategy(androidx.camera.core.resolutionselector.ResolutionStrategy);
+ }
+
+ @RequiresApi(21) public final class ResolutionStrategy {
+ ctor public ResolutionStrategy(android.util.Size, int);
+ method public android.util.Size? getBoundSize();
+ method public int getFallbackRule();
+ field public static final int FALLBACK_RULE_CLOSEST_HIGHER = 2; // 0x2
+ field public static final int FALLBACK_RULE_CLOSEST_HIGHER_THEN_LOWER = 1; // 0x1
+ field public static final int FALLBACK_RULE_CLOSEST_LOWER = 4; // 0x4
+ field public static final int FALLBACK_RULE_CLOSEST_LOWER_THEN_HIGHER = 3; // 0x3
+ field public static final int FALLBACK_RULE_NONE = 0; // 0x0
+ field public static final androidx.camera.core.resolutionselector.ResolutionStrategy HIGHEST_AVAILABLE_STRATEGY;
+ }
+
+}
+
diff --git a/camera/camera-effects-still-portrait/api/1.3.0-beta01.txt b/camera/camera-effects-still-portrait/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-effects-still-portrait/api/1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-effects-still-portrait/api/res-1.3.0-beta01.txt b/camera/camera-effects-still-portrait/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-effects-still-portrait/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-effects-still-portrait/api/restricted_1.3.0-beta01.txt b/camera/camera-effects-still-portrait/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-effects-still-portrait/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-effects/api/1.3.0-beta01.txt b/camera/camera-effects/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-effects/api/1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-effects/api/res-1.3.0-beta01.txt b/camera/camera-effects/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-effects/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-effects/api/restricted_1.3.0-beta01.txt b/camera/camera-effects/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-effects/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-extensions/api/1.3.0-beta01.txt b/camera/camera-extensions/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..5c6e740
--- /dev/null
+++ b/camera/camera-extensions/api/1.3.0-beta01.txt
@@ -0,0 +1,22 @@
+// Signature format: 4.0
+package androidx.camera.extensions {
+
+ @RequiresApi(21) public final class ExtensionMode {
+ field public static final int AUTO = 5; // 0x5
+ field public static final int BOKEH = 1; // 0x1
+ field public static final int FACE_RETOUCH = 4; // 0x4
+ field public static final int HDR = 2; // 0x2
+ field public static final int NIGHT = 3; // 0x3
+ field public static final int NONE = 0; // 0x0
+ }
+
+ @RequiresApi(21) public final class ExtensionsManager {
+ method public android.util.Range<java.lang.Long!>? getEstimatedCaptureLatencyRange(androidx.camera.core.CameraSelector, int);
+ method public androidx.camera.core.CameraSelector getExtensionEnabledCameraSelector(androidx.camera.core.CameraSelector, int);
+ method public static com.google.common.util.concurrent.ListenableFuture<androidx.camera.extensions.ExtensionsManager!> getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider);
+ method public boolean isExtensionAvailable(androidx.camera.core.CameraSelector, int);
+ method public boolean isImageAnalysisSupported(androidx.camera.core.CameraSelector, int);
+ }
+
+}
+
diff --git a/camera/camera-extensions/api/res-1.3.0-beta01.txt b/camera/camera-extensions/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-extensions/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-extensions/api/restricted_1.3.0-beta01.txt b/camera/camera-extensions/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..5c6e740
--- /dev/null
+++ b/camera/camera-extensions/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,22 @@
+// Signature format: 4.0
+package androidx.camera.extensions {
+
+ @RequiresApi(21) public final class ExtensionMode {
+ field public static final int AUTO = 5; // 0x5
+ field public static final int BOKEH = 1; // 0x1
+ field public static final int FACE_RETOUCH = 4; // 0x4
+ field public static final int HDR = 2; // 0x2
+ field public static final int NIGHT = 3; // 0x3
+ field public static final int NONE = 0; // 0x0
+ }
+
+ @RequiresApi(21) public final class ExtensionsManager {
+ method public android.util.Range<java.lang.Long!>? getEstimatedCaptureLatencyRange(androidx.camera.core.CameraSelector, int);
+ method public androidx.camera.core.CameraSelector getExtensionEnabledCameraSelector(androidx.camera.core.CameraSelector, int);
+ method public static com.google.common.util.concurrent.ListenableFuture<androidx.camera.extensions.ExtensionsManager!> getInstanceAsync(android.content.Context, androidx.camera.core.CameraProvider);
+ method public boolean isExtensionAvailable(androidx.camera.core.CameraSelector, int);
+ method public boolean isImageAnalysisSupported(androidx.camera.core.CameraSelector, int);
+ }
+
+}
+
diff --git a/camera/camera-lifecycle/api/1.3.0-beta01.txt b/camera/camera-lifecycle/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..606a816
--- /dev/null
+++ b/camera/camera-lifecycle/api/1.3.0-beta01.txt
@@ -0,0 +1,23 @@
+// Signature format: 4.0
+package androidx.camera.lifecycle {
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalCameraProviderConfiguration {
+ }
+
+ @RequiresApi(21) public final class ProcessCameraProvider implements androidx.camera.core.CameraProvider {
+ method @MainThread public androidx.camera.core.Camera bindToLifecycle(androidx.lifecycle.LifecycleOwner, androidx.camera.core.CameraSelector, androidx.camera.core.UseCase!...);
+ method @MainThread public androidx.camera.core.Camera bindToLifecycle(androidx.lifecycle.LifecycleOwner, androidx.camera.core.CameraSelector, androidx.camera.core.UseCaseGroup);
+ method @MainThread public androidx.camera.core.ConcurrentCamera bindToLifecycle(java.util.List<androidx.camera.core.ConcurrentCamera.SingleCameraConfig!>);
+ method @androidx.camera.lifecycle.ExperimentalCameraProviderConfiguration public static void configureInstance(androidx.camera.core.CameraXConfig);
+ method public java.util.List<androidx.camera.core.CameraInfo!> getAvailableCameraInfos();
+ method public java.util.List<java.util.List<androidx.camera.core.CameraInfo!>!> getAvailableConcurrentCameraInfos();
+ method public static com.google.common.util.concurrent.ListenableFuture<androidx.camera.lifecycle.ProcessCameraProvider!> getInstance(android.content.Context);
+ method public boolean hasCamera(androidx.camera.core.CameraSelector) throws androidx.camera.core.CameraInfoUnavailableException;
+ method public boolean isBound(androidx.camera.core.UseCase);
+ method @MainThread public boolean isConcurrentCameraModeOn();
+ method @MainThread public void unbind(androidx.camera.core.UseCase!...);
+ method @MainThread public void unbindAll();
+ }
+
+}
+
diff --git a/camera/camera-lifecycle/api/res-1.3.0-beta01.txt b/camera/camera-lifecycle/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-lifecycle/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-lifecycle/api/restricted_1.3.0-beta01.txt b/camera/camera-lifecycle/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..606a816
--- /dev/null
+++ b/camera/camera-lifecycle/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,23 @@
+// Signature format: 4.0
+package androidx.camera.lifecycle {
+
+ @RequiresOptIn @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) public @interface ExperimentalCameraProviderConfiguration {
+ }
+
+ @RequiresApi(21) public final class ProcessCameraProvider implements androidx.camera.core.CameraProvider {
+ method @MainThread public androidx.camera.core.Camera bindToLifecycle(androidx.lifecycle.LifecycleOwner, androidx.camera.core.CameraSelector, androidx.camera.core.UseCase!...);
+ method @MainThread public androidx.camera.core.Camera bindToLifecycle(androidx.lifecycle.LifecycleOwner, androidx.camera.core.CameraSelector, androidx.camera.core.UseCaseGroup);
+ method @MainThread public androidx.camera.core.ConcurrentCamera bindToLifecycle(java.util.List<androidx.camera.core.ConcurrentCamera.SingleCameraConfig!>);
+ method @androidx.camera.lifecycle.ExperimentalCameraProviderConfiguration public static void configureInstance(androidx.camera.core.CameraXConfig);
+ method public java.util.List<androidx.camera.core.CameraInfo!> getAvailableCameraInfos();
+ method public java.util.List<java.util.List<androidx.camera.core.CameraInfo!>!> getAvailableConcurrentCameraInfos();
+ method public static com.google.common.util.concurrent.ListenableFuture<androidx.camera.lifecycle.ProcessCameraProvider!> getInstance(android.content.Context);
+ method public boolean hasCamera(androidx.camera.core.CameraSelector) throws androidx.camera.core.CameraInfoUnavailableException;
+ method public boolean isBound(androidx.camera.core.UseCase);
+ method @MainThread public boolean isConcurrentCameraModeOn();
+ method @MainThread public void unbind(androidx.camera.core.UseCase!...);
+ method @MainThread public void unbindAll();
+ }
+
+}
+
diff --git a/camera/camera-mlkit-vision/api/1.3.0-beta01.txt b/camera/camera-mlkit-vision/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..0599c25
--- /dev/null
+++ b/camera/camera-mlkit-vision/api/1.3.0-beta01.txt
@@ -0,0 +1,20 @@
+// Signature format: 4.0
+package androidx.camera.mlkit.vision {
+
+ @RequiresApi(21) public class MlKitAnalyzer implements androidx.camera.core.ImageAnalysis.Analyzer {
+ ctor public MlKitAnalyzer(java.util.List<com.google.mlkit.vision.interfaces.Detector<?>!>, int, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.mlkit.vision.MlKitAnalyzer.Result!>);
+ method public final void analyze(androidx.camera.core.ImageProxy);
+ method public final android.util.Size getDefaultTargetResolution();
+ method public final int getTargetCoordinateSystem();
+ method public final void updateTransform(android.graphics.Matrix?);
+ }
+
+ public static final class MlKitAnalyzer.Result {
+ ctor public MlKitAnalyzer.Result(java.util.Map<com.google.mlkit.vision.interfaces.Detector<?>!,java.lang.Object!>, long, java.util.Map<com.google.mlkit.vision.interfaces.Detector<?>!,java.lang.Throwable!>);
+ method public Throwable? getThrowable(com.google.mlkit.vision.interfaces.Detector<?>);
+ method public long getTimestamp();
+ method public <T> T? getValue(com.google.mlkit.vision.interfaces.Detector<T!>);
+ }
+
+}
+
diff --git a/camera/camera-mlkit-vision/api/res-1.3.0-beta01.txt b/camera/camera-mlkit-vision/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-mlkit-vision/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-mlkit-vision/api/restricted_1.3.0-beta01.txt b/camera/camera-mlkit-vision/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..0599c25
--- /dev/null
+++ b/camera/camera-mlkit-vision/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,20 @@
+// Signature format: 4.0
+package androidx.camera.mlkit.vision {
+
+ @RequiresApi(21) public class MlKitAnalyzer implements androidx.camera.core.ImageAnalysis.Analyzer {
+ ctor public MlKitAnalyzer(java.util.List<com.google.mlkit.vision.interfaces.Detector<?>!>, int, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.mlkit.vision.MlKitAnalyzer.Result!>);
+ method public final void analyze(androidx.camera.core.ImageProxy);
+ method public final android.util.Size getDefaultTargetResolution();
+ method public final int getTargetCoordinateSystem();
+ method public final void updateTransform(android.graphics.Matrix?);
+ }
+
+ public static final class MlKitAnalyzer.Result {
+ ctor public MlKitAnalyzer.Result(java.util.Map<com.google.mlkit.vision.interfaces.Detector<?>!,java.lang.Object!>, long, java.util.Map<com.google.mlkit.vision.interfaces.Detector<?>!,java.lang.Throwable!>);
+ method public Throwable? getThrowable(com.google.mlkit.vision.interfaces.Detector<?>);
+ method public long getTimestamp();
+ method public <T> T? getValue(com.google.mlkit.vision.interfaces.Detector<T!>);
+ }
+
+}
+
diff --git a/camera/camera-video/api/1.3.0-beta01.txt b/camera/camera-video/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..fb0f4c7
--- /dev/null
+++ b/camera/camera-video/api/1.3.0-beta01.txt
@@ -0,0 +1,202 @@
+// Signature format: 4.0
+package androidx.camera.video {
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class AudioStats {
+ method public abstract int getAudioState();
+ method public abstract Throwable? getErrorCause();
+ method public boolean hasAudio();
+ method public boolean hasError();
+ field public static final int AUDIO_STATE_ACTIVE = 0; // 0x0
+ field public static final int AUDIO_STATE_DISABLED = 1; // 0x1
+ field public static final int AUDIO_STATE_ENCODER_ERROR = 3; // 0x3
+ field public static final int AUDIO_STATE_MUTED = 5; // 0x5
+ field public static final int AUDIO_STATE_SOURCE_ERROR = 4; // 0x4
+ field public static final int AUDIO_STATE_SOURCE_SILENCED = 2; // 0x2
+ }
+
+ @RequiresApi(21) public class FallbackStrategy {
+ method public static androidx.camera.video.FallbackStrategy higherQualityOrLowerThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy higherQualityThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy lowerQualityOrHigherThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy lowerQualityThan(androidx.camera.video.Quality);
+ }
+
+ @RequiresApi(21) public final class FileDescriptorOutputOptions extends androidx.camera.video.OutputOptions {
+ method public android.os.ParcelFileDescriptor getParcelFileDescriptor();
+ }
+
+ @RequiresApi(21) public static final class FileDescriptorOutputOptions.Builder {
+ ctor public FileDescriptorOutputOptions.Builder(android.os.ParcelFileDescriptor);
+ method public androidx.camera.video.FileDescriptorOutputOptions build();
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public final class FileOutputOptions extends androidx.camera.video.OutputOptions {
+ method public java.io.File getFile();
+ }
+
+ @RequiresApi(21) public static final class FileOutputOptions.Builder {
+ ctor public FileOutputOptions.Builder(java.io.File);
+ method public androidx.camera.video.FileOutputOptions build();
+ method public androidx.camera.video.FileOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.FileOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.FileOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public final class MediaStoreOutputOptions extends androidx.camera.video.OutputOptions {
+ method public android.net.Uri getCollectionUri();
+ method public android.content.ContentResolver getContentResolver();
+ method public android.content.ContentValues getContentValues();
+ field public static final android.content.ContentValues EMPTY_CONTENT_VALUES;
+ }
+
+ public static final class MediaStoreOutputOptions.Builder {
+ ctor public MediaStoreOutputOptions.Builder(android.content.ContentResolver, android.net.Uri);
+ method public androidx.camera.video.MediaStoreOutputOptions build();
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setContentValues(android.content.ContentValues);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public abstract class OutputOptions {
+ method @IntRange(from=0) public long getDurationLimitMillis();
+ method @IntRange(from=0) public long getFileSizeLimit();
+ method public android.location.Location? getLocation();
+ field public static final int DURATION_UNLIMITED = 0; // 0x0
+ field public static final int FILE_SIZE_UNLIMITED = 0; // 0x0
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class OutputResults {
+ ctor public OutputResults();
+ method public abstract android.net.Uri getOutputUri();
+ }
+
+ @RequiresApi(21) public final class PendingRecording {
+ method @CheckResult public androidx.camera.video.Recording start(java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @RequiresPermission(android.Manifest.permission.RECORD_AUDIO) public androidx.camera.video.PendingRecording withAudioEnabled();
+ }
+
+ @RequiresApi(21) public class Quality {
+ field public static final androidx.camera.video.Quality FHD;
+ field public static final androidx.camera.video.Quality HD;
+ field public static final androidx.camera.video.Quality HIGHEST;
+ field public static final androidx.camera.video.Quality LOWEST;
+ field public static final androidx.camera.video.Quality SD;
+ field public static final androidx.camera.video.Quality UHD;
+ }
+
+ @RequiresApi(21) public final class QualitySelector {
+ method public static androidx.camera.video.QualitySelector from(androidx.camera.video.Quality);
+ method public static androidx.camera.video.QualitySelector from(androidx.camera.video.Quality, androidx.camera.video.FallbackStrategy);
+ method public static androidx.camera.video.QualitySelector fromOrderedList(java.util.List<androidx.camera.video.Quality!>);
+ method public static androidx.camera.video.QualitySelector fromOrderedList(java.util.List<androidx.camera.video.Quality!>, androidx.camera.video.FallbackStrategy);
+ method public static android.util.Size? getResolution(androidx.camera.core.CameraInfo, androidx.camera.video.Quality);
+ method @Deprecated public static java.util.List<androidx.camera.video.Quality!> getSupportedQualities(androidx.camera.core.CameraInfo);
+ method @Deprecated public static boolean isQualitySupported(androidx.camera.core.CameraInfo, androidx.camera.video.Quality);
+ }
+
+ @RequiresApi(21) public final class Recorder implements androidx.camera.video.VideoOutput {
+ method public int getAspectRatio();
+ method public java.util.concurrent.Executor? getExecutor();
+ method public androidx.camera.video.QualitySelector getQualitySelector();
+ method public int getTargetVideoEncodingBitRate();
+ method public static androidx.camera.video.VideoCapabilities getVideoCapabilities(androidx.camera.core.CameraInfo);
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ method @RequiresApi(26) public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.FileDescriptorOutputOptions);
+ method public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.FileOutputOptions);
+ method public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.MediaStoreOutputOptions);
+ field public static final androidx.camera.video.QualitySelector DEFAULT_QUALITY_SELECTOR;
+ }
+
+ @RequiresApi(21) public static final class Recorder.Builder {
+ ctor public Recorder.Builder();
+ method public androidx.camera.video.Recorder build();
+ method public androidx.camera.video.Recorder.Builder setAspectRatio(int);
+ method public androidx.camera.video.Recorder.Builder setExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.video.Recorder.Builder setQualitySelector(androidx.camera.video.QualitySelector);
+ method public androidx.camera.video.Recorder.Builder setTargetVideoEncodingBitRate(@IntRange(from=1) int);
+ }
+
+ @RequiresApi(21) public final class Recording implements java.lang.AutoCloseable {
+ method public void close();
+ method public void mute(boolean);
+ method public void pause();
+ method public void resume();
+ method public void stop();
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class RecordingStats {
+ method public abstract androidx.camera.video.AudioStats getAudioStats();
+ method public abstract long getNumBytesRecorded();
+ method public abstract long getRecordedDurationNanos();
+ }
+
+ @RequiresApi(21) public interface VideoCapabilities {
+ method public java.util.Set<androidx.camera.core.DynamicRange!> getSupportedDynamicRanges();
+ method public java.util.List<androidx.camera.video.Quality!> getSupportedQualities(androidx.camera.core.DynamicRange);
+ method public boolean isQualitySupported(androidx.camera.video.Quality, androidx.camera.core.DynamicRange);
+ }
+
+ @RequiresApi(21) public final class VideoCapture<T extends androidx.camera.video.VideoOutput> extends androidx.camera.core.UseCase {
+ method public androidx.camera.core.DynamicRange getDynamicRange();
+ method public int getMirrorMode();
+ method public T getOutput();
+ method public android.util.Range<java.lang.Integer!> getTargetFrameRate();
+ method public int getTargetRotation();
+ method public void setTargetRotation(int);
+ method public static <T extends androidx.camera.video.VideoOutput> androidx.camera.video.VideoCapture<T!> withOutput(T);
+ }
+
+ @RequiresApi(21) public static final class VideoCapture.Builder<T extends androidx.camera.video.VideoOutput> implements androidx.camera.core.ExtendableBuilder<androidx.camera.video.VideoCapture> {
+ ctor public VideoCapture.Builder(T);
+ method public androidx.camera.video.VideoCapture<T!> build();
+ method public androidx.camera.video.VideoCapture.Builder<T!> setDynamicRange(androidx.camera.core.DynamicRange);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setMirrorMode(int);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setTargetFrameRate(android.util.Range<java.lang.Integer!>);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setTargetRotation(int);
+ }
+
+ @RequiresApi(21) public interface VideoOutput {
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ }
+
+ @RequiresApi(21) public abstract class VideoRecordEvent {
+ method public androidx.camera.video.OutputOptions getOutputOptions();
+ method public androidx.camera.video.RecordingStats getRecordingStats();
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Finalize extends androidx.camera.video.VideoRecordEvent {
+ method public Throwable? getCause();
+ method public int getError();
+ method public androidx.camera.video.OutputResults getOutputResults();
+ method public boolean hasError();
+ field public static final int ERROR_DURATION_LIMIT_REACHED = 9; // 0x9
+ field public static final int ERROR_ENCODING_FAILED = 6; // 0x6
+ field public static final int ERROR_FILE_SIZE_LIMIT_REACHED = 2; // 0x2
+ field public static final int ERROR_INSUFFICIENT_STORAGE = 3; // 0x3
+ field public static final int ERROR_INVALID_OUTPUT_OPTIONS = 5; // 0x5
+ field public static final int ERROR_NONE = 0; // 0x0
+ field public static final int ERROR_NO_VALID_DATA = 8; // 0x8
+ field public static final int ERROR_RECORDER_ERROR = 7; // 0x7
+ field public static final int ERROR_RECORDING_GARBAGE_COLLECTED = 10; // 0xa
+ field public static final int ERROR_SOURCE_INACTIVE = 4; // 0x4
+ field public static final int ERROR_UNKNOWN = 1; // 0x1
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Pause extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Resume extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Start extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Status extends androidx.camera.video.VideoRecordEvent {
+ }
+
+}
+
diff --git a/camera/camera-video/api/res-1.3.0-beta01.txt b/camera/camera-video/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-video/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-video/api/restricted_1.3.0-beta01.txt b/camera/camera-video/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..fb0f4c7
--- /dev/null
+++ b/camera/camera-video/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,202 @@
+// Signature format: 4.0
+package androidx.camera.video {
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class AudioStats {
+ method public abstract int getAudioState();
+ method public abstract Throwable? getErrorCause();
+ method public boolean hasAudio();
+ method public boolean hasError();
+ field public static final int AUDIO_STATE_ACTIVE = 0; // 0x0
+ field public static final int AUDIO_STATE_DISABLED = 1; // 0x1
+ field public static final int AUDIO_STATE_ENCODER_ERROR = 3; // 0x3
+ field public static final int AUDIO_STATE_MUTED = 5; // 0x5
+ field public static final int AUDIO_STATE_SOURCE_ERROR = 4; // 0x4
+ field public static final int AUDIO_STATE_SOURCE_SILENCED = 2; // 0x2
+ }
+
+ @RequiresApi(21) public class FallbackStrategy {
+ method public static androidx.camera.video.FallbackStrategy higherQualityOrLowerThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy higherQualityThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy lowerQualityOrHigherThan(androidx.camera.video.Quality);
+ method public static androidx.camera.video.FallbackStrategy lowerQualityThan(androidx.camera.video.Quality);
+ }
+
+ @RequiresApi(21) public final class FileDescriptorOutputOptions extends androidx.camera.video.OutputOptions {
+ method public android.os.ParcelFileDescriptor getParcelFileDescriptor();
+ }
+
+ @RequiresApi(21) public static final class FileDescriptorOutputOptions.Builder {
+ ctor public FileDescriptorOutputOptions.Builder(android.os.ParcelFileDescriptor);
+ method public androidx.camera.video.FileDescriptorOutputOptions build();
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.FileDescriptorOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public final class FileOutputOptions extends androidx.camera.video.OutputOptions {
+ method public java.io.File getFile();
+ }
+
+ @RequiresApi(21) public static final class FileOutputOptions.Builder {
+ ctor public FileOutputOptions.Builder(java.io.File);
+ method public androidx.camera.video.FileOutputOptions build();
+ method public androidx.camera.video.FileOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.FileOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.FileOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public final class MediaStoreOutputOptions extends androidx.camera.video.OutputOptions {
+ method public android.net.Uri getCollectionUri();
+ method public android.content.ContentResolver getContentResolver();
+ method public android.content.ContentValues getContentValues();
+ field public static final android.content.ContentValues EMPTY_CONTENT_VALUES;
+ }
+
+ public static final class MediaStoreOutputOptions.Builder {
+ ctor public MediaStoreOutputOptions.Builder(android.content.ContentResolver, android.net.Uri);
+ method public androidx.camera.video.MediaStoreOutputOptions build();
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setContentValues(android.content.ContentValues);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setDurationLimitMillis(@IntRange(from=0) long);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setFileSizeLimit(@IntRange(from=0) long);
+ method public androidx.camera.video.MediaStoreOutputOptions.Builder setLocation(android.location.Location?);
+ }
+
+ @RequiresApi(21) public abstract class OutputOptions {
+ method @IntRange(from=0) public long getDurationLimitMillis();
+ method @IntRange(from=0) public long getFileSizeLimit();
+ method public android.location.Location? getLocation();
+ field public static final int DURATION_UNLIMITED = 0; // 0x0
+ field public static final int FILE_SIZE_UNLIMITED = 0; // 0x0
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class OutputResults {
+ ctor public OutputResults();
+ method public abstract android.net.Uri getOutputUri();
+ }
+
+ @RequiresApi(21) public final class PendingRecording {
+ method @CheckResult public androidx.camera.video.Recording start(java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @RequiresPermission(android.Manifest.permission.RECORD_AUDIO) public androidx.camera.video.PendingRecording withAudioEnabled();
+ }
+
+ @RequiresApi(21) public class Quality {
+ field public static final androidx.camera.video.Quality FHD;
+ field public static final androidx.camera.video.Quality HD;
+ field public static final androidx.camera.video.Quality HIGHEST;
+ field public static final androidx.camera.video.Quality LOWEST;
+ field public static final androidx.camera.video.Quality SD;
+ field public static final androidx.camera.video.Quality UHD;
+ }
+
+ @RequiresApi(21) public final class QualitySelector {
+ method public static androidx.camera.video.QualitySelector from(androidx.camera.video.Quality);
+ method public static androidx.camera.video.QualitySelector from(androidx.camera.video.Quality, androidx.camera.video.FallbackStrategy);
+ method public static androidx.camera.video.QualitySelector fromOrderedList(java.util.List<androidx.camera.video.Quality!>);
+ method public static androidx.camera.video.QualitySelector fromOrderedList(java.util.List<androidx.camera.video.Quality!>, androidx.camera.video.FallbackStrategy);
+ method public static android.util.Size? getResolution(androidx.camera.core.CameraInfo, androidx.camera.video.Quality);
+ method @Deprecated public static java.util.List<androidx.camera.video.Quality!> getSupportedQualities(androidx.camera.core.CameraInfo);
+ method @Deprecated public static boolean isQualitySupported(androidx.camera.core.CameraInfo, androidx.camera.video.Quality);
+ }
+
+ @RequiresApi(21) public final class Recorder implements androidx.camera.video.VideoOutput {
+ method public int getAspectRatio();
+ method public java.util.concurrent.Executor? getExecutor();
+ method public androidx.camera.video.QualitySelector getQualitySelector();
+ method public int getTargetVideoEncodingBitRate();
+ method public static androidx.camera.video.VideoCapabilities getVideoCapabilities(androidx.camera.core.CameraInfo);
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ method @RequiresApi(26) public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.FileDescriptorOutputOptions);
+ method public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.FileOutputOptions);
+ method public androidx.camera.video.PendingRecording prepareRecording(android.content.Context, androidx.camera.video.MediaStoreOutputOptions);
+ field public static final androidx.camera.video.QualitySelector DEFAULT_QUALITY_SELECTOR;
+ }
+
+ @RequiresApi(21) public static final class Recorder.Builder {
+ ctor public Recorder.Builder();
+ method public androidx.camera.video.Recorder build();
+ method public androidx.camera.video.Recorder.Builder setAspectRatio(int);
+ method public androidx.camera.video.Recorder.Builder setExecutor(java.util.concurrent.Executor);
+ method public androidx.camera.video.Recorder.Builder setQualitySelector(androidx.camera.video.QualitySelector);
+ method public androidx.camera.video.Recorder.Builder setTargetVideoEncodingBitRate(@IntRange(from=1) int);
+ }
+
+ @RequiresApi(21) public final class Recording implements java.lang.AutoCloseable {
+ method public void close();
+ method public void mute(boolean);
+ method public void pause();
+ method public void resume();
+ method public void stop();
+ }
+
+ @RequiresApi(21) @com.google.auto.value.AutoValue public abstract class RecordingStats {
+ method public abstract androidx.camera.video.AudioStats getAudioStats();
+ method public abstract long getNumBytesRecorded();
+ method public abstract long getRecordedDurationNanos();
+ }
+
+ @RequiresApi(21) public interface VideoCapabilities {
+ method public java.util.Set<androidx.camera.core.DynamicRange!> getSupportedDynamicRanges();
+ method public java.util.List<androidx.camera.video.Quality!> getSupportedQualities(androidx.camera.core.DynamicRange);
+ method public boolean isQualitySupported(androidx.camera.video.Quality, androidx.camera.core.DynamicRange);
+ }
+
+ @RequiresApi(21) public final class VideoCapture<T extends androidx.camera.video.VideoOutput> extends androidx.camera.core.UseCase {
+ method public androidx.camera.core.DynamicRange getDynamicRange();
+ method public int getMirrorMode();
+ method public T getOutput();
+ method public android.util.Range<java.lang.Integer!> getTargetFrameRate();
+ method public int getTargetRotation();
+ method public void setTargetRotation(int);
+ method public static <T extends androidx.camera.video.VideoOutput> androidx.camera.video.VideoCapture<T!> withOutput(T);
+ }
+
+ @RequiresApi(21) public static final class VideoCapture.Builder<T extends androidx.camera.video.VideoOutput> implements androidx.camera.core.ExtendableBuilder<androidx.camera.video.VideoCapture> {
+ ctor public VideoCapture.Builder(T);
+ method public androidx.camera.video.VideoCapture<T!> build();
+ method public androidx.camera.video.VideoCapture.Builder<T!> setDynamicRange(androidx.camera.core.DynamicRange);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setMirrorMode(int);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setTargetFrameRate(android.util.Range<java.lang.Integer!>);
+ method public androidx.camera.video.VideoCapture.Builder<T!> setTargetRotation(int);
+ }
+
+ @RequiresApi(21) public interface VideoOutput {
+ method public void onSurfaceRequested(androidx.camera.core.SurfaceRequest);
+ }
+
+ @RequiresApi(21) public abstract class VideoRecordEvent {
+ method public androidx.camera.video.OutputOptions getOutputOptions();
+ method public androidx.camera.video.RecordingStats getRecordingStats();
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Finalize extends androidx.camera.video.VideoRecordEvent {
+ method public Throwable? getCause();
+ method public int getError();
+ method public androidx.camera.video.OutputResults getOutputResults();
+ method public boolean hasError();
+ field public static final int ERROR_DURATION_LIMIT_REACHED = 9; // 0x9
+ field public static final int ERROR_ENCODING_FAILED = 6; // 0x6
+ field public static final int ERROR_FILE_SIZE_LIMIT_REACHED = 2; // 0x2
+ field public static final int ERROR_INSUFFICIENT_STORAGE = 3; // 0x3
+ field public static final int ERROR_INVALID_OUTPUT_OPTIONS = 5; // 0x5
+ field public static final int ERROR_NONE = 0; // 0x0
+ field public static final int ERROR_NO_VALID_DATA = 8; // 0x8
+ field public static final int ERROR_RECORDER_ERROR = 7; // 0x7
+ field public static final int ERROR_RECORDING_GARBAGE_COLLECTED = 10; // 0xa
+ field public static final int ERROR_SOURCE_INACTIVE = 4; // 0x4
+ field public static final int ERROR_UNKNOWN = 1; // 0x1
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Pause extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Resume extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Start extends androidx.camera.video.VideoRecordEvent {
+ }
+
+ @RequiresApi(21) public static final class VideoRecordEvent.Status extends androidx.camera.video.VideoRecordEvent {
+ }
+
+}
+
diff --git a/camera/camera-video/lint.xml b/camera/camera-video/lint.xml
deleted file mode 100644
index 0843ecf..0000000
--- a/camera/camera-video/lint.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<lint>
- <!-- Disable NewApi lint check temporarily for unit tests.
- This file can be removed once b/200599470 is resolved. -->
- <issue id="NewApi">
- <ignore path="src/test/**" />
- </issue>
-</lint>
\ No newline at end of file
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/RecorderVideoCapabilitiesTest.kt b/camera/camera-video/src/test/java/androidx/camera/video/RecorderVideoCapabilitiesTest.kt
index 2a1c94e..46aa625 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/RecorderVideoCapabilitiesTest.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/RecorderVideoCapabilitiesTest.kt
@@ -14,11 +14,14 @@
* limitations under the License.
*/
+@file:RequiresApi(21)
+
package androidx.camera.video
import android.media.CamcorderProfile
import android.os.Build
import android.util.Size
+import androidx.annotation.RequiresApi
import androidx.camera.core.DynamicRange
import androidx.camera.core.DynamicRange.BIT_DEPTH_10_BIT
import androidx.camera.core.DynamicRange.BIT_DEPTH_8_BIT
@@ -283,4 +286,4 @@
assertThat(videoCapabilities.findHighestSupportedEncoderProfilesFor(exactSize720p, SDR))
.isEqualTo(validatedProfiles720p)
}
-}
\ No newline at end of file
+}
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/VideoCaptureTest.kt b/camera/camera-video/src/test/java/androidx/camera/video/VideoCaptureTest.kt
index b3c282b..1442c00 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/VideoCaptureTest.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/VideoCaptureTest.kt
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+@file:RequiresApi(21)
+
package androidx.camera.video
import android.content.Context
@@ -31,6 +33,7 @@
import android.util.Range
import android.util.Size
import android.view.Surface
+import androidx.annotation.RequiresApi
import androidx.arch.core.util.Function
import androidx.camera.core.AspectRatio.RATIO_16_9
import androidx.camera.core.AspectRatio.RATIO_4_3
@@ -124,7 +127,7 @@
import org.robolectric.annotation.internal.DoNotInstrument
import org.robolectric.shadows.ShadowLog
-private val ANY_SIZE = Size(640, 480)
+private val ANY_SIZE by lazy { Size(640, 480) }
private const val CAMERA_ID_0 = "0"
@RunWith(RobolectricTestRunner::class)
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt b/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
index 6421b0fc..2e50631 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/VideoRecordEventTest.kt
@@ -14,10 +14,13 @@
* limitations under the License.
*/
+@file:RequiresApi(21)
+
package androidx.camera.video
import android.net.Uri
import android.os.Build
+import androidx.annotation.RequiresApi
import androidx.camera.video.VideoRecordEvent.Finalize.ERROR_NONE
import androidx.camera.video.VideoRecordEvent.Finalize.ERROR_UNKNOWN
import com.google.common.truth.Truth.assertThat
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/FakeBufferProvider.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/FakeBufferProvider.kt
index 0b1f22f..a946d9d 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/FakeBufferProvider.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/FakeBufferProvider.kt
@@ -16,6 +16,7 @@
package androidx.camera.video.internal
+import androidx.annotation.RequiresApi
import androidx.camera.core.impl.Observable
import androidx.camera.core.impl.utils.executor.CameraXExecutors.directExecutor
import androidx.camera.core.impl.utils.futures.Futures.immediateFailedFuture
@@ -28,6 +29,7 @@
import java.util.concurrent.ExecutionException
import java.util.concurrent.Executor
+@RequiresApi(21)
class FakeBufferProvider(
private var state: BufferProvider.State = BufferProvider.State.ACTIVE,
private val bufferFactory: (Int) -> ListenableFuture<FakeInputBuffer>,
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/VideoValidatedEncoderProfilesProxyTest.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/VideoValidatedEncoderProfilesProxyTest.kt
index b853ba7..e9d1954 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/VideoValidatedEncoderProfilesProxyTest.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/VideoValidatedEncoderProfilesProxyTest.kt
@@ -14,9 +14,12 @@
* limitations under the License.
*/
+@file:RequiresApi(21)
+
package androidx.camera.video.internal
import android.os.Build
+import androidx.annotation.RequiresApi
import androidx.camera.core.impl.EncoderProfilesProxy.VideoProfileProxy
import androidx.camera.testing.EncoderProfilesUtil
import com.google.common.truth.Truth.assertThat
@@ -28,19 +31,21 @@
private const val DEFAULT_WIDTH = 1920
private const val DEFAULT_HEIGHT = 1080
-private val DEFAULT_VIDEO_PROFILE = VideoProfileProxy.create(
- EncoderProfilesUtil.DEFAULT_VIDEO_CODEC,
- EncoderProfilesUtil.DEFAULT_VIDEO_MEDIA_TYPE,
- EncoderProfilesUtil.DEFAULT_VIDEO_BITRATE,
- EncoderProfilesUtil.DEFAULT_VIDEO_FRAME_RATE,
- DEFAULT_WIDTH,
- DEFAULT_HEIGHT,
- EncoderProfilesUtil.DEFAULT_VIDEO_PROFILE,
- EncoderProfilesUtil.DEFAULT_VIDEO_BIT_DEPTH,
- EncoderProfilesUtil.DEFAULT_VIDEO_CHROMA_SUBSAMPLING,
- EncoderProfilesUtil.DEFAULT_VIDEO_HDR_FORMAT
-)
+private val DEFAULT_VIDEO_PROFILE by lazy {
+ VideoProfileProxy.create(
+ EncoderProfilesUtil.DEFAULT_VIDEO_CODEC,
+ EncoderProfilesUtil.DEFAULT_VIDEO_MEDIA_TYPE,
+ EncoderProfilesUtil.DEFAULT_VIDEO_BITRATE,
+ EncoderProfilesUtil.DEFAULT_VIDEO_FRAME_RATE,
+ DEFAULT_WIDTH,
+ DEFAULT_HEIGHT,
+ EncoderProfilesUtil.DEFAULT_VIDEO_PROFILE,
+ EncoderProfilesUtil.DEFAULT_VIDEO_BIT_DEPTH,
+ EncoderProfilesUtil.DEFAULT_VIDEO_CHROMA_SUBSAMPLING,
+ EncoderProfilesUtil.DEFAULT_VIDEO_HDR_FORMAT
+ )
+}
@RunWith(RobolectricTestRunner::class)
@DoNotInstrument
@Config(minSdk = Build.VERSION_CODES.LOLLIPOP)
@@ -113,4 +118,4 @@
)
assertThat(validatedProfiles.defaultAudioProfile).isNull()
}
-}
\ No newline at end of file
+}
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioSourceCallback.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioSourceCallback.kt
index 2ae5a4d..da51b39 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioSourceCallback.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioSourceCallback.kt
@@ -16,11 +16,13 @@
package androidx.camera.video.internal.audio
+import androidx.annotation.RequiresApi
import androidx.camera.testing.mocks.MockConsumer
import androidx.camera.testing.mocks.MockConsumer.NO_TIMEOUT
import androidx.camera.testing.mocks.helpers.CallTimes
import androidx.camera.testing.mocks.verifyAcceptCallExt
+@RequiresApi(21)
class FakeAudioSourceCallback : AudioSource.AudioSourceCallback {
private val onSuspendedCallbacks = MockConsumer<Boolean>()
private val onSilencedCallbacks = MockConsumer<Boolean>()
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStream.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStream.kt
index e3c0464..2b12cf6 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStream.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStream.kt
@@ -16,6 +16,7 @@
package androidx.camera.video.internal.audio
+import androidx.annotation.RequiresApi
import androidx.camera.testing.mocks.MockConsumer
import androidx.camera.testing.mocks.helpers.CallTimes
import androidx.camera.video.internal.audio.AudioStream.PacketInfo
@@ -23,6 +24,7 @@
import java.nio.ByteBuffer
import java.util.concurrent.Executor
+@RequiresApi(21)
class FakeAudioStream(
private val audioDataProvider: (index: Int) -> AudioData,
isSilenced: Boolean = false,
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStreamCallback.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStreamCallback.kt
index 19f26737..113419a 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStreamCallback.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/audio/FakeAudioStreamCallback.kt
@@ -16,10 +16,12 @@
package androidx.camera.video.internal.audio
+import androidx.annotation.RequiresApi
import androidx.camera.testing.mocks.MockConsumer
import androidx.camera.testing.mocks.helpers.CallTimes
import androidx.camera.testing.mocks.verifyAcceptCallExt
+@RequiresApi(21)
class FakeAudioStreamCallback : AudioStream.AudioStreamCallback {
private val onSilencedCallbacks = MockConsumer<Boolean>()
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/compat/quirk/DeviceQuirks.java b/camera/camera-video/src/test/java/androidx/camera/video/internal/compat/quirk/DeviceQuirks.java
index 6db867b..8039731 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/compat/quirk/DeviceQuirks.java
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/compat/quirk/DeviceQuirks.java
@@ -18,6 +18,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
import androidx.camera.core.impl.Quirk;
import androidx.camera.core.impl.Quirks;
@@ -41,6 +42,7 @@
}
/** Returns all video specific quirks loaded on the current device. */
+ @RequiresApi(21)
@NonNull
public static Quirks getAll() {
return new Quirks(DeviceQuirksLoader.loadQuirks());
@@ -53,6 +55,7 @@
* @return A device {@link Quirk} instance of the provided type, or {@code null} if it isn't
* found.
*/
+ @RequiresApi(21)
@SuppressWarnings("unchecked")
@Nullable
public static <T extends Quirk> T get(@NonNull final Class<T> quirkClass) {
@@ -72,6 +75,7 @@
* @return A device {@link Quirk} list of the provided type. An empty list is returned if it
* isn't found.
*/
+ @RequiresApi(21)
@SuppressWarnings("unchecked")
@NonNull
public static <T extends Quirk> List<T> getAll(@NonNull Class<T> quirkClass) {
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/encoder/FakeInputBuffer.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/encoder/FakeInputBuffer.kt
index 0a2867a..942a5f7 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/encoder/FakeInputBuffer.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/encoder/FakeInputBuffer.kt
@@ -16,11 +16,13 @@
package androidx.camera.video.internal.encoder
+import androidx.annotation.RequiresApi
import androidx.concurrent.futures.ResolvableFuture
import com.google.common.util.concurrent.ListenableFuture
import java.nio.ByteBuffer
import java.util.concurrent.atomic.AtomicBoolean
+@RequiresApi(21)
class FakeInputBuffer(capacity: Int = 16) : InputBuffer {
private val byteBuffer = ByteBuffer.allocate(capacity)
private val terminationFuture = ResolvableFuture.create<Void>()
diff --git a/camera/camera-video/src/test/java/androidx/camera/video/internal/workaround/FakeTimeProvider.kt b/camera/camera-video/src/test/java/androidx/camera/video/internal/workaround/FakeTimeProvider.kt
index eb2df49..b43e3d2 100644
--- a/camera/camera-video/src/test/java/androidx/camera/video/internal/workaround/FakeTimeProvider.kt
+++ b/camera/camera-video/src/test/java/androidx/camera/video/internal/workaround/FakeTimeProvider.kt
@@ -16,12 +16,14 @@
package androidx.camera.video.internal.workaround
+import androidx.annotation.RequiresApi
import androidx.camera.video.internal.encoder.TimeProvider
import java.util.concurrent.TimeUnit
/**
* A fake TimeProvider implementation.
*/
+@RequiresApi(21)
class FakeTimeProvider(var uptimeNs: Long = 0L, var realtimeNs: Long = 0L) : TimeProvider {
override fun uptimeUs() = TimeUnit.NANOSECONDS.toMicros(uptimeNs)
diff --git a/camera/camera-view/api/1.3.0-beta01.txt b/camera/camera-view/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..ed1e846
--- /dev/null
+++ b/camera/camera-view/api/1.3.0-beta01.txt
@@ -0,0 +1,173 @@
+// Signature format: 4.0
+package androidx.camera.view {
+
+ @RequiresApi(21) public abstract class CameraController {
+ method @MainThread public void clearEffects();
+ method @MainThread public void clearImageAnalysisAnalyzer();
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
+ method @MainThread public androidx.camera.core.CameraControl? getCameraControl();
+ method @MainThread public androidx.camera.core.CameraInfo? getCameraInfo();
+ method @MainThread public androidx.camera.core.CameraSelector getCameraSelector();
+ method @MainThread public java.util.concurrent.Executor? getImageAnalysisBackgroundExecutor();
+ method @MainThread public int getImageAnalysisBackpressureStrategy();
+ method @MainThread public int getImageAnalysisImageQueueDepth();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getImageAnalysisTargetSize();
+ method @MainThread public int getImageCaptureFlashMode();
+ method @MainThread public java.util.concurrent.Executor? getImageCaptureIoExecutor();
+ method @MainThread public int getImageCaptureMode();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getImageCaptureTargetSize();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> getInitializationFuture();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getPreviewTargetSize();
+ method @MainThread public androidx.lifecycle.LiveData<java.lang.Integer!> getTapToFocusState();
+ method @MainThread public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+ method @MainThread public androidx.camera.video.QualitySelector getVideoCaptureQualitySelector();
+ method @MainThread public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
+ method @MainThread public boolean hasCamera(androidx.camera.core.CameraSelector);
+ method @MainThread public boolean isImageAnalysisEnabled();
+ method @MainThread public boolean isImageCaptureEnabled();
+ method @MainThread public boolean isPinchToZoomEnabled();
+ method @MainThread public boolean isRecording();
+ method @MainThread public boolean isTapToFocusEnabled();
+ method @MainThread public boolean isVideoCaptureEnabled();
+ method @MainThread public void setCameraSelector(androidx.camera.core.CameraSelector);
+ method @MainThread public void setEffects(java.util.Set<androidx.camera.core.CameraEffect!>);
+ method @MainThread public void setEnabledUseCases(int);
+ method @MainThread public void setImageAnalysisAnalyzer(java.util.concurrent.Executor, androidx.camera.core.ImageAnalysis.Analyzer);
+ method @MainThread public void setImageAnalysisBackgroundExecutor(java.util.concurrent.Executor?);
+ method @MainThread public void setImageAnalysisBackpressureStrategy(int);
+ method @MainThread public void setImageAnalysisImageQueueDepth(int);
+ method @MainThread public void setImageAnalysisTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public void setImageCaptureFlashMode(int);
+ method @MainThread public void setImageCaptureIoExecutor(java.util.concurrent.Executor?);
+ method @MainThread public void setImageCaptureMode(int);
+ method @MainThread public void setImageCaptureTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+ method @MainThread public void setPinchToZoomEnabled(boolean);
+ method @MainThread public void setPreviewTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public void setTapToFocusEnabled(boolean);
+ method @MainThread public void setVideoCaptureQualitySelector(androidx.camera.video.QualitySelector);
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
+ method @MainThread @RequiresApi(26) public androidx.camera.video.Recording startRecording(androidx.camera.video.FileDescriptorOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public androidx.camera.video.Recording startRecording(androidx.camera.video.FileOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public androidx.camera.video.Recording startRecording(androidx.camera.video.MediaStoreOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public void takePicture(androidx.camera.core.ImageCapture.OutputFileOptions, java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageSavedCallback);
+ method @MainThread public void takePicture(java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageCapturedCallback);
+ field public static final int COORDINATE_SYSTEM_VIEW_REFERENCED = 1; // 0x1
+ field public static final int IMAGE_ANALYSIS = 2; // 0x2
+ field public static final int IMAGE_CAPTURE = 1; // 0x1
+ field public static final int TAP_TO_FOCUS_FAILED = 4; // 0x4
+ field public static final int TAP_TO_FOCUS_FOCUSED = 2; // 0x2
+ field public static final int TAP_TO_FOCUS_NOT_FOCUSED = 3; // 0x3
+ field public static final int TAP_TO_FOCUS_NOT_STARTED = 0; // 0x0
+ field public static final int TAP_TO_FOCUS_STARTED = 1; // 0x1
+ field public static final int VIDEO_CAPTURE = 4; // 0x4
+ }
+
+ @RequiresApi(21) public static final class CameraController.OutputSize {
+ ctor public CameraController.OutputSize(android.util.Size);
+ ctor public CameraController.OutputSize(int);
+ method public int getAspectRatio();
+ method public android.util.Size? getResolution();
+ field public static final int UNASSIGNED_ASPECT_RATIO = -1; // 0xffffffff
+ }
+
+ @RequiresApi(21) public final class LifecycleCameraController extends androidx.camera.view.CameraController {
+ ctor public LifecycleCameraController(android.content.Context);
+ method @MainThread public void bindToLifecycle(androidx.lifecycle.LifecycleOwner);
+ method @MainThread public void unbind();
+ }
+
+ @RequiresApi(21) public final class PreviewView extends android.widget.FrameLayout {
+ ctor @UiThread public PreviewView(android.content.Context);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?, int);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?, int, int);
+ method @UiThread public android.graphics.Bitmap? getBitmap();
+ method @UiThread public androidx.camera.view.CameraController? getController();
+ method @UiThread public androidx.camera.view.PreviewView.ImplementationMode getImplementationMode();
+ method @UiThread public androidx.camera.core.MeteringPointFactory getMeteringPointFactory();
+ method public androidx.camera.view.transform.OutputTransform? getOutputTransform();
+ method public androidx.lifecycle.LiveData<androidx.camera.view.PreviewView.StreamState!> getPreviewStreamState();
+ method @UiThread public androidx.camera.view.PreviewView.ScaleType getScaleType();
+ method @UiThread public androidx.camera.core.Preview.SurfaceProvider getSurfaceProvider();
+ method @UiThread public androidx.camera.core.ViewPort? getViewPort();
+ method @UiThread public androidx.camera.core.ViewPort? getViewPort(int);
+ method @UiThread public void setController(androidx.camera.view.CameraController?);
+ method @UiThread public void setImplementationMode(androidx.camera.view.PreviewView.ImplementationMode);
+ method @UiThread public void setScaleType(androidx.camera.view.PreviewView.ScaleType);
+ }
+
+ @RequiresApi(21) public enum PreviewView.ImplementationMode {
+ enum_constant public static final androidx.camera.view.PreviewView.ImplementationMode COMPATIBLE;
+ enum_constant public static final androidx.camera.view.PreviewView.ImplementationMode PERFORMANCE;
+ }
+
+ @RequiresApi(21) public enum PreviewView.ScaleType {
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_CENTER;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_END;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_START;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_CENTER;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_END;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_START;
+ }
+
+ public enum PreviewView.StreamState {
+ enum_constant public static final androidx.camera.view.PreviewView.StreamState IDLE;
+ enum_constant public static final androidx.camera.view.PreviewView.StreamState STREAMING;
+ }
+
+ @RequiresApi(21) public final class RotationProvider {
+ ctor public RotationProvider(android.content.Context);
+ method @CheckResult public boolean addListener(java.util.concurrent.Executor, androidx.camera.view.RotationProvider.Listener);
+ method public void removeListener(androidx.camera.view.RotationProvider.Listener);
+ }
+
+ public static interface RotationProvider.Listener {
+ method public void onRotationChanged(int);
+ }
+
+}
+
+package androidx.camera.view.transform {
+
+ @RequiresApi(21) public final class CoordinateTransform {
+ ctor public CoordinateTransform(androidx.camera.view.transform.OutputTransform, androidx.camera.view.transform.OutputTransform);
+ method public void mapPoint(android.graphics.PointF);
+ method public void mapPoints(float[]);
+ method public void mapRect(android.graphics.RectF);
+ method public void transform(android.graphics.Matrix);
+ }
+
+ @RequiresApi(21) public final class FileTransformFactory {
+ ctor public FileTransformFactory();
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(android.content.ContentResolver, android.net.Uri) throws java.io.IOException;
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(java.io.File) throws java.io.IOException;
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(java.io.InputStream) throws java.io.IOException;
+ method public boolean isUsingExifOrientation();
+ method public void setUsingExifOrientation(boolean);
+ }
+
+ @RequiresApi(21) public final class ImageProxyTransformFactory {
+ ctor public ImageProxyTransformFactory();
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(androidx.camera.core.ImageProxy);
+ method public boolean isUsingCropRect();
+ method public boolean isUsingRotationDegrees();
+ method public void setUsingCropRect(boolean);
+ method public void setUsingRotationDegrees(boolean);
+ }
+
+ @RequiresApi(21) public final class OutputTransform {
+ }
+
+}
+
+package androidx.camera.view.video {
+
+ @RequiresApi(21) public class AudioConfig {
+ method @RequiresPermission(android.Manifest.permission.RECORD_AUDIO) public static androidx.camera.view.video.AudioConfig create(boolean);
+ method public boolean getAudioEnabled();
+ field public static final androidx.camera.view.video.AudioConfig AUDIO_DISABLED;
+ }
+
+}
+
diff --git a/camera/camera-view/api/res-1.3.0-beta01.txt b/camera/camera-view/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-view/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-view/api/restricted_1.3.0-beta01.txt b/camera/camera-view/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..ed1e846
--- /dev/null
+++ b/camera/camera-view/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,173 @@
+// Signature format: 4.0
+package androidx.camera.view {
+
+ @RequiresApi(21) public abstract class CameraController {
+ method @MainThread public void clearEffects();
+ method @MainThread public void clearImageAnalysisAnalyzer();
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> enableTorch(boolean);
+ method @MainThread public androidx.camera.core.CameraControl? getCameraControl();
+ method @MainThread public androidx.camera.core.CameraInfo? getCameraInfo();
+ method @MainThread public androidx.camera.core.CameraSelector getCameraSelector();
+ method @MainThread public java.util.concurrent.Executor? getImageAnalysisBackgroundExecutor();
+ method @MainThread public int getImageAnalysisBackpressureStrategy();
+ method @MainThread public int getImageAnalysisImageQueueDepth();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getImageAnalysisTargetSize();
+ method @MainThread public int getImageCaptureFlashMode();
+ method @MainThread public java.util.concurrent.Executor? getImageCaptureIoExecutor();
+ method @MainThread public int getImageCaptureMode();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getImageCaptureTargetSize();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> getInitializationFuture();
+ method @MainThread public androidx.camera.view.CameraController.OutputSize? getPreviewTargetSize();
+ method @MainThread public androidx.lifecycle.LiveData<java.lang.Integer!> getTapToFocusState();
+ method @MainThread public androidx.lifecycle.LiveData<java.lang.Integer!> getTorchState();
+ method @MainThread public androidx.camera.video.QualitySelector getVideoCaptureQualitySelector();
+ method @MainThread public androidx.lifecycle.LiveData<androidx.camera.core.ZoomState!> getZoomState();
+ method @MainThread public boolean hasCamera(androidx.camera.core.CameraSelector);
+ method @MainThread public boolean isImageAnalysisEnabled();
+ method @MainThread public boolean isImageCaptureEnabled();
+ method @MainThread public boolean isPinchToZoomEnabled();
+ method @MainThread public boolean isRecording();
+ method @MainThread public boolean isTapToFocusEnabled();
+ method @MainThread public boolean isVideoCaptureEnabled();
+ method @MainThread public void setCameraSelector(androidx.camera.core.CameraSelector);
+ method @MainThread public void setEffects(java.util.Set<androidx.camera.core.CameraEffect!>);
+ method @MainThread public void setEnabledUseCases(int);
+ method @MainThread public void setImageAnalysisAnalyzer(java.util.concurrent.Executor, androidx.camera.core.ImageAnalysis.Analyzer);
+ method @MainThread public void setImageAnalysisBackgroundExecutor(java.util.concurrent.Executor?);
+ method @MainThread public void setImageAnalysisBackpressureStrategy(int);
+ method @MainThread public void setImageAnalysisImageQueueDepth(int);
+ method @MainThread public void setImageAnalysisTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public void setImageCaptureFlashMode(int);
+ method @MainThread public void setImageCaptureIoExecutor(java.util.concurrent.Executor?);
+ method @MainThread public void setImageCaptureMode(int);
+ method @MainThread public void setImageCaptureTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setLinearZoom(@FloatRange(from=0.0f, to=1.0f) float);
+ method @MainThread public void setPinchToZoomEnabled(boolean);
+ method @MainThread public void setPreviewTargetSize(androidx.camera.view.CameraController.OutputSize?);
+ method @MainThread public void setTapToFocusEnabled(boolean);
+ method @MainThread public void setVideoCaptureQualitySelector(androidx.camera.video.QualitySelector);
+ method @MainThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> setZoomRatio(float);
+ method @MainThread @RequiresApi(26) public androidx.camera.video.Recording startRecording(androidx.camera.video.FileDescriptorOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public androidx.camera.video.Recording startRecording(androidx.camera.video.FileOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public androidx.camera.video.Recording startRecording(androidx.camera.video.MediaStoreOutputOptions, androidx.camera.view.video.AudioConfig, java.util.concurrent.Executor, androidx.core.util.Consumer<androidx.camera.video.VideoRecordEvent!>);
+ method @MainThread public void takePicture(androidx.camera.core.ImageCapture.OutputFileOptions, java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageSavedCallback);
+ method @MainThread public void takePicture(java.util.concurrent.Executor, androidx.camera.core.ImageCapture.OnImageCapturedCallback);
+ field public static final int COORDINATE_SYSTEM_VIEW_REFERENCED = 1; // 0x1
+ field public static final int IMAGE_ANALYSIS = 2; // 0x2
+ field public static final int IMAGE_CAPTURE = 1; // 0x1
+ field public static final int TAP_TO_FOCUS_FAILED = 4; // 0x4
+ field public static final int TAP_TO_FOCUS_FOCUSED = 2; // 0x2
+ field public static final int TAP_TO_FOCUS_NOT_FOCUSED = 3; // 0x3
+ field public static final int TAP_TO_FOCUS_NOT_STARTED = 0; // 0x0
+ field public static final int TAP_TO_FOCUS_STARTED = 1; // 0x1
+ field public static final int VIDEO_CAPTURE = 4; // 0x4
+ }
+
+ @RequiresApi(21) public static final class CameraController.OutputSize {
+ ctor public CameraController.OutputSize(android.util.Size);
+ ctor public CameraController.OutputSize(int);
+ method public int getAspectRatio();
+ method public android.util.Size? getResolution();
+ field public static final int UNASSIGNED_ASPECT_RATIO = -1; // 0xffffffff
+ }
+
+ @RequiresApi(21) public final class LifecycleCameraController extends androidx.camera.view.CameraController {
+ ctor public LifecycleCameraController(android.content.Context);
+ method @MainThread public void bindToLifecycle(androidx.lifecycle.LifecycleOwner);
+ method @MainThread public void unbind();
+ }
+
+ @RequiresApi(21) public final class PreviewView extends android.widget.FrameLayout {
+ ctor @UiThread public PreviewView(android.content.Context);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?, int);
+ ctor @UiThread public PreviewView(android.content.Context, android.util.AttributeSet?, int, int);
+ method @UiThread public android.graphics.Bitmap? getBitmap();
+ method @UiThread public androidx.camera.view.CameraController? getController();
+ method @UiThread public androidx.camera.view.PreviewView.ImplementationMode getImplementationMode();
+ method @UiThread public androidx.camera.core.MeteringPointFactory getMeteringPointFactory();
+ method public androidx.camera.view.transform.OutputTransform? getOutputTransform();
+ method public androidx.lifecycle.LiveData<androidx.camera.view.PreviewView.StreamState!> getPreviewStreamState();
+ method @UiThread public androidx.camera.view.PreviewView.ScaleType getScaleType();
+ method @UiThread public androidx.camera.core.Preview.SurfaceProvider getSurfaceProvider();
+ method @UiThread public androidx.camera.core.ViewPort? getViewPort();
+ method @UiThread public androidx.camera.core.ViewPort? getViewPort(int);
+ method @UiThread public void setController(androidx.camera.view.CameraController?);
+ method @UiThread public void setImplementationMode(androidx.camera.view.PreviewView.ImplementationMode);
+ method @UiThread public void setScaleType(androidx.camera.view.PreviewView.ScaleType);
+ }
+
+ @RequiresApi(21) public enum PreviewView.ImplementationMode {
+ enum_constant public static final androidx.camera.view.PreviewView.ImplementationMode COMPATIBLE;
+ enum_constant public static final androidx.camera.view.PreviewView.ImplementationMode PERFORMANCE;
+ }
+
+ @RequiresApi(21) public enum PreviewView.ScaleType {
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_CENTER;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_END;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FILL_START;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_CENTER;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_END;
+ enum_constant public static final androidx.camera.view.PreviewView.ScaleType FIT_START;
+ }
+
+ public enum PreviewView.StreamState {
+ enum_constant public static final androidx.camera.view.PreviewView.StreamState IDLE;
+ enum_constant public static final androidx.camera.view.PreviewView.StreamState STREAMING;
+ }
+
+ @RequiresApi(21) public final class RotationProvider {
+ ctor public RotationProvider(android.content.Context);
+ method @CheckResult public boolean addListener(java.util.concurrent.Executor, androidx.camera.view.RotationProvider.Listener);
+ method public void removeListener(androidx.camera.view.RotationProvider.Listener);
+ }
+
+ public static interface RotationProvider.Listener {
+ method public void onRotationChanged(int);
+ }
+
+}
+
+package androidx.camera.view.transform {
+
+ @RequiresApi(21) public final class CoordinateTransform {
+ ctor public CoordinateTransform(androidx.camera.view.transform.OutputTransform, androidx.camera.view.transform.OutputTransform);
+ method public void mapPoint(android.graphics.PointF);
+ method public void mapPoints(float[]);
+ method public void mapRect(android.graphics.RectF);
+ method public void transform(android.graphics.Matrix);
+ }
+
+ @RequiresApi(21) public final class FileTransformFactory {
+ ctor public FileTransformFactory();
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(android.content.ContentResolver, android.net.Uri) throws java.io.IOException;
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(java.io.File) throws java.io.IOException;
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(java.io.InputStream) throws java.io.IOException;
+ method public boolean isUsingExifOrientation();
+ method public void setUsingExifOrientation(boolean);
+ }
+
+ @RequiresApi(21) public final class ImageProxyTransformFactory {
+ ctor public ImageProxyTransformFactory();
+ method public androidx.camera.view.transform.OutputTransform getOutputTransform(androidx.camera.core.ImageProxy);
+ method public boolean isUsingCropRect();
+ method public boolean isUsingRotationDegrees();
+ method public void setUsingCropRect(boolean);
+ method public void setUsingRotationDegrees(boolean);
+ }
+
+ @RequiresApi(21) public final class OutputTransform {
+ }
+
+}
+
+package androidx.camera.view.video {
+
+ @RequiresApi(21) public class AudioConfig {
+ method @RequiresPermission(android.Manifest.permission.RECORD_AUDIO) public static androidx.camera.view.video.AudioConfig create(boolean);
+ method public boolean getAudioEnabled();
+ field public static final androidx.camera.view.video.AudioConfig AUDIO_DISABLED;
+ }
+
+}
+
diff --git a/camera/camera-viewfinder-compose/api/1.3.0-beta01.txt b/camera/camera-viewfinder-compose/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-viewfinder-compose/api/1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-viewfinder-compose/api/res-1.3.0-beta01.txt b/camera/camera-viewfinder-compose/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-viewfinder-compose/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-viewfinder-compose/api/restricted_1.3.0-beta01.txt b/camera/camera-viewfinder-compose/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-viewfinder-compose/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-viewfinder-core/api/1.3.0-beta01.txt b/camera/camera-viewfinder-core/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-viewfinder-core/api/1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-viewfinder-core/api/res-1.3.0-beta01.txt b/camera/camera-viewfinder-core/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-viewfinder-core/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-viewfinder-core/api/restricted_1.3.0-beta01.txt b/camera/camera-viewfinder-core/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/camera/camera-viewfinder-core/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/camera/camera-viewfinder/api/1.3.0-beta01.txt b/camera/camera-viewfinder/api/1.3.0-beta01.txt
new file mode 100644
index 0000000..a7333d7
--- /dev/null
+++ b/camera/camera-viewfinder/api/1.3.0-beta01.txt
@@ -0,0 +1,58 @@
+// Signature format: 4.0
+package androidx.camera.viewfinder {
+
+ @RequiresApi(21) public final class CameraViewfinder extends android.widget.FrameLayout {
+ ctor @UiThread public CameraViewfinder(android.content.Context);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?, int);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?, int, int);
+ method @UiThread public android.graphics.Bitmap? getBitmap();
+ method @UiThread public androidx.camera.viewfinder.CameraViewfinder.ImplementationMode getImplementationMode();
+ method @UiThread public androidx.camera.viewfinder.CameraViewfinder.ScaleType getScaleType();
+ method @UiThread public com.google.common.util.concurrent.ListenableFuture<android.view.Surface!> requestSurfaceAsync(androidx.camera.viewfinder.ViewfinderSurfaceRequest);
+ method @UiThread public void setScaleType(androidx.camera.viewfinder.CameraViewfinder.ScaleType);
+ }
+
+ @RequiresApi(21) public enum CameraViewfinder.ImplementationMode {
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ImplementationMode COMPATIBLE;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ImplementationMode PERFORMANCE;
+ }
+
+ @RequiresApi(21) public enum CameraViewfinder.ScaleType {
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_CENTER;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_END;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_START;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_CENTER;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_END;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_START;
+ }
+
+ @RequiresApi(21) public final class CameraViewfinderExt {
+ method public suspend Object? requestSurface(androidx.camera.viewfinder.CameraViewfinder, androidx.camera.viewfinder.ViewfinderSurfaceRequest viewfinderSurfaceRequest, kotlin.coroutines.Continuation<? super android.view.Surface>);
+ field public static final androidx.camera.viewfinder.CameraViewfinderExt INSTANCE;
+ }
+
+ @RequiresApi(21) public class ViewfinderSurfaceRequest {
+ method public androidx.camera.viewfinder.CameraViewfinder.ImplementationMode? getImplementationMode();
+ method public int getLensFacing();
+ method public android.util.Size getResolution();
+ method public int getSensorOrientation();
+ method public void markSurfaceSafeToRelease();
+ }
+
+ public static final class ViewfinderSurfaceRequest.Builder {
+ ctor public ViewfinderSurfaceRequest.Builder(android.util.Size);
+ ctor public ViewfinderSurfaceRequest.Builder(androidx.camera.viewfinder.ViewfinderSurfaceRequest);
+ ctor public ViewfinderSurfaceRequest.Builder(androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest build();
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setImplementationMode(androidx.camera.viewfinder.CameraViewfinder.ImplementationMode?);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setLensFacing(int);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setSensorOrientation(int);
+ }
+
+ public final class ViewfinderSurfaceRequestUtil {
+ method @RequiresApi(21) public static androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder populateFromCharacteristics(androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder, android.hardware.camera2.CameraCharacteristics cameraCharacteristics);
+ }
+
+}
+
diff --git a/camera/camera-viewfinder/api/res-1.3.0-beta01.txt b/camera/camera-viewfinder/api/res-1.3.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/camera/camera-viewfinder/api/res-1.3.0-beta01.txt
diff --git a/camera/camera-viewfinder/api/restricted_1.3.0-beta01.txt b/camera/camera-viewfinder/api/restricted_1.3.0-beta01.txt
new file mode 100644
index 0000000..a7333d7
--- /dev/null
+++ b/camera/camera-viewfinder/api/restricted_1.3.0-beta01.txt
@@ -0,0 +1,58 @@
+// Signature format: 4.0
+package androidx.camera.viewfinder {
+
+ @RequiresApi(21) public final class CameraViewfinder extends android.widget.FrameLayout {
+ ctor @UiThread public CameraViewfinder(android.content.Context);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?, int);
+ ctor @UiThread public CameraViewfinder(android.content.Context, android.util.AttributeSet?, int, int);
+ method @UiThread public android.graphics.Bitmap? getBitmap();
+ method @UiThread public androidx.camera.viewfinder.CameraViewfinder.ImplementationMode getImplementationMode();
+ method @UiThread public androidx.camera.viewfinder.CameraViewfinder.ScaleType getScaleType();
+ method @UiThread public com.google.common.util.concurrent.ListenableFuture<android.view.Surface!> requestSurfaceAsync(androidx.camera.viewfinder.ViewfinderSurfaceRequest);
+ method @UiThread public void setScaleType(androidx.camera.viewfinder.CameraViewfinder.ScaleType);
+ }
+
+ @RequiresApi(21) public enum CameraViewfinder.ImplementationMode {
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ImplementationMode COMPATIBLE;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ImplementationMode PERFORMANCE;
+ }
+
+ @RequiresApi(21) public enum CameraViewfinder.ScaleType {
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_CENTER;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_END;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FILL_START;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_CENTER;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_END;
+ enum_constant public static final androidx.camera.viewfinder.CameraViewfinder.ScaleType FIT_START;
+ }
+
+ @RequiresApi(21) public final class CameraViewfinderExt {
+ method public suspend Object? requestSurface(androidx.camera.viewfinder.CameraViewfinder, androidx.camera.viewfinder.ViewfinderSurfaceRequest viewfinderSurfaceRequest, kotlin.coroutines.Continuation<? super android.view.Surface>);
+ field public static final androidx.camera.viewfinder.CameraViewfinderExt INSTANCE;
+ }
+
+ @RequiresApi(21) public class ViewfinderSurfaceRequest {
+ method public androidx.camera.viewfinder.CameraViewfinder.ImplementationMode? getImplementationMode();
+ method public int getLensFacing();
+ method public android.util.Size getResolution();
+ method public int getSensorOrientation();
+ method public void markSurfaceSafeToRelease();
+ }
+
+ public static final class ViewfinderSurfaceRequest.Builder {
+ ctor public ViewfinderSurfaceRequest.Builder(android.util.Size);
+ ctor public ViewfinderSurfaceRequest.Builder(androidx.camera.viewfinder.ViewfinderSurfaceRequest);
+ ctor public ViewfinderSurfaceRequest.Builder(androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest build();
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setImplementationMode(androidx.camera.viewfinder.CameraViewfinder.ImplementationMode?);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setLensFacing(int);
+ method public androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder setSensorOrientation(int);
+ }
+
+ public final class ViewfinderSurfaceRequestUtil {
+ method @RequiresApi(21) public static androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder populateFromCharacteristics(androidx.camera.viewfinder.ViewfinderSurfaceRequest.Builder, android.hardware.camera2.CameraCharacteristics cameraCharacteristics);
+ }
+
+}
+
diff --git a/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/FunctionalInterfaceExtensionReceiverTransformTests.kt b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/FunctionalInterfaceExtensionReceiverTransformTests.kt
new file mode 100644
index 0000000..86c1eaa
--- /dev/null
+++ b/compose/compiler/compiler-hosted/integration-tests/src/test/java/androidx/compose/compiler/plugins/kotlin/FunctionalInterfaceExtensionReceiverTransformTests.kt
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.compiler.plugins.kotlin
+
+import org.junit.Test
+
+class FunctionalInterfaceExtensionReceiverTransformTests : AbstractControlFlowTransformTests() {
+ @Test
+ fun testFunctionalInterfaceWithExtensionReceiverTransformation() {
+ verifyComposeIrTransform(
+ source = """
+ import androidx.compose.runtime.*
+ fun interface TestContent {
+ @Composable
+ fun String.Content()
+ }
+ @Composable
+ fun Test(content: TestContent) {
+ with(content) {
+ "".Content()
+ }
+ }
+
+ @Composable
+ fun CallTest() {
+ Test { this.length }
+ }
+ """.trimIndent(),
+ expectedTransformed = """
+ interface TestContent {
+ @Composable
+ abstract fun String.Content(%composer: Composer?, %changed: Int)
+ }
+ @Composable
+ @ComposableInferredTarget(scheme = "[0[0]]")
+ fun Test(content: TestContent, %composer: Composer?, %changed: Int) {
+ %composer = %composer.startRestartGroup(<>)
+ sourceInformation(%composer, "C(Test)*<Conten...>:Test.kt")
+ val %dirty = %changed
+ if (%changed and 0b1110 === 0) {
+ %dirty = %dirty or if (%composer.changed(content)) 0b0100 else 0b0010
+ }
+ if (%dirty and 0b1011 !== 0b0010 || !%composer.skipping) {
+ if (isTraceInProgress()) {
+ traceEventStart(<>, %changed, -1, <>)
+ }
+ with(content) {
+ %this%with.Content(%composer, 0b0110)
+ }
+ if (isTraceInProgress()) {
+ traceEventEnd()
+ }
+ } else {
+ %composer.skipToGroupEnd()
+ }
+ %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
+ Test(content, %composer, updateChangedFlags(%changed or 0b0001))
+ }
+ }
+ @Composable
+ fun CallTest(%composer: Composer?, %changed: Int) {
+ %composer = %composer.startRestartGroup(<>)
+ sourceInformation(%composer, "C(CallTest)<Test>:Test.kt")
+ if (%changed !== 0 || !%composer.skipping) {
+ if (isTraceInProgress()) {
+ traceEventStart(<>, %changed, -1, <>)
+ }
+ Test(class <no name provided> : TestContent {
+ @Composable
+ override fun Content(%this%Test: String, %composer: Composer?, %changed: Int) {
+ %composer = %composer.startRestartGroup(<>)
+ sourceInformation(%composer, "C(Content):Test.kt")
+ val %dirty = %changed
+ if (%changed and 0b1110 === 0) {
+ %dirty = %dirty or if (%composer.changed(%this%Test)) 0b0100 else 0b0010
+ }
+ if (%dirty and 0b1011 !== 0b0010 || !%composer.skipping) {
+ if (isTraceInProgress()) {
+ traceEventStart(<>, %changed, -1, <>)
+ }
+ %this%Test.length
+ if (isTraceInProgress()) {
+ traceEventEnd()
+ }
+ } else {
+ %composer.skipToGroupEnd()
+ }
+ val tmp0_rcvr = <this>
+ %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
+ tmp0_rcvr.Content(%this%Test, %composer, updateChangedFlags(%changed or 0b0001))
+ }
+ }
+ }
+ <no name provided>(), %composer, 0)
+ if (isTraceInProgress()) {
+ traceEventEnd()
+ }
+ } else {
+ %composer.skipToGroupEnd()
+ }
+ %composer.endRestartGroup()?.updateScope { %composer: Composer?, %force: Int ->
+ CallTest(%composer, updateChangedFlags(%changed or 0b0001))
+ }
+ }
+ """.trimIndent()
+ )
+ }
+}
\ No newline at end of file
diff --git a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
index 43cb8fe..0db9743 100644
--- a/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
+++ b/compose/compiler/compiler-hosted/src/main/java/androidx/compose/compiler/plugins/kotlin/lower/ComposableFunctionBodyTransformer.kt
@@ -3852,9 +3852,7 @@
for (param in function.valueParameters) {
val paramName = param.name.asString()
when {
- !paramName.startsWith('$') &&
- !paramName.startsWith("_context_receiver_") ->
- realValueParamCount++
+ paramName.startsWith("_context_receiver_") -> Unit
paramName == KtxNameConventions.COMPOSER_PARAMETER.identifier ->
composerParameter = param
paramName.startsWith(KtxNameConventions.DEFAULT_PARAMETER.identifier) ->
@@ -3864,7 +3862,8 @@
paramName.startsWith("\$anonymous\$parameter") -> Unit
paramName.startsWith("\$name\$for\$destructuring") -> Unit
paramName.startsWith("\$noName_") -> Unit
- else -> Unit
+ paramName == "\$this" -> Unit
+ else -> realValueParamCount++
}
}
slotCount = realValueParamCount
diff --git a/compose/foundation/foundation/build.gradle b/compose/foundation/foundation/build.gradle
index 2c62926..3d9c6dcc 100644
--- a/compose/foundation/foundation/build.gradle
+++ b/compose/foundation/foundation/build.gradle
@@ -62,7 +62,7 @@
dependencies {
api("androidx.annotation:annotation:1.1.0")
implementation("androidx.emoji2:emoji2:1.3.0")
- implementation(project(":core:core"))
+ implementation("androidx.core:core:1.11.0-beta02")
}
}
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutTest.kt
index c9c1a87..7cedc56 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutTest.kt
@@ -447,28 +447,6 @@
}
@Test
- fun regularCompositionIsUsedInPrefetchTimeCalculation() {
- val itemProvider = itemProvider({ 1 }) {
- Box(Modifier.fillMaxSize())
- }
- val prefetchState = LazyLayoutPrefetchState()
- rule.setContent {
- LazyLayout(itemProvider, prefetchState = prefetchState) { constraint ->
- val item = measure(0, constraint)[0]
- layout(100, 100) {
- item.place(0, 0)
- }
- }
- }
-
- rule.runOnIdle {
- val timeTracker = requireNotNull(prefetchState.prefetcher?.timeTracker)
- assertThat(timeTracker.compositionTimeNs).isGreaterThan(0L)
- assertThat(timeTracker.measurementTimeNs).isGreaterThan(0L)
- }
- }
-
- @Test
fun skippingItemBlockWhenKeyIsObservableButDidntChange() {
val stateList = mutableStateListOf(0)
var itemCalls = 0
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
index 377a6ab..3d3b62e 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text/CoreTextFieldInputServiceIntegrationTest.kt
@@ -444,6 +444,54 @@
}
}
+ @Test
+ fun updateTextLayoutResultCalledOnGlobalPositionChanged() {
+ var offset by mutableStateOf(IntOffset(0, 10))
+ val value = TextFieldValue("abc\nefg", TextRange(6))
+ lateinit var textLayoutResult: TextLayoutResult
+ val focusRequester = FocusRequester()
+
+ setContent {
+ Box(Modifier.offset { offset }) {
+ CoreTextField(
+ value = value,
+ modifier = Modifier.focusRequester(focusRequester),
+ onValueChange = { },
+ onTextLayout = { textLayoutResult = it }
+ )
+ }
+ }
+
+ rule.runOnIdle {
+ assertThat(platformTextInputService.lastInputValue).isNull()
+ assertThat(platformTextInputService.textLayoutResult).isNull()
+ assertThat(platformTextInputService.textLayoutPositionInWindow).isNull()
+ assertThat(platformTextInputService.innerTextFieldBounds).isNull()
+ assertThat(platformTextInputService.decorationBoxBounds).isNull()
+ }
+
+ rule.runOnUiThread {
+ focusRequester.requestFocus()
+ }
+
+ rule.runOnIdle {
+ assertThat(platformTextInputService.lastInputValue).isEqualTo(value)
+ assertThat(platformTextInputService.textLayoutResult).isNotNull()
+ assertThat(platformTextInputService.textLayoutResult).isEqualTo(textLayoutResult)
+ assertThat(platformTextInputService.textLayoutPositionInWindow)
+ .isEqualTo(offset.toOffset())
+ assertThat(platformTextInputService.innerTextFieldBounds).isNotNull()
+ assertThat(platformTextInputService.decorationBoxBounds).isNotNull()
+ }
+
+ offset = IntOffset(10, 20)
+
+ rule.runOnIdle {
+ assertThat(platformTextInputService.textLayoutPositionInWindow)
+ .isEqualTo(offset.toOffset())
+ }
+ }
+
private fun setContent(content: @Composable () -> Unit) {
rule.setContent {
focusManager = LocalFocusManager.current
@@ -464,6 +512,11 @@
var lastInputValue: TextFieldValue? = null
var lastInputImeOptions: ImeOptions? = null
+ var textLayoutResult: TextLayoutResult? = null
+ var textLayoutPositionInWindow: Offset? = null
+ var innerTextFieldBounds: Rect? = null
+ var decorationBoxBounds: Rect? = null
+
override fun startInput(
value: TextFieldValue,
imeOptions: ImeOptions,
@@ -498,5 +551,19 @@
override fun notifyFocusedRect(rect: Rect) {
focusedRect = rect
}
+
+ override fun updateTextLayoutResult(
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResult,
+ textLayoutPositionInWindow: Offset,
+ innerTextFieldBounds: Rect,
+ decorationBoxBounds: Rect
+ ) {
+ lastInputValue = textFieldValue
+ this.textLayoutResult = textLayoutResult
+ this.textLayoutPositionInWindow = textLayoutPositionInWindow
+ this.innerTextFieldBounds = innerTextFieldBounds
+ this.decorationBoxBounds = decorationBoxBounds
+ }
}
}
diff --git a/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetcher.android.kt b/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetcher.android.kt
index 3498cb7..bfec568 100644
--- a/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetcher.android.kt
+++ b/compose/foundation/foundation/src/androidMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetcher.android.kt
@@ -20,7 +20,6 @@
import android.view.Display
import android.view.View
import androidx.compose.foundation.ExperimentalFoundationApi
-import androidx.compose.foundation.lazy.layout.LazyLayoutPrefetchState.AverageTimeTracker
import androidx.compose.runtime.Composable
import androidx.compose.runtime.RememberObserver
import androidx.compose.runtime.collection.mutableVectorOf
@@ -72,7 +71,26 @@
* Frame 4 - prefetch [e], [f]
* Something similar is not possible with LazyColumn yet.
*
- * 2) Prefetch is not aware of item type.
+ * 2) Prefetching time estimation only captured during the prefetch.
+ * We currently don't track the time of the regular subcompose call happened during the regular
+ * measure pass, only the ones which are done during the prefetching. The downside is we build
+ * our prefetch information only after scrolling has started and items are showing up. Your very
+ * first scroll won't know if it's safe to prefetch. Why:
+ * a) SubcomposeLayout is not exposing an API to understand if subcompose() call is going to
+ * do the real work. The work could be skipped if the same lambda was passed as for the
+ * previous invocation or if there were no recompositions scheduled. We could workaround it
+ * by keeping the extra state in LazyListState about what items we already composed and to
+ * only measure the first composition for the given slot, or consider exposing extra
+ * information in SubcomposeLayoutState API.
+ * b) It allows us to nicely decouple the logic, now the prefetching logic is build on
+ * top of the regular LazyColumn measuring functionallity and the main logic knows nothing
+ * about prefetch
+ * c) Maybe the better approach would be to wait till the low-level runtime infra is ready to
+ * do subcompositions on the different threads which illuminates the need to calculate the
+ * deadlines completely.
+ * Tracking bug: b/187393381.
+ *
+ * 3) Prefetch is not aware of item type.
* RecyclerView separates timing metadata about different item types. For example, in play
* store style UI, this allows RecyclerView to separately estimate the cost of a header,
* separator, and item row. In this implementation, all of these would be averaged together in
@@ -103,6 +121,14 @@
*/
private val prefetchRequests = mutableVectorOf<PrefetchRequest>()
+ /**
+ * Average time the prefetching operations takes. Keeping it allows us to not start the work
+ * if in this frame we are most likely not going to finish the work in time to not delay the
+ * next frame.
+ */
+ private var averagePrecomposeTimeNs: Long = 0
+ private var averagePremeasureTimeNs: Long = 0
+
private var prefetchScheduled = false
private val choreographer = Choreographer.getInstance()
@@ -114,10 +140,6 @@
calculateFrameIntervalIfNeeded(view)
}
- override val timeTracker: AverageTimeTracker = object : AverageTimeTracker() {
- override fun currentTime(): Long = System.nanoTime()
- }
-
/**
* Callback to be executed when the prefetching is needed.
* [prefetchRequests] will be used as an input.
@@ -143,14 +165,15 @@
val beforeTimeNs = System.nanoTime()
// check if there is enough time left in this frame. otherwise, we schedule
// a next frame callback in which we will post the message in the handler again.
- if (enoughTimeLeft(beforeTimeNs, nextFrameNs, timeTracker.compositionTimeNs)) {
+ if (enoughTimeLeft(beforeTimeNs, nextFrameNs, averagePrecomposeTimeNs)) {
val key = itemProvider.getKey(request.index)
val contentType = itemProvider.getContentType(request.index)
val content = itemContentFactory.getContent(request.index, key, contentType)
- timeTracker.trackComposition {
- request.precomposeHandle =
- subcomposeLayoutState.precompose(key, content)
- }
+ request.precomposeHandle = subcomposeLayoutState.precompose(key, content)
+ averagePrecomposeTimeNs = calculateAverageTime(
+ System.nanoTime() - beforeTimeNs,
+ averagePrecomposeTimeNs
+ )
} else {
scheduleForNextFrame = true
}
@@ -159,16 +182,18 @@
check(!request.measured) { "request already measured" }
trace("compose:lazylist:prefetch:measure") {
val beforeTimeNs = System.nanoTime()
- if (enoughTimeLeft(beforeTimeNs, nextFrameNs, timeTracker.measurementTimeNs)) {
+ if (enoughTimeLeft(beforeTimeNs, nextFrameNs, averagePremeasureTimeNs)) {
val handle = request.precomposeHandle!!
- timeTracker.trackMeasurement {
- repeat(handle.placeablesCount) { placeableIndex ->
- handle.premeasure(
- placeableIndex,
- request.constraints
- )
- }
+ repeat(handle.placeablesCount) { placeableIndex ->
+ handle.premeasure(
+ placeableIndex,
+ request.constraints
+ )
}
+ averagePremeasureTimeNs = calculateAverageTime(
+ System.nanoTime() - beforeTimeNs,
+ averagePremeasureTimeNs
+ )
// we finished this request
prefetchRequests.removeAt(0)
} else {
@@ -201,6 +226,18 @@
}
}
+ private fun calculateAverageTime(new: Long, current: Long): Long {
+ // Calculate a weighted moving average of time taken to compose an item. We use weighted
+ // moving average to bias toward more recent measurements, and to minimize storage /
+ // computation cost. (the idea is taken from RecycledViewPool)
+ return if (current == 0L) {
+ new
+ } else {
+ // dividing first to avoid a potential overflow
+ current / 4 * 3 + new / 4
+ }
+ }
+
override fun schedulePrefetch(
index: Int,
constraints: Constraints
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt
index ffc8ddc..3ad7f4f 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt
@@ -81,8 +81,7 @@
with(
LazyLayoutMeasureScopeImpl(
itemContentFactory,
- this,
- prefetchState?.prefetcher?.timeTracker
+ this
)
) {
measurePolicy(constraints)
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutMeasureScope.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutMeasureScope.kt
index 2a8bb45..c8b3c0d 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutMeasureScope.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutMeasureScope.kt
@@ -99,8 +99,7 @@
@ExperimentalFoundationApi
internal class LazyLayoutMeasureScopeImpl internal constructor(
private val itemContentFactory: LazyLayoutItemContentFactory,
- private val subcomposeMeasureScope: SubcomposeMeasureScope,
- private val timeTracker: LazyLayoutPrefetchState.AverageTimeTracker?
+ private val subcomposeMeasureScope: SubcomposeMeasureScope
) : LazyLayoutMeasureScope, MeasureScope by subcomposeMeasureScope {
private val itemProvider = itemContentFactory.itemProvider()
@@ -119,32 +118,12 @@
val key = itemProvider.getKey(index)
val contentType = itemProvider.getContentType(index)
val itemContent = itemContentFactory.getContent(index, key, contentType)
- val measurables = trackComposition {
- subcomposeMeasureScope.subcompose(key, itemContent)
+ val measurables = subcomposeMeasureScope.subcompose(key, itemContent)
+ List(measurables.size) { i ->
+ measurables[i].measure(constraints)
+ }.also {
+ placeablesCache[index] = it
}
- trackMeasurement {
- List(measurables.size) { i ->
- measurables[i].measure(constraints)
- }.also {
- placeablesCache[index] = it
- }
- }
- }
- }
-
- private inline fun <T> trackComposition(block: () -> T): T {
- return if (timeTracker != null) {
- timeTracker.trackComposition(block)
- } else {
- block()
- }
- }
-
- private inline fun <T> trackMeasurement(block: () -> T): T {
- return if (timeTracker != null) {
- timeTracker.trackMeasurement(block)
- } else {
- block()
}
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetchState.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetchState.kt
index 1184ff7..6937c59 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetchState.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayoutPrefetchState.kt
@@ -48,55 +48,6 @@
internal interface Prefetcher {
fun schedulePrefetch(index: Int, constraints: Constraints): PrefetchHandle
-
- val timeTracker: AverageTimeTracker
- }
-
- internal abstract class AverageTimeTracker {
-
- /**
- * Average time the prefetching operations takes. Keeping it allows us to not start the work
- * if in this frame we are most likely not going to finish the work in time to not delay the
- * next frame.
- */
- var compositionTimeNs: Long = 0
- private set
- var measurementTimeNs: Long = 0
- private set
-
- abstract fun currentTime(): Long
-
- inline fun <T> trackComposition(block: () -> T): T {
- val beforeTimeNs = currentTime()
- val returnValue = block()
- compositionTimeNs = calculateAverageTime(
- currentTime() - beforeTimeNs,
- compositionTimeNs
- )
- return returnValue
- }
-
- inline fun <T> trackMeasurement(block: () -> T): T {
- val beforeTimeNs = currentTime()
- val returnValue = block()
- measurementTimeNs = calculateAverageTime(
- currentTime() - beforeTimeNs,
- measurementTimeNs
- )
- return returnValue
- }
-
- private fun calculateAverageTime(new: Long, current: Long): Long {
- // Calculate a weighted moving average of time taken to compose an item. We use weighted
- // moving average to bias toward more recent measurements, and to minimize storage /
- // computation cost. (the idea is taken from RecycledViewPool)
- return if (current == 0L) {
- new
- } else {
- // dividing first to avoid a potential overflow
- current / 4 * 3 + new / 4
- }
- }
}
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
index e5eb2d3..ba290e4 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt
@@ -384,6 +384,7 @@
val onPositionedModifier = Modifier.onGloballyPositioned {
state.layoutCoordinates = it
+ state.layoutResult?.innerTextFieldCoordinates = it
if (enabled) {
if (state.handleState == HandleState.Selection) {
if (state.showFloatingToolbar) {
@@ -401,8 +402,14 @@
manager.isSelectionHandleInVisibleBound(isStartHandle = true)
}
notifyFocusedRect(state, value, offsetMapping)
+ state.layoutResult?.let { layoutResult ->
+ state.inputSession?.let { inputSession ->
+ if (state.hasFocus) {
+ TextFieldDelegate.updateTextLayoutResult(inputSession, value, layoutResult)
+ }
+ }
+ }
}
- state.layoutResult?.innerTextFieldCoordinates = it
}
val isPassword = visualTransformation is PasswordVisualTransformation
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
index c93715b..8f8a6d6 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt
@@ -16,12 +16,14 @@
package androidx.compose.foundation.text
+import androidx.compose.foundation.text.selection.visibleBounds
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Canvas
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.layout.LayoutCoordinates
+import androidx.compose.ui.layout.positionInWindow
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.Paragraph
import androidx.compose.ui.text.SpanStyle
@@ -178,6 +180,36 @@
}
/**
+ * Notify the input service of layout and position changes.
+ *
+ * @param textInputSession the current input session
+ * @param textFieldValue the editor state
+ * @param textLayoutResult the layout result
+ */
+ @JvmStatic
+ internal fun updateTextLayoutResult(
+ textInputSession: TextInputSession,
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResultProxy
+ ) {
+ textLayoutResult.innerTextFieldCoordinates?.let { innerTextFieldCoordinates ->
+ if (!innerTextFieldCoordinates.isAttached) return
+ textLayoutResult.decorationBoxCoordinates?.let { decorationBoxCoordinates ->
+ textInputSession.updateTextLayoutResult(
+ textFieldValue,
+ textLayoutResult.value,
+ innerTextFieldCoordinates.positionInWindow(),
+ innerTextFieldCoordinates.visibleBounds(),
+ innerTextFieldCoordinates.localBoundingBoxOf(
+ decorationBoxCoordinates,
+ clipBounds = false
+ )
+ )
+ }
+ }
+ }
+
+ /**
* Called when edit operations are passed from TextInputService
*
* @param ops A list of edit operations.
diff --git a/compose/material3/material3/api/current.txt b/compose/material3/material3/api/current.txt
index 3c5de3a..2dd54ac 100644
--- a/compose/material3/material3/api/current.txt
+++ b/compose/material3/material3/api/current.txt
@@ -113,6 +113,15 @@
}
@androidx.compose.runtime.Immutable public final class ButtonColors {
+ ctor public ButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class ButtonDefaults {
@@ -175,6 +184,15 @@
}
@androidx.compose.runtime.Immutable public final class CardColors {
+ ctor public CardColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class CardDefaults {
@@ -207,6 +225,29 @@
}
@androidx.compose.runtime.Immutable public final class CheckboxColors {
+ ctor public CheckboxColors(long checkedCheckmarkColor, long uncheckedCheckmarkColor, long checkedBoxColor, long uncheckedBoxColor, long disabledCheckedBoxColor, long disabledUncheckedBoxColor, long disabledIndeterminateBoxColor, long checkedBorderColor, long uncheckedBorderColor, long disabledBorderColor, long disabledIndeterminateBorderColor);
+ method public long getCheckedBorderColor();
+ method public long getCheckedBoxColor();
+ method public long getCheckedCheckmarkColor();
+ method public long getDisabledBorderColor();
+ method public long getDisabledCheckedBoxColor();
+ method public long getDisabledIndeterminateBorderColor();
+ method public long getDisabledIndeterminateBoxColor();
+ method public long getDisabledUncheckedBoxColor();
+ method public long getUncheckedBorderColor();
+ method public long getUncheckedBoxColor();
+ method public long getUncheckedCheckmarkColor();
+ property public final long checkedBorderColor;
+ property public final long checkedBoxColor;
+ property public final long checkedCheckmarkColor;
+ property public final long disabledBorderColor;
+ property public final long disabledCheckedBoxColor;
+ property public final long disabledIndeterminateBorderColor;
+ property public final long disabledIndeterminateBoxColor;
+ property public final long disabledUncheckedBoxColor;
+ property public final long uncheckedBorderColor;
+ property public final long uncheckedBoxColor;
+ property public final long uncheckedCheckmarkColor;
}
public final class CheckboxDefaults {
@@ -223,6 +264,23 @@
}
@androidx.compose.runtime.Immutable public final class ChipColors {
+ ctor public ChipColors(long containerColor, long labelColor, long leadingIconContentColor, long trailingIconContentColor, long disabledContainerColor, long disabledLabelColor, long disabledLeadingIconContentColor, long disabledTrailingIconContentColor);
+ method public long getContainerColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledLabelColor();
+ method public long getDisabledLeadingIconContentColor();
+ method public long getDisabledTrailingIconContentColor();
+ method public long getLabelColor();
+ method public long getLeadingIconContentColor();
+ method public long getTrailingIconContentColor();
+ property public final long containerColor;
+ property public final long disabledContainerColor;
+ property public final long disabledLabelColor;
+ property public final long disabledLeadingIconContentColor;
+ property public final long disabledTrailingIconContentColor;
+ property public final long labelColor;
+ property public final long leadingIconContentColor;
+ property public final long trailingIconContentColor;
}
@androidx.compose.runtime.Immutable public final class ChipElevation {
@@ -335,6 +393,57 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class DatePickerColors {
+ ctor public DatePickerColors(long containerColor, long titleContentColor, long headlineContentColor, long weekdayContentColor, long subheadContentColor, long navigationContentColor, long yearContentColor, long disabledYearContentColor, long currentYearContentColor, long selectedYearContentColor, long disabledSelectedYearContentColor, long selectedYearContainerColor, long disabledSelectedYearContainerColor, long dayContentColor, long disabledDayContentColor, long selectedDayContentColor, long disabledSelectedDayContentColor, long selectedDayContainerColor, long disabledSelectedDayContainerColor, long todayContentColor, long todayDateBorderColor, long dayInSelectionRangeContainerColor, long dayInSelectionRangeContentColor, long dividerColor, androidx.compose.material3.TextFieldColors dateTextFieldColors);
+ method public long getContainerColor();
+ method public long getCurrentYearContentColor();
+ method public androidx.compose.material3.TextFieldColors getDateTextFieldColors();
+ method public long getDayContentColor();
+ method public long getDayInSelectionRangeContainerColor();
+ method public long getDayInSelectionRangeContentColor();
+ method public long getDisabledDayContentColor();
+ method public long getDisabledSelectedDayContainerColor();
+ method public long getDisabledSelectedDayContentColor();
+ method public long getDisabledSelectedYearContainerColor();
+ method public long getDisabledSelectedYearContentColor();
+ method public long getDisabledYearContentColor();
+ method public long getDividerColor();
+ method public long getHeadlineContentColor();
+ method public long getNavigationContentColor();
+ method public long getSelectedDayContainerColor();
+ method public long getSelectedDayContentColor();
+ method public long getSelectedYearContainerColor();
+ method public long getSelectedYearContentColor();
+ method public long getSubheadContentColor();
+ method public long getTitleContentColor();
+ method public long getTodayContentColor();
+ method public long getTodayDateBorderColor();
+ method public long getWeekdayContentColor();
+ method public long getYearContentColor();
+ property public final long containerColor;
+ property public final long currentYearContentColor;
+ property public final androidx.compose.material3.TextFieldColors dateTextFieldColors;
+ property public final long dayContentColor;
+ property public final long dayInSelectionRangeContainerColor;
+ property public final long dayInSelectionRangeContentColor;
+ property public final long disabledDayContentColor;
+ property public final long disabledSelectedDayContainerColor;
+ property public final long disabledSelectedDayContentColor;
+ property public final long disabledSelectedYearContainerColor;
+ property public final long disabledSelectedYearContentColor;
+ property public final long disabledYearContentColor;
+ property public final long dividerColor;
+ property public final long headlineContentColor;
+ property public final long navigationContentColor;
+ property public final long selectedDayContainerColor;
+ property public final long selectedDayContentColor;
+ property public final long selectedYearContainerColor;
+ property public final long selectedYearContentColor;
+ property public final long subheadContentColor;
+ property public final long titleContentColor;
+ property public final long todayContentColor;
+ property public final long todayDateBorderColor;
+ property public final long weekdayContentColor;
+ property public final long yearContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class DatePickerDefaults {
@@ -613,6 +722,15 @@
}
@androidx.compose.runtime.Immutable public final class IconButtonColors {
+ ctor public IconButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class IconButtonDefaults {
@@ -651,6 +769,19 @@
}
@androidx.compose.runtime.Immutable public final class IconToggleButtonColors {
+ ctor public IconToggleButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor, long checkedContainerColor, long checkedContentColor);
+ method public long getCheckedContainerColor();
+ method public long getCheckedContentColor();
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long checkedContainerColor;
+ property public final long checkedContentColor;
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api public final class InputChipDefaults {
@@ -677,6 +808,25 @@
}
@androidx.compose.runtime.Immutable public final class ListItemColors {
+ ctor public ListItemColors(long containerColor, long headlineColor, long leadingIconColor, long overlineColor, long supportingTextColor, long trailingIconColor, long disabledHeadlineColor, long disabledLeadingIconColor, long disabledTrailingIconColor);
+ method public long getContainerColor();
+ method public long getDisabledHeadlineColor();
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getHeadlineColor();
+ method public long getLeadingIconColor();
+ method public long getOverlineColor();
+ method public long getSupportingTextColor();
+ method public long getTrailingIconColor();
+ property public final long containerColor;
+ property public final long disabledHeadlineColor;
+ property public final long disabledLeadingIconColor;
+ property public final long disabledTrailingIconColor;
+ property public final long headlineColor;
+ property public final long leadingIconColor;
+ property public final long overlineColor;
+ property public final long supportingTextColor;
+ property public final long trailingIconColor;
}
public final class ListItemDefaults {
@@ -718,6 +868,19 @@
}
@androidx.compose.runtime.Immutable public final class MenuItemColors {
+ ctor public MenuItemColors(long textColor, long leadingIconColor, long trailingIconColor, long disabledTextColor, long disabledLeadingIconColor, long disabledTrailingIconColor);
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledTextColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getLeadingIconColor();
+ method public long getTextColor();
+ method public long getTrailingIconColor();
+ property public final long disabledLeadingIconColor;
+ property public final long disabledTextColor;
+ property public final long disabledTrailingIconColor;
+ property public final long leadingIconColor;
+ property public final long textColor;
+ property public final long trailingIconColor;
}
public final class ModalBottomSheet_androidKt {
@@ -736,6 +899,21 @@
}
@androidx.compose.runtime.Stable public final class NavigationBarItemColors {
+ ctor public NavigationBarItemColors(long selectedIconColor, long selectedTextColor, long selectedIndicatorColor, long unselectedIconColor, long unselectedTextColor, long disabledIconColor, long disabledTextColor);
+ method public long getDisabledIconColor();
+ method public long getDisabledTextColor();
+ method public long getSelectedIconColor();
+ method public long getSelectedIndicatorColor();
+ method public long getSelectedTextColor();
+ method public long getUnselectedIconColor();
+ method public long getUnselectedTextColor();
+ property public final long disabledIconColor;
+ property public final long disabledTextColor;
+ property public final long selectedIconColor;
+ property public final long selectedIndicatorColor;
+ property public final long selectedTextColor;
+ property public final long unselectedIconColor;
+ property public final long unselectedTextColor;
}
public final class NavigationBarItemDefaults {
@@ -783,6 +961,21 @@
}
@androidx.compose.runtime.Stable public final class NavigationRailItemColors {
+ ctor public NavigationRailItemColors(long selectedIconColor, long selectedTextColor, long selectedIndicatorColor, long unselectedIconColor, long unselectedTextColor, long disabledIconColor, long disabledTextColor);
+ method public long getDisabledIconColor();
+ method public long getDisabledTextColor();
+ method public long getSelectedIconColor();
+ method public long getSelectedIndicatorColor();
+ method public long getSelectedTextColor();
+ method public long getUnselectedIconColor();
+ method public long getUnselectedTextColor();
+ property public final long disabledIconColor;
+ property public final long disabledTextColor;
+ property public final long selectedIconColor;
+ property public final long selectedIndicatorColor;
+ property public final long selectedTextColor;
+ property public final long unselectedIconColor;
+ property public final long unselectedTextColor;
}
public final class NavigationRailItemDefaults {
@@ -858,6 +1051,15 @@
}
@androidx.compose.runtime.Immutable public final class RadioButtonColors {
+ ctor public RadioButtonColors(long selectedColor, long unselectedColor, long disabledSelectedColor, long disabledUnselectedColor);
+ method public long getDisabledSelectedColor();
+ method public long getDisabledUnselectedColor();
+ method public long getSelectedColor();
+ method public long getUnselectedColor();
+ property public final long disabledSelectedColor;
+ property public final long disabledUnselectedColor;
+ property public final long selectedColor;
+ property public final long unselectedColor;
}
public final class RadioButtonDefaults {
@@ -937,9 +1139,22 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class SelectableChipColors {
+ ctor public SelectableChipColors(long containerColor, long labelColor, long leadingIconColor, long trailingIconColor, long disabledContainerColor, long disabledLabelColor, long disabledLeadingIconColor, long disabledTrailingIconColor, long selectedContainerColor, long disabledSelectedContainerColor, long selectedLabelColor, long selectedLeadingIconColor, long selectedTrailingIconColor);
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class SelectableChipElevation {
+ method public float getDisabledElevation();
+ method public float getDraggedElevation();
+ method public float getElevation();
+ method public float getFocusedElevation();
+ method public float getHoveredElevation();
+ method public float getPressedElevation();
+ property public final float disabledElevation;
+ property public final float draggedElevation;
+ property public final float elevation;
+ property public final float focusedElevation;
+ property public final float hoveredElevation;
+ property public final float pressedElevation;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public interface SelectableDates {
@@ -1009,6 +1224,27 @@
}
@androidx.compose.runtime.Immutable public final class SliderColors {
+ ctor public SliderColors(long thumbColor, long activeTrackColor, long activeTickColor, long inactiveTrackColor, long inactiveTickColor, long disabledThumbColor, long disabledActiveTrackColor, long disabledActiveTickColor, long disabledInactiveTrackColor, long disabledInactiveTickColor);
+ method public long getActiveTickColor();
+ method public long getActiveTrackColor();
+ method public long getDisabledActiveTickColor();
+ method public long getDisabledActiveTrackColor();
+ method public long getDisabledInactiveTickColor();
+ method public long getDisabledInactiveTrackColor();
+ method public long getDisabledThumbColor();
+ method public long getInactiveTickColor();
+ method public long getInactiveTrackColor();
+ method public long getThumbColor();
+ property public final long activeTickColor;
+ property public final long activeTrackColor;
+ property public final long disabledActiveTickColor;
+ property public final long disabledActiveTrackColor;
+ property public final long disabledInactiveTickColor;
+ property public final long disabledInactiveTrackColor;
+ property public final long disabledThumbColor;
+ property public final long inactiveTickColor;
+ property public final long inactiveTrackColor;
+ property public final long thumbColor;
}
@androidx.compose.runtime.Stable public final class SliderDefaults {
@@ -1151,6 +1387,39 @@
}
@androidx.compose.runtime.Immutable public final class SwitchColors {
+ ctor public SwitchColors(long checkedThumbColor, long checkedTrackColor, long checkedBorderColor, long checkedIconColor, long uncheckedThumbColor, long uncheckedTrackColor, long uncheckedBorderColor, long uncheckedIconColor, long disabledCheckedThumbColor, long disabledCheckedTrackColor, long disabledCheckedBorderColor, long disabledCheckedIconColor, long disabledUncheckedThumbColor, long disabledUncheckedTrackColor, long disabledUncheckedBorderColor, long disabledUncheckedIconColor);
+ method public long getCheckedBorderColor();
+ method public long getCheckedIconColor();
+ method public long getCheckedThumbColor();
+ method public long getCheckedTrackColor();
+ method public long getDisabledCheckedBorderColor();
+ method public long getDisabledCheckedIconColor();
+ method public long getDisabledCheckedThumbColor();
+ method public long getDisabledCheckedTrackColor();
+ method public long getDisabledUncheckedBorderColor();
+ method public long getDisabledUncheckedIconColor();
+ method public long getDisabledUncheckedThumbColor();
+ method public long getDisabledUncheckedTrackColor();
+ method public long getUncheckedBorderColor();
+ method public long getUncheckedIconColor();
+ method public long getUncheckedThumbColor();
+ method public long getUncheckedTrackColor();
+ property public final long checkedBorderColor;
+ property public final long checkedIconColor;
+ property public final long checkedThumbColor;
+ property public final long checkedTrackColor;
+ property public final long disabledCheckedBorderColor;
+ property public final long disabledCheckedIconColor;
+ property public final long disabledCheckedThumbColor;
+ property public final long disabledCheckedTrackColor;
+ property public final long disabledUncheckedBorderColor;
+ property public final long disabledUncheckedIconColor;
+ property public final long disabledUncheckedThumbColor;
+ property public final long disabledUncheckedTrackColor;
+ property public final long uncheckedBorderColor;
+ property public final long uncheckedIconColor;
+ property public final long uncheckedThumbColor;
+ property public final long uncheckedTrackColor;
}
public final class SwitchDefaults {
@@ -1199,6 +1468,93 @@
}
@androidx.compose.runtime.Immutable public final class TextFieldColors {
+ ctor public TextFieldColors(long focusedTextColor, long unfocusedTextColor, long disabledTextColor, long errorTextColor, long focusedContainerColor, long unfocusedContainerColor, long disabledContainerColor, long errorContainerColor, long cursorColor, long errorCursorColor, androidx.compose.foundation.text.selection.TextSelectionColors textSelectionColors, long focusedIndicatorColor, long unfocusedIndicatorColor, long disabledIndicatorColor, long errorIndicatorColor, long focusedLeadingIconColor, long unfocusedLeadingIconColor, long disabledLeadingIconColor, long errorLeadingIconColor, long focusedTrailingIconColor, long unfocusedTrailingIconColor, long disabledTrailingIconColor, long errorTrailingIconColor, long focusedLabelColor, long unfocusedLabelColor, long disabledLabelColor, long errorLabelColor, long focusedPlaceholderColor, long unfocusedPlaceholderColor, long disabledPlaceholderColor, long errorPlaceholderColor, long focusedSupportingTextColor, long unfocusedSupportingTextColor, long disabledSupportingTextColor, long errorSupportingTextColor, long focusedPrefixColor, long unfocusedPrefixColor, long disabledPrefixColor, long errorPrefixColor, long focusedSuffixColor, long unfocusedSuffixColor, long disabledSuffixColor, long errorSuffixColor);
+ method public long getCursorColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledIndicatorColor();
+ method public long getDisabledLabelColor();
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledPlaceholderColor();
+ method public long getDisabledPrefixColor();
+ method public long getDisabledSuffixColor();
+ method public long getDisabledSupportingTextColor();
+ method public long getDisabledTextColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getErrorContainerColor();
+ method public long getErrorCursorColor();
+ method public long getErrorIndicatorColor();
+ method public long getErrorLabelColor();
+ method public long getErrorLeadingIconColor();
+ method public long getErrorPlaceholderColor();
+ method public long getErrorPrefixColor();
+ method public long getErrorSuffixColor();
+ method public long getErrorSupportingTextColor();
+ method public long getErrorTextColor();
+ method public long getErrorTrailingIconColor();
+ method public long getFocusedContainerColor();
+ method public long getFocusedIndicatorColor();
+ method public long getFocusedLabelColor();
+ method public long getFocusedLeadingIconColor();
+ method public long getFocusedPlaceholderColor();
+ method public long getFocusedPrefixColor();
+ method public long getFocusedSuffixColor();
+ method public long getFocusedSupportingTextColor();
+ method public long getFocusedTextColor();
+ method public long getFocusedTrailingIconColor();
+ method public androidx.compose.foundation.text.selection.TextSelectionColors getTextSelectionColors();
+ method public long getUnfocusedContainerColor();
+ method public long getUnfocusedIndicatorColor();
+ method public long getUnfocusedLabelColor();
+ method public long getUnfocusedLeadingIconColor();
+ method public long getUnfocusedPlaceholderColor();
+ method public long getUnfocusedPrefixColor();
+ method public long getUnfocusedSuffixColor();
+ method public long getUnfocusedSupportingTextColor();
+ method public long getUnfocusedTextColor();
+ method public long getUnfocusedTrailingIconColor();
+ property public final long cursorColor;
+ property public final long disabledContainerColor;
+ property public final long disabledIndicatorColor;
+ property public final long disabledLabelColor;
+ property public final long disabledLeadingIconColor;
+ property public final long disabledPlaceholderColor;
+ property public final long disabledPrefixColor;
+ property public final long disabledSuffixColor;
+ property public final long disabledSupportingTextColor;
+ property public final long disabledTextColor;
+ property public final long disabledTrailingIconColor;
+ property public final long errorContainerColor;
+ property public final long errorCursorColor;
+ property public final long errorIndicatorColor;
+ property public final long errorLabelColor;
+ property public final long errorLeadingIconColor;
+ property public final long errorPlaceholderColor;
+ property public final long errorPrefixColor;
+ property public final long errorSuffixColor;
+ property public final long errorSupportingTextColor;
+ property public final long errorTextColor;
+ property public final long errorTrailingIconColor;
+ property public final long focusedContainerColor;
+ property public final long focusedIndicatorColor;
+ property public final long focusedLabelColor;
+ property public final long focusedLeadingIconColor;
+ property public final long focusedPlaceholderColor;
+ property public final long focusedPrefixColor;
+ property public final long focusedSuffixColor;
+ property public final long focusedSupportingTextColor;
+ property public final long focusedTextColor;
+ property public final long focusedTrailingIconColor;
+ property public final androidx.compose.foundation.text.selection.TextSelectionColors textSelectionColors;
+ property public final long unfocusedContainerColor;
+ property public final long unfocusedIndicatorColor;
+ property public final long unfocusedLabelColor;
+ property public final long unfocusedLeadingIconColor;
+ property public final long unfocusedPlaceholderColor;
+ property public final long unfocusedPrefixColor;
+ property public final long unfocusedSuffixColor;
+ property public final long unfocusedSupportingTextColor;
+ property public final long unfocusedTextColor;
+ property public final long unfocusedTrailingIconColor;
}
@androidx.compose.runtime.Immutable public final class TextFieldDefaults {
@@ -1260,6 +1616,35 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class TimePickerColors {
+ ctor public TimePickerColors(long clockDialColor, long selectorColor, long containerColor, long periodSelectorBorderColor, long clockDialSelectedContentColor, long clockDialUnselectedContentColor, long periodSelectorSelectedContainerColor, long periodSelectorUnselectedContainerColor, long periodSelectorSelectedContentColor, long periodSelectorUnselectedContentColor, long timeSelectorSelectedContainerColor, long timeSelectorUnselectedContainerColor, long timeSelectorSelectedContentColor, long timeSelectorUnselectedContentColor);
+ method public long getClockDialColor();
+ method public long getClockDialSelectedContentColor();
+ method public long getClockDialUnselectedContentColor();
+ method public long getContainerColor();
+ method public long getPeriodSelectorBorderColor();
+ method public long getPeriodSelectorSelectedContainerColor();
+ method public long getPeriodSelectorSelectedContentColor();
+ method public long getPeriodSelectorUnselectedContainerColor();
+ method public long getPeriodSelectorUnselectedContentColor();
+ method public long getSelectorColor();
+ method public long getTimeSelectorSelectedContainerColor();
+ method public long getTimeSelectorSelectedContentColor();
+ method public long getTimeSelectorUnselectedContainerColor();
+ method public long getTimeSelectorUnselectedContentColor();
+ property public final long clockDialColor;
+ property public final long clockDialSelectedContentColor;
+ property public final long clockDialUnselectedContentColor;
+ property public final long containerColor;
+ property public final long periodSelectorBorderColor;
+ property public final long periodSelectorSelectedContainerColor;
+ property public final long periodSelectorSelectedContentColor;
+ property public final long periodSelectorUnselectedContainerColor;
+ property public final long periodSelectorUnselectedContentColor;
+ property public final long selectorColor;
+ property public final long timeSelectorSelectedContainerColor;
+ property public final long timeSelectorSelectedContentColor;
+ property public final long timeSelectorUnselectedContainerColor;
+ property public final long timeSelectorUnselectedContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class TimePickerDefaults {
@@ -1336,6 +1721,17 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class TopAppBarColors {
+ ctor public TopAppBarColors(long containerColor, long scrolledContainerColor, long navigationIconContentColor, long titleContentColor, long actionIconContentColor);
+ method public long getActionIconContentColor();
+ method public long getContainerColor();
+ method public long getNavigationIconContentColor();
+ method public long getScrolledContainerColor();
+ method public long getTitleContentColor();
+ property public final long actionIconContentColor;
+ property public final long containerColor;
+ property public final long navigationIconContentColor;
+ property public final long scrolledContainerColor;
+ property public final long titleContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api public final class TopAppBarDefaults {
diff --git a/compose/material3/material3/api/restricted_current.txt b/compose/material3/material3/api/restricted_current.txt
index 3c5de3a..2dd54ac 100644
--- a/compose/material3/material3/api/restricted_current.txt
+++ b/compose/material3/material3/api/restricted_current.txt
@@ -113,6 +113,15 @@
}
@androidx.compose.runtime.Immutable public final class ButtonColors {
+ ctor public ButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class ButtonDefaults {
@@ -175,6 +184,15 @@
}
@androidx.compose.runtime.Immutable public final class CardColors {
+ ctor public CardColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class CardDefaults {
@@ -207,6 +225,29 @@
}
@androidx.compose.runtime.Immutable public final class CheckboxColors {
+ ctor public CheckboxColors(long checkedCheckmarkColor, long uncheckedCheckmarkColor, long checkedBoxColor, long uncheckedBoxColor, long disabledCheckedBoxColor, long disabledUncheckedBoxColor, long disabledIndeterminateBoxColor, long checkedBorderColor, long uncheckedBorderColor, long disabledBorderColor, long disabledIndeterminateBorderColor);
+ method public long getCheckedBorderColor();
+ method public long getCheckedBoxColor();
+ method public long getCheckedCheckmarkColor();
+ method public long getDisabledBorderColor();
+ method public long getDisabledCheckedBoxColor();
+ method public long getDisabledIndeterminateBorderColor();
+ method public long getDisabledIndeterminateBoxColor();
+ method public long getDisabledUncheckedBoxColor();
+ method public long getUncheckedBorderColor();
+ method public long getUncheckedBoxColor();
+ method public long getUncheckedCheckmarkColor();
+ property public final long checkedBorderColor;
+ property public final long checkedBoxColor;
+ property public final long checkedCheckmarkColor;
+ property public final long disabledBorderColor;
+ property public final long disabledCheckedBoxColor;
+ property public final long disabledIndeterminateBorderColor;
+ property public final long disabledIndeterminateBoxColor;
+ property public final long disabledUncheckedBoxColor;
+ property public final long uncheckedBorderColor;
+ property public final long uncheckedBoxColor;
+ property public final long uncheckedCheckmarkColor;
}
public final class CheckboxDefaults {
@@ -223,6 +264,23 @@
}
@androidx.compose.runtime.Immutable public final class ChipColors {
+ ctor public ChipColors(long containerColor, long labelColor, long leadingIconContentColor, long trailingIconContentColor, long disabledContainerColor, long disabledLabelColor, long disabledLeadingIconContentColor, long disabledTrailingIconContentColor);
+ method public long getContainerColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledLabelColor();
+ method public long getDisabledLeadingIconContentColor();
+ method public long getDisabledTrailingIconContentColor();
+ method public long getLabelColor();
+ method public long getLeadingIconContentColor();
+ method public long getTrailingIconContentColor();
+ property public final long containerColor;
+ property public final long disabledContainerColor;
+ property public final long disabledLabelColor;
+ property public final long disabledLeadingIconContentColor;
+ property public final long disabledTrailingIconContentColor;
+ property public final long labelColor;
+ property public final long leadingIconContentColor;
+ property public final long trailingIconContentColor;
}
@androidx.compose.runtime.Immutable public final class ChipElevation {
@@ -335,6 +393,57 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class DatePickerColors {
+ ctor public DatePickerColors(long containerColor, long titleContentColor, long headlineContentColor, long weekdayContentColor, long subheadContentColor, long navigationContentColor, long yearContentColor, long disabledYearContentColor, long currentYearContentColor, long selectedYearContentColor, long disabledSelectedYearContentColor, long selectedYearContainerColor, long disabledSelectedYearContainerColor, long dayContentColor, long disabledDayContentColor, long selectedDayContentColor, long disabledSelectedDayContentColor, long selectedDayContainerColor, long disabledSelectedDayContainerColor, long todayContentColor, long todayDateBorderColor, long dayInSelectionRangeContainerColor, long dayInSelectionRangeContentColor, long dividerColor, androidx.compose.material3.TextFieldColors dateTextFieldColors);
+ method public long getContainerColor();
+ method public long getCurrentYearContentColor();
+ method public androidx.compose.material3.TextFieldColors getDateTextFieldColors();
+ method public long getDayContentColor();
+ method public long getDayInSelectionRangeContainerColor();
+ method public long getDayInSelectionRangeContentColor();
+ method public long getDisabledDayContentColor();
+ method public long getDisabledSelectedDayContainerColor();
+ method public long getDisabledSelectedDayContentColor();
+ method public long getDisabledSelectedYearContainerColor();
+ method public long getDisabledSelectedYearContentColor();
+ method public long getDisabledYearContentColor();
+ method public long getDividerColor();
+ method public long getHeadlineContentColor();
+ method public long getNavigationContentColor();
+ method public long getSelectedDayContainerColor();
+ method public long getSelectedDayContentColor();
+ method public long getSelectedYearContainerColor();
+ method public long getSelectedYearContentColor();
+ method public long getSubheadContentColor();
+ method public long getTitleContentColor();
+ method public long getTodayContentColor();
+ method public long getTodayDateBorderColor();
+ method public long getWeekdayContentColor();
+ method public long getYearContentColor();
+ property public final long containerColor;
+ property public final long currentYearContentColor;
+ property public final androidx.compose.material3.TextFieldColors dateTextFieldColors;
+ property public final long dayContentColor;
+ property public final long dayInSelectionRangeContainerColor;
+ property public final long dayInSelectionRangeContentColor;
+ property public final long disabledDayContentColor;
+ property public final long disabledSelectedDayContainerColor;
+ property public final long disabledSelectedDayContentColor;
+ property public final long disabledSelectedYearContainerColor;
+ property public final long disabledSelectedYearContentColor;
+ property public final long disabledYearContentColor;
+ property public final long dividerColor;
+ property public final long headlineContentColor;
+ property public final long navigationContentColor;
+ property public final long selectedDayContainerColor;
+ property public final long selectedDayContentColor;
+ property public final long selectedYearContainerColor;
+ property public final long selectedYearContentColor;
+ property public final long subheadContentColor;
+ property public final long titleContentColor;
+ property public final long todayContentColor;
+ property public final long todayDateBorderColor;
+ property public final long weekdayContentColor;
+ property public final long yearContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class DatePickerDefaults {
@@ -613,6 +722,15 @@
}
@androidx.compose.runtime.Immutable public final class IconButtonColors {
+ ctor public IconButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
public final class IconButtonDefaults {
@@ -651,6 +769,19 @@
}
@androidx.compose.runtime.Immutable public final class IconToggleButtonColors {
+ ctor public IconToggleButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor, long checkedContainerColor, long checkedContentColor);
+ method public long getCheckedContainerColor();
+ method public long getCheckedContentColor();
+ method public long getContainerColor();
+ method public long getContentColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledContentColor();
+ property public final long checkedContainerColor;
+ property public final long checkedContentColor;
+ property public final long containerColor;
+ property public final long contentColor;
+ property public final long disabledContainerColor;
+ property public final long disabledContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api public final class InputChipDefaults {
@@ -677,6 +808,25 @@
}
@androidx.compose.runtime.Immutable public final class ListItemColors {
+ ctor public ListItemColors(long containerColor, long headlineColor, long leadingIconColor, long overlineColor, long supportingTextColor, long trailingIconColor, long disabledHeadlineColor, long disabledLeadingIconColor, long disabledTrailingIconColor);
+ method public long getContainerColor();
+ method public long getDisabledHeadlineColor();
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getHeadlineColor();
+ method public long getLeadingIconColor();
+ method public long getOverlineColor();
+ method public long getSupportingTextColor();
+ method public long getTrailingIconColor();
+ property public final long containerColor;
+ property public final long disabledHeadlineColor;
+ property public final long disabledLeadingIconColor;
+ property public final long disabledTrailingIconColor;
+ property public final long headlineColor;
+ property public final long leadingIconColor;
+ property public final long overlineColor;
+ property public final long supportingTextColor;
+ property public final long trailingIconColor;
}
public final class ListItemDefaults {
@@ -718,6 +868,19 @@
}
@androidx.compose.runtime.Immutable public final class MenuItemColors {
+ ctor public MenuItemColors(long textColor, long leadingIconColor, long trailingIconColor, long disabledTextColor, long disabledLeadingIconColor, long disabledTrailingIconColor);
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledTextColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getLeadingIconColor();
+ method public long getTextColor();
+ method public long getTrailingIconColor();
+ property public final long disabledLeadingIconColor;
+ property public final long disabledTextColor;
+ property public final long disabledTrailingIconColor;
+ property public final long leadingIconColor;
+ property public final long textColor;
+ property public final long trailingIconColor;
}
public final class ModalBottomSheet_androidKt {
@@ -736,6 +899,21 @@
}
@androidx.compose.runtime.Stable public final class NavigationBarItemColors {
+ ctor public NavigationBarItemColors(long selectedIconColor, long selectedTextColor, long selectedIndicatorColor, long unselectedIconColor, long unselectedTextColor, long disabledIconColor, long disabledTextColor);
+ method public long getDisabledIconColor();
+ method public long getDisabledTextColor();
+ method public long getSelectedIconColor();
+ method public long getSelectedIndicatorColor();
+ method public long getSelectedTextColor();
+ method public long getUnselectedIconColor();
+ method public long getUnselectedTextColor();
+ property public final long disabledIconColor;
+ property public final long disabledTextColor;
+ property public final long selectedIconColor;
+ property public final long selectedIndicatorColor;
+ property public final long selectedTextColor;
+ property public final long unselectedIconColor;
+ property public final long unselectedTextColor;
}
public final class NavigationBarItemDefaults {
@@ -783,6 +961,21 @@
}
@androidx.compose.runtime.Stable public final class NavigationRailItemColors {
+ ctor public NavigationRailItemColors(long selectedIconColor, long selectedTextColor, long selectedIndicatorColor, long unselectedIconColor, long unselectedTextColor, long disabledIconColor, long disabledTextColor);
+ method public long getDisabledIconColor();
+ method public long getDisabledTextColor();
+ method public long getSelectedIconColor();
+ method public long getSelectedIndicatorColor();
+ method public long getSelectedTextColor();
+ method public long getUnselectedIconColor();
+ method public long getUnselectedTextColor();
+ property public final long disabledIconColor;
+ property public final long disabledTextColor;
+ property public final long selectedIconColor;
+ property public final long selectedIndicatorColor;
+ property public final long selectedTextColor;
+ property public final long unselectedIconColor;
+ property public final long unselectedTextColor;
}
public final class NavigationRailItemDefaults {
@@ -858,6 +1051,15 @@
}
@androidx.compose.runtime.Immutable public final class RadioButtonColors {
+ ctor public RadioButtonColors(long selectedColor, long unselectedColor, long disabledSelectedColor, long disabledUnselectedColor);
+ method public long getDisabledSelectedColor();
+ method public long getDisabledUnselectedColor();
+ method public long getSelectedColor();
+ method public long getUnselectedColor();
+ property public final long disabledSelectedColor;
+ property public final long disabledUnselectedColor;
+ property public final long selectedColor;
+ property public final long unselectedColor;
}
public final class RadioButtonDefaults {
@@ -937,9 +1139,22 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class SelectableChipColors {
+ ctor public SelectableChipColors(long containerColor, long labelColor, long leadingIconColor, long trailingIconColor, long disabledContainerColor, long disabledLabelColor, long disabledLeadingIconColor, long disabledTrailingIconColor, long selectedContainerColor, long disabledSelectedContainerColor, long selectedLabelColor, long selectedLeadingIconColor, long selectedTrailingIconColor);
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class SelectableChipElevation {
+ method public float getDisabledElevation();
+ method public float getDraggedElevation();
+ method public float getElevation();
+ method public float getFocusedElevation();
+ method public float getHoveredElevation();
+ method public float getPressedElevation();
+ property public final float disabledElevation;
+ property public final float draggedElevation;
+ property public final float elevation;
+ property public final float focusedElevation;
+ property public final float hoveredElevation;
+ property public final float pressedElevation;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public interface SelectableDates {
@@ -1009,6 +1224,27 @@
}
@androidx.compose.runtime.Immutable public final class SliderColors {
+ ctor public SliderColors(long thumbColor, long activeTrackColor, long activeTickColor, long inactiveTrackColor, long inactiveTickColor, long disabledThumbColor, long disabledActiveTrackColor, long disabledActiveTickColor, long disabledInactiveTrackColor, long disabledInactiveTickColor);
+ method public long getActiveTickColor();
+ method public long getActiveTrackColor();
+ method public long getDisabledActiveTickColor();
+ method public long getDisabledActiveTrackColor();
+ method public long getDisabledInactiveTickColor();
+ method public long getDisabledInactiveTrackColor();
+ method public long getDisabledThumbColor();
+ method public long getInactiveTickColor();
+ method public long getInactiveTrackColor();
+ method public long getThumbColor();
+ property public final long activeTickColor;
+ property public final long activeTrackColor;
+ property public final long disabledActiveTickColor;
+ property public final long disabledActiveTrackColor;
+ property public final long disabledInactiveTickColor;
+ property public final long disabledInactiveTrackColor;
+ property public final long disabledThumbColor;
+ property public final long inactiveTickColor;
+ property public final long inactiveTrackColor;
+ property public final long thumbColor;
}
@androidx.compose.runtime.Stable public final class SliderDefaults {
@@ -1151,6 +1387,39 @@
}
@androidx.compose.runtime.Immutable public final class SwitchColors {
+ ctor public SwitchColors(long checkedThumbColor, long checkedTrackColor, long checkedBorderColor, long checkedIconColor, long uncheckedThumbColor, long uncheckedTrackColor, long uncheckedBorderColor, long uncheckedIconColor, long disabledCheckedThumbColor, long disabledCheckedTrackColor, long disabledCheckedBorderColor, long disabledCheckedIconColor, long disabledUncheckedThumbColor, long disabledUncheckedTrackColor, long disabledUncheckedBorderColor, long disabledUncheckedIconColor);
+ method public long getCheckedBorderColor();
+ method public long getCheckedIconColor();
+ method public long getCheckedThumbColor();
+ method public long getCheckedTrackColor();
+ method public long getDisabledCheckedBorderColor();
+ method public long getDisabledCheckedIconColor();
+ method public long getDisabledCheckedThumbColor();
+ method public long getDisabledCheckedTrackColor();
+ method public long getDisabledUncheckedBorderColor();
+ method public long getDisabledUncheckedIconColor();
+ method public long getDisabledUncheckedThumbColor();
+ method public long getDisabledUncheckedTrackColor();
+ method public long getUncheckedBorderColor();
+ method public long getUncheckedIconColor();
+ method public long getUncheckedThumbColor();
+ method public long getUncheckedTrackColor();
+ property public final long checkedBorderColor;
+ property public final long checkedIconColor;
+ property public final long checkedThumbColor;
+ property public final long checkedTrackColor;
+ property public final long disabledCheckedBorderColor;
+ property public final long disabledCheckedIconColor;
+ property public final long disabledCheckedThumbColor;
+ property public final long disabledCheckedTrackColor;
+ property public final long disabledUncheckedBorderColor;
+ property public final long disabledUncheckedIconColor;
+ property public final long disabledUncheckedThumbColor;
+ property public final long disabledUncheckedTrackColor;
+ property public final long uncheckedBorderColor;
+ property public final long uncheckedIconColor;
+ property public final long uncheckedThumbColor;
+ property public final long uncheckedTrackColor;
}
public final class SwitchDefaults {
@@ -1199,6 +1468,93 @@
}
@androidx.compose.runtime.Immutable public final class TextFieldColors {
+ ctor public TextFieldColors(long focusedTextColor, long unfocusedTextColor, long disabledTextColor, long errorTextColor, long focusedContainerColor, long unfocusedContainerColor, long disabledContainerColor, long errorContainerColor, long cursorColor, long errorCursorColor, androidx.compose.foundation.text.selection.TextSelectionColors textSelectionColors, long focusedIndicatorColor, long unfocusedIndicatorColor, long disabledIndicatorColor, long errorIndicatorColor, long focusedLeadingIconColor, long unfocusedLeadingIconColor, long disabledLeadingIconColor, long errorLeadingIconColor, long focusedTrailingIconColor, long unfocusedTrailingIconColor, long disabledTrailingIconColor, long errorTrailingIconColor, long focusedLabelColor, long unfocusedLabelColor, long disabledLabelColor, long errorLabelColor, long focusedPlaceholderColor, long unfocusedPlaceholderColor, long disabledPlaceholderColor, long errorPlaceholderColor, long focusedSupportingTextColor, long unfocusedSupportingTextColor, long disabledSupportingTextColor, long errorSupportingTextColor, long focusedPrefixColor, long unfocusedPrefixColor, long disabledPrefixColor, long errorPrefixColor, long focusedSuffixColor, long unfocusedSuffixColor, long disabledSuffixColor, long errorSuffixColor);
+ method public long getCursorColor();
+ method public long getDisabledContainerColor();
+ method public long getDisabledIndicatorColor();
+ method public long getDisabledLabelColor();
+ method public long getDisabledLeadingIconColor();
+ method public long getDisabledPlaceholderColor();
+ method public long getDisabledPrefixColor();
+ method public long getDisabledSuffixColor();
+ method public long getDisabledSupportingTextColor();
+ method public long getDisabledTextColor();
+ method public long getDisabledTrailingIconColor();
+ method public long getErrorContainerColor();
+ method public long getErrorCursorColor();
+ method public long getErrorIndicatorColor();
+ method public long getErrorLabelColor();
+ method public long getErrorLeadingIconColor();
+ method public long getErrorPlaceholderColor();
+ method public long getErrorPrefixColor();
+ method public long getErrorSuffixColor();
+ method public long getErrorSupportingTextColor();
+ method public long getErrorTextColor();
+ method public long getErrorTrailingIconColor();
+ method public long getFocusedContainerColor();
+ method public long getFocusedIndicatorColor();
+ method public long getFocusedLabelColor();
+ method public long getFocusedLeadingIconColor();
+ method public long getFocusedPlaceholderColor();
+ method public long getFocusedPrefixColor();
+ method public long getFocusedSuffixColor();
+ method public long getFocusedSupportingTextColor();
+ method public long getFocusedTextColor();
+ method public long getFocusedTrailingIconColor();
+ method public androidx.compose.foundation.text.selection.TextSelectionColors getTextSelectionColors();
+ method public long getUnfocusedContainerColor();
+ method public long getUnfocusedIndicatorColor();
+ method public long getUnfocusedLabelColor();
+ method public long getUnfocusedLeadingIconColor();
+ method public long getUnfocusedPlaceholderColor();
+ method public long getUnfocusedPrefixColor();
+ method public long getUnfocusedSuffixColor();
+ method public long getUnfocusedSupportingTextColor();
+ method public long getUnfocusedTextColor();
+ method public long getUnfocusedTrailingIconColor();
+ property public final long cursorColor;
+ property public final long disabledContainerColor;
+ property public final long disabledIndicatorColor;
+ property public final long disabledLabelColor;
+ property public final long disabledLeadingIconColor;
+ property public final long disabledPlaceholderColor;
+ property public final long disabledPrefixColor;
+ property public final long disabledSuffixColor;
+ property public final long disabledSupportingTextColor;
+ property public final long disabledTextColor;
+ property public final long disabledTrailingIconColor;
+ property public final long errorContainerColor;
+ property public final long errorCursorColor;
+ property public final long errorIndicatorColor;
+ property public final long errorLabelColor;
+ property public final long errorLeadingIconColor;
+ property public final long errorPlaceholderColor;
+ property public final long errorPrefixColor;
+ property public final long errorSuffixColor;
+ property public final long errorSupportingTextColor;
+ property public final long errorTextColor;
+ property public final long errorTrailingIconColor;
+ property public final long focusedContainerColor;
+ property public final long focusedIndicatorColor;
+ property public final long focusedLabelColor;
+ property public final long focusedLeadingIconColor;
+ property public final long focusedPlaceholderColor;
+ property public final long focusedPrefixColor;
+ property public final long focusedSuffixColor;
+ property public final long focusedSupportingTextColor;
+ property public final long focusedTextColor;
+ property public final long focusedTrailingIconColor;
+ property public final androidx.compose.foundation.text.selection.TextSelectionColors textSelectionColors;
+ property public final long unfocusedContainerColor;
+ property public final long unfocusedIndicatorColor;
+ property public final long unfocusedLabelColor;
+ property public final long unfocusedLeadingIconColor;
+ property public final long unfocusedPlaceholderColor;
+ property public final long unfocusedPrefixColor;
+ property public final long unfocusedSuffixColor;
+ property public final long unfocusedSupportingTextColor;
+ property public final long unfocusedTextColor;
+ property public final long unfocusedTrailingIconColor;
}
@androidx.compose.runtime.Immutable public final class TextFieldDefaults {
@@ -1260,6 +1616,35 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Immutable public final class TimePickerColors {
+ ctor public TimePickerColors(long clockDialColor, long selectorColor, long containerColor, long periodSelectorBorderColor, long clockDialSelectedContentColor, long clockDialUnselectedContentColor, long periodSelectorSelectedContainerColor, long periodSelectorUnselectedContainerColor, long periodSelectorSelectedContentColor, long periodSelectorUnselectedContentColor, long timeSelectorSelectedContainerColor, long timeSelectorUnselectedContainerColor, long timeSelectorSelectedContentColor, long timeSelectorUnselectedContentColor);
+ method public long getClockDialColor();
+ method public long getClockDialSelectedContentColor();
+ method public long getClockDialUnselectedContentColor();
+ method public long getContainerColor();
+ method public long getPeriodSelectorBorderColor();
+ method public long getPeriodSelectorSelectedContainerColor();
+ method public long getPeriodSelectorSelectedContentColor();
+ method public long getPeriodSelectorUnselectedContainerColor();
+ method public long getPeriodSelectorUnselectedContentColor();
+ method public long getSelectorColor();
+ method public long getTimeSelectorSelectedContainerColor();
+ method public long getTimeSelectorSelectedContentColor();
+ method public long getTimeSelectorUnselectedContainerColor();
+ method public long getTimeSelectorUnselectedContentColor();
+ property public final long clockDialColor;
+ property public final long clockDialSelectedContentColor;
+ property public final long clockDialUnselectedContentColor;
+ property public final long containerColor;
+ property public final long periodSelectorBorderColor;
+ property public final long periodSelectorSelectedContainerColor;
+ property public final long periodSelectorSelectedContentColor;
+ property public final long periodSelectorUnselectedContainerColor;
+ property public final long periodSelectorUnselectedContentColor;
+ property public final long selectorColor;
+ property public final long timeSelectorSelectedContainerColor;
+ property public final long timeSelectorSelectedContentColor;
+ property public final long timeSelectorUnselectedContainerColor;
+ property public final long timeSelectorUnselectedContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class TimePickerDefaults {
@@ -1336,6 +1721,17 @@
}
@androidx.compose.material3.ExperimentalMaterial3Api @androidx.compose.runtime.Stable public final class TopAppBarColors {
+ ctor public TopAppBarColors(long containerColor, long scrolledContainerColor, long navigationIconContentColor, long titleContentColor, long actionIconContentColor);
+ method public long getActionIconContentColor();
+ method public long getContainerColor();
+ method public long getNavigationIconContentColor();
+ method public long getScrolledContainerColor();
+ method public long getTitleContentColor();
+ property public final long actionIconContentColor;
+ property public final long containerColor;
+ property public final long navigationIconContentColor;
+ property public final long scrolledContainerColor;
+ property public final long titleContentColor;
}
@androidx.compose.material3.ExperimentalMaterial3Api public final class TopAppBarDefaults {
diff --git a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ListSamples.kt b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ListSamples.kt
index 5355796..5173712 100644
--- a/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ListSamples.kt
+++ b/compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/ListSamples.kt
@@ -21,7 +21,6 @@
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material3.Divider
-import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.Text
@@ -31,7 +30,6 @@
@Preview
@Sampled
@Composable
-@OptIn(ExperimentalMaterial3Api::class)
fun OneLineListItem() {
Column {
ListItem(
@@ -50,7 +48,6 @@
@Preview
@Sampled
@Composable
-@OptIn(ExperimentalMaterial3Api::class)
fun TwoLineListItem() {
Column {
ListItem(
@@ -71,7 +68,6 @@
@Preview
@Sampled
@Composable
-@OptIn(ExperimentalMaterial3Api::class)
fun ThreeLineListItem() {
Column {
ListItem(
diff --git a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ListItemTest.kt b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ListItemTest.kt
index 1b21463..b5e14eb 100644
--- a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ListItemTest.kt
+++ b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/ListItemTest.kt
@@ -18,12 +18,14 @@
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.size
import androidx.compose.material3.tokens.ListTokens
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.layout.LayoutCoordinates
import androidx.compose.ui.layout.onGloballyPositioned
+import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.node.Ref
import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertWidthIsEqualTo
@@ -125,8 +127,8 @@
@Test
fun listItem_oneLine_positioning_noIcon() {
val listItemHeight = ListTokens.ListItemOneLineContainerHeight
- val expectedStartPadding = 16.dp
- val expectedEndPadding = 24.dp
+ val expectedStartPadding = LeadingContentEndPadding
+ val expectedEndPadding = ListItemEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -151,17 +153,17 @@
val ds = rule.onRoot().getUnclippedBoundsInRoot()
rule.runOnIdleWithDensity {
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(textPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - textSize.value!!.height) / 2f
)
- assertThat(trailingPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
ds.width.toPx() - trailingSize.value!!.width - expectedEndPadding.toPx()
)
- assertThat(trailingPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - trailingSize.value!!.height) / 2f
)
}
@@ -170,8 +172,8 @@
@Test
fun listItem_oneLine_positioning_withIcon() {
val listItemHeight = ListTokens.ListItemOneLineContainerHeight
- val expectedStartPadding = 16.dp
- val expectedTextStartPadding = 16.dp
+ val expectedStartPadding = ListItemStartPadding
+ val expectedTextStartPadding = LeadingContentEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -193,29 +195,90 @@
}
}
rule.runOnIdleWithDensity {
- assertThat(iconPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(iconPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - iconSize.value!!.height) / 2f
)
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() +
iconSize.value!!.width +
expectedTextStartPadding.toPx()
)
- assertThat(textPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - textSize.value!!.height) / 2f
)
}
}
@Test
+ fun listItem_oneLine_positioning_customSize() {
+ val listItemHeight = 100.dp
+ val listItemWidth = 300.dp
+ val expectedStartPadding = ListItemStartPadding
+ val expectedEndPadding = ListItemEndPadding
+ val expectedTextStartPadding = LeadingContentEndPadding
+
+ val textPosition = Ref<Offset>()
+ val textSize = Ref<IntSize>()
+ val leadingIconPosition = Ref<Offset>()
+ val leadingIconSize = Ref<IntSize>()
+ val trailingPosition = Ref<Offset>()
+ val trailingSize = Ref<IntSize>()
+ rule.setMaterialContent(lightColorScheme()) {
+ ListItem(
+ modifier = Modifier.size(width = listItemWidth, height = listItemHeight),
+ headlineContent = {
+ Text("Primary text", Modifier.saveLayout(textPosition, textSize))
+ },
+ leadingContent = {
+ Image(
+ icon24x24,
+ null,
+ Modifier.saveLayout(leadingIconPosition, leadingIconSize))
+ },
+ trailingContent = {
+ Text(
+ "meta",
+ Modifier.saveLayout(trailingPosition, trailingSize)
+ )
+ }
+ )
+ }
+ rule.runOnIdleWithDensity {
+ assertThat(leadingIconPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx()
+ )
+ assertThat(leadingIconPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - leadingIconSize.value!!.height) / 2f
+ )
+
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - textSize.value!!.height) / 2f
+ )
+
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
+ listItemWidth.toPx() - trailingSize.value!!.width -
+ expectedEndPadding.toPx()
+ )
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - trailingSize.value!!.height) / 2f
+ )
+ }
+ }
+
+ @Test
fun listItem_twoLine_positioning_noIcon() {
val listItemHeight = ListTokens.ListItemTwoLineContainerHeight
- val expectedStartPadding = 16.dp
- val expectedEndPadding = 24.dp
+ val expectedStartPadding = ListItemStartPadding
+ val expectedEndPadding = ListItemEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -251,25 +314,25 @@
rule.runOnIdleWithDensity {
val totalTextHeight = textSize.value!!.height + secondaryTextSize.value!!.height
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(textPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - totalTextHeight) / 2f
)
- assertThat(secondaryTextPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(secondaryTextPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - totalTextHeight) / 2f + textSize.value!!.height
)
- assertThat(trailingPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
ds.width.toPx() - trailingSize.value!!.width -
expectedEndPadding.toPx()
)
- assertThat(trailingPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - trailingSize.value!!.height) / 2f
)
}
@@ -278,8 +341,8 @@
@Test
fun listItem_twoLine_positioning_withIcon() {
val listItemHeight = ListTokens.ListItemTwoLineContainerHeight
- val expectedStartPadding = 16.dp
- val expectedContentStartPadding = 16.dp
+ val expectedStartPadding = ListItemStartPadding
+ val expectedContentStartPadding = LeadingContentEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -311,36 +374,117 @@
rule.runOnIdleWithDensity {
val totalTextHeight = textSize.value!!.height + secondaryTextSize.value!!.height
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
- assertThat(textPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - totalTextHeight) / 2f
)
- assertThat(secondaryTextPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
- assertThat(secondaryTextPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - totalTextHeight) / 2f + textSize.value!!.height
)
- assertThat(iconPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(iconPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.y).isWithin(1f).of(
(listItemHeight.toPx() - iconSize.value!!.height) / 2f
)
}
}
@Test
+ fun listItem_twoLine_positioning_customSize() {
+ val listItemHeight = 100.dp
+ val listItemWidth = 300.dp
+ val expectedStartPadding = ListItemStartPadding
+ val expectedEndPadding = ListItemEndPadding
+ val expectedTextStartPadding = LeadingContentEndPadding
+
+ val textPosition = Ref<Offset>()
+ val textSize = Ref<IntSize>()
+ val secondaryTextPosition = Ref<Offset>()
+ val secondaryTextSize = Ref<IntSize>()
+ val leadingIconPosition = Ref<Offset>()
+ val leadingIconSize = Ref<IntSize>()
+ val trailingPosition = Ref<Offset>()
+ val trailingSize = Ref<IntSize>()
+ rule.setMaterialContent(lightColorScheme()) {
+ ListItem(
+ modifier = Modifier.size(width = listItemWidth, height = listItemHeight),
+ headlineContent = {
+ Text("Primary text", Modifier.saveLayout(textPosition, textSize))
+ },
+ supportingContent = {
+ Text(
+ "Secondary text",
+ Modifier.saveLayout(secondaryTextPosition, secondaryTextSize)
+ )
+ },
+ leadingContent = {
+ Image(
+ icon24x24,
+ null,
+ Modifier.saveLayout(leadingIconPosition, leadingIconSize))
+ },
+ trailingContent = {
+ Text(
+ "meta",
+ Modifier.saveLayout(trailingPosition, trailingSize)
+ )
+ }
+ )
+ }
+ rule.runOnIdleWithDensity {
+ val totalTextHeight = textSize.value!!.height + secondaryTextSize.value!!.height
+
+ assertThat(leadingIconPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx()
+ )
+ assertThat(leadingIconPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - leadingIconSize.value!!.height) / 2f
+ )
+
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - totalTextHeight) / 2f
+ )
+
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - totalTextHeight) / 2f + textSize.value!!.height
+ )
+
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
+ listItemWidth.toPx() - trailingSize.value!!.width -
+ expectedEndPadding.toPx()
+ )
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
+ (listItemHeight.toPx() - trailingSize.value!!.height) / 2f
+ )
+ }
+ }
+
+ @Test
fun listItem_threeLine_positioning_noOverline_metaText() {
- val expectedStartPadding = 16.dp
- val expectedContentStartPadding = 16.dp
- val expectedEndPadding = 24.dp
+ val expectedTopPadding = ListItemThreeLineVerticalPadding
+ val expectedStartPadding = ListItemStartPadding
+ val expectedContentStartPadding = LeadingContentEndPadding
+ val expectedEndPadding = ListItemEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -376,34 +520,45 @@
}
val ds = rule.onRoot().getUnclippedBoundsInRoot()
rule.runOnIdleWithDensity {
- // TODO(b/233782301): Test y positions when this is implemented as a 3-line ListItem
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
- assertThat(secondaryTextPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx() + textSize.value!!.height
+ )
- assertThat(iconPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
+ assertThat(iconPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
- assertThat(trailingPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
ds.width.toPx() - trailingSize.value!!.width -
expectedEndPadding.toPx()
)
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
}
}
@Test
fun listItem_threeLine_positioning_overline_trailingIcon() {
- val expectedTopPadding = 12.dp
- val expectedStartPadding = 16.dp
- val expectedContentStartPadding = 16.dp
- val expectedEndPadding = 24.dp
+ val expectedTopPadding = ListItemThreeLineVerticalPadding
+ val expectedStartPadding = ListItemStartPadding
+ val expectedContentStartPadding = LeadingContentEndPadding
+ val expectedEndPadding = ListItemEndPadding
val textPosition = Ref<Offset>()
val textSize = Ref<IntSize>()
@@ -455,43 +610,140 @@
val ds = rule.onRoot().getUnclippedBoundsInRoot()
rule.runOnIdleWithDensity {
- assertThat(textPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
- assertThat(textPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
expectedTopPadding.toPx() + overlineTextSize.value!!.height
)
- assertThat(secondaryTextPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
- assertThat(secondaryTextPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
expectedTopPadding.toPx() + overlineTextSize.value!!.height +
textSize.value!!.height
)
- assertThat(iconPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx()
)
- assertThat(iconPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(iconPosition.value!!.y).isWithin(1f).of(
expectedTopPadding.toPx()
)
- assertThat(trailingPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
ds.width.toPx() - trailingSize.value!!.width -
expectedEndPadding.toPx()
)
- assertThat(trailingPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
expectedTopPadding.toPx()
)
- assertThat(overlineTextPosition.value!!.x).isWithin(0.5f).of(
+ assertThat(overlineTextPosition.value!!.x).isWithin(1f).of(
expectedStartPadding.toPx() + iconSize.value!!.width +
expectedContentStartPadding.toPx()
)
- assertThat(overlineTextPosition.value!!.y).isWithin(0.5f).of(
+ assertThat(overlineTextPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
+ }
+ }
+
+ @Test
+ fun listItem_threeLine_overline_positioning_customSize() {
+ val listItemHeight = 100.dp
+ val listItemWidth = 300.dp
+ val expectedTopPadding = ListItemThreeLineVerticalPadding
+ val expectedStartPadding = ListItemStartPadding
+ val expectedEndPadding = ListItemEndPadding
+ val expectedTextStartPadding = LeadingContentEndPadding
+
+ val textPosition = Ref<Offset>()
+ val textSize = Ref<IntSize>()
+ val overlineTextPosition = Ref<Offset>()
+ val overlineTextSize = Ref<IntSize>()
+ val secondaryTextPosition = Ref<Offset>()
+ val secondaryTextSize = Ref<IntSize>()
+ val leadingIconPosition = Ref<Offset>()
+ val leadingIconSize = Ref<IntSize>()
+ val trailingPosition = Ref<Offset>()
+ val trailingSize = Ref<IntSize>()
+ rule.setMaterialContent(lightColorScheme()) {
+ ListItem(
+ modifier = Modifier.size(width = listItemWidth, height = listItemHeight),
+ overlineContent = {
+ Text(
+ "OVERLINE",
+ Modifier.saveLayout(overlineTextPosition, overlineTextSize)
+ )
+ },
+ headlineContent = {
+ Text("Primary text", Modifier.saveLayout(textPosition, textSize))
+ },
+ supportingContent = {
+ Text(
+ "Secondary text",
+ Modifier.saveLayout(secondaryTextPosition, secondaryTextSize)
+ )
+ },
+ leadingContent = {
+ Image(
+ icon24x24,
+ null,
+ Modifier.saveLayout(leadingIconPosition, leadingIconSize))
+ },
+ trailingContent = {
+ Text(
+ "meta",
+ Modifier.saveLayout(trailingPosition, trailingSize)
+ )
+ }
+ )
+ }
+ rule.runOnIdleWithDensity {
+ assertThat(leadingIconPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx()
+ )
+ assertThat(leadingIconPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
+
+ assertThat(overlineTextPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(overlineTextPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx()
+ )
+
+ assertThat(textPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(textPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx() + overlineTextSize.value!!.height
+ )
+
+ assertThat(secondaryTextPosition.value!!.x).isWithin(1f).of(
+ expectedStartPadding.toPx() +
+ leadingIconSize.value!!.width +
+ expectedTextStartPadding.toPx()
+ )
+ assertThat(secondaryTextPosition.value!!.y).isWithin(1f).of(
+ expectedTopPadding.toPx() + overlineTextSize.value!!.height +
+ textSize.value!!.height
+ )
+
+ assertThat(trailingPosition.value!!.x).isWithin(1f).of(
+ listItemWidth.toPx() - trailingSize.value!!.width -
+ expectedEndPadding.toPx()
+ )
+ assertThat(trailingPosition.value!!.y).isWithin(1f).of(
expectedTopPadding.toPx()
)
}
@@ -503,7 +755,7 @@
coords: Ref<Offset>,
size: Ref<IntSize>,
): Modifier = onGloballyPositioned { coordinates: LayoutCoordinates ->
- coords.value = coordinates.localToRoot(Offset.Zero)
+ coords.value = coordinates.positionInRoot()
size.value = coordinates.size
}
}
\ No newline at end of file
diff --git a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TimePickerTest.kt b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TimePickerTest.kt
index c514c93..d65f3d9 100644
--- a/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TimePickerTest.kt
+++ b/compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/TimePickerTest.kt
@@ -564,6 +564,15 @@
}
@Test
+ fun clockFace_12Hour_initAtNoon() {
+ val state = TimePickerState(initialHour = 12, initialMinute = 0, is24Hour = false)
+
+ assertThat(state.isAfternoonToggle).isTrue()
+
+ assertThat(state.hour).isEqualTo(12)
+ }
+
+ @Test
fun clockFace_24HourMinutes_everyValue() {
val state = TimePickerState(initialHour = 10, initialMinute = 23, is24Hour = true)
state.selection = Selection.Minute
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
index e1799f9..8e30c16 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/AppBar.kt
@@ -915,15 +915,24 @@
* Represents the colors used by a top app bar in different states.
* This implementation animates the container color according to the top app bar scroll state. It
* does not animate the leading, headline, or trailing colors.
+ *
+ * @constructor create an instance with arbitrary colors, see [TopAppBarColors] for a
+ * factory method using the default material3 spec
+ * @param containerColor the color used for the background of this BottomAppBar. Use
+ * [Color.Transparent] to have no color.
+ * @param scrolledContainerColor the container color when content is scrolled behind it
+ * @param navigationIconContentColor the content color used for the navigation icon
+ * @param titleContentColor the content color used for the title
+ * @param actionIconContentColor the content color used for actions
*/
@ExperimentalMaterial3Api
@Stable
-class TopAppBarColors internal constructor(
- private val containerColor: Color,
- private val scrolledContainerColor: Color,
- internal val navigationIconContentColor: Color,
- internal val titleContentColor: Color,
- internal val actionIconContentColor: Color,
+class TopAppBarColors constructor(
+ val containerColor: Color,
+ val scrolledContainerColor: Color,
+ val navigationIconContentColor: Color,
+ val titleContentColor: Color,
+ val actionIconContentColor: Color,
) {
/**
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
index 6580872..47cbc44 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Button.kt
@@ -905,16 +905,21 @@
/**
* Represents the container and content colors used in a button in different states.
*
+ * @constructor create an instance with arbitrary colors.
* - See [ButtonDefaults.buttonColors] for the default colors used in a [Button].
* - See [ButtonDefaults.elevatedButtonColors] for the default colors used in a [ElevatedButton].
* - See [ButtonDefaults.textButtonColors] for the default colors used in a [TextButton].
+ * @param containerColor the container color of this [Button] when enabled.
+ * @param contentColor the content color of this [Button] when enabled.
+ * @param disabledContainerColor the container color of this [Button] when not enabled.
+ * @param disabledContentColor the content color of this [Button] when not enabled.
*/
@Immutable
-class ButtonColors internal constructor(
- private val containerColor: Color,
- private val contentColor: Color,
- private val disabledContainerColor: Color,
- private val disabledContentColor: Color,
+class ButtonColors constructor(
+ val containerColor: Color,
+ val contentColor: Color,
+ val disabledContainerColor: Color,
+ val disabledContentColor: Color,
) {
/**
* Represents the container color for this button, depending on [enabled].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
index e952287..cf4ce4c 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Card.kt
@@ -720,16 +720,22 @@
/**
* Represents the container and content colors used in a card in different states.
*
+ * @constructor create an instance with arbitrary colors.
* - See [CardDefaults.cardColors] for the default colors used in a [Card].
* - See [CardDefaults.elevatedCardColors] for the default colors used in a [ElevatedCard].
* - See [CardDefaults.outlinedCardColors] for the default colors used in a [OutlinedCard].
+ *
+ * @param containerColor the container color of this [Card] when enabled.
+ * @param contentColor the content color of this [Card] when enabled.
+ * @param disabledContainerColor the container color of this [Card] when not enabled.
+ * @param disabledContentColor the content color of this [Card] when not enabled.
*/
@Immutable
-class CardColors internal constructor(
- private val containerColor: Color,
- private val contentColor: Color,
- private val disabledContainerColor: Color,
- private val disabledContentColor: Color,
+class CardColors constructor(
+ val containerColor: Color,
+ val contentColor: Color,
+ val disabledContainerColor: Color,
+ val disabledContentColor: Color,
) {
/**
* Represents the container color for this card, depending on [enabled].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt
index 010b841..55571a3 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt
@@ -373,22 +373,38 @@
* Represents the colors used by the three different sections (checkmark, box, and border) of a
* [Checkbox] or [TriStateCheckbox] in different states.
*
- * See [CheckboxDefaults.colors] for the default implementation that follows Material
- * specifications.
+ * @constructor create an instance with arbitrary colors, see [CheckboxDefaults.colors] for the
+ * default implementation that follows Material specifications.
+ *
+ * @param checkedCheckmarkColor color that will be used for the checkmark when checked
+ * @param uncheckedCheckmarkColor color that will be used for the checkmark when unchecked
+ * @param checkedBoxColor the color that will be used for the box when checked
+ * @param uncheckedBoxColor color that will be used for the box when unchecked
+ * @param disabledCheckedBoxColor color that will be used for the box when disabled and
+ * checked
+ * @param disabledUncheckedBoxColor color that will be used for the box and border when disabled
+ * and not checked
+ * @param disabledIndeterminateBoxColor color that will be used for the box and
+ * border in a [TriStateCheckbox] when disabled AND in an [ToggleableState.Indeterminate] state.
+ * @param checkedBorderColor color that will be used for the border when checked
+ * @param uncheckedBorderColor color that will be used for the border when unchecked
+ * @param disabledBorderColor color that will be used for the border when disabled
+ * @param disabledIndeterminateBorderColor color that will be used for the border when in an
+ * [ToggleableState.Indeterminate] state.
*/
@Immutable
-class CheckboxColors internal constructor(
- private val checkedCheckmarkColor: Color,
- private val uncheckedCheckmarkColor: Color,
- private val checkedBoxColor: Color,
- private val uncheckedBoxColor: Color,
- private val disabledCheckedBoxColor: Color,
- private val disabledUncheckedBoxColor: Color,
- private val disabledIndeterminateBoxColor: Color,
- private val checkedBorderColor: Color,
- private val uncheckedBorderColor: Color,
- private val disabledBorderColor: Color,
- private val disabledIndeterminateBorderColor: Color
+class CheckboxColors constructor(
+ val checkedCheckmarkColor: Color,
+ val uncheckedCheckmarkColor: Color,
+ val checkedBoxColor: Color,
+ val uncheckedBoxColor: Color,
+ val disabledCheckedBoxColor: Color,
+ val disabledUncheckedBoxColor: Color,
+ val disabledIndeterminateBoxColor: Color,
+ val checkedBorderColor: Color,
+ val uncheckedBorderColor: Color,
+ val disabledBorderColor: Color,
+ val disabledIndeterminateBorderColor: Color
) {
/**
* Represents the color used for the checkmark inside the checkbox, depending on [state].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
index 6f2b7ac..897d1d4 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Chip.kt
@@ -1599,16 +1599,22 @@
* Note that this default implementation does not take into consideration the `selectable` state
* passed into its [tonalElevation] and [shadowElevation]. If you wish to apply that state, use a
* different [SelectableChipElevation].
+ *
+ * @param pressedElevation the elevation used when the chip is pressed.
+ * @param focusedElevation the elevation used when the chip is focused
+ * @param hoveredElevation the elevation used when the chip is hovered
+ * @param draggedElevation the elevation used when the chip is dragged
+ * @param disabledElevation the elevation used when the chip is not enabled
*/
@ExperimentalMaterial3Api
@Immutable
class SelectableChipElevation internal constructor(
- private val elevation: Dp,
- private val pressedElevation: Dp,
- private val focusedElevation: Dp,
- private val hoveredElevation: Dp,
- private val draggedElevation: Dp,
- private val disabledElevation: Dp
+ val elevation: Dp,
+ val pressedElevation: Dp,
+ val focusedElevation: Dp,
+ val hoveredElevation: Dp,
+ val draggedElevation: Dp,
+ val disabledElevation: Dp
) {
/**
* Represents the tonal elevation used in a chip, depending on [enabled] and
@@ -1753,19 +1759,29 @@
/**
* Represents the container and content colors used in a clickable chip in different states.
*
- * See [AssistChipDefaults], [InputChipDefaults], and [SuggestionChipDefaults] for the default
- * colors used in the various Chip configurations.
+ * @constructor create an instance with arbitrary colors, see [AssistChipDefaults],
+ * [InputChipDefaults], and [SuggestionChipDefaults] for the default colors used in the various Chip
+ * configurations.
+ *
+ * @param containerColor the container color of this chip when enabled
+ * @param labelColor the label color of this chip when enabled
+ * @param leadingIconContentColor the color of this chip's start icon when enabled
+ * @param trailingIconContentColor the color of this chip's end icon when enabled
+ * @param disabledContainerColor the container color of this chip when not enabled
+ * @param disabledLabelColor the label color of this chip when not enabled
+ * @param disabledLeadingIconContentColor the color of this chip's start icon when not enabled
+ * @param disabledTrailingIconContentColor the color of this chip's end icon when not enabled
*/
@Immutable
-class ChipColors internal constructor(
- private val containerColor: Color,
- private val labelColor: Color,
- private val leadingIconContentColor: Color,
- private val trailingIconContentColor: Color,
- private val disabledContainerColor: Color,
- private val disabledLabelColor: Color,
- private val disabledLeadingIconContentColor: Color,
- private val disabledTrailingIconContentColor: Color
+class ChipColors constructor(
+ val containerColor: Color,
+ val labelColor: Color,
+ val leadingIconContentColor: Color,
+ val trailingIconContentColor: Color,
+ val disabledContainerColor: Color,
+ val disabledLabelColor: Color,
+ val disabledLeadingIconContentColor: Color,
+ val disabledTrailingIconContentColor: Color
// TODO(b/113855296): Support other states: hover, focus, drag
) {
/**
@@ -1850,7 +1866,7 @@
*/
@ExperimentalMaterial3Api
@Immutable
-class SelectableChipColors internal constructor(
+class SelectableChipColors constructor(
private val containerColor: Color,
private val labelColor: Color,
private val leadingIconColor: Color,
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
index 8ff82a1..2cd943d 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/DatePicker.kt
@@ -640,37 +640,72 @@
/**
* Represents the colors used by the date picker.
*
- * See [DatePickerDefaults.colors] for the default implementation that follows Material
- * specifications.
+ * @constructor create an instance with arbitrary colors, see [DatePickerDefaults.colors] for the
+ * default implementation that follows Material specifications.
+ *
+ * @param containerColor the color used for the date picker's background
+ * @param titleContentColor the color used for the date picker's title
+ * @param headlineContentColor the color used for the date picker's headline
+ * @param weekdayContentColor the color used for the weekday letters
+ * @param subheadContentColor the color used for the month and year subhead labels that appear
+ * when months are displayed at a `DateRangePicker`.
+ * @param navigationContentColor the content color used for the year selection menu button and
+ * the months arrow navigation when displayed at a `DatePicker`.
+ * @param yearContentColor the color used for a year item content
+ * @param disabledYearContentColor the color used for a disabled year item content
+ * @param currentYearContentColor the color used for the current year content when selecting a
+ * year
+ * @param selectedYearContentColor the color used for a selected year item content
+ * @param disabledSelectedYearContentColor the color used for a disabled selected year item
+ * content
+ * @param selectedYearContainerColor the color used for a selected year item container
+ * @param disabledSelectedYearContainerColor the color used for a disabled selected year item
+ * container
+ * @param dayContentColor the color used for days content
+ * @param disabledDayContentColor the color used for disabled days content
+ * @param selectedDayContentColor the color used for selected days content
+ * @param disabledSelectedDayContentColor the color used for disabled selected days content
+ * @param selectedDayContainerColor the color used for a selected day container
+ * @param disabledSelectedDayContainerColor the color used for a disabled selected day container
+ * @param todayContentColor the color used for the day that marks the current date
+ * @param todayDateBorderColor the color used for the border of the day that marks the current
+ * date
+ * @param dayInSelectionRangeContentColor the content color used for days that are within a date
+ * range selection
+ * @param dayInSelectionRangeContainerColor the container color used for days that are within a
+ * date range selection
+ * @param dividerColor the color used for the dividers used at the date pickers
+ * @param dateTextFieldColors the [TextFieldColors] defaults for the date text field when in
+ * [DisplayMode.Input]. See [OutlinedTextFieldDefaults.colors].
*/
@ExperimentalMaterial3Api
@Immutable
-class DatePickerColors internal constructor(
- internal val containerColor: Color,
- internal val titleContentColor: Color,
- internal val headlineContentColor: Color,
- internal val weekdayContentColor: Color,
- internal val subheadContentColor: Color,
- internal val navigationContentColor: Color,
- private val yearContentColor: Color,
- private val disabledYearContentColor: Color,
- private val currentYearContentColor: Color,
- private val selectedYearContentColor: Color,
- private val disabledSelectedYearContentColor: Color,
- private val selectedYearContainerColor: Color,
- private val disabledSelectedYearContainerColor: Color,
- private val dayContentColor: Color,
- private val disabledDayContentColor: Color,
- private val selectedDayContentColor: Color,
- private val disabledSelectedDayContentColor: Color,
- private val selectedDayContainerColor: Color,
- private val disabledSelectedDayContainerColor: Color,
- private val todayContentColor: Color,
- internal val todayDateBorderColor: Color,
- internal val dayInSelectionRangeContainerColor: Color,
- private val dayInSelectionRangeContentColor: Color,
- internal val dividerColor: Color,
- internal val dateTextFieldColors: TextFieldColors
+class DatePickerColors constructor(
+ val containerColor: Color,
+ val titleContentColor: Color,
+ val headlineContentColor: Color,
+ val weekdayContentColor: Color,
+ val subheadContentColor: Color,
+ val navigationContentColor: Color,
+ val yearContentColor: Color,
+ val disabledYearContentColor: Color,
+ val currentYearContentColor: Color,
+ val selectedYearContentColor: Color,
+ val disabledSelectedYearContentColor: Color,
+ val selectedYearContainerColor: Color,
+ val disabledSelectedYearContainerColor: Color,
+ val dayContentColor: Color,
+ val disabledDayContentColor: Color,
+ val selectedDayContentColor: Color,
+ val disabledSelectedDayContentColor: Color,
+ val selectedDayContainerColor: Color,
+ val disabledSelectedDayContainerColor: Color,
+ val todayContentColor: Color,
+ val todayDateBorderColor: Color,
+ val dayInSelectionRangeContainerColor: Color,
+ val dayInSelectionRangeContentColor: Color,
+ val dividerColor: Color,
+ val dateTextFieldColors: TextFieldColors
) {
/**
* Represents the content color for a calendar day.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
index abacad1..51ae14d 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/IconButton.kt
@@ -801,18 +801,24 @@
/**
* Represents the container and content colors used in an icon button in different states.
*
+ * @constructor create an instance with arbitrary colors.
* - See [IconButtonDefaults.filledIconButtonColors] and
* [IconButtonDefaults.filledTonalIconButtonColors] for the default colors used in a
* [FilledIconButton].
* - See [IconButtonDefaults.outlinedIconButtonColors] for the default colors used in an
* [OutlinedIconButton].
+ *
+ * @param containerColor the container color of this icon button when enabled.
+ * @param contentColor the content color of this icon button when enabled.
+ * @param disabledContainerColor the container color of this icon button when not enabled.
+ * @param disabledContentColor the content color of this icon button when not enabled.
*/
@Immutable
-class IconButtonColors internal constructor(
- private val containerColor: Color,
- private val contentColor: Color,
- private val disabledContainerColor: Color,
- private val disabledContentColor: Color,
+class IconButtonColors constructor(
+ val containerColor: Color,
+ val contentColor: Color,
+ val disabledContainerColor: Color,
+ val disabledContentColor: Color,
) {
/**
* Represents the container color for this icon button, depending on [enabled].
@@ -860,20 +866,28 @@
* Represents the container and content colors used in a toggleable icon button in
* different states.
*
+ * @constructor create an instance with arbitrary colors.
* - See [IconButtonDefaults.filledIconToggleButtonColors] and
* [IconButtonDefaults.filledTonalIconToggleButtonColors] for the default colors used in a
* [FilledIconButton].
* - See [IconButtonDefaults.outlinedIconToggleButtonColors] for the default colors used in a
* toggleable [OutlinedIconButton].
+ *
+ * @param containerColor the container color of this icon button when enabled.
+ * @param contentColor the content color of this icon button when enabled.
+ * @param disabledContainerColor the container color of this icon button when not enabled.
+ * @param disabledContentColor the content color of this icon button when not enabled.
+ * @param checkedContainerColor the container color of this icon button when checked.
+ * @param checkedContentColor the content color of this icon button when checked.
*/
@Immutable
-class IconToggleButtonColors internal constructor(
- private val containerColor: Color,
- private val contentColor: Color,
- private val disabledContainerColor: Color,
- private val disabledContentColor: Color,
- private val checkedContainerColor: Color,
- private val checkedContentColor: Color,
+class IconToggleButtonColors constructor(
+ val containerColor: Color,
+ val contentColor: Color,
+ val disabledContainerColor: Color,
+ val disabledContentColor: Color,
+ val checkedContainerColor: Color,
+ val checkedContentColor: Color,
) {
/**
* Represents the container color for this icon button, depending on [enabled] and [checked].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ListItem.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ListItem.kt
index ae11486..1bd20c5 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ListItem.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/ListItem.kt
@@ -16,13 +16,11 @@
package androidx.compose.material3
-import androidx.compose.foundation.layout.Arrangement
+import androidx.annotation.VisibleForTesting
import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.RowScope
-import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.calculateEndPadding
+import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.tokens.ListTokens
import androidx.compose.material3.tokens.TypographyKeyTokens
@@ -32,14 +30,24 @@
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.State
import androidx.compose.runtime.rememberUpdatedState
-import androidx.compose.ui.Alignment
import androidx.compose.ui.Alignment.Companion.CenterVertically
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
+import androidx.compose.ui.layout.FirstBaseline
+import androidx.compose.ui.layout.LastBaseline
+import androidx.compose.ui.layout.Layout
+import androidx.compose.ui.layout.MeasureResult
+import androidx.compose.ui.layout.MeasureScope
+import androidx.compose.ui.layout.Placeable
+import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.offset
+import kotlin.math.max
/**
* <a href="https://m3.material.io/components/lists/overview" class="external" target="_blank">Material Design list item.</a>
@@ -90,7 +98,7 @@
)
}
val decoratedSupportingContent: @Composable (() -> Unit)? = supportingContent?.let {
- @Composable {
+ {
ProvideTextStyleFromToken(
colors.supportingColor().value,
ListTokens.ListItemSupportingTextFont,
@@ -99,7 +107,7 @@
}
}
val decoratedOverlineContent: @Composable (() -> Unit)? = overlineContent?.let {
- @Composable {
+ {
ProvideTextStyleFromToken(
colors.overlineColor().value,
ListTokens.ListItemOverlineFont,
@@ -107,153 +115,264 @@
)
}
}
-
- val listItemType = ListItemType.getListItemType(
- hasOverline = decoratedOverlineContent != null,
- hasSupporting = decoratedSupportingContent != null
- )
- val isThreeLine = listItemType == ListItemType.ThreeLine
-
- val decoratedLeadingContent: @Composable (RowScope.() -> Unit)? = leadingContent?.let {
+ val decoratedLeadingContent: @Composable (() -> Unit)? = leadingContent?.let {
{
- LeadingContent(
- contentColor = colors.leadingIconColor(enabled = true).value,
- topAlign = isThreeLine,
- content = it
- )
+ Box(Modifier.padding(end = LeadingContentEndPadding)) {
+ CompositionLocalProvider(
+ LocalContentColor provides colors.leadingIconColor(enabled = true).value,
+ content = it
+ )
+ }
+ }
+ }
+ val decoratedTrailingContent: @Composable (() -> Unit)? = trailingContent?.let {
+ {
+ Box(Modifier.padding(start = TrailingContentStartPadding)) {
+ ProvideTextStyleFromToken(
+ colors.trailingIconColor(enabled = true).value,
+ ListTokens.ListItemTrailingSupportingTextFont,
+ content = it
+ )
+ }
}
}
- val decoratedTrailingContent: @Composable (RowScope.() -> Unit)? = trailingContent?.let {
- {
- TrailingContent(
- contentColor = colors.trailingIconColor(enabled = true).value,
- topAlign = isThreeLine,
- content = it
- )
- }
- }
- val minHeight: Dp = when (listItemType) {
- ListItemType.OneLine -> ListTokens.ListItemOneLineContainerHeight
- ListItemType.TwoLine -> ListTokens.ListItemTwoLineContainerHeight
- else -> ListTokens.ListItemThreeLineContainerHeight // 3
- }
- val verticalPadding = if (isThreeLine) ListItemThreeLineVerticalPadding else
- ListItemVerticalPadding
- val outerPaddingValues =
- PaddingValues(
- start = ListItemStartPadding,
- top = verticalPadding,
- end = ListItemEndPadding,
- bottom = verticalPadding,
- )
-
- ListItem(
- modifier = modifier,
- containerColor = colors.containerColor().value,
+ Surface(
+ modifier = Modifier.semantics(mergeDescendants = true) {}.then(modifier),
+ shape = ListItemDefaults.shape,
+ color = colors.containerColor().value,
contentColor = colors.headlineColor(enabled = true).value,
tonalElevation = tonalElevation,
shadowElevation = shadowElevation,
- minHeight = minHeight,
- paddingValues = outerPaddingValues
) {
- if (decoratedLeadingContent != null) {
- decoratedLeadingContent()
- }
- Column(
- modifier = Modifier
- .weight(1f)
- .align(if (isThreeLine) Alignment.Top else CenterVertically),
- verticalArrangement = if (isThreeLine) Arrangement.Top else Arrangement.Center
- ) {
- if (decoratedOverlineContent != null) {
- decoratedOverlineContent()
- }
- decoratedHeadlineContent()
- if (decoratedSupportingContent != null) {
- decoratedSupportingContent()
- }
- }
- if (decoratedTrailingContent != null) {
- decoratedTrailingContent()
- }
+ ListItemLayout(
+ headline = decoratedHeadlineContent,
+ overline = decoratedOverlineContent,
+ supporting = decoratedSupportingContent,
+ leading = decoratedLeadingContent,
+ trailing = decoratedTrailingContent,
+ )
}
}
-// TODO(b/233782301): Complete 3-line list item
-/**
- * <a href="https://m3.material.io/components/lists/overview" class="external" target="_blank">Material Design list item.</a>
- *
- * Lists are continuous, vertical indexes of text or images. For more opinionated List Items,
- * consider using another overload
- *
- * @param modifier [Modifier] to be applied to the list item
- * @param shape defines the list item's shape
- * @param containerColor the container color of this list item
- * @param contentColor the content color of this list item
- * @param tonalElevation the tonal elevation of this list item
- * @param shadowElevation the shadow elevation of this list item
- * @param content the content to be displayed in the middle section of this list item
- */
@Composable
-private fun ListItem(
- modifier: Modifier = Modifier,
- shape: Shape = ListItemDefaults.shape,
- containerColor: Color = ListItemDefaults.containerColor,
- contentColor: Color = ListItemDefaults.contentColor,
- tonalElevation: Dp = ListItemDefaults.Elevation,
- shadowElevation: Dp = ListItemDefaults.Elevation,
- minHeight: Dp,
- paddingValues: PaddingValues,
- content: @Composable RowScope.() -> Unit,
+private fun ListItemLayout(
+ leading: @Composable (() -> Unit)?,
+ trailing: @Composable (() -> Unit)?,
+ headline: @Composable () -> Unit,
+ overline: @Composable (() -> Unit)?,
+ supporting: @Composable (() -> Unit)?,
) {
- val semanticModifier = Modifier.semantics(mergeDescendants = true) { }.then(modifier)
- Surface(
- modifier = semanticModifier,
- shape = shape,
- color = containerColor,
- contentColor = contentColor,
- tonalElevation = tonalElevation,
- shadowElevation = shadowElevation,
- ) {
- Row(
- modifier = Modifier
- .heightIn(min = minHeight)
- .padding(paddingValues),
- content = content
+ val layoutDirection = LocalLayoutDirection.current
+ Layout(
+ contents = listOf(
+ headline,
+ overline ?: {},
+ supporting ?: {},
+ leading ?: {},
+ trailing ?: {},
+ )
+ ) { measurables, constraints ->
+ val (headlineMeasurable, overlineMeasurable, supportingMeasurable, leadingMeasurable,
+ trailingMeasurable) = measurables
+ var currentTotalWidth = 0
+
+ val looseConstraints = constraints.copy(minWidth = 0, minHeight = 0)
+ .offset(
+ horizontal = -(ListItemStartPadding + ListItemEndPadding).roundToPx(),
+ vertical = -(ListItemVerticalPadding * 2).roundToPx()
+ )
+
+ val leadingPlaceable = leadingMeasurable.firstOrNull()?.measure(looseConstraints)
+ currentTotalWidth += widthOrZero(leadingPlaceable)
+
+ val trailingPlaceable = trailingMeasurable.firstOrNull()?.measure(
+ looseConstraints.offset(
+ horizontal = -currentTotalWidth
+ ))
+ currentTotalWidth += widthOrZero(trailingPlaceable)
+
+ var currentTotalHeight = 0
+
+ val headlinePlaceable = headlineMeasurable.first().measure(
+ looseConstraints.offset(
+ horizontal = -currentTotalWidth
+ ))
+ currentTotalHeight += headlinePlaceable.height
+
+ val supportingPlaceable = supportingMeasurable.firstOrNull()?.measure(
+ looseConstraints.offset(
+ horizontal = -currentTotalWidth,
+ vertical = -currentTotalHeight
+ ))
+ currentTotalHeight += heightOrZero(supportingPlaceable)
+ val isSupportingMultiline = supportingPlaceable != null &&
+ (supportingPlaceable[FirstBaseline] != supportingPlaceable[LastBaseline])
+
+ val overlinePlaceable = overlineMeasurable.firstOrNull()?.measure(
+ looseConstraints.offset(
+ horizontal = -currentTotalWidth,
+ vertical = -currentTotalHeight
+ ))
+
+ val listItemType = ListItemType.getListItemType(
+ hasOverline = overlinePlaceable != null,
+ hasSupporting = supportingPlaceable != null,
+ isSupportingMultiline = isSupportingMultiline
+ )
+ val isThreeLine = listItemType == ListItemType.ThreeLine
+
+ val paddingValues = PaddingValues(
+ start = ListItemStartPadding,
+ end = ListItemEndPadding,
+ top = if (isThreeLine) ListItemThreeLineVerticalPadding else ListItemVerticalPadding,
+ bottom = if (isThreeLine) ListItemThreeLineVerticalPadding else ListItemVerticalPadding,
+ )
+
+ val width = calculateWidth(
+ leadingPlaceable = leadingPlaceable,
+ trailingPlaceable = trailingPlaceable,
+ headlinePlaceable = headlinePlaceable,
+ overlinePlaceable = overlinePlaceable,
+ supportingPlaceable = supportingPlaceable,
+ paddingValues = paddingValues,
+ layoutDirection = layoutDirection,
+ constraints = constraints,
+ )
+ val height = calculateHeight(
+ leadingPlaceable = leadingPlaceable,
+ trailingPlaceable = trailingPlaceable,
+ headlinePlaceable = headlinePlaceable,
+ overlinePlaceable = overlinePlaceable,
+ supportingPlaceable = supportingPlaceable,
+ listItemType = listItemType,
+ paddingValues = paddingValues,
+ constraints = constraints,
+ )
+
+ place(
+ width = width,
+ height = height,
+ leadingPlaceable = leadingPlaceable,
+ trailingPlaceable = trailingPlaceable,
+ headlinePlaceable = headlinePlaceable,
+ overlinePlaceable = overlinePlaceable,
+ supportingPlaceable = supportingPlaceable,
+ isThreeLine = isThreeLine,
+ layoutDirection = layoutDirection,
+ paddingValues = paddingValues,
)
}
}
-@Composable
-private fun RowScope.LeadingContent(
- contentColor: Color,
- topAlign: Boolean,
- content: @Composable () -> Unit,
-) = CompositionLocalProvider(LocalContentColor provides contentColor) {
- Box(
- Modifier
- .padding(end = LeadingContentEndPadding)
- .then(if (!topAlign) Modifier.align(CenterVertically) else Modifier),
- ) { content() }
+private fun MeasureScope.calculateWidth(
+ leadingPlaceable: Placeable?,
+ trailingPlaceable: Placeable?,
+ headlinePlaceable: Placeable,
+ overlinePlaceable: Placeable?,
+ supportingPlaceable: Placeable?,
+ layoutDirection: LayoutDirection,
+ paddingValues: PaddingValues,
+ constraints: Constraints,
+): Int {
+ if (constraints.hasBoundedWidth) {
+ return constraints.maxWidth
}
+ // Fallback behavior if width constraints are infinite
+ val horizontalPadding = (paddingValues.calculateLeftPadding(layoutDirection) +
+ paddingValues.calculateRightPadding(layoutDirection)).roundToPx()
+ val mainContentWidth = maxOf(
+ headlinePlaceable.width,
+ widthOrZero(overlinePlaceable),
+ widthOrZero(supportingPlaceable),
+ )
+ return horizontalPadding +
+ widthOrZero(leadingPlaceable) +
+ mainContentWidth +
+ widthOrZero(trailingPlaceable)
+}
-@Composable
-private fun RowScope.TrailingContent(
- contentColor: Color,
- topAlign: Boolean,
- content: @Composable () -> Unit,
-) = Box(
- Modifier
- .padding(start = TrailingContentStartPadding)
- .then(if (!topAlign) Modifier.align(CenterVertically) else Modifier),
- ) {
- ProvideTextStyleFromToken(
- contentColor,
- ListTokens.ListItemTrailingSupportingTextFont,
- content
- )
+private fun MeasureScope.calculateHeight(
+ leadingPlaceable: Placeable?,
+ trailingPlaceable: Placeable?,
+ headlinePlaceable: Placeable,
+ overlinePlaceable: Placeable?,
+ supportingPlaceable: Placeable?,
+ listItemType: ListItemType,
+ paddingValues: PaddingValues,
+ constraints: Constraints,
+): Int {
+ val defaultMinHeight = when (listItemType) {
+ ListItemType.OneLine -> ListTokens.ListItemOneLineContainerHeight
+ ListItemType.TwoLine -> ListTokens.ListItemTwoLineContainerHeight
+ else /* ListItemType.ThreeLine */ -> ListTokens.ListItemThreeLineContainerHeight
}
+ val minHeight = max(constraints.minHeight, defaultMinHeight.roundToPx())
+
+ val verticalPadding =
+ paddingValues.calculateTopPadding() + paddingValues.calculateBottomPadding()
+
+ val mainContentHeight = headlinePlaceable.height +
+ heightOrZero(overlinePlaceable) +
+ heightOrZero(supportingPlaceable)
+
+ return max(
+ minHeight,
+ verticalPadding.roundToPx() + maxOf(
+ heightOrZero(leadingPlaceable),
+ mainContentHeight,
+ heightOrZero(trailingPlaceable),
+ )
+ ).coerceAtMost(constraints.maxHeight)
+}
+
+private fun MeasureScope.place(
+ width: Int,
+ height: Int,
+ leadingPlaceable: Placeable?,
+ trailingPlaceable: Placeable?,
+ headlinePlaceable: Placeable,
+ overlinePlaceable: Placeable?,
+ supportingPlaceable: Placeable?,
+ isThreeLine: Boolean,
+ layoutDirection: LayoutDirection,
+ paddingValues: PaddingValues,
+): MeasureResult {
+ return layout(width, height) {
+ val startPadding = paddingValues.calculateStartPadding(layoutDirection).roundToPx()
+ val endPadding = paddingValues.calculateEndPadding(layoutDirection).roundToPx()
+ val topPadding = paddingValues.calculateTopPadding().roundToPx()
+
+ leadingPlaceable?.let {
+ it.placeRelative(
+ x = startPadding,
+ y = if (isThreeLine) topPadding else CenterVertically.align(it.height, height)
+ )
+ }
+ trailingPlaceable?.let {
+ it.placeRelative(
+ x = width - endPadding - it.width,
+ y = if (isThreeLine) topPadding else CenterVertically.align(it.height, height)
+ )
+ }
+
+ val mainContentX = startPadding + widthOrZero(leadingPlaceable)
+ val mainContentY = if (isThreeLine) { topPadding } else {
+ val totalHeight = headlinePlaceable.height + heightOrZero(overlinePlaceable) +
+ heightOrZero(supportingPlaceable)
+ CenterVertically.align(totalHeight, height)
+ }
+ var currentY = mainContentY
+
+ overlinePlaceable?.placeRelative(mainContentX, currentY)
+ currentY += heightOrZero(overlinePlaceable)
+
+ headlinePlaceable.placeRelative(mainContentX, currentY)
+ currentY += headlinePlaceable.height
+
+ supportingPlaceable?.placeRelative(mainContentX, currentY)
+ }
+}
/**
* Contains the default values used by list items.
@@ -325,19 +444,33 @@
/**
* Represents the container and content colors used in a list item in different states.
*
- * - See [ListItemDefaults.colors] for the default colors used in a [ListItem].
+ * @constructor create an instance with arbitrary colors.
+ * See [ListItemDefaults.colors] for the default colors used in a [ListItem].
+ *
+ * @param containerColor the container color of this list item when enabled.
+ * @param headlineColor the headline text content color of this list item when
+ * enabled.
+ * @param leadingIconColor the color of this list item's leading content when enabled.
+ * @param overlineColor the overline text color of this list item
+ * @param supportingTextColor the supporting text color of this list item
+ * @param trailingIconColor the color of this list item's trailing content when enabled.
+ * @param disabledHeadlineColor the content color of this list item when not enabled.
+ * @param disabledLeadingIconColor the color of this list item's leading content when not
+ * enabled.
+ * @param disabledTrailingIconColor the color of this list item's trailing content when not
+ * enabled.
*/
@Immutable
-class ListItemColors internal constructor(
- private val containerColor: Color,
- private val headlineColor: Color,
- private val leadingIconColor: Color,
- private val overlineColor: Color,
- private val supportingTextColor: Color,
- private val trailingIconColor: Color,
- private val disabledHeadlineColor: Color,
- private val disabledLeadingIconColor: Color,
- private val disabledTrailingIconColor: Color,
+class ListItemColors constructor(
+ val containerColor: Color,
+ val headlineColor: Color,
+ val leadingIconColor: Color,
+ val overlineColor: Color,
+ val supportingTextColor: Color,
+ val trailingIconColor: Color,
+ val disabledHeadlineColor: Color,
+ val disabledLeadingIconColor: Color,
+ val disabledTrailingIconColor: Color,
) {
/** The container color of this [ListItem] based on enabled state */
@Composable
@@ -413,9 +546,13 @@
/** Three line list item */
val ThreeLine = ListItemType(3)
- internal fun getListItemType(hasOverline: Boolean, hasSupporting: Boolean): ListItemType {
+ internal fun getListItemType(
+ hasOverline: Boolean,
+ hasSupporting: Boolean,
+ isSupportingMultiline: Boolean
+ ): ListItemType {
return when {
- hasOverline && hasSupporting -> ThreeLine
+ (hasOverline && hasSupporting) || isSupportingMultiline -> ThreeLine
hasOverline || hasSupporting -> TwoLine
else -> OneLine
}
@@ -425,15 +562,21 @@
// Container related defaults
// TODO: Make sure these values stay up to date until replaced with tokens.
-private val ListItemVerticalPadding = 8.dp
-private val ListItemThreeLineVerticalPadding = 12.dp
-private val ListItemStartPadding = 16.dp
-private val ListItemEndPadding = 24.dp
+@VisibleForTesting
+internal val ListItemVerticalPadding = 8.dp
+@VisibleForTesting
+internal val ListItemThreeLineVerticalPadding = 12.dp
+@VisibleForTesting
+internal val ListItemStartPadding = 16.dp
+@VisibleForTesting
+internal val ListItemEndPadding = 24.dp
// Icon related defaults.
// TODO: Make sure these values stay up to date until replaced with tokens.
-private val LeadingContentEndPadding = 16.dp
+@VisibleForTesting
+internal val LeadingContentEndPadding = 16.dp
// Trailing related defaults.
// TODO: Make sure these values stay up to date until replaced with tokens.
-private val TrailingContentStartPadding = 16.dp
+@VisibleForTesting
+internal val TrailingContentStartPadding = 16.dp
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
index 6356636..3788a3b 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Menu.kt
@@ -369,16 +369,27 @@
/**
* Represents the text and icon colors used in a menu item at different states.
*
- * - See [MenuDefaults.itemColors] for the default colors used in a [DropdownMenuItemContent].
+ * @constructor create an instance with arbitrary colors.
+ * See [MenuDefaults.itemColors] for the default colors used in a [DropdownMenuItemContent].
+ *
+ * @param textColor the text color of this [DropdownMenuItemContent] when enabled
+ * @param leadingIconColor the leading icon color of this [DropdownMenuItemContent] when enabled
+ * @param trailingIconColor the trailing icon color of this [DropdownMenuItemContent] when
+ * enabled
+ * @param disabledTextColor the text color of this [DropdownMenuItemContent] when not enabled
+ * @param disabledLeadingIconColor the leading icon color of this [DropdownMenuItemContent] when
+ * not enabled
+ * @param disabledTrailingIconColor the trailing icon color of this [DropdownMenuItemContent]
+ * when not enabled
*/
@Immutable
-class MenuItemColors internal constructor(
- private val textColor: Color,
- private val leadingIconColor: Color,
- private val trailingIconColor: Color,
- private val disabledTextColor: Color,
- private val disabledLeadingIconColor: Color,
- private val disabledTrailingIconColor: Color,
+class MenuItemColors constructor(
+ val textColor: Color,
+ val leadingIconColor: Color,
+ val trailingIconColor: Color,
+ val disabledTextColor: Color,
+ val disabledLeadingIconColor: Color,
+ val disabledTrailingIconColor: Color,
) {
/**
* Represents the text color for a menu item, depending on its [enabled] state.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
index 989ceba..bb9e6a2 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationBar.kt
@@ -331,15 +331,28 @@
)
}
+/**
+ * Represents the colors of the various elements of a navigation item.
+ *
+ * @constructor create an instance with arbitrary colors.
+ *
+ * @param selectedIconColor the color to use for the icon when the item is selected.
+ * @param selectedTextColor the color to use for the text label when the item is selected.
+ * @param selectedIndicatorColor the color to use for the indicator when the item is selected.
+ * @param unselectedIconColor the color to use for the icon when the item is unselected.
+ * @param unselectedTextColor the color to use for the text label when the item is unselected.
+ * @param disabledIconColor the color to use for the icon when the item is disabled.
+ * @param disabledTextColor the color to use for the text label when the item is disabled.
+*/
@Stable
-class NavigationBarItemColors internal constructor(
- private val selectedIconColor: Color,
- private val selectedTextColor: Color,
- private val selectedIndicatorColor: Color,
- private val unselectedIconColor: Color,
- private val unselectedTextColor: Color,
- private val disabledIconColor: Color,
- private val disabledTextColor: Color,
+class NavigationBarItemColors constructor(
+ val selectedIconColor: Color,
+ val selectedTextColor: Color,
+ val selectedIndicatorColor: Color,
+ val unselectedIconColor: Color,
+ val unselectedTextColor: Color,
+ val disabledIconColor: Color,
+ val disabledTextColor: Color,
) {
/**
* Represents the icon color for this item, depending on whether it is [selected].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
index 3647d4b..fcee888 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/NavigationRail.kt
@@ -328,16 +328,28 @@
)
}
-/** Represents the colors of the various elements of a navigation item. */
+/**
+ * Represents the colors of the various elements of a navigation item.
+ *
+ * @constructor create an instance with arbitrary colors.
+ *
+ * @param selectedIconColor the color to use for the icon when the item is selected.
+ * @param selectedTextColor the color to use for the text label when the item is selected.
+ * @param selectedIndicatorColor the color to use for the indicator when the item is selected.
+ * @param unselectedIconColor the color to use for the icon when the item is unselected.
+ * @param unselectedTextColor the color to use for the text label when the item is unselected.
+ * @param disabledIconColor the color to use for the icon when the item is disabled.
+ * @param disabledTextColor the color to use for the text label when the item is disabled.
+ */
@Stable
-class NavigationRailItemColors internal constructor(
- private val selectedIconColor: Color,
- private val selectedTextColor: Color,
- private val selectedIndicatorColor: Color,
- private val unselectedIconColor: Color,
- private val unselectedTextColor: Color,
- private val disabledIconColor: Color,
- private val disabledTextColor: Color,
+class NavigationRailItemColors constructor(
+ val selectedIconColor: Color,
+ val selectedTextColor: Color,
+ val selectedIndicatorColor: Color,
+ val unselectedIconColor: Color,
+ val unselectedTextColor: Color,
+ val disabledIconColor: Color,
+ val disabledTextColor: Color,
) {
/**
* Represents the icon color for this item, depending on whether it is [selected].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/RadioButton.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/RadioButton.kt
index ca727e5..101aed1 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/RadioButton.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/RadioButton.kt
@@ -162,15 +162,22 @@
/**
* Represents the color used by a [RadioButton] in different states.
*
+ * @constructor create an instance with arbitrary colors.
* See [RadioButtonDefaults.colors] for the default implementation that follows Material
* specifications.
+ *
+ * @param selectedColor the color to use for the RadioButton when selected and enabled.
+ * @param unselectedColor the color to use for the RadioButton when unselected and enabled.
+ * @param disabledSelectedColor the color to use for the RadioButton when disabled and selected.
+ * @param disabledUnselectedColor the color to use for the RadioButton when disabled and not
+ * selected.
*/
@Immutable
-class RadioButtonColors internal constructor(
- private val selectedColor: Color,
- private val unselectedColor: Color,
- private val disabledSelectedColor: Color,
- private val disabledUnselectedColor: Color
+class RadioButtonColors constructor(
+ val selectedColor: Color,
+ val unselectedColor: Color,
+ val disabledSelectedColor: Color,
+ val disabledUnselectedColor: Color
) {
/**
* Represents the main color used to draw the outer and inner circles, depending on whether
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
index 7e21534..6124a4c 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Slider.kt
@@ -1488,18 +1488,44 @@
}
}
+/**
+ * Represents the color used by a [Slider] in different states.
+ *
+ * @constructor create an instance with arbitrary colors.
+ * See [SliderDefaults.colors] for the default implementation that follows Material
+ * specifications.
+ *
+ * @param thumbColor thumb color when enabled
+ * @param activeTrackColor color of the track in the part that is "active", meaning that the
+ * thumb is ahead of it
+ * @param activeTickColor colors to be used to draw tick marks on the active track, if `steps`
+ * is specified
+ * @param inactiveTrackColor color of the track in the part that is "inactive", meaning that the
+ * thumb is before it
+ * @param inactiveTickColor colors to be used to draw tick marks on the inactive track, if
+ * `steps` are specified on the Slider is specified
+ * @param disabledThumbColor thumb colors when disabled
+ * @param disabledActiveTrackColor color of the track in the "active" part when the Slider is
+ * disabled
+ * @param disabledActiveTickColor colors to be used to draw tick marks on the active track
+ * when Slider is disabled and when `steps` are specified on it
+ * @param disabledInactiveTrackColor color of the track in the "inactive" part when the
+ * Slider is disabled
+ * @param disabledInactiveTickColor colors to be used to draw tick marks on the inactive part
+ * of the track when Slider is disabled and when `steps` are specified on it
+ */
@Immutable
-class SliderColors internal constructor(
- private val thumbColor: Color,
- private val activeTrackColor: Color,
- private val activeTickColor: Color,
- private val inactiveTrackColor: Color,
- private val inactiveTickColor: Color,
- private val disabledThumbColor: Color,
- private val disabledActiveTrackColor: Color,
- private val disabledActiveTickColor: Color,
- private val disabledInactiveTrackColor: Color,
- private val disabledInactiveTickColor: Color
+class SliderColors constructor(
+ val thumbColor: Color,
+ val activeTrackColor: Color,
+ val activeTickColor: Color,
+ val inactiveTrackColor: Color,
+ val inactiveTickColor: Color,
+ val disabledThumbColor: Color,
+ val disabledActiveTrackColor: Color,
+ val disabledActiveTickColor: Color,
+ val disabledInactiveTrackColor: Color,
+ val disabledInactiveTickColor: Color
) {
@Composable
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Switch.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Switch.kt
index e5e80146..01d9d73 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Switch.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Switch.kt
@@ -342,27 +342,45 @@
/**
* Represents the colors used by a [Switch] in different states
*
+ * @constructor create an instance with arbitrary colors.
* See [SwitchDefaults.colors] for the default implementation that follows Material
* specifications.
+ *
+ * @param checkedThumbColor the color used for the thumb when enabled and checked
+ * @param checkedTrackColor the color used for the track when enabled and checked
+ * @param checkedBorderColor the color used for the border when enabled and checked
+ * @param checkedIconColor the color used for the icon when enabled and checked
+ * @param uncheckedThumbColor the color used for the thumb when enabled and unchecked
+ * @param uncheckedTrackColor the color used for the track when enabled and unchecked
+ * @param uncheckedBorderColor the color used for the border when enabled and unchecked
+ * @param uncheckedIconColor the color used for the icon when enabled and unchecked
+ * @param disabledCheckedThumbColor the color used for the thumb when disabled and checked
+ * @param disabledCheckedTrackColor the color used for the track when disabled and checked
+ * @param disabledCheckedBorderColor the color used for the border when disabled and checked
+ * @param disabledCheckedIconColor the color used for the icon when disabled and checked
+ * @param disabledUncheckedThumbColor the color used for the thumb when disabled and unchecked
+ * @param disabledUncheckedTrackColor the color used for the track when disabled and unchecked
+ * @param disabledUncheckedBorderColor the color used for the border when disabled and unchecked
+ * @param disabledUncheckedIconColor the color used for the icon when disabled and unchecked
*/
@Immutable
-class SwitchColors internal constructor(
- private val checkedThumbColor: Color,
- private val checkedTrackColor: Color,
- private val checkedBorderColor: Color,
- private val checkedIconColor: Color,
- private val uncheckedThumbColor: Color,
- private val uncheckedTrackColor: Color,
- private val uncheckedBorderColor: Color,
- private val uncheckedIconColor: Color,
- private val disabledCheckedThumbColor: Color,
- private val disabledCheckedTrackColor: Color,
- private val disabledCheckedBorderColor: Color,
- private val disabledCheckedIconColor: Color,
- private val disabledUncheckedThumbColor: Color,
- private val disabledUncheckedTrackColor: Color,
- private val disabledUncheckedBorderColor: Color,
- private val disabledUncheckedIconColor: Color
+class SwitchColors constructor(
+ val checkedThumbColor: Color,
+ val checkedTrackColor: Color,
+ val checkedBorderColor: Color,
+ val checkedIconColor: Color,
+ val uncheckedThumbColor: Color,
+ val uncheckedTrackColor: Color,
+ val uncheckedBorderColor: Color,
+ val uncheckedIconColor: Color,
+ val disabledCheckedThumbColor: Color,
+ val disabledCheckedTrackColor: Color,
+ val disabledCheckedBorderColor: Color,
+ val disabledCheckedIconColor: Color,
+ val disabledUncheckedThumbColor: Color,
+ val disabledUncheckedTrackColor: Color,
+ val disabledUncheckedBorderColor: Color,
+ val disabledUncheckedIconColor: Color
) {
/**
* Represents the color used for the switch's thumb, depending on [enabled] and [checked].
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
index db2f2e7..7929f2e 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TextFieldDefaults.kt
@@ -1688,54 +1688,105 @@
* Represents the colors of the input text, container, and content (including label, placeholder,
* leading and trailing icons) used in a text field in different states.
*
+ * @constructor create an instance with arbitrary colors.
* See [TextFieldDefaults.colors] for the default colors used in [TextField].
* See [OutlinedTextFieldDefaults.colors] for the default colors used in [OutlinedTextField].
+ *
+ * @param focusedTextColor the color used for the input text of this text field when focused
+ * @param unfocusedTextColor the color used for the input text of this text field when not
+ * focused
+ * @param disabledTextColor the color used for the input text of this text field when disabled
+ * @param errorTextColor the color used for the input text of this text field when in error
+ * state
+ * @param focusedContainerColor the container color for this text field when focused
+ * @param unfocusedContainerColor the container color for this text field when not focused
+ * @param disabledContainerColor the container color for this text field when disabled
+ * @param errorContainerColor the container color for this text field when in error state
+ * @param cursorColor the cursor color for this text field
+ * @param errorCursorColor the cursor color for this text field when in error state
+ * @param textSelectionColors the colors used when the input text of this text field is selected
+ * @param focusedIndicatorColor the indicator color for this text field when focused
+ * @param unfocusedIndicatorColor the indicator color for this text field when not focused
+ * @param disabledIndicatorColor the indicator color for this text field when disabled
+ * @param errorIndicatorColor the indicator color for this text field when in error state
+ * @param focusedLeadingIconColor the leading icon color for this text field when focused
+ * @param unfocusedLeadingIconColor the leading icon color for this text field when not focused
+ * @param disabledLeadingIconColor the leading icon color for this text field when disabled
+ * @param errorLeadingIconColor the leading icon color for this text field when in error state
+ * @param focusedTrailingIconColor the trailing icon color for this text field when focused
+ * @param unfocusedTrailingIconColor the trailing icon color for this text field when not
+ * focused
+ * @param disabledTrailingIconColor the trailing icon color for this text field when disabled
+ * @param errorTrailingIconColor the trailing icon color for this text field when in error state
+ * @param focusedLabelColor the label color for this text field when focused
+ * @param unfocusedLabelColor the label color for this text field when not focused
+ * @param disabledLabelColor the label color for this text field when disabled
+ * @param errorLabelColor the label color for this text field when in error state
+ * @param focusedPlaceholderColor the placeholder color for this text field when focused
+ * @param unfocusedPlaceholderColor the placeholder color for this text field when not focused
+ * @param disabledPlaceholderColor the placeholder color for this text field when disabled
+ * @param errorPlaceholderColor the placeholder color for this text field when in error state
+ * @param focusedSupportingTextColor the supporting text color for this text field when focused
+ * @param unfocusedSupportingTextColor the supporting text color for this text field when not
+ * focused
+ * @param disabledSupportingTextColor the supporting text color for this text field when
+ * disabled
+ * @param errorSupportingTextColor the supporting text color for this text field when in error
+ * state
+ * @param focusedPrefixColor the prefix color for this text field when focused
+ * @param unfocusedPrefixColor the prefix color for this text field when not focused
+ * @param disabledPrefixColor the prefix color for this text field when disabled
+ * @param errorPrefixColor the prefix color for this text field when in error state
+ * @param focusedSuffixColor the suffix color for this text field when focused
+ * @param unfocusedSuffixColor the suffix color for this text field when not focused
+ * @param disabledSuffixColor the suffix color for this text field when disabled
+ * @param errorSuffixColor the suffix color for this text field when in error state
*/
@Immutable
-class TextFieldColors internal constructor(
- private val focusedTextColor: Color,
- private val unfocusedTextColor: Color,
- private val disabledTextColor: Color,
- private val errorTextColor: Color,
- private val focusedContainerColor: Color,
- private val unfocusedContainerColor: Color,
- private val disabledContainerColor: Color,
- private val errorContainerColor: Color,
- private val cursorColor: Color,
- private val errorCursorColor: Color,
- private val textSelectionColors: TextSelectionColors,
- private val focusedIndicatorColor: Color,
- private val unfocusedIndicatorColor: Color,
- private val disabledIndicatorColor: Color,
- private val errorIndicatorColor: Color,
- private val focusedLeadingIconColor: Color,
- private val unfocusedLeadingIconColor: Color,
- private val disabledLeadingIconColor: Color,
- private val errorLeadingIconColor: Color,
- private val focusedTrailingIconColor: Color,
- private val unfocusedTrailingIconColor: Color,
- private val disabledTrailingIconColor: Color,
- private val errorTrailingIconColor: Color,
- private val focusedLabelColor: Color,
- private val unfocusedLabelColor: Color,
- private val disabledLabelColor: Color,
- private val errorLabelColor: Color,
- private val focusedPlaceholderColor: Color,
- private val unfocusedPlaceholderColor: Color,
- private val disabledPlaceholderColor: Color,
- private val errorPlaceholderColor: Color,
- private val focusedSupportingTextColor: Color,
- private val unfocusedSupportingTextColor: Color,
- private val disabledSupportingTextColor: Color,
- private val errorSupportingTextColor: Color,
- private val focusedPrefixColor: Color,
- private val unfocusedPrefixColor: Color,
- private val disabledPrefixColor: Color,
- private val errorPrefixColor: Color,
- private val focusedSuffixColor: Color,
- private val unfocusedSuffixColor: Color,
- private val disabledSuffixColor: Color,
- private val errorSuffixColor: Color,
+class TextFieldColors constructor(
+ val focusedTextColor: Color,
+ val unfocusedTextColor: Color,
+ val disabledTextColor: Color,
+ val errorTextColor: Color,
+ val focusedContainerColor: Color,
+ val unfocusedContainerColor: Color,
+ val disabledContainerColor: Color,
+ val errorContainerColor: Color,
+ val cursorColor: Color,
+ val errorCursorColor: Color,
+ val textSelectionColors: TextSelectionColors,
+ val focusedIndicatorColor: Color,
+ val unfocusedIndicatorColor: Color,
+ val disabledIndicatorColor: Color,
+ val errorIndicatorColor: Color,
+ val focusedLeadingIconColor: Color,
+ val unfocusedLeadingIconColor: Color,
+ val disabledLeadingIconColor: Color,
+ val errorLeadingIconColor: Color,
+ val focusedTrailingIconColor: Color,
+ val unfocusedTrailingIconColor: Color,
+ val disabledTrailingIconColor: Color,
+ val errorTrailingIconColor: Color,
+ val focusedLabelColor: Color,
+ val unfocusedLabelColor: Color,
+ val disabledLabelColor: Color,
+ val errorLabelColor: Color,
+ val focusedPlaceholderColor: Color,
+ val unfocusedPlaceholderColor: Color,
+ val disabledPlaceholderColor: Color,
+ val errorPlaceholderColor: Color,
+ val focusedSupportingTextColor: Color,
+ val unfocusedSupportingTextColor: Color,
+ val disabledSupportingTextColor: Color,
+ val errorSupportingTextColor: Color,
+ val focusedPrefixColor: Color,
+ val unfocusedPrefixColor: Color,
+ val disabledPrefixColor: Color,
+ val errorPrefixColor: Color,
+ val focusedSuffixColor: Color,
+ val unfocusedSuffixColor: Color,
+ val disabledSuffixColor: Color,
+ val errorSuffixColor: Color,
) {
/**
* Represents the color used for the leading icon of this text field.
diff --git a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
index ca5f3c1..f179e9e 100644
--- a/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
+++ b/compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/TimePicker.kt
@@ -320,26 +320,52 @@
/**
* Represents the colors used by a [TimePicker] in different states
*
+ * @constructor create an instance with arbitrary colors.
* See [TimePickerDefaults.colors] for the default implementation that follows Material
* specifications.
+ *
+ * @param clockDialColor The color of the clock dial.
+ * @param clockDialSelectedContentColor the color of the numbers of the clock dial when they
+ * are selected or overlapping with the selector
+ * @param clockDialUnselectedContentColor the color of the numbers of the clock dial when they
+ * are unselected
+ * @param selectorColor The color of the clock dial selector.
+ * @param containerColor The container color of the time picker.
+ * @param periodSelectorBorderColor the color used for the border of the AM/PM toggle.
+ * @param periodSelectorSelectedContainerColor the color used for the selected container of
+ * the AM/PM toggle
+ * @param periodSelectorUnselectedContainerColor the color used for the unselected container
+ * of the AM/PM toggle
+ * @param periodSelectorSelectedContentColor color used for the selected content of
+ * the AM/PM toggle
+ * @param periodSelectorUnselectedContentColor color used for the unselected content
+ * of the AM/PM toggle
+ * @param timeSelectorSelectedContainerColor color used for the selected container of the
+ * display buttons to switch between hour and minutes
+ * @param timeSelectorUnselectedContainerColor color used for the unselected container of the
+ * display buttons to switch between hour and minutes
+ * @param timeSelectorSelectedContentColor color used for the selected content of the display
+ * buttons to switch between hour and minutes
+ * @param timeSelectorUnselectedContentColor color used for the unselected content of the
+ * display buttons to switch between hour and minutes
*/
@Immutable
@ExperimentalMaterial3Api
-class TimePickerColors internal constructor(
- internal val clockDialColor: Color,
- internal val selectorColor: Color,
- internal val containerColor: Color,
- internal val periodSelectorBorderColor: Color,
- private val clockDialSelectedContentColor: Color,
- private val clockDialUnselectedContentColor: Color,
- private val periodSelectorSelectedContainerColor: Color,
- private val periodSelectorUnselectedContainerColor: Color,
- private val periodSelectorSelectedContentColor: Color,
- private val periodSelectorUnselectedContentColor: Color,
- private val timeSelectorSelectedContainerColor: Color,
- private val timeSelectorUnselectedContainerColor: Color,
- private val timeSelectorSelectedContentColor: Color,
- private val timeSelectorUnselectedContentColor: Color,
+class TimePickerColors constructor(
+ val clockDialColor: Color,
+ val selectorColor: Color,
+ val containerColor: Color,
+ val periodSelectorBorderColor: Color,
+ val clockDialSelectedContentColor: Color,
+ val clockDialUnselectedContentColor: Color,
+ val periodSelectorSelectedContainerColor: Color,
+ val periodSelectorUnselectedContainerColor: Color,
+ val periodSelectorSelectedContentColor: Color,
+ val periodSelectorUnselectedContentColor: Color,
+ val timeSelectorSelectedContainerColor: Color,
+ val timeSelectorUnselectedContainerColor: Color,
+ val timeSelectorSelectedContentColor: Color,
+ val timeSelectorUnselectedContentColor: Color,
) {
internal fun periodSelectorContainerColor(selected: Boolean) =
if (selected) {
@@ -496,7 +522,7 @@
) {
init {
require(initialHour in 0..23) { "initialHour should in [0..23] range" }
- require(initialHour in 0..59) { "initialMinute should be in [0..59] range" }
+ require(initialMinute in 0..59) { "initialMinute should be in [0..59] range" }
}
val minute: Int get() = minuteAngle.toMinute()
@@ -524,7 +550,7 @@
internal val values get() = if (selection == Selection.Minute) Minutes else Hours
internal var selection by mutableStateOf(Selection.Hour)
- internal var isAfternoonToggle by mutableStateOf(initialHour > 12 && !is24Hour)
+ internal var isAfternoonToggle by mutableStateOf(initialHour >= 12 && !is24Hour)
internal var isInnerCircle by mutableStateOf(initialHour >= 12)
internal var hourAngle by mutableFloatStateOf(
diff --git a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetector.kt b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetector.kt
index b013276..06d4a03 100644
--- a/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetector.kt
+++ b/compose/runtime/runtime-lint/src/main/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetector.kt
@@ -172,7 +172,7 @@
"specialized primitive state implementation for `Int`, `Long`, `Float`, and " +
"`Double` when the state does not need to track null values and does not " +
"override the default `SnapshotMutationPolicy`.",
- category = Category.PERFORMANCE, priority = 3, severity = Severity.WARNING,
+ category = Category.PERFORMANCE, priority = 3, severity = Severity.INFORMATIONAL,
implementation = Implementation(
AutoboxingStateCreationDetector::class.java,
EnumSet.of(Scope.JAVA_FILE)
diff --git a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.kt b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.kt
index 06eb0d1..35b6b07 100644
--- a/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.kt
+++ b/compose/runtime/runtime-lint/src/test/java/androidx/compose/runtime/lint/AutoboxingStateCreationDetectorTest.kt
@@ -94,10 +94,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
val state = mutableStateOf<$type>($stateValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -130,10 +130,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
val state = mutableStateOf($stateValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -166,10 +166,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
val state = mutableStateOf<$fqType>($stateValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -202,10 +202,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
var state by mutableStateOf<$type>($stateValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -238,10 +238,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
var state by mutableStateOf($stateValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -274,10 +274,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/Test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/Test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
var state by mutableStateOf(initialValue)
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -310,10 +310,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
var state: $type by mutableStateOf($stateValue)
${" ".repeat(type.length)} ~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
@@ -368,10 +368,10 @@
)
).run().expect(
"""
-src/androidx/compose/runtime/lint/test/test.kt:8: Warning: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
+src/androidx/compose/runtime/lint/test/test.kt:8: Information: Prefer mutable${type}StateOf instead of mutableStateOf [AutoboxingStateCreation]
val state = mutableStateOf($stateValue, structuralEqualityPolicy())
~~~~~~~~~~~~~~
-0 errors, 1 warnings
+0 errors, 0 warnings
"""
).expectFixDiffs(
"""
diff --git a/compose/ui/ui-text/api/current.txt b/compose/ui/ui-text/api/current.txt
index e93dd1d..ba3232f 100644
--- a/compose/ui/ui-text/api/current.txt
+++ b/compose/ui/ui-text/api/current.txt
@@ -1125,6 +1125,7 @@
method public void startInput(androidx.compose.ui.text.input.TextFieldValue value, androidx.compose.ui.text.input.ImeOptions imeOptions, kotlin.jvm.functions.Function1<? super java.util.List<? extends androidx.compose.ui.text.input.EditCommand>,kotlin.Unit> onEditCommand, kotlin.jvm.functions.Function1<? super androidx.compose.ui.text.input.ImeAction,kotlin.Unit> onImeActionPerformed);
method public void stopInput();
method public void updateState(androidx.compose.ui.text.input.TextFieldValue? oldValue, androidx.compose.ui.text.input.TextFieldValue newValue);
+ method public default void updateTextLayoutResult(androidx.compose.ui.text.input.TextFieldValue textFieldValue, androidx.compose.ui.text.TextLayoutResult textLayoutResult, long textLayoutPositionInWindow, androidx.compose.ui.geometry.Rect innerTextFieldBounds, androidx.compose.ui.geometry.Rect decorationBoxBounds);
}
public final class SetComposingRegionCommand implements androidx.compose.ui.text.input.EditCommand {
@@ -1200,6 +1201,7 @@
method public boolean notifyFocusedRect(androidx.compose.ui.geometry.Rect rect);
method public boolean showSoftwareKeyboard();
method public boolean updateState(androidx.compose.ui.text.input.TextFieldValue? oldValue, androidx.compose.ui.text.input.TextFieldValue newValue);
+ method public boolean updateTextLayoutResult(androidx.compose.ui.text.input.TextFieldValue textFieldValue, androidx.compose.ui.text.TextLayoutResult textLayoutResult, long textLayoutPositionInWindow, androidx.compose.ui.geometry.Rect innerTextFieldBounds, androidx.compose.ui.geometry.Rect decorationBoxBounds);
property public final boolean isOpen;
}
diff --git a/compose/ui/ui-text/api/restricted_current.txt b/compose/ui/ui-text/api/restricted_current.txt
index e93dd1d..ba3232f 100644
--- a/compose/ui/ui-text/api/restricted_current.txt
+++ b/compose/ui/ui-text/api/restricted_current.txt
@@ -1125,6 +1125,7 @@
method public void startInput(androidx.compose.ui.text.input.TextFieldValue value, androidx.compose.ui.text.input.ImeOptions imeOptions, kotlin.jvm.functions.Function1<? super java.util.List<? extends androidx.compose.ui.text.input.EditCommand>,kotlin.Unit> onEditCommand, kotlin.jvm.functions.Function1<? super androidx.compose.ui.text.input.ImeAction,kotlin.Unit> onImeActionPerformed);
method public void stopInput();
method public void updateState(androidx.compose.ui.text.input.TextFieldValue? oldValue, androidx.compose.ui.text.input.TextFieldValue newValue);
+ method public default void updateTextLayoutResult(androidx.compose.ui.text.input.TextFieldValue textFieldValue, androidx.compose.ui.text.TextLayoutResult textLayoutResult, long textLayoutPositionInWindow, androidx.compose.ui.geometry.Rect innerTextFieldBounds, androidx.compose.ui.geometry.Rect decorationBoxBounds);
}
public final class SetComposingRegionCommand implements androidx.compose.ui.text.input.EditCommand {
@@ -1200,6 +1201,7 @@
method public boolean notifyFocusedRect(androidx.compose.ui.geometry.Rect rect);
method public boolean showSoftwareKeyboard();
method public boolean updateState(androidx.compose.ui.text.input.TextFieldValue? oldValue, androidx.compose.ui.text.input.TextFieldValue newValue);
+ method public boolean updateTextLayoutResult(androidx.compose.ui.text.input.TextFieldValue textFieldValue, androidx.compose.ui.text.TextLayoutResult textLayoutResult, long textLayoutPositionInWindow, androidx.compose.ui.geometry.Rect innerTextFieldBounds, androidx.compose.ui.geometry.Rect decorationBoxBounds);
property public final boolean isOpen;
}
diff --git a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
index 74046f65..3067cef 100644
--- a/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
+++ b/compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/input/TextInputService.kt
@@ -16,8 +16,10 @@
package androidx.compose.ui.text.input
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.text.AtomicReference
+import androidx.compose.ui.text.TextLayoutResult
/**
* Handles communication with the IME. Informs about the IME changes via [EditCommand]s and
@@ -111,6 +113,7 @@
// TODO(b/183448615) @InternalTextApi
fun hideSoftwareKeyboard(): Unit = platformTextInputService.hideSoftwareKeyboard()
}
+
/**
* Represents a input session for interactions between a soft keyboard and editable text.
*
@@ -175,6 +178,33 @@
}
/**
+ * Notify the input service of layout and position changes.
+ *
+ * @param textFieldValue the text field's [TextFieldValue]
+ * @param textLayoutResult the text field's [TextLayoutResult]
+ * @param textLayoutPositionInWindow position of the text field relative to the window
+ * @param innerTextFieldBounds visible bounds of the text field in local coordinates, or an
+ * empty rectangle if the text field is not visible
+ * @param decorationBoxBounds visible bounds of the decoration box in local coordinates, or an
+ * empty rectangle if the decoration box is not visible
+ */
+ fun updateTextLayoutResult(
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResult,
+ textLayoutPositionInWindow: Offset,
+ innerTextFieldBounds: Rect,
+ decorationBoxBounds: Rect
+ ) = ensureOpenSession {
+ platformTextInputService.updateTextLayoutResult(
+ textFieldValue,
+ textLayoutResult,
+ textLayoutPositionInWindow,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ }
+
+ /**
* Notify IME about the new [TextFieldValue] and latest state of the editing buffer. [oldValue]
* is the state of the buffer before the changes applied by the [newValue].
*
@@ -270,10 +300,10 @@
*/
fun hideSoftwareKeyboard()
- /*
+ /**
* Notify the new editor model to IME.
*
- * @see TextInputService.updateState
+ * @see TextInputSession.updateState
*/
fun updateState(oldValue: TextFieldValue?, newValue: TextFieldValue)
@@ -287,4 +317,18 @@
// TODO(b/262648050) Try to find a better API.
fun notifyFocusedRect(rect: Rect) {
}
+
+ /**
+ * Notify the input service of layout and position changes.
+ *
+ * @see TextInputSession.updateTextLayoutResult
+ */
+ fun updateTextLayoutResult(
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResult,
+ textLayoutPositionInWindow: Offset,
+ innerTextFieldBounds: Rect,
+ decorationBoxBounds: Rect
+ ) {
+ }
}
diff --git a/compose/ui/ui-tooling-preview/api/current.txt b/compose/ui/ui-tooling-preview/api/current.txt
index ed0685d9..80f655a 100644
--- a/compose/ui/ui-tooling-preview/api/current.txt
+++ b/compose/ui/ui-tooling-preview/api/current.txt
@@ -69,6 +69,15 @@
method public abstract androidx.compose.ui.tooling.preview.Preview[] value();
}
+ @androidx.compose.ui.tooling.preview.Preview(name="Red", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.RED_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Blue", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.BLUE_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Green", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.GREEN_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Yellow", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.YELLOW_DOMINATED_EXAMPLE) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewDynamicColors {
+ }
+
+ @androidx.compose.ui.tooling.preview.Preview(name="85%", fontScale=0.85f) @androidx.compose.ui.tooling.preview.Preview(name="100%", fontScale=1.0f) @androidx.compose.ui.tooling.preview.Preview(name="115%", fontScale=1.15f) @androidx.compose.ui.tooling.preview.Preview(name="130%", fontScale=1.3f) @androidx.compose.ui.tooling.preview.Preview(name="150%", fontScale=1.5f) @androidx.compose.ui.tooling.preview.Preview(name="180%", fontScale=1.8f) @androidx.compose.ui.tooling.preview.Preview(name="200%", fontScale=2.0f) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewFontScale {
+ }
+
+ @androidx.compose.ui.tooling.preview.Preview(name="Light") @androidx.compose.ui.tooling.preview.Preview(name="Dark", uiMode=android.content.res.Configuration.UI_MODE_NIGHT_YES | android.content.res.Configuration.UI_MODE_TYPE_NORMAL) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewLightDark {
+ }
+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface PreviewParameter {
method public abstract int limit() default kotlin.jvm.internal.IntCompanionObject.MAX_VALUE;
method public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider();
@@ -83,6 +92,9 @@
property public abstract kotlin.sequences.Sequence<T> values;
}
+ @androidx.compose.ui.tooling.preview.Preview(name="Phone", device=androidx.compose.ui.tooling.preview.Devices.PHONE) @androidx.compose.ui.tooling.preview.Preview(name="Phone - Landscape", device="spec:width = 411dp, height = 891dp, orientation = landscape, dpi = 420") @androidx.compose.ui.tooling.preview.Preview(name="Unfolded Foldable", device=androidx.compose.ui.tooling.preview.Devices.FOLDABLE) @androidx.compose.ui.tooling.preview.Preview(name="Tablet", device=androidx.compose.ui.tooling.preview.Devices.TABLET) @androidx.compose.ui.tooling.preview.Preview(name="Desktop", device=androidx.compose.ui.tooling.preview.Devices.DESKTOP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewScreenSizes {
+ }
+
public final class Wallpapers {
field public static final int BLUE_DOMINATED_EXAMPLE = 2; // 0x2
field public static final int GREEN_DOMINATED_EXAMPLE = 1; // 0x1
diff --git a/compose/ui/ui-tooling-preview/api/restricted_current.txt b/compose/ui/ui-tooling-preview/api/restricted_current.txt
index ed0685d9..80f655a 100644
--- a/compose/ui/ui-tooling-preview/api/restricted_current.txt
+++ b/compose/ui/ui-tooling-preview/api/restricted_current.txt
@@ -69,6 +69,15 @@
method public abstract androidx.compose.ui.tooling.preview.Preview[] value();
}
+ @androidx.compose.ui.tooling.preview.Preview(name="Red", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.RED_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Blue", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.BLUE_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Green", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.GREEN_DOMINATED_EXAMPLE) @androidx.compose.ui.tooling.preview.Preview(name="Yellow", wallpaper=androidx.compose.ui.tooling.preview.Wallpapers.YELLOW_DOMINATED_EXAMPLE) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewDynamicColors {
+ }
+
+ @androidx.compose.ui.tooling.preview.Preview(name="85%", fontScale=0.85f) @androidx.compose.ui.tooling.preview.Preview(name="100%", fontScale=1.0f) @androidx.compose.ui.tooling.preview.Preview(name="115%", fontScale=1.15f) @androidx.compose.ui.tooling.preview.Preview(name="130%", fontScale=1.3f) @androidx.compose.ui.tooling.preview.Preview(name="150%", fontScale=1.5f) @androidx.compose.ui.tooling.preview.Preview(name="180%", fontScale=1.8f) @androidx.compose.ui.tooling.preview.Preview(name="200%", fontScale=2.0f) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewFontScale {
+ }
+
+ @androidx.compose.ui.tooling.preview.Preview(name="Light") @androidx.compose.ui.tooling.preview.Preview(name="Dark", uiMode=android.content.res.Configuration.UI_MODE_NIGHT_YES | android.content.res.Configuration.UI_MODE_TYPE_NORMAL) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewLightDark {
+ }
+
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) public @interface PreviewParameter {
method public abstract int limit() default kotlin.jvm.internal.IntCompanionObject.MAX_VALUE;
method public abstract kotlin.reflect.KClass<? extends androidx.compose.ui.tooling.preview.PreviewParameterProvider<?>> provider();
@@ -83,6 +92,9 @@
property public abstract kotlin.sequences.Sequence<T> values;
}
+ @androidx.compose.ui.tooling.preview.Preview(name="Phone", device=androidx.compose.ui.tooling.preview.Devices.PHONE) @androidx.compose.ui.tooling.preview.Preview(name="Phone - Landscape", device="spec:width = 411dp, height = 891dp, orientation = landscape, dpi = 420") @androidx.compose.ui.tooling.preview.Preview(name="Unfolded Foldable", device=androidx.compose.ui.tooling.preview.Devices.FOLDABLE) @androidx.compose.ui.tooling.preview.Preview(name="Tablet", device=androidx.compose.ui.tooling.preview.Devices.TABLET) @androidx.compose.ui.tooling.preview.Preview(name="Desktop", device=androidx.compose.ui.tooling.preview.Devices.DESKTOP) @kotlin.annotation.Retention(kotlin.annotation.AnnotationRetention.BINARY) @kotlin.annotation.Target(allowedTargets={kotlin.annotation.AnnotationTarget.ANNOTATION_CLASS, kotlin.annotation.AnnotationTarget.FUNCTION}) public @interface PreviewScreenSizes {
+ }
+
public final class Wallpapers {
field public static final int BLUE_DOMINATED_EXAMPLE = 2; // 0x2
field public static final int GREEN_DOMINATED_EXAMPLE = 1; // 0x1
diff --git a/compose/ui/ui-tooling-preview/src/androidMain/kotlin/androidx/compose/ui/tooling/preview/MultiPreviews.kt b/compose/ui/ui-tooling-preview/src/androidMain/kotlin/androidx/compose/ui/tooling/preview/MultiPreviews.kt
new file mode 100644
index 0000000..866d472
--- /dev/null
+++ b/compose/ui/ui-tooling-preview/src/androidMain/kotlin/androidx/compose/ui/tooling/preview/MultiPreviews.kt
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.ui.tooling.preview
+
+import android.content.res.Configuration.UI_MODE_NIGHT_YES
+import android.content.res.Configuration.UI_MODE_TYPE_NORMAL
+import androidx.compose.ui.tooling.preview.Devices.DESKTOP
+import androidx.compose.ui.tooling.preview.Devices.FOLDABLE
+import androidx.compose.ui.tooling.preview.Devices.PHONE
+import androidx.compose.ui.tooling.preview.Devices.TABLET
+import androidx.compose.ui.tooling.preview.Wallpapers.BLUE_DOMINATED_EXAMPLE
+import androidx.compose.ui.tooling.preview.Wallpapers.GREEN_DOMINATED_EXAMPLE
+import androidx.compose.ui.tooling.preview.Wallpapers.RED_DOMINATED_EXAMPLE
+import androidx.compose.ui.tooling.preview.Wallpapers.YELLOW_DOMINATED_EXAMPLE
+
+/**
+ * A MultiPreview annotation for displaying a @[Composable] method using the screen sizes of five different reference devices.
+ */
+@Retention(AnnotationRetention.BINARY)
+@Target(
+ AnnotationTarget.ANNOTATION_CLASS,
+ AnnotationTarget.FUNCTION
+)
+@Preview(name = "Phone", device = PHONE)
+@Preview(name = "Phone - Landscape",
+ device = "spec:width = 411dp, height = 891dp, orientation = landscape, dpi = 420")
+@Preview(name = "Unfolded Foldable", device = FOLDABLE)
+@Preview(name = "Tablet", device = TABLET)
+@Preview(name = "Desktop", device = DESKTOP)
+annotation class PreviewScreenSizes
+
+/**
+ * A MultiPreview annotation for desplaying a @[Composable] method using seven standard font sizes.
+ */
+@Retention(AnnotationRetention.BINARY)
+@Target(
+ AnnotationTarget.ANNOTATION_CLASS,
+ AnnotationTarget.FUNCTION
+)
+@Preview(name = "85%", fontScale = 0.85f)
+@Preview(name = "100%", fontScale = 1.0f)
+@Preview(name = "115%", fontScale = 1.15f)
+@Preview(name = "130%", fontScale = 1.3f)
+@Preview(name = "150%", fontScale = 1.5f)
+@Preview(name = "180%", fontScale = 1.8f)
+@Preview(name = "200%", fontScale = 2f)
+annotation class PreviewFontScale
+
+/**
+ * A MultiPreview annotation for desplaying a @[Composable] method using light and dark themes.
+ *
+ * Note that the app theme should support dark and light modes for these previews to be different.
+ */
+@Retention(AnnotationRetention.BINARY)
+@Target(
+ AnnotationTarget.ANNOTATION_CLASS,
+ AnnotationTarget.FUNCTION
+)
+@Preview(name = "Light")
+@Preview(name = "Dark", uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL)
+annotation class PreviewLightDark
+
+/**
+ * A MultiPreview annotation for desplaying a @[Composable] method using four different wallpaper colors.
+ *
+ * Note that the app should use a dynamic theme for these previews to be different.
+ */
+@Retention(AnnotationRetention.BINARY)
+@Target(
+ AnnotationTarget.ANNOTATION_CLASS,
+ AnnotationTarget.FUNCTION
+)
+@Preview(name = "Red", wallpaper = RED_DOMINATED_EXAMPLE)
+@Preview(name = "Blue", wallpaper = BLUE_DOMINATED_EXAMPLE)
+@Preview(name = "Green", wallpaper = GREEN_DOMINATED_EXAMPLE)
+@Preview(name = "Yellow", wallpaper = YELLOW_DOMINATED_EXAMPLE)
+annotation class PreviewDynamicColors
diff --git a/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/ComposeViewAdapterTest.kt b/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/ComposeViewAdapterTest.kt
index a8dfc85..a63a2c0 100644
--- a/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/ComposeViewAdapterTest.kt
+++ b/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/ComposeViewAdapterTest.kt
@@ -603,6 +603,10 @@
"androidx.compose.ui.tooling.SimpleComposablePreviewKt",
"Multipreview"
)
+ assertRendersCorrectly(
+ "androidx.compose.ui.tooling.SimpleComposablePreviewKt",
+ "MultiPreviews"
+ )
}
/**
diff --git a/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt b/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
index 12bde52..4b4e147 100644
--- a/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
+++ b/compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
@@ -29,8 +29,12 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.tooling.preview.Preview
+import androidx.compose.ui.tooling.preview.PreviewDynamicColors
+import androidx.compose.ui.tooling.preview.PreviewFontScale
+import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.tooling.preview.PreviewParameter
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
+import androidx.compose.ui.tooling.preview.PreviewScreenSizes
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.viewmodel.compose.viewModel
@@ -155,6 +159,15 @@
}
}
+@PreviewDynamicColors
+@PreviewFontScale
+@PreviewLightDark
+@PreviewScreenSizes
+@Composable
+fun MultiPreviews() {
+ Text("MultiPreviews test")
+}
+
class TestContentParameterProviderBoolean : PreviewParameterProvider<Boolean> {
override val values: Sequence<Boolean>
get() = sequenceOf(false, true)
diff --git a/compose/ui/ui/build.gradle b/compose/ui/ui/build.gradle
index 3ad4391..22541cb 100644
--- a/compose/ui/ui/build.gradle
+++ b/compose/ui/ui/build.gradle
@@ -84,7 +84,7 @@
implementation(libs.kotlinCoroutinesAndroid)
implementation("androidx.activity:activity-ktx:1.7.0")
- implementation(project(":core:core"))
+ implementation("androidx.core:core:1.11.0-beta02")
implementation('androidx.collection:collection:1.0.0')
implementation("androidx.customview:customview-poolingcontainer:1.0.0")
implementation("androidx.savedstate:savedstate-ktx:1.2.1")
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/RecordingInputConnectionTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/RecordingInputConnectionTest.kt
index ed4776e..8232cfc 100644
--- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/RecordingInputConnectionTest.kt
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/RecordingInputConnectionTest.kt
@@ -16,8 +16,10 @@
package androidx.compose.ui.input
+import android.os.Build
import android.view.KeyEvent
import android.view.inputmethod.CorrectionInfo
+import android.view.inputmethod.InputConnection
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.CommitTextCommand
import androidx.compose.ui.text.input.DeleteSurroundingTextCommand
@@ -31,6 +33,7 @@
import androidx.compose.ui.text.input.SetSelectionCommand
import androidx.compose.ui.text.input.TextFieldValue
import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SdkSuppress
import androidx.test.filters.SmallTest
import com.google.common.truth.Truth.assertThat
import org.junit.Assert.assertTrue
@@ -151,6 +154,56 @@
assertThat(ic.getSelectedText(0)).isEqualTo("Hello, World")
}
+ @SdkSuppress(maxSdkVersion = Build.VERSION_CODES.S_V2)
+ @Test
+ fun requestCursorUpdates_preT() {
+ ic.requestCursorUpdates(
+ InputConnection.CURSOR_UPDATE_IMMEDIATE or InputConnection.CURSOR_UPDATE_MONITOR
+ )
+
+ verify(mCallback)
+ .onRequestCursorAnchorInfo(
+ immediate = true,
+ monitor = true,
+ includeInsertionMarker = true,
+ includeCharacterBounds = true,
+ includeEditorBounds = false
+ )
+ }
+
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.TIRAMISU)
+ @Test
+ fun requestCursorUpdates_atLeastT_filterFlags() {
+ ic.requestCursorUpdates(
+ InputConnection.CURSOR_UPDATE_MONITOR or
+ InputConnection.CURSOR_UPDATE_FILTER_EDITOR_BOUNDS
+ )
+
+ verify(mCallback)
+ .onRequestCursorAnchorInfo(
+ immediate = false,
+ monitor = true,
+ includeInsertionMarker = false,
+ includeCharacterBounds = false,
+ includeEditorBounds = true
+ )
+ }
+
+ @SdkSuppress(minSdkVersion = Build.VERSION_CODES.TIRAMISU)
+ @Test
+ fun requestCursorUpdates_atLeastT_noFilterFlags() {
+ ic.requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE)
+
+ verify(mCallback)
+ .onRequestCursorAnchorInfo(
+ immediate = true,
+ monitor = false,
+ includeInsertionMarker = true,
+ includeCharacterBounds = true,
+ includeEditorBounds = true
+ )
+ }
+
@Test
fun commitTextTest() {
val captor = argumentCaptor<List<EditCommand>>()
diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/TextInputServiceAndroidCursorAnchorInfoTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/TextInputServiceAndroidCursorAnchorInfoTest.kt
new file mode 100644
index 0000000..d4a44fb
--- /dev/null
+++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/TextInputServiceAndroidCursorAnchorInfoTest.kt
@@ -0,0 +1,411 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.ui.input
+
+import android.graphics.Matrix
+import android.view.Choreographer
+import android.view.View
+import android.view.inputmethod.CursorAnchorInfo
+import android.view.inputmethod.EditorInfo
+import android.view.inputmethod.InputConnection
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Rect
+import androidx.compose.ui.text.AnnotatedString
+import androidx.compose.ui.text.MultiParagraph
+import androidx.compose.ui.text.TextLayoutInput
+import androidx.compose.ui.text.TextLayoutResult
+import androidx.compose.ui.text.TextRange
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.Font
+import androidx.compose.ui.text.font.FontStyle
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.font.createFontFamilyResolver
+import androidx.compose.ui.text.font.toFontFamily
+import androidx.compose.ui.text.input.ImeOptions
+import androidx.compose.ui.text.input.InputMethodManager
+import androidx.compose.ui.text.input.RecordingInputConnection
+import androidx.compose.ui.text.input.TextFieldValue
+import androidx.compose.ui.text.input.TextInputServiceAndroid
+import androidx.compose.ui.text.input.asExecutor
+import androidx.compose.ui.text.input.build
+import androidx.compose.ui.text.style.TextOverflow
+import androidx.compose.ui.unit.Constraints
+import androidx.compose.ui.unit.Density
+import androidx.compose.ui.unit.IntSize
+import androidx.compose.ui.unit.LayoutDirection
+import androidx.compose.ui.unit.sp
+import androidx.test.espresso.Espresso
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.testutils.fonts.R
+import kotlin.math.ceil
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.clearInvocations
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class TextInputServiceAndroidCursorAnchorInfoTest {
+ private val context = InstrumentationRegistry.getInstrumentation().context
+ private val defaultDensity = Density(density = 1f)
+ private val fontFamilyMeasureFont =
+ Font(resId = R.font.sample_font, weight = FontWeight.Normal, style = FontStyle.Normal)
+ .toFontFamily()
+
+ private lateinit var textInputService: TextInputServiceAndroid
+ private lateinit var inputMethodManager: InputMethodManager
+ private lateinit var inputConnection: RecordingInputConnection
+
+ private val builder = CursorAnchorInfo.Builder()
+ private val matrix = Matrix()
+
+ @Before
+ fun setup() {
+ val view = View(InstrumentationRegistry.getInstrumentation().context)
+ inputMethodManager = mock() { on { isActive() } doReturn true }
+ // Choreographer must be retrieved on main thread.
+ val choreographer = Espresso.onIdle { Choreographer.getInstance() }
+ textInputService =
+ TextInputServiceAndroid(
+ view,
+ inputMethodManager,
+ inputCommandProcessorExecutor = choreographer.asExecutor()
+ )
+ textInputService.startInput(
+ value = TextFieldValue(""),
+ imeOptions = ImeOptions.Default,
+ onEditCommand = {},
+ onImeActionPerformed = {}
+ )
+ inputConnection =
+ textInputService.createInputConnection(EditorInfo()) as RecordingInputConnection
+ }
+
+ @Test
+ fun requestCursorUpdates_immediate() {
+ val textFieldValue =
+ TextFieldValue("abc", selection = TextRange(2), composition = TextRange(1, 2))
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ val textLayoutResult = getTextLayoutResult(textFieldValue.text)
+ var textLayoutPositionInWindow = Offset(1f, 1f)
+ val innerTextFieldBounds = Rect.Zero
+ val decorationBoxBounds = Rect.Zero
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ inputConnection.requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE)
+
+ // Immediate update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected)
+
+ clearInvocations(inputMethodManager)
+ textLayoutPositionInWindow = Offset(2f, 2f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // No further updates since monitoring is off
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+ }
+
+ @Test
+ fun requestCursorUpdates_immediate_beforeUpdateTextLayoutResult() {
+ val textFieldValue =
+ TextFieldValue("abc", selection = TextRange(2), composition = TextRange(1, 2))
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ inputConnection.requestCursorUpdates(InputConnection.CURSOR_UPDATE_IMMEDIATE)
+
+ // No immediate update until updateTextLayoutResult call
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+
+ val textLayoutResult = getTextLayoutResult(textFieldValue.text)
+ var textLayoutPositionInWindow = Offset(1f, 1f)
+ val innerTextFieldBounds = Rect.Zero
+ val decorationBoxBounds = Rect.Zero
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // Immediate update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected)
+
+ clearInvocations(inputMethodManager)
+ textLayoutPositionInWindow = Offset(2f, 2f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // No further updates since monitoring is off
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+ }
+
+ @Test
+ fun requestCursorUpdates_monitor() {
+ var textFieldValue =
+ TextFieldValue("abc", selection = TextRange(2), composition = TextRange(1, 2))
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ val textLayoutResult = getTextLayoutResult(textFieldValue.text)
+ var textLayoutPositionInWindow = Offset(1f, 1f)
+ val innerTextFieldBounds = Rect.Zero
+ val decorationBoxBounds = Rect.Zero
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ inputConnection.requestCursorUpdates(InputConnection.CURSOR_UPDATE_MONITOR)
+
+ // No immediate update
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+
+ clearInvocations(inputMethodManager)
+ textLayoutPositionInWindow = Offset(2f, 2f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // Monitoring update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected)
+
+ clearInvocations(inputMethodManager)
+ textFieldValue = TextFieldValue("ac")
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ // No monitoring update until updateTextLayoutResult call
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+
+ clearInvocations(inputMethodManager)
+ textLayoutPositionInWindow = Offset(3f, 3f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // Monitoring update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected2 =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected2)
+ }
+
+ @Test
+ fun requestCursorUpdates_immediateAndMonitor() {
+ val textFieldValue =
+ TextFieldValue("abc", selection = TextRange(2), composition = TextRange(1, 2))
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ val textLayoutResult = getTextLayoutResult(textFieldValue.text)
+ var textLayoutPositionInWindow = Offset(1f, 1f)
+ val innerTextFieldBounds = Rect.Zero
+ val decorationBoxBounds = Rect.Zero
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ inputConnection.requestCursorUpdates(
+ InputConnection.CURSOR_UPDATE_IMMEDIATE or InputConnection.CURSOR_UPDATE_MONITOR
+ )
+
+ // Immediate update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected)
+
+ clearInvocations(inputMethodManager)
+ textLayoutPositionInWindow = Offset(2f, 2f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // Monitoring update
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow.x, textLayoutPositionInWindow.y)
+ val expected2 =
+ builder.build(
+ textFieldValue,
+ textLayoutResult,
+ matrix,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ verify(inputMethodManager).updateCursorAnchorInfo(expected2)
+ }
+
+ @Test
+ fun requestCursorUpdates_cancel() {
+ val textFieldValue =
+ TextFieldValue("abc", selection = TextRange(2), composition = TextRange(1, 2))
+ textInputService.updateState(oldValue = textFieldValue, newValue = textFieldValue)
+
+ val textLayoutResult = getTextLayoutResult(textFieldValue.text)
+ var textLayoutPositionInWindow = Offset(1f, 1f)
+ val innerTextFieldBounds = Rect.Zero
+ val decorationBoxBounds = Rect.Zero
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ inputConnection.requestCursorUpdates(
+ InputConnection.CURSOR_UPDATE_IMMEDIATE or InputConnection.CURSOR_UPDATE_MONITOR
+ )
+
+ // Immediate update
+ verify(inputMethodManager).updateCursorAnchorInfo(any())
+
+ clearInvocations(inputMethodManager)
+ inputConnection.requestCursorUpdates(0) // cancel updates
+
+ // No immediate update
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+
+ textLayoutPositionInWindow = Offset(2f, 2f)
+ textInputService.updateTextLayoutResult(
+ textFieldValue = textFieldValue,
+ textLayoutResult = textLayoutResult,
+ textLayoutPositionInWindow = textLayoutPositionInWindow,
+ innerTextFieldBounds = innerTextFieldBounds,
+ decorationBoxBounds = decorationBoxBounds
+ )
+
+ // No monitoring update
+ verify(inputMethodManager, never()).updateCursorAnchorInfo(any())
+ }
+
+ private fun getTextLayoutResult(text: String): TextLayoutResult {
+ val width = 1000
+ val fontFamilyResolver = createFontFamilyResolver(context)
+
+ val input =
+ TextLayoutInput(
+ text = AnnotatedString(text),
+ style = TextStyle(fontFamily = fontFamilyMeasureFont, fontSize = 12.sp),
+ placeholders = listOf(),
+ maxLines = Int.MAX_VALUE,
+ softWrap = true,
+ overflow = TextOverflow.Visible,
+ density = defaultDensity,
+ layoutDirection = LayoutDirection.Ltr,
+ fontFamilyResolver = fontFamilyResolver,
+ constraints = Constraints(maxWidth = width)
+ )
+
+ val paragraph =
+ MultiParagraph(
+ annotatedString = input.text,
+ style = input.style,
+ constraints = Constraints(maxWidth = width),
+ density = input.density,
+ fontFamilyResolver = fontFamilyResolver
+ )
+
+ return TextLayoutResult(input, paragraph, IntSize(width, ceil(paragraph.height).toInt()))
+ }
+}
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/CursorAnchorInfoController.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/CursorAnchorInfoController.kt
new file mode 100644
index 0000000..5af5e07
--- /dev/null
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/CursorAnchorInfoController.kt
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.compose.ui.text.input
+
+import android.graphics.Matrix
+import android.view.inputmethod.CursorAnchorInfo
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.geometry.Rect
+import androidx.compose.ui.text.TextLayoutResult
+
+internal class CursorAnchorInfoController(private val inputMethodManager: InputMethodManager) {
+ private var monitorEnabled = false
+ private var hasPendingImmediateRequest = false
+
+ private var includeInsertionMarker = false
+ private var includeCharacterBounds = false
+ private var includeEditorBounds = false
+
+ private var textFieldValue: TextFieldValue? = null
+ private var textLayoutResult: TextLayoutResult? = null
+ private var textLayoutPositionInWindow: Offset? = null
+ private var innerTextFieldBounds: Rect? = null
+ private var decorationBoxBounds: Rect? = null
+
+ private val builder = CursorAnchorInfo.Builder()
+ private val matrix = Matrix()
+
+ /**
+ * Requests [CursorAnchorInfo] updates to be provided to the [InputMethodManager].
+ *
+ * Combinations of [immediate] and [monitor] are used to specify when to provide updates. If
+ * these are both false, then no further updates will be provided.
+ *
+ * @param immediate whether to update with the current [CursorAnchorInfo] immediately, or as
+ * soon as available
+ * @param monitor whether to provide [CursorAnchorInfo] updates for all future layout or
+ * position changes
+ * @param includeInsertionMarker whether to include insertion marker (i.e. cursor) location
+ * information
+ * @param includeCharacterBounds whether to include character bounds information for the
+ * composition range
+ * @param includeEditorBounds whether to include editor bounds information
+ */
+ fun requestUpdate(
+ immediate: Boolean,
+ monitor: Boolean,
+ includeInsertionMarker: Boolean,
+ includeCharacterBounds: Boolean,
+ includeEditorBounds: Boolean
+ ) {
+ this.includeInsertionMarker = includeInsertionMarker
+ this.includeCharacterBounds = includeCharacterBounds
+ this.includeEditorBounds = includeEditorBounds
+
+ if (immediate) {
+ hasPendingImmediateRequest = true
+ if (textFieldValue != null) {
+ updateCursorAnchorInfo()
+ }
+ }
+ monitorEnabled = monitor
+ }
+
+ /**
+ * Notify the controller of layout and position changes.
+ *
+ * @param textFieldValue the text field's [TextFieldValue]
+ * @param textLayoutResult the text field's [TextLayoutResult]
+ * @param textLayoutPositionInWindow position of the text field relative to the window
+ * @param innerTextFieldBounds visible bounds of the text field in local coordinates, or an
+ * empty rectangle if the text field is not visible
+ * @param decorationBoxBounds visible bounds of the decoration box in local coordinates, or an
+ * empty rectangle if the decoration box is not visible
+ */
+ fun updateTextLayoutResult(
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResult,
+ textLayoutPositionInWindow: Offset,
+ innerTextFieldBounds: Rect,
+ decorationBoxBounds: Rect
+ ) {
+ this.textFieldValue = textFieldValue
+ this.textLayoutResult = textLayoutResult
+ this.textLayoutPositionInWindow = textLayoutPositionInWindow
+ this.innerTextFieldBounds = innerTextFieldBounds
+ this.decorationBoxBounds = decorationBoxBounds
+
+ if (hasPendingImmediateRequest || monitorEnabled) {
+ updateCursorAnchorInfo()
+ }
+ }
+
+ /**
+ * Invalidate the last received layout and position data.
+ *
+ * This should be called when the [TextFieldValue] has changed, so the last received layout and
+ * position data is no longer valid. [CursorAnchorInfo] updates will not be sent until new
+ * layout and position data is received.
+ */
+ fun invalidate() {
+ textFieldValue = null
+ textLayoutResult = null
+ textLayoutPositionInWindow = null
+ innerTextFieldBounds = null
+ decorationBoxBounds = null
+ }
+
+ private fun updateCursorAnchorInfo() {
+ if (!inputMethodManager.isActive()) return
+
+ matrix.reset()
+ matrix.postTranslate(textLayoutPositionInWindow!!.x, textLayoutPositionInWindow!!.y)
+
+ inputMethodManager.updateCursorAnchorInfo(
+ builder.build(
+ textFieldValue!!,
+ textLayoutResult!!,
+ matrix,
+ innerTextFieldBounds!!,
+ decorationBoxBounds!!,
+ includeInsertionMarker,
+ includeCharacterBounds,
+ includeEditorBounds
+ )
+ )
+
+ hasPendingImmediateRequest = false
+ }
+}
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputEventCallback2.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputEventCallback2.android.kt
index 36a4079..bb01aca 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputEventCallback2.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputEventCallback2.android.kt
@@ -42,6 +42,19 @@
fun onKeyEvent(event: KeyEvent)
/**
+ * Called when IME requests cursor information updates.
+ *
+ * @see CursorAnchorInfoController.requestUpdate
+ */
+ fun onRequestCursorAnchorInfo(
+ immediate: Boolean,
+ monitor: Boolean,
+ includeInsertionMarker: Boolean,
+ includeCharacterBounds: Boolean,
+ includeEditorBounds: Boolean
+ )
+
+ /**
* Called when IME closed the input connection.
*
* @param ic a closed input connection
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputMethodManager.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputMethodManager.kt
index 4bb1b10..32c9fc7 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputMethodManager.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/InputMethodManager.kt
@@ -19,10 +19,13 @@
import android.content.Context
import android.util.Log
import android.view.View
+import android.view.inputmethod.CursorAnchorInfo
import android.view.inputmethod.ExtractedText
import androidx.core.view.SoftwareKeyboardControllerCompat
internal interface InputMethodManager {
+ fun isActive(): Boolean
+
fun restartInput()
fun showSoftInput()
@@ -40,6 +43,8 @@
compositionStart: Int,
compositionEnd: Int
)
+
+ fun updateCursorAnchorInfo(cursorAnchorInfo: CursorAnchorInfo)
}
/**
@@ -56,6 +61,8 @@
private val softwareKeyboardControllerCompat =
SoftwareKeyboardControllerCompat(view)
+ override fun isActive(): Boolean = imm.isActive(view)
+
override fun restartInput() {
imm.restartInput(view)
}
@@ -87,4 +94,8 @@
) {
imm.updateSelection(view, selectionStart, selectionEnd, compositionStart, compositionEnd)
}
+
+ override fun updateCursorAnchorInfo(cursorAnchorInfo: CursorAnchorInfo) {
+ imm.updateCursorAnchorInfo(view, cursorAnchorInfo)
+ }
}
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/RecordingInputConnection.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/RecordingInputConnection.android.kt
index f234d53..189e751 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/RecordingInputConnection.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/RecordingInputConnection.android.kt
@@ -16,6 +16,7 @@
package androidx.compose.ui.text.input
+import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.text.TextUtils
@@ -257,9 +258,38 @@
}
override fun requestCursorUpdates(cursorUpdateMode: Int): Boolean = ensureActive {
- if (DEBUG) { logDebug("requestCursorUpdates($cursorUpdateMode)") }
- Log.w(TAG, "requestCursorUpdates is not supported")
- return false
+ val immediate = cursorUpdateMode and InputConnection.CURSOR_UPDATE_IMMEDIATE != 0
+ val monitor = cursorUpdateMode and InputConnection.CURSOR_UPDATE_MONITOR != 0
+ if (DEBUG) {
+ logDebug(
+ "requestCursorUpdates($cursorUpdateMode=[immediate:$immediate, monitor: $monitor])"
+ )
+ }
+
+ // Before Android T, filter flags are not used, and insertion marker and character bounds
+ // info are always included.
+ var includeInsertionMarker = true
+ var includeCharacterBounds = true
+ var includeEditorBounds = false
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
+ includeInsertionMarker =
+ cursorUpdateMode and InputConnection.CURSOR_UPDATE_FILTER_INSERTION_MARKER != 0
+ includeCharacterBounds =
+ cursorUpdateMode and InputConnection.CURSOR_UPDATE_FILTER_CHARACTER_BOUNDS != 0
+ includeEditorBounds =
+ cursorUpdateMode and InputConnection.CURSOR_UPDATE_FILTER_EDITOR_BOUNDS != 0
+ // If no filter flags are used, then all info should be included.
+ if (!includeInsertionMarker && !includeCharacterBounds && !includeEditorBounds) {
+ includeInsertionMarker = true
+ includeCharacterBounds = true
+ includeEditorBounds = true
+ }
+ }
+
+ eventCallback.onRequestCursorAnchorInfo(
+ immediate, monitor, includeInsertionMarker, includeCharacterBounds, includeEditorBounds
+ )
+ return true
}
override fun getExtractedText(request: ExtractedTextRequest?, flags: Int): ExtractedText {
diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
index 411909b..b1e7a48 100644
--- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
+++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroid.android.kt
@@ -28,8 +28,10 @@
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputConnection
import androidx.compose.runtime.collection.mutableVectorOf
+import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.text.ExperimentalTextApi
+import androidx.compose.ui.text.TextLayoutResult
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.TextInputServiceAndroid.TextInputCommand.HideKeyboard
import androidx.compose.ui.text.input.TextInputServiceAndroid.TextInputCommand.ShowKeyboard
@@ -92,6 +94,8 @@
private var focusedRect: AndroidRect? = null
+ private val cursorAnchorInfoController = CursorAnchorInfoController(inputMethodManager)
+
/**
* A channel that is used to debounce rapid operations such as showing/hiding the keyboard and
* starting/stopping input, so we can make the minimal number of calls on the
@@ -136,6 +140,22 @@
baseInputConnection.sendKeyEvent(event)
}
+ override fun onRequestCursorAnchorInfo(
+ immediate: Boolean,
+ monitor: Boolean,
+ includeInsertionMarker: Boolean,
+ includeCharacterBounds: Boolean,
+ includeEditorBounds: Boolean
+ ) {
+ cursorAnchorInfoController.requestUpdate(
+ immediate,
+ monitor,
+ includeInsertionMarker,
+ includeCharacterBounds,
+ includeEditorBounds
+ )
+ }
+
override fun onConnectionClosed(ic: RecordingInputConnection) {
for (i in 0 until ics.size) {
if (ics[i].get() == ic) {
@@ -322,6 +342,7 @@
for (i in 0 until ics.size) {
ics[i].get()?.mTextFieldValue = newValue
}
+ cursorAnchorInfoController.invalidate()
if (oldValue == newValue) {
if (DEBUG) {
@@ -382,6 +403,22 @@
}
}
+ override fun updateTextLayoutResult(
+ textFieldValue: TextFieldValue,
+ textLayoutResult: TextLayoutResult,
+ textLayoutPositionInWindow: Offset,
+ innerTextFieldBounds: Rect,
+ decorationBoxBounds: Rect
+ ) {
+ cursorAnchorInfoController.updateTextLayoutResult(
+ textFieldValue,
+ textLayoutResult,
+ textLayoutPositionInWindow,
+ innerTextFieldBounds,
+ decorationBoxBounds
+ )
+ }
+
/** Immediately restart the IME connection, bypassing the [textInputCommandQueue]. */
private fun restartInputImmediately() {
if (DEBUG) Log.d(TAG, "$DEBUG_CLASS.restartInputImmediately")
diff --git a/compose/ui/ui/src/test/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroidCommandDebouncingTest.kt b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroidCommandDebouncingTest.kt
index 4fd72dc..c50568b 100644
--- a/compose/ui/ui/src/test/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroidCommandDebouncingTest.kt
+++ b/compose/ui/ui/src/test/kotlin/androidx/compose/ui/text/input/TextInputServiceAndroidCommandDebouncingTest.kt
@@ -17,6 +17,7 @@
package androidx.compose.ui.text.input
import android.view.View
+import android.view.inputmethod.CursorAnchorInfo
import android.view.inputmethod.ExtractedText
import com.google.common.truth.Truth.assertThat
import java.util.concurrent.Executor
@@ -270,6 +271,8 @@
var showSoftInputCalls = 0
var hideSoftInputCalls = 0
+ override fun isActive(): Boolean = true
+
override fun restartInput() {
restartCalls++
}
@@ -292,5 +295,8 @@
compositionEnd: Int
) {
}
+
+ override fun updateCursorAnchorInfo(cursorAnchorInfo: CursorAnchorInfo) {
+ }
}
-}
\ No newline at end of file
+}
diff --git a/development/importMaven/src/main/kotlin/androidx/build/importMaven/Main.kt b/development/importMaven/src/main/kotlin/androidx/build/importMaven/Main.kt
index bd5716f..8730816 100644
--- a/development/importMaven/src/main/kotlin/androidx/build/importMaven/Main.kt
+++ b/development/importMaven/src/main/kotlin/androidx/build/importMaven/Main.kt
@@ -27,11 +27,11 @@
import com.github.ajalt.clikt.parameters.options.option
import com.github.ajalt.clikt.parameters.options.required
import com.github.ajalt.clikt.parameters.types.int
+import kotlin.system.exitProcess
import okio.FileSystem
import okio.Path
import okio.Path.Companion.toPath
import org.apache.logging.log4j.kotlin.logger
-import kotlin.system.exitProcess
/**
* Base class for all commands which only reads the support repo folder.
@@ -253,6 +253,7 @@
--------------------------------------------------------------------------------
""".trimIndent()
}
+ updatePlaygroundMetalavaBuildIfNecessary(downloadedFiles)
if (downloadedFiles.isEmpty()) {
logger.warn(
"""
@@ -267,7 +268,7 @@
} else {
if (!result.dependenciesPassedVerification) {
logger.warn(
- """
+ """
[33mOur Gradle build won't trust any artifacts that are unsigned or are signed with new keys. To trust these artifacts, run `development/update-verification-metadata.sh
""".trimIndent()
)
@@ -275,6 +276,42 @@
}
flushLogs()
}
+
+ /**
+ * GitHub Playground's metalava build id needs to match the build id used by androidx.
+ *
+ * This method takes care of updating playground.properties if the metalava build id
+ * is specified in the import maven script, and we've downloaded metalava.
+ */
+ private fun updatePlaygroundMetalavaBuildIfNecessary(downloadedFiles: Set<Path>) {
+ val metalavaBuild = metalavaBuildId ?: return
+ val downloadedMetalava = downloadedFiles.any {
+ it.name.contains("metalava")
+ }
+ if (!downloadedMetalava) {
+ return
+ }
+ val playgroundPropertiesFile = null.orFromSupportRepoFolder(
+ "playground-common/playground.properties"
+ ).toFile()
+ check(playgroundPropertiesFile.exists()) {
+ """
+ Cannot find playground properties file. This is needed to update metalava in
+ playground to match AndroidX.
+ """.trimIndent()
+ }
+ val updatedProperties = playgroundPropertiesFile.readLines(
+ Charsets.UTF_8
+ ).joinToString("\n") {
+ if (it.trim().startsWith("androidx.playground.metalavaBuildId=")) {
+ "androidx.playground.metalavaBuildId=$metalavaBuild"
+ } else {
+ it
+ }
+ }
+ playgroundPropertiesFile.writeText(updatedProperties)
+ logger.info { "updated playground properties" }
+ }
}
/**
diff --git a/docs-public/build.gradle b/docs-public/build.gradle
index 8ca6f01..f637e2b 100644
--- a/docs-public/build.gradle
+++ b/docs-public/build.gradle
@@ -30,14 +30,14 @@
docs("androidx.asynclayoutinflater:asynclayoutinflater:1.1.0-alpha01")
docs("androidx.asynclayoutinflater:asynclayoutinflater-appcompat:1.1.0-alpha01")
docs("androidx.autofill:autofill:1.3.0-alpha01")
- docs("androidx.benchmark:benchmark-common:1.2.0-alpha14")
- docs("androidx.benchmark:benchmark-junit4:1.2.0-alpha14")
- docs("androidx.benchmark:benchmark-macro:1.2.0-alpha14")
- docs("androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha14")
+ docs("androidx.benchmark:benchmark-common:1.2.0-alpha15")
+ docs("androidx.benchmark:benchmark-junit4:1.2.0-alpha15")
+ docs("androidx.benchmark:benchmark-macro:1.2.0-alpha15")
+ docs("androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha15")
docs("androidx.biometric:biometric:1.2.0-alpha05")
docs("androidx.biometric:biometric-ktx:1.2.0-alpha05")
samples("androidx.biometric:biometric-ktx-samples:1.2.0-alpha05")
- docs("androidx.browser:browser:1.6.0-alpha01")
+ docs("androidx.browser:browser:1.6.0-alpha02")
docs("androidx.camera:camera-camera2:1.3.0-alpha07")
docs("androidx.camera:camera-core:1.3.0-alpha07")
docs("androidx.camera:camera-extensions:1.3.0-alpha07")
@@ -55,55 +55,55 @@
docs("androidx.cardview:cardview:1.0.0")
kmpDocs("androidx.collection:collection:1.3.0-alpha03")
docs("androidx.collection:collection-ktx:1.3.0-alpha03")
- kmpDocs("androidx.compose.animation:animation:1.5.0-beta01")
+ kmpDocs("androidx.compose.animation:animation:1.5.0-beta02")
kmpDocs("androidx.compose.animation:animation-core:1.5.0-beta01")
- kmpDocs("androidx.compose.animation:animation-graphics:1.5.0-beta01")
- samples("androidx.compose.animation:animation-samples:1.5.0-beta01")
- samples("androidx.compose.animation:animation-core-samples:1.5.0-beta01")
- samples("androidx.compose.animation:animation-graphics-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.foundation:foundation:1.5.0-beta01")
- kmpDocs("androidx.compose.foundation:foundation-layout:1.5.0-beta01")
- samples("androidx.compose.foundation:foundation-layout-samples:1.5.0-beta01")
- samples("androidx.compose.foundation:foundation-samples:1.5.0-beta01")
+ kmpDocs("androidx.compose.animation:animation-graphics:1.5.0-beta02")
+ samples("androidx.compose.animation:animation-samples:1.5.0-beta02")
+ samples("androidx.compose.animation:animation-core-samples:1.5.0-beta02")
+ samples("androidx.compose.animation:animation-graphics-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.foundation:foundation:1.5.0-beta02")
+ kmpDocs("androidx.compose.foundation:foundation-layout:1.5.0-beta02")
+ samples("androidx.compose.foundation:foundation-layout-samples:1.5.0-beta02")
+ samples("androidx.compose.foundation:foundation-samples:1.5.0-beta02")
kmpDocs("androidx.compose.material3:material3:1.2.0-alpha02")
samples("androidx.compose.material3:material3-samples:1.2.0-alpha02")
kmpDocs("androidx.compose.material3:material3-window-size-class:1.2.0-alpha02")
samples("androidx.compose.material3:material3-window-size-class-samples:1.2.0-alpha01")
- kmpDocs("androidx.compose.material:material:1.5.0-beta01")
- kmpDocs("androidx.compose.material:material-icons-core:1.5.0-beta01")
- samples("androidx.compose.material:material-icons-core-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.material:material-ripple:1.5.0-beta01")
- samples("androidx.compose.material:material-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.runtime:runtime:1.5.0-beta01")
- docs("androidx.compose.runtime:runtime-livedata:1.5.0-beta01")
- samples("androidx.compose.runtime:runtime-livedata-samples:1.5.0-beta01")
- docs("androidx.compose.runtime:runtime-rxjava2:1.5.0-beta01")
- samples("androidx.compose.runtime:runtime-rxjava2-samples:1.5.0-beta01")
- docs("androidx.compose.runtime:runtime-rxjava3:1.5.0-beta01")
- samples("androidx.compose.runtime:runtime-rxjava3-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.runtime:runtime-saveable:1.5.0-beta01")
- samples("androidx.compose.runtime:runtime-saveable-samples:1.5.0-beta01")
- samples("androidx.compose.runtime:runtime-samples:1.5.0-beta01")
+ kmpDocs("androidx.compose.material:material:1.5.0-beta02")
+ kmpDocs("androidx.compose.material:material-icons-core:1.5.0-beta02")
+ samples("androidx.compose.material:material-icons-core-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.material:material-ripple:1.5.0-beta02")
+ samples("androidx.compose.material:material-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.runtime:runtime:1.5.0-beta02")
+ docs("androidx.compose.runtime:runtime-livedata:1.5.0-beta02")
+ samples("androidx.compose.runtime:runtime-livedata-samples:1.5.0-beta02")
+ docs("androidx.compose.runtime:runtime-rxjava2:1.5.0-beta02")
+ samples("androidx.compose.runtime:runtime-rxjava2-samples:1.5.0-beta02")
+ docs("androidx.compose.runtime:runtime-rxjava3:1.5.0-beta02")
+ samples("androidx.compose.runtime:runtime-rxjava3-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.runtime:runtime-saveable:1.5.0-beta02")
+ samples("androidx.compose.runtime:runtime-saveable-samples:1.5.0-beta02")
+ samples("androidx.compose.runtime:runtime-samples:1.5.0-beta02")
docs("androidx.compose.runtime:runtime-tracing:1.0.0-alpha03")
- kmpDocs("androidx.compose.ui:ui:1.5.0-beta01")
+ kmpDocs("androidx.compose.ui:ui:1.5.0-beta02")
kmpDocs("androidx.compose.ui:ui-geometry:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-graphics:1.5.0-beta01")
- samples("androidx.compose.ui:ui-graphics-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-test:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-test-junit4:1.5.0-beta01")
- samples("androidx.compose.ui:ui-test-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-text:1.5.0-beta01")
- docs("androidx.compose.ui:ui-text-google-fonts:1.5.0-beta01")
- samples("androidx.compose.ui:ui-text-samples:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-tooling:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-tooling-data:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-tooling-preview:1.5.0-beta01")
- kmpDocs("androidx.compose.ui:ui-unit:1.5.0-beta01")
- samples("androidx.compose.ui:ui-unit-samples:1.5.0-beta01")
+ kmpDocs("androidx.compose.ui:ui-graphics:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-graphics-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-test:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-test-junit4:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-test-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-text:1.5.0-beta02")
+ docs("androidx.compose.ui:ui-text-google-fonts:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-text-samples:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-tooling:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-tooling-data:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-tooling-preview:1.5.0-beta02")
+ kmpDocs("androidx.compose.ui:ui-unit:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-unit-samples:1.5.0-beta02")
kmpDocs("androidx.compose.ui:ui-util:1.5.0-beta01")
- docs("androidx.compose.ui:ui-viewbinding:1.5.0-beta01")
- samples("androidx.compose.ui:ui-viewbinding-samples:1.5.0-beta01")
- samples("androidx.compose.ui:ui-samples:1.5.0-beta01")
+ docs("androidx.compose.ui:ui-viewbinding:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-viewbinding-samples:1.5.0-beta02")
+ samples("androidx.compose.ui:ui-samples:1.5.0-beta02")
docs("androidx.concurrent:concurrent-futures:1.2.0-alpha01")
docs("androidx.concurrent:concurrent-futures-ktx:1.2.0-alpha01")
docs("androidx.constraintlayout:constraintlayout:2.2.0-alpha10")
@@ -166,7 +166,7 @@
docs("androidx.glance:glance-preview:1.0.0-alpha06")
docs("androidx.glance:glance-wear-tiles:1.0.0-alpha06")
docs("androidx.glance:glance-wear-tiles-preview:1.0.0-alpha06")
- docs("androidx.graphics:graphics-core:1.0.0-alpha03")
+ docs("androidx.graphics:graphics-core:1.0.0-alpha04")
docs("androidx.gridlayout:gridlayout:1.1.0-beta01")
docs("androidx.health.connect:connect-client:1.0.0-alpha11")
samples("androidx.health.connect:connect-client-samples:1.0.0-alpha11")
@@ -214,67 +214,67 @@
docs("androidx.media2:media2-session:1.2.1")
docs("androidx.media2:media2-widget:1.2.1")
docs("androidx.media:media:1.6.0")
- docs("androidx.media3:media3-cast:1.1.0-beta01")
- docs("androidx.media3:media3-common:1.1.0-beta01")
- docs("androidx.media3:media3-container:1.1.0-beta01")
- docs("androidx.media3:media3-database:1.1.0-beta01")
- docs("androidx.media3:media3-datasource:1.1.0-beta01")
- docs("androidx.media3:media3-datasource-cronet:1.1.0-beta01")
- docs("androidx.media3:media3-datasource-okhttp:1.1.0-beta01")
- docs("androidx.media3:media3-datasource-rtmp:1.1.0-beta01")
- docs("androidx.media3:media3-decoder:1.1.0-beta01")
- docs("androidx.media3:media3-effect:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-dash:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-hls:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-ima:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-rtsp:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-smoothstreaming:1.1.0-beta01")
- docs("androidx.media3:media3-exoplayer-workmanager:1.1.0-beta01")
- docs("androidx.media3:media3-extractor:1.1.0-beta01")
- docs("androidx.media3:media3-muxer:1.1.0-beta01")
- docs("androidx.media3:media3-session:1.1.0-beta01")
- docs("androidx.media3:media3-test-utils:1.1.0-beta01")
- docs("androidx.media3:media3-test-utils-robolectric:1.1.0-beta01")
- docs("androidx.media3:media3-transformer:1.1.0-beta01")
- docs("androidx.media3:media3-ui:1.1.0-beta01")
- docs("androidx.media3:media3-ui-leanback:1.1.0-beta01")
+ docs("androidx.media3:media3-cast:1.1.0-rc01")
+ docs("androidx.media3:media3-common:1.1.0-rc01")
+ docs("androidx.media3:media3-container:1.1.0-rc01")
+ docs("androidx.media3:media3-database:1.1.0-rc01")
+ docs("androidx.media3:media3-datasource:1.1.0-rc01")
+ docs("androidx.media3:media3-datasource-cronet:1.1.0-rc01")
+ docs("androidx.media3:media3-datasource-okhttp:1.1.0-rc01")
+ docs("androidx.media3:media3-datasource-rtmp:1.1.0-rc01")
+ docs("androidx.media3:media3-decoder:1.1.0-rc01")
+ docs("androidx.media3:media3-effect:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-dash:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-hls:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-ima:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-rtsp:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-smoothstreaming:1.1.0-rc01")
+ docs("androidx.media3:media3-exoplayer-workmanager:1.1.0-rc01")
+ docs("androidx.media3:media3-extractor:1.1.0-rc01")
+ docs("androidx.media3:media3-muxer:1.1.0-rc01")
+ docs("androidx.media3:media3-session:1.1.0-rc01")
+ docs("androidx.media3:media3-test-utils:1.1.0-rc01")
+ docs("androidx.media3:media3-test-utils-robolectric:1.1.0-rc01")
+ docs("androidx.media3:media3-transformer:1.1.0-rc01")
+ docs("androidx.media3:media3-ui:1.1.0-rc01")
+ docs("androidx.media3:media3-ui-leanback:1.1.0-rc01")
docs("androidx.mediarouter:mediarouter:1.6.0-alpha03")
docs("androidx.mediarouter:mediarouter-testing:1.6.0-alpha03")
docs("androidx.metrics:metrics-performance:1.0.0-alpha04")
- docs("androidx.navigation:navigation-common:2.7.0-alpha01")
- docs("androidx.navigation:navigation-common-ktx:2.7.0-alpha01")
- docs("androidx.navigation:navigation-compose:2.7.0-alpha01")
- samples("androidx.navigation:navigation-compose-samples:2.7.0-alpha01")
- docs("androidx.navigation:navigation-dynamic-features-fragment:2.7.0-alpha01")
- docs("androidx.navigation:navigation-dynamic-features-runtime:2.7.0-alpha01")
- docs("androidx.navigation:navigation-fragment:2.7.0-alpha01")
- docs("androidx.navigation:navigation-fragment-ktx:2.7.0-alpha01")
- docs("androidx.navigation:navigation-runtime:2.7.0-alpha01")
- docs("androidx.navigation:navigation-runtime-ktx:2.7.0-alpha01")
- docs("androidx.navigation:navigation-testing:2.7.0-alpha01")
- docs("androidx.navigation:navigation-ui:2.7.0-alpha01")
- docs("androidx.navigation:navigation-ui-ktx:2.7.0-alpha01")
- docs("androidx.paging:paging-common:3.2.0-alpha06")
- docs("androidx.paging:paging-common-ktx:3.2.0-alpha06")
- docs("androidx.paging:paging-compose:1.0.0-alpha20")
- samples("androidx.paging:paging-compose-samples:1.0.0-alpha20")
- docs("androidx.paging:paging-guava:3.2.0-alpha06")
- docs("androidx.paging:paging-runtime:3.2.0-alpha06")
- docs("androidx.paging:paging-runtime-ktx:3.2.0-alpha06")
- docs("androidx.paging:paging-rxjava2:3.2.0-alpha06")
- docs("androidx.paging:paging-rxjava2-ktx:3.2.0-alpha06")
- docs("androidx.paging:paging-rxjava3:3.2.0-alpha06")
- samples("androidx.paging:paging-samples:3.2.0-alpha06")
- docs("androidx.paging:paging-testing:3.2.0-alpha06")
+ docs("androidx.navigation:navigation-common:2.7.0-beta01")
+ docs("androidx.navigation:navigation-common-ktx:2.7.0-beta01")
+ docs("androidx.navigation:navigation-compose:2.7.0-beta01")
+ samples("androidx.navigation:navigation-compose-samples:2.7.0-beta01")
+ docs("androidx.navigation:navigation-dynamic-features-fragment:2.7.0-beta01")
+ docs("androidx.navigation:navigation-dynamic-features-runtime:2.7.0-beta01")
+ docs("androidx.navigation:navigation-fragment:2.7.0-beta01")
+ docs("androidx.navigation:navigation-fragment-ktx:2.7.0-beta01")
+ docs("androidx.navigation:navigation-runtime:2.7.0-beta01")
+ docs("androidx.navigation:navigation-runtime-ktx:2.7.0-beta01")
+ docs("androidx.navigation:navigation-testing:2.7.0-beta01")
+ docs("androidx.navigation:navigation-ui:2.7.0-beta01")
+ docs("androidx.navigation:navigation-ui-ktx:2.7.0-beta01")
+ docs("androidx.paging:paging-common:3.2.0-beta01")
+ docs("androidx.paging:paging-common-ktx:3.2.0-beta01")
+ docs("androidx.paging:paging-compose:3.2.0-beta01")
+ samples("androidx.paging:paging-compose-samples:3.2.0-beta01")
+ docs("androidx.paging:paging-guava:3.2.0-beta01")
+ docs("androidx.paging:paging-runtime:3.2.0-beta01")
+ docs("androidx.paging:paging-runtime-ktx:3.2.0-beta01")
+ docs("androidx.paging:paging-rxjava2:3.2.0-beta01")
+ docs("androidx.paging:paging-rxjava2-ktx:3.2.0-beta01")
+ docs("androidx.paging:paging-rxjava3:3.2.0-beta01")
+ samples("androidx.paging:paging-samples:3.2.0-beta01")
+ docs("androidx.paging:paging-testing:3.2.0-beta01")
docs("androidx.palette:palette:1.0.0")
docs("androidx.palette:palette-ktx:1.0.0")
docs("androidx.percentlayout:percentlayout:1.0.1")
docs("androidx.preference:preference:1.2.0")
docs("androidx.preference:preference-ktx:1.2.0")
docs("androidx.print:print:1.1.0-beta01")
- docs("androidx.privacysandbox.ads:ads-adservices:1.0.0-beta04")
- docs("androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta04")
+ docs("androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05")
+ docs("androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05")
docs("androidx.privacysandbox.sdkruntime:sdkruntime-client:1.0.0-alpha04")
docs("androidx.privacysandbox.sdkruntime:sdkruntime-core:1.0.0-alpha04")
docs("androidx.privacysandbox.tools:tools:1.0.0-alpha04")
@@ -342,15 +342,15 @@
docs("androidx.test.services:storage:1.5.0-alpha01")
docs("androidx.test.uiautomator:uiautomator:2.3.0-alpha03")
docs("androidx.textclassifier:textclassifier:1.0.0-alpha04")
- docs("androidx.tracing:tracing:1.2.0-rc01")
- docs("androidx.tracing:tracing-ktx:1.2.0-rc01")
- docs("androidx.tracing:tracing-perfetto:1.0.0-alpha15")
- docs("androidx.tracing:tracing-perfetto-common:1.0.0-alpha15")
+ docs("androidx.tracing:tracing:1.3.0-alpha01")
+ docs("androidx.tracing:tracing-ktx:1.3.0-alpha01")
+ docs("androidx.tracing:tracing-perfetto:1.0.0-alpha16")
+ docs("androidx.tracing:tracing-perfetto-common:1.0.0-alpha16")
docs("androidx.transition:transition:1.5.0-alpha01")
docs("androidx.transition:transition-ktx:1.5.0-alpha01")
- docs("androidx.tv:tv-foundation:1.0.0-alpha06")
- docs("androidx.tv:tv-material:1.0.0-alpha06")
- samples("androidx.tv:tv-samples:1.0.0-alpha06")
+ docs("androidx.tv:tv-foundation:1.0.0-alpha07")
+ docs("androidx.tv:tv-material:1.0.0-alpha07")
+ samples("androidx.tv:tv-samples:1.0.0-alpha07")
docs("androidx.tvprovider:tvprovider:1.1.0-alpha01")
docs("androidx.vectordrawable:vectordrawable:1.2.0-beta01")
docs("androidx.vectordrawable:vectordrawable-animated:1.2.0-alpha01")
@@ -358,26 +358,26 @@
docs("androidx.versionedparcelable:versionedparcelable:1.1.1")
docs("androidx.viewpager2:viewpager2:1.1.0-beta02")
docs("androidx.viewpager:viewpager:1.1.0-alpha01")
- docs("androidx.wear.compose:compose-foundation:1.2.0-beta01")
- samples("androidx.wear.compose:compose-foundation-samples:1.2.0-beta01")
- docs("androidx.wear.compose:compose-material:1.2.0-beta01")
- docs("androidx.wear.compose:compose-material-core:1.2.0-beta01")
- samples("androidx.wear.compose:compose-material-samples:1.2.0-beta01")
- docs("androidx.wear.compose:compose-material3:1.0.0-alpha05")
- samples("androidx.wear.compose:compose-material3-samples:1.2.0-beta01")
- docs("androidx.wear.compose:compose-navigation:1.2.0-beta01")
- samples("androidx.wear.compose:compose-navigation-samples:1.2.0-beta01")
- docs("androidx.wear.compose:compose-ui-tooling:1.2.0-beta01")
- docs("androidx.wear.protolayout:protolayout:1.0.0-alpha10")
- docs("androidx.wear.protolayout:protolayout-expression:1.0.0-alpha10")
- docs("androidx.wear.protolayout:protolayout-material:1.0.0-alpha10")
- docs("androidx.wear.protolayout:protolayout-renderer:1.0.0-alpha10")
- docs("androidx.wear.tiles:tiles:1.2.0-alpha06")
- docs("androidx.wear.tiles:tiles-material:1.2.0-alpha06")
- docs("androidx.wear.tiles:tiles-proto:1.2.0-alpha06")
- docs("androidx.wear.tiles:tiles-renderer:1.2.0-alpha06")
- docs("androidx.wear.tiles:tiles-testing:1.2.0-alpha06")
- docs("androidx.wear.tiles:tiles-tooling:1.2.0-alpha06")
+ docs("androidx.wear.compose:compose-foundation:1.2.0-beta02")
+ samples("androidx.wear.compose:compose-foundation-samples:1.2.0-beta02")
+ docs("androidx.wear.compose:compose-material:1.2.0-beta02")
+ docs("androidx.wear.compose:compose-material-core:1.2.0-beta02")
+ samples("androidx.wear.compose:compose-material-samples:1.2.0-beta02")
+ docs("androidx.wear.compose:compose-material3:1.0.0-alpha06")
+ samples("androidx.wear.compose:compose-material3-samples:1.2.0-beta02")
+ docs("androidx.wear.compose:compose-navigation:1.2.0-beta02")
+ samples("androidx.wear.compose:compose-navigation-samples:1.2.0-beta02")
+ docs("androidx.wear.compose:compose-ui-tooling:1.2.0-beta02")
+ docs("androidx.wear.protolayout:protolayout:1.0.0-alpha11")
+ docs("androidx.wear.protolayout:protolayout-expression:1.0.0-alpha11")
+ docs("androidx.wear.protolayout:protolayout-material:1.0.0-alpha11")
+ docs("androidx.wear.protolayout:protolayout-renderer:1.0.0-alpha11")
+ docs("androidx.wear.tiles:tiles:1.2.0-alpha07")
+ docs("androidx.wear.tiles:tiles-material:1.2.0-alpha07")
+ docs("androidx.wear.tiles:tiles-proto:1.2.0-alpha07")
+ docs("androidx.wear.tiles:tiles-renderer:1.2.0-alpha07")
+ docs("androidx.wear.tiles:tiles-testing:1.2.0-alpha07")
+ docs("androidx.wear.tiles:tiles-tooling:1.2.0-alpha07")
docs("androidx.wear.watchface:watchface:1.2.0-alpha08")
docs("androidx.wear.watchface:watchface-client:1.2.0-alpha08")
docs("androidx.wear.watchface:watchface-client-guava:1.2.0-alpha08")
@@ -394,7 +394,7 @@
docs("androidx.wear.watchface:watchface-guava:1.2.0-alpha08")
samples("androidx.wear.watchface:watchface-samples:1.2.0-alpha08")
docs("androidx.wear.watchface:watchface-style:1.2.0-alpha08")
- docs("androidx.wear:wear:1.3.0-alpha05")
+ docs("androidx.wear:wear:1.3.0-beta01")
stubs(fileTree(dir: "../wear/wear_stubs/", include: ["com.google.android.wearable-stubs.jar"]))
docs("androidx.wear:wear-ongoing:1.1.0-alpha01")
docs("androidx.wear:wear-phone-interactions:1.1.0-alpha03")
@@ -402,22 +402,22 @@
docs("androidx.wear:wear-input:1.2.0-alpha02")
samples("androidx.wear:wear-input-samples:1.2.0-alpha01")
docs("androidx.wear:wear-input-testing:1.2.0-alpha02")
- docs("androidx.webkit:webkit:1.7.0")
+ docs("androidx.webkit:webkit:1.8.0-alpha01")
docs("androidx.window.extensions.core:core:1.0.0")
- docs("androidx.window:window:1.2.0-alpha01")
+ docs("androidx.window:window:1.2.0-alpha02")
stubs(fileTree(dir: "../window/stubs/", include: ["window-sidecar-release-0.1.0-alpha01.aar"]))
- docs("androidx.window:window-core:1.2.0-alpha01")
+ docs("androidx.window:window-core:1.2.0-alpha02")
stubs("androidx.window:window-extensions:1.0.0-alpha01")
- docs("androidx.window:window-java:1.2.0-alpha01")
- docs("androidx.window:window-rxjava2:1.2.0-alpha01")
- docs("androidx.window:window-rxjava3:1.2.0-alpha01")
- samples("androidx.window:window-samples:1.2.0-alpha01")
- docs("androidx.window:window-testing:1.2.0-alpha01")
- docs("androidx.work:work-gcm:2.8.1")
- docs("androidx.work:work-multiprocess:2.8.1")
- docs("androidx.work:work-runtime:2.8.1")
- docs("androidx.work:work-runtime-ktx:2.8.1")
- docs("androidx.work:work-rxjava2:2.8.1")
- docs("androidx.work:work-rxjava3:2.8.1")
- docs("androidx.work:work-testing:2.8.1")
+ docs("androidx.window:window-java:1.2.0-alpha02")
+ docs("androidx.window:window-rxjava2:1.2.0-alpha02")
+ docs("androidx.window:window-rxjava3:1.2.0-alpha02")
+ samples("androidx.window:window-samples:1.2.0-alpha02")
+ docs("androidx.window:window-testing:1.2.0-alpha02")
+ docs("androidx.work:work-gcm:2.9.0-alpha01")
+ docs("androidx.work:work-multiprocess:2.9.0-alpha01")
+ docs("androidx.work:work-runtime:2.9.0-alpha01")
+ docs("androidx.work:work-runtime-ktx:2.9.0-alpha01")
+ docs("androidx.work:work-rxjava2:2.9.0-alpha01")
+ docs("androidx.work:work-rxjava3:2.9.0-alpha01")
+ docs("androidx.work:work-testing:2.9.0-alpha01")
}
diff --git a/docs/onboarding.md b/docs/onboarding.md
index feb4b7d..2069d45 100644
--- a/docs/onboarding.md
+++ b/docs/onboarding.md
@@ -524,7 +524,7 @@
`{androidx-main-checkout}/prebuilts/androidx/internal/androidx/`. We
colloquially refer to this two step process of (1) updating `docs-public` and
(2) checking in a prebuilt artifact into the prebuilts directory as
-[The Prebuilts Dance](/company/teams/androidx/releasing_detailed.md#the-prebuilts-dance™).
+[The Prebuilts Dance](/company/teams/androidx/releasing_prebuilts_dance.md#the-prebuilts-dance™).
So, to build javadocs that will be published to
https://developer.android.com/reference/androidx/packages, both of these steps
need to be completed.
diff --git a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt
index d7693a77..551c543 100644
--- a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt
+++ b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/CoroutineBroadcastReceiverTest.kt
@@ -76,6 +76,7 @@
val value = "value"
context.sendBroadcast(
Intent(BROADCAST_ACTION)
+ .setPackage(context.packageName)
.putExtra(EXTRA_STRING, value)
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
)
diff --git a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/GlanceAppWidgetReceiverScreenshotTest.kt b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/GlanceAppWidgetReceiverScreenshotTest.kt
index 3fcfbdd..ffb947e 100644
--- a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/GlanceAppWidgetReceiverScreenshotTest.kt
+++ b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/GlanceAppWidgetReceiverScreenshotTest.kt
@@ -30,6 +30,7 @@
import androidx.glance.ImageProvider
import androidx.glance.LocalContext
import androidx.glance.action.actionStartActivity
+import androidx.glance.appwidget.lazy.LazyColumn
import androidx.glance.appwidget.test.R
import androidx.glance.background
import androidx.glance.color.ColorProvider
@@ -56,12 +57,15 @@
import androidx.glance.unit.ColorProvider
import androidx.test.filters.MediumTest
import androidx.test.filters.SdkSuppress
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.runTest
import org.junit.Rule
import org.junit.Test
import org.junit.rules.RuleChain
import org.junit.rules.TestRule
@SdkSuppress(minSdkVersion = 29)
+@OptIn(ExperimentalCoroutinesApi::class)
@MediumTest
class GlanceAppWidgetReceiverScreenshotTest {
private val mScreenshotRule = screenshotRule()
@@ -537,6 +541,76 @@
mScreenshotRule.checkScreenshot(mHostRule.mHostView, "alignment")
}
+
+ @Test
+ fun lazyColumn_alignment_end() = runTest {
+ val count = 5
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumnAlignmentTest(
+ count = count,
+ horizontalAlignment = Alignment.End
+ )
+ }
+
+ mHostRule.startHost()
+
+ mHostRule.waitForListViewChildCount(count)
+ mScreenshotRule.checkScreenshot(mHostRule.mHostView, "lazyColumn_alignment_end")
+ }
+
+ @Test
+ fun lazyColumn_alignment_center() = runTest {
+ val count = 5
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumnAlignmentTest(
+ count = count,
+ horizontalAlignment = Alignment.CenterHorizontally
+ )
+ }
+
+ mHostRule.startHost()
+
+ mHostRule.waitForListViewChildCount(count)
+ mScreenshotRule.checkScreenshot(mHostRule.mHostView, "lazyColumn_alignment_center")
+ }
+
+ @Test
+ fun lazyColumn_alignment_start() = runTest {
+ val count = 5
+ TestGlanceAppWidget.uiDefinition = {
+ LazyColumnAlignmentTest(
+ count = count,
+ horizontalAlignment = Alignment.Start
+ )
+ }
+
+ mHostRule.startHost()
+
+ mHostRule.waitForListViewChildCount(count)
+ mScreenshotRule.checkScreenshot(mHostRule.mHostView, "lazyColumn_alignment_start")
+ }
+}
+
+@Composable
+private fun LazyColumnAlignmentTest(count: Int, horizontalAlignment: Alignment.Horizontal) {
+ val columnColors = listOf(Color(0xffffdbcd), Color(0xff7d2d00))
+ val textBgColors = listOf(Color(0xffa33e00), Color(0xffffb596))
+
+ LazyColumn(
+ modifier = GlanceModifier
+ .fillMaxSize()
+ .background(columnColors[0], columnColors[1]),
+ horizontalAlignment = horizontalAlignment
+ ) {
+ items(count) { index ->
+ Text(
+ text = "item $index",
+ modifier = GlanceModifier
+ .padding(horizontal = 16.dp, vertical = 8.dp)
+ .background(textBgColors[0], textBgColors[1])
+ )
+ }
+ }
}
@Composable
diff --git a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt
index 52d61ec..6040bea 100644
--- a/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt
+++ b/glance/glance-appwidget/src/androidTest/kotlin/androidx/glance/appwidget/LazyColumnTest.kt
@@ -186,10 +186,14 @@
mHostRule.startHost()
mHostRule.waitForListViewChildren { list ->
- val textView0 = list.getUnboxedListItem<TextView>(0)
- val textView1 = list.getUnboxedListItem<TextView>(1)
- val textView2 = list.getUnboxedListItem<TextView>(2)
- val textView3 = list.getUnboxedListItem<TextView>(3)
+ val textView0 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 0, viewPosition = 0)
+ val textView1 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 1, viewPosition = 0)
+ val textView2 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 2, viewPosition = 0)
+ val textView3 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 3, viewPosition = 0)
assertThat(textView0.text.toString()).isEqualTo("Row 0")
assertThat(textView1.text.toString()).isEqualTo("Row 1")
assertThat(textView2.text.toString()).isEqualTo("Row 2")
@@ -210,10 +214,14 @@
mHostRule.startHost()
mHostRule.waitForListViewChildren { list ->
- val textView0 = list.getUnboxedListItem<TextView>(0)
- val textView1 = list.getUnboxedListItem<TextView>(1)
- val textView2 = list.getUnboxedListItem<TextView>(2)
- val textView3 = list.getUnboxedListItem<TextView>(3)
+ val textView0 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 0, viewPosition = 0)
+ val textView1 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 1, viewPosition = 0)
+ val textView2 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 2, viewPosition = 0)
+ val textView3 =
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 3, viewPosition = 0)
assertThat(textView0.text.toString()).isEqualTo("Row 0")
assertThat(textView1.text.toString()).isEqualTo("Row 1")
assertThat(textView2.text.toString()).isEqualTo("Row 2")
@@ -234,7 +242,7 @@
mHostRule.startHost()
mHostRule.waitForListViewChildren { list ->
- list.getUnboxedListItem<TextView>(0)
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 0, viewPosition = 0)
}
}
@@ -251,7 +259,7 @@
mHostRule.startHost()
mHostRule.waitForListViewChildren { list ->
- list.getUnboxedListItem<TextView>(0)
+ list.getViewFromUnboxedListItem<TextView>(itemPosition = 0, viewPosition = 0)
}
}
@@ -374,7 +382,7 @@
rowItem0.performClick()
}
- mHostRule.waitForListViewChildWithText(text = "Row item 0, count 1") {}
+ mHostRule.waitForListViewChildWithText(text = "Row item 0, count 2") {}
}
@Test
@@ -462,7 +470,8 @@
val buttons = arrayOfNulls<Button>(5)
mHostRule.waitForListViewChildren { list ->
for (it in 0..4) {
- val button = list.getUnboxedListItem<Button>(it)
+ val button =
+ list.getViewFromUnboxedListItem<Button>(itemPosition = it, viewPosition = 0)
buttons[it] = button
}
}
@@ -497,7 +506,10 @@
val buttons = arrayOfNulls<FrameLayout>(5)
mHostRule.waitForListViewChildren { list ->
for (it in 0..4) {
- val button = list.getUnboxedListItem<FrameLayout>(it)
+ val button = list.getViewFromUnboxedListItem<FrameLayout>(
+ itemPosition = it,
+ viewPosition = 0
+ )
buttons[it] = assertIs<FrameLayout>(button)
}
}
@@ -633,12 +645,24 @@
}.buffer(0)
internal inline fun <reified T : View> ListView.getUnboxedListItem(position: Int): T {
+ // RemoteViewsAdapter$RemoteViewsFrameLayout
val remoteViewFrame = assertIs<FrameLayout>(getChildAt(position))
// Android S- have a RemoteViewsAdapter$RemoteViewsFrameLayout first, Android T+ do not.
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.S) {
return remoteViewFrame.getChildAt(0).getTargetView()
}
- val frame = assertIs<FrameLayout>(remoteViewFrame.getChildAt(0))
- return frame.getChildAt(0).getTargetView()
+ // The RemoteViews created in translateComposition for holding an item
+ val rootView = assertIs<FrameLayout>(remoteViewFrame.getChildAt(0))
+ return rootView.getChildAt(0).getTargetView()
+}
+
+internal inline fun <reified T : View> ListView.getViewFromUnboxedListItem(
+ itemPosition: Int,
+ viewPosition: Int
+): T {
+ // Box added during normalization to allow aligning item contents per the alignment set on
+ // LazyColumn
+ val alignmentView = assertIs<FrameLayout>(getUnboxedListItem(itemPosition))
+ return alignmentView.getChildAt(viewPosition).getTargetView()
}
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/NormalizeCompositionTree.kt b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/NormalizeCompositionTree.kt
index da340c7c..2b86729 100644
--- a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/NormalizeCompositionTree.kt
+++ b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/NormalizeCompositionTree.kt
@@ -167,7 +167,6 @@
}
private fun normalizeLazyListItem(view: EmittableLazyItemWithChildren) {
- if (view.children.size == 1 && view.alignment == Alignment.CenterStart) return
val box = EmittableBox()
box.children += view.children
box.contentAlignment = view.alignment
diff --git a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyList.kt b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyList.kt
index eaaf5e0..277b12a 100644
--- a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyList.kt
+++ b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyList.kt
@@ -293,12 +293,9 @@
}
internal class EmittableLazyListItem : EmittableLazyItemWithChildren() {
- override var modifier: GlanceModifier
- get() = children.singleOrNull()?.modifier
- ?: GlanceModifier.wrapContentHeight().fillMaxWidth()
- set(_) {
- throw IllegalAccessError("You cannot set the modifier of an EmittableLazyListItem")
- }
+ // Fill max width of the lazy column so that item contents can be aligned per the horizontal
+ // alignment.
+ override var modifier: GlanceModifier = GlanceModifier.wrapContentHeight().fillMaxWidth()
var itemId: Long = 0
override fun copy(): Emittable = EmittableLazyListItem().also {
diff --git a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyVerticalGrid.kt b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyVerticalGrid.kt
index 9778863..a0051e0 100644
--- a/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyVerticalGrid.kt
+++ b/glance/glance-appwidget/src/main/java/androidx/glance/appwidget/lazy/LazyVerticalGrid.kt
@@ -294,14 +294,9 @@
}
internal class EmittableLazyVerticalGridListItem : EmittableLazyItemWithChildren() {
- override var modifier: GlanceModifier
- get() = children.singleOrNull()?.modifier
- ?: GlanceModifier.wrapContentHeight().fillMaxWidth()
- set(_) {
- throw IllegalAccessError(
- "You cannot set the modifier of an EmittableLazyVerticalGridListItem"
- )
- }
+ // Fill max width of the grid cell so that item contents can be aligned per the horizontal
+ // alignment.
+ override var modifier: GlanceModifier = GlanceModifier.wrapContentHeight().fillMaxWidth()
var itemId: Long = 0
override fun copy(): Emittable = EmittableLazyVerticalGridListItem().also {
diff --git a/graphics/graphics-core/src/main/java/androidx/hardware/SyncFenceCompat.kt b/graphics/graphics-core/src/main/java/androidx/hardware/SyncFenceCompat.kt
index 055bc4f..64cb8a1 100644
--- a/graphics/graphics-core/src/main/java/androidx/hardware/SyncFenceCompat.kt
+++ b/graphics/graphics-core/src/main/java/androidx/hardware/SyncFenceCompat.kt
@@ -138,7 +138,7 @@
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
@androidx.annotation.DoNotInline
fun createSyncFenceCompatV33(): SyncFenceCompat {
- val display = EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY)
+ val display = EGL14.eglGetCurrentDisplay()
if (display == EGL15.EGL_NO_DISPLAY) {
throw RuntimeException("no EGL display")
}
diff --git a/health/connect/connect-client/src/main/java/androidx/health/platform/client/impl/sdkservice/HealthDataSdkService.java b/health/connect/connect-client/src/main/java/androidx/health/platform/client/impl/sdkservice/HealthDataSdkService.java
index ad6a2a9..5ae90a7 100644
--- a/health/connect/connect-client/src/main/java/androidx/health/platform/client/impl/sdkservice/HealthDataSdkService.java
+++ b/health/connect/connect-client/src/main/java/androidx/health/platform/client/impl/sdkservice/HealthDataSdkService.java
@@ -49,6 +49,7 @@
new ThreadFactoryBuilder()
.setNameFormat("HealthData-HealthDataSdkService-%d")
.build());
- return new HealthDataSdkServiceStubImpl(this, executor);
+ // Pass application context to avoid leaking the service.
+ return new HealthDataSdkServiceStubImpl(this.getApplicationContext(), executor);
}
}
diff --git a/libraryversions.toml b/libraryversions.toml
index a8188fa..88d2c2a 100644
--- a/libraryversions.toml
+++ b/libraryversions.toml
@@ -14,7 +14,7 @@
BLUETOOTH = "1.0.0-alpha01"
BROWSER = "1.6.0-beta01"
BUILDSRC_TESTS = "1.0.0-alpha01"
-CAMERA = "1.3.0-alpha08"
+CAMERA = "1.3.0-beta01"
CAMERA_PIPE = "1.0.0-alpha01"
CARDVIEW = "1.1.0-alpha01"
CAR_APP = "1.4.0-alpha01"
@@ -67,7 +67,7 @@
GRAPHICS_SHAPES = "1.0.0-alpha03"
GRIDLAYOUT = "1.1.0-beta02"
HEALTH_CONNECT = "1.0.0-alpha11"
-HEALTH_SERVICES_CLIENT = "1.0.0-rc01"
+HEALTH_SERVICES_CLIENT = "1.1.0-alpha01"
HEIFWRITER = "1.1.0-alpha02"
HILT = "1.1.0-alpha03"
HILT_NAVIGATION_COMPOSE = "1.1.0-alpha02"
@@ -90,14 +90,14 @@
MEDIAROUTER = "1.5.0-alpha02"
METRICS = "1.0.0-alpha05"
NAVIGATION = "2.7.0-beta01"
-PAGING = "3.2.0-beta01"
+PAGING = "3.2.0-rc01"
PALETTE = "1.1.0-alpha01"
PERCENTLAYOUT = "1.1.0-alpha01"
PREFERENCE = "1.3.0-alpha01"
PRINT = "1.1.0-beta01"
PRIVACYSANDBOX_ADS = "1.0.0-beta05"
PRIVACYSANDBOX_PLUGINS = "1.0.0-alpha02"
-PRIVACYSANDBOX_SDKRUNTIME = "1.0.0-alpha05"
+PRIVACYSANDBOX_SDKRUNTIME = "1.0.0-alpha06"
PRIVACYSANDBOX_TOOLS = "1.0.0-alpha05"
PRIVACYSANDBOX_UI = "1.0.0-alpha04"
PROFILEINSTALLER = "1.4.0-alpha01"
@@ -147,9 +147,9 @@
WEAR_INPUT_TESTING = "1.2.0-alpha03"
WEAR_ONGOING = "1.1.0-alpha01"
WEAR_PHONE_INTERACTIONS = "1.1.0-alpha04"
-WEAR_PROTOLAYOUT = "1.0.0-alpha11"
+WEAR_PROTOLAYOUT = "1.0.0-beta01"
WEAR_REMOTE_INTERACTIONS = "1.1.0-alpha01"
-WEAR_TILES = "1.2.0-alpha07"
+WEAR_TILES = "1.2.0-beta01"
WEAR_WATCHFACE = "1.2.0-alpha09"
WEBKIT = "1.8.0-alpha01"
WINDOW = "1.2.0-alpha03"
diff --git a/mediarouter/mediarouter/build.gradle b/mediarouter/mediarouter/build.gradle
index 100993c..96734ab 100644
--- a/mediarouter/mediarouter/build.gradle
+++ b/mediarouter/mediarouter/build.gradle
@@ -25,9 +25,11 @@
api("androidx.media:media:1.4.1")
api(libs.guavaListenableFuture)
- // We use a project dependency on androidx.core to keep an up-to-date BuildCompat dependency.
- // See b/283315121 for context.
- implementation(project(":core:core"))
+ // We should keep androidx.core up-to-date to keep an up-to-date BuildCompat dependency.
+ // See b/283315121 for context, However we cannot depend on tip of the tree dependency because
+ // it prevents our library releases, so we should update this dependency manually whenever
+ // there is a new stable release of it.
+ implementation("androidx.core:core:1.10.1")
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.palette:palette:1.0.0")
implementation("androidx.recyclerview:recyclerview:1.1.0")
diff --git a/playground-common/playground.properties b/playground-common/playground.properties
index f8f005e..8b17cc1 100644
--- a/playground-common/playground.properties
+++ b/playground-common/playground.properties
@@ -25,6 +25,6 @@
kotlin.code.style=official
# Disable docs
androidx.enableDocumentation=false
-androidx.playground.snapshotBuildId=10178688
-androidx.playground.metalavaBuildId=10250225
+androidx.playground.snapshotBuildId=10295852
+androidx.playground.metalavaBuildId=10307282
androidx.studio.type=playground
diff --git a/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt b/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
index 57e13f0..149b5f5 100644
--- a/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
+++ b/room/room-runtime-lint/src/main/java/androidx/room/lint/CursorKotlinUseIssueDetector.kt
@@ -16,8 +16,7 @@
package androidx.room.lint
-import com.android.tools.lint.checks.VersionChecks.Companion.isPrecededByVersionCheckExit
-import com.android.tools.lint.checks.VersionChecks.Companion.isWithinVersionCheckConditional
+import com.android.tools.lint.detector.api.ApiConstraint
import com.android.tools.lint.detector.api.Category
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Implementation
@@ -64,10 +63,8 @@
}
// If the call is within an SDK_INT check, then its OK
if (
- @Suppress("DEPRECATION") // b/262915639
- VersionChecks.isWithinVersionCheckConditional(context, node, 16) ||
- @Suppress("DEPRECATION") // b/262915639
- VersionChecks.isPrecededByVersionCheckExit(context, node, 16)
+ VersionChecks.isWithinVersionCheckConditional(context, node, ApiConstraint.get(16)) ||
+ VersionChecks.isPrecededByVersionCheckExit(context, node, ApiConstraint.get(16))
) {
return
}
diff --git a/test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/UiObject2Test.java b/test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/UiObject2Test.java
index 67efd97..2ef98c0 100644
--- a/test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/UiObject2Test.java
+++ b/test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/UiObject2Test.java
@@ -106,7 +106,7 @@
// Short click with a time duration as a parameter (`click(long duration)`).
UiObject2 button4 = mDevice.findObject(By.res(TEST_APP, "button4"));
assertEquals("text4", button4.getText());
- button4.click(50L);
+ button4.click((long) (ViewConfiguration.getLongPressTimeout() / 1.5));
button4.wait(Until.textEquals("text4_clicked"), TIMEOUT_MS);
assertEquals("text4_clicked", button4.getText());
@@ -125,7 +125,8 @@
// Short click with two parameters (`click(Point point, long duration)`).
UiObject2 button6 = mDevice.findObject(By.res(TEST_APP, "button6"));
assertEquals("text6", button6.getText());
- button6.click(getPointInsideBounds(button6), 50L);
+ button6.click(getPointInsideBounds(button6),
+ (long) (ViewConfiguration.getLongPressTimeout() / 1.5));
button6.wait(Until.textEquals("text6_clicked"), TIMEOUT_MS);
assertEquals("text6_clicked", button6.getText());
diff --git a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/GestureController.java b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/GestureController.java
index 03fbd29..84d4740 100644
--- a/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/GestureController.java
+++ b/test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/GestureController.java
@@ -146,8 +146,8 @@
// Loop
MotionEvent event;
- long elapsedTime = 0;
- for (; !pending.isEmpty() || !active.isEmpty(); elapsedTime += injectionDelay) {
+ for (long elapsedTime = 0; !pending.isEmpty() || !active.isEmpty();
+ elapsedTime = SystemClock.uptimeMillis() - startTime) {
// Touch up any completed pointers
while (!active.isEmpty()
@@ -168,7 +168,7 @@
action = MotionEvent.ACTION_POINTER_UP
+ (index << MotionEvent.ACTION_POINTER_INDEX_SHIFT);
}
- event = getMotionEvent(startTime, SystemClock.uptimeMillis(), action, properties,
+ event = getMotionEvent(startTime, startTime + elapsedTime, action, properties,
coordinates, gesture.displayId());
getDevice().getUiAutomation().injectInputEvent(event, false);
@@ -183,9 +183,8 @@
}
if (!active.isEmpty()) {
- event = getMotionEvent(startTime, SystemClock.uptimeMillis(),
- MotionEvent.ACTION_MOVE, properties, coordinates,
- active.peek().displayId());
+ event = getMotionEvent(startTime, startTime + elapsedTime, MotionEvent.ACTION_MOVE,
+ properties, coordinates, active.peek().displayId());
getDevice().getUiAutomation().injectInputEvent(event, false);
}
@@ -206,7 +205,7 @@
action = MotionEvent.ACTION_POINTER_DOWN
+ ((properties.size() - 1) << MotionEvent.ACTION_POINTER_INDEX_SHIFT);
}
- event = getMotionEvent(startTime, SystemClock.uptimeMillis(), action, properties,
+ event = getMotionEvent(startTime, startTime + elapsedTime, action, properties,
coordinates, gesture.displayId());
getDevice().getUiAutomation().injectInputEvent(event, false);
@@ -216,12 +215,6 @@
SystemClock.sleep(injectionDelay);
}
-
- long upTime = SystemClock.uptimeMillis() - startTime;
- if (upTime >= 2 * elapsedTime) {
- Log.w(TAG, String.format("Gestures took longer than expected (%dms >> %dms), device "
- + "might be in a busy state.", upTime, elapsedTime));
- }
}
/** Helper function to obtain a MotionEvent. */
diff --git a/tv/integration-tests/playground/build.gradle b/tv/integration-tests/playground/build.gradle
index f8b1d68..b1da39a 100644
--- a/tv/integration-tests/playground/build.gradle
+++ b/tv/integration-tests/playground/build.gradle
@@ -35,6 +35,14 @@
implementation(project(":tv:tv-foundation"))
implementation(project(":tv:tv-material"))
+
+ // pull latest compose (if build fails in future, just comment the following compose deps until
+ // we fix this package)
+ implementation(project(":compose:animation:animation"))
+ implementation(project(":compose:runtime:runtime"))
+ implementation(project(":compose:ui:ui"))
+ implementation(project(":compose:foundation:foundation-layout"))
+ implementation(project(":compose:ui:ui"))
}
androidx {
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/FocusGroup.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/FocusGroup.kt
deleted file mode 100644
index 715033a..0000000
--- a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/FocusGroup.kt
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.tv.integration.playground
-
-import android.annotation.SuppressLint
-import androidx.compose.foundation.ExperimentalFoundationApi
-import androidx.compose.foundation.focusGroup
-import androidx.compose.foundation.layout.Box
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.DisposableEffect
-import androidx.compose.runtime.MutableState
-import androidx.compose.runtime.Stable
-import androidx.compose.runtime.currentCompositeKeyHash
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberUpdatedState
-import androidx.compose.runtime.saveable.rememberSaveable
-import androidx.compose.ui.ExperimentalComposeUiApi
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.focus.FocusDirection
-import androidx.compose.ui.focus.FocusRequester
-import androidx.compose.ui.focus.focusProperties
-import androidx.compose.ui.focus.focusRequester
-import androidx.compose.ui.focus.onFocusChanged
-import androidx.compose.ui.platform.LocalFocusManager
-import androidx.tv.foundation.ExperimentalTvFoundationApi
-
-/**
- * Composable container that provides modifier extensions to allow focus to be restored to the
- * element that was previously focused within the TvFocusGroup.
- *
- * @param modifier the modifier to apply to this group.
- * @param content the content that is present within the group and can use focus-group modifier
- * extensions.
- */
-@OptIn(ExperimentalComposeUiApi::class, ExperimentalFoundationApi::class)
-@ExperimentalTvFoundationApi
-@Composable
-fun FocusGroup(
- modifier: Modifier = Modifier,
- content: @Composable FocusGroupScope.() -> Unit
-) {
- val focusGroupKeyHash = currentCompositeKeyHash
-
- // TODO: Is this the intended way to call rememberSaveable
- // with key set to parentHash?
- val previousFocusedItemHash: MutableState<Int?> = rememberSaveable(
- key = focusGroupKeyHash.toString()
- ) {
- mutableStateOf(null)
- }
-
- val state = FocusGroupState(previousFocusedItemHash = previousFocusedItemHash)
-
- Box(
- modifier = modifier
- .focusProperties {
- enter = {
- if (state.hasRecordedState()) {
- state.focusRequester
- } else {
- FocusRequester.Default
- }
- }
- }
- .focusGroup()
- ) {
- FocusGroupScope(state).content()
- }
-}
-
-/**
- * Scope containing the modifier extensions to be used within [FocusGroup].
- */
-@ExperimentalTvFoundationApi
-class FocusGroupScope internal constructor(private val state: FocusGroupState) {
- private var currentFocusableIdIndex = 0
-
- private fun generateUniqueFocusableId(): Int = currentFocusableIdIndex++
-
- /**
- * Modifier that records if the item was in focus before it moved out of the group. When focus
- * enters the [FocusGroup], the item will be returned focus.
- */
- @SuppressLint("ComposableModifierFactory")
- @Composable
- fun Modifier.restorableFocus(): Modifier =
- this.restorableFocus(focusId = rememberSaveable { generateUniqueFocusableId() })
-
- /**
- * Modifier that marks the current composable as the item to gain focus initially when focus
- * enters the [FocusGroup]. When focus enters the [FocusGroup], the item will be returned focus.
- */
- @SuppressLint("ComposableModifierFactory")
- @Composable
- fun Modifier.initiallyFocused(): Modifier {
- val focusId = rememberSaveable { generateUniqueFocusableId() }
- if (state.noRecordedState()) {
- state.recordFocusedItemHash(focusId)
- }
- return this.restorableFocus(focusId)
- }
-
- @SuppressLint("ComposableModifierFactory")
- @OptIn(ExperimentalComposeUiApi::class)
- @Composable
- private fun Modifier.restorableFocus(focusId: Int): Modifier {
- val focusRequester = remember { FocusRequester() }
- var isFocused = remember { false }
- val isCurrentlyFocused by rememberUpdatedState(isFocused)
- val focusManager = LocalFocusManager.current
- state.associatedWith(focusId, focusRequester)
- DisposableEffect(Unit) {
- onDispose {
- state.clearDisposedFocusRequester(focusId)
- if (isCurrentlyFocused) {
- focusManager.moveFocus(FocusDirection.Exit)
- focusManager.moveFocus(FocusDirection.Enter)
- }
- }
- }
-
- return this
- .focusRequester(focusRequester)
- .onFocusChanged {
- isFocused = it.isFocused || it.hasFocus
- if (isFocused) {
- state.recordFocusedItemHash(focusId)
- state.associatedWith(focusId, focusRequester)
- }
- }
- }
-}
-
-@Stable
-@ExperimentalTvFoundationApi
-internal class FocusGroupState(
- private var previousFocusedItemHash: MutableState<Int?>
-) {
- internal var focusRequester: FocusRequester = FocusRequester.Default
- private set
-
- internal fun recordFocusedItemHash(itemHash: Int) {
- previousFocusedItemHash.value = itemHash
- }
-
- internal fun clearDisposedFocusRequester(itemHash: Int) {
- if (previousFocusedItemHash.value == itemHash) {
- focusRequester = FocusRequester.Default
- }
- }
-
- internal fun associatedWith(itemHash: Int, focusRequester: FocusRequester) {
- if (previousFocusedItemHash.value == itemHash) {
- this.focusRequester = focusRequester
- }
- }
-
- internal fun hasRecordedState(): Boolean = !noRecordedState()
-
- internal fun noRecordedState(): Boolean =
- previousFocusedItemHash.value == null && focusRequester == FocusRequester.Default
-}
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ImmersiveList.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ImmersiveList.kt
index ac3d021..94240b6 100644
--- a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ImmersiveList.kt
+++ b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ImmersiveList.kt
@@ -30,7 +30,6 @@
import androidx.compose.ui.semantics.collectionItemInfo
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
-import androidx.tv.foundation.ExperimentalTvFoundationApi
import androidx.tv.foundation.lazy.list.TvLazyColumn
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.ImmersiveList
@@ -44,7 +43,7 @@
}
}
-@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalTvFoundationApi::class)
+@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
private fun SampleImmersiveList() {
val immersiveListHeight = 300.dp
@@ -56,40 +55,37 @@
Color.Magenta,
)
- FocusGroup {
- ImmersiveList(
- modifier = Modifier
- .height(immersiveListHeight + cardHeight / 2)
- .fillMaxWidth(),
- background = { index, _ ->
- Box(
- modifier = Modifier
- .background(backgrounds[index].copy(alpha = 0.3f))
- .height(immersiveListHeight)
- .fillMaxWidth()
- )
- }
- ) {
- LazyRow(
- horizontalArrangement = Arrangement.spacedBy(cardSpacing),
- modifier = Modifier.lazyListSemantics(1, backgrounds.count())
- ) {
- itemsIndexed(backgrounds) { index, backgroundColor ->
- val cardModifier =
- if (index == 0)
- Modifier.initiallyFocused()
- else
- Modifier.restorableFocus()
+ ImmersiveList(
+ modifier = Modifier
+ .height(immersiveListHeight + cardHeight / 2)
+ .fillMaxWidth(),
+ background = { index, _ ->
+ Box(
+ modifier = Modifier
+ .background(backgrounds[index].copy(alpha = 0.3f))
+ .height(immersiveListHeight)
+ .fillMaxWidth()
+ )
+ }
+ ) {
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
- Card(
- modifier = cardModifier
- .semantics {
- collectionItemInfo = CollectionItemInfo(0, 1, index, 1)
- }
- .immersiveListItem(index),
- backgroundColor = backgroundColor
- )
- }
+ LazyRow(
+ horizontalArrangement = Arrangement.spacedBy(cardSpacing),
+ modifier = Modifier
+ .lazyListSemantics(1, backgrounds.count())
+ .then(focusRestorerModifiers.parentModifier)
+ ) {
+ itemsIndexed(backgrounds) { index, backgroundColor ->
+ Card(
+ modifier = Modifier
+ .semantics {
+ collectionItemInfo = CollectionItemInfo(0, 1, index, 1)
+ }
+ .immersiveListItem(index)
+ .ifElse(index == 0, focusRestorerModifiers.childModifier),
+ backgroundColor = backgroundColor
+ )
}
}
}
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/LazyRowsAndColumns.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/LazyRowsAndColumns.kt
index 2fbddf4..20134a5 100644
--- a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/LazyRowsAndColumns.kt
+++ b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/LazyRowsAndColumns.kt
@@ -31,7 +31,6 @@
import androidx.compose.ui.semantics.collectionItemInfo
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
-import androidx.tv.foundation.ExperimentalTvFoundationApi
import androidx.tv.foundation.PivotOffsets
import androidx.tv.foundation.lazy.list.TvLazyColumn
import androidx.tv.foundation.lazy.list.TvLazyRow
@@ -57,31 +56,27 @@
}
}
-@OptIn(ExperimentalTvFoundationApi::class)
@Composable
fun SampleLazyRow(modifier: Modifier = Modifier) {
val colors = listOf(Color.Red, Color.Magenta, Color.Green, Color.Yellow, Color.Blue, Color.Cyan)
val backgroundColors = List(columnsCount) { colors.random() }
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
- FocusGroup {
- TvLazyRow(
- modifier = modifier.lazyListSemantics(1, columnsCount),
- horizontalArrangement = Arrangement.spacedBy(10.dp)
- ) {
- itemsIndexed(backgroundColors) { index, item ->
- val cardModifier =
- if (index == 0)
- Modifier.initiallyFocused()
- else
- Modifier.restorableFocus()
-
- Card(
- modifier = cardModifier.semantics {
+ TvLazyRow(
+ modifier = modifier
+ .lazyListSemantics(1, columnsCount)
+ .then(focusRestorerModifiers.parentModifier),
+ horizontalArrangement = Arrangement.spacedBy(10.dp)
+ ) {
+ itemsIndexed(backgroundColors) { index, item ->
+ Card(
+ modifier = Modifier
+ .ifElse(index == 0, focusRestorerModifiers.childModifier)
+ .semantics {
collectionItemInfo = CollectionItemInfo(0, 1, index, 1)
},
- backgroundColor = item
- )
- }
+ backgroundColor = item
+ )
}
}
}
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/TopNavigation.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/TopNavigation.kt
index 30b8f83..7a71b47 100644
--- a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/TopNavigation.kt
+++ b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/TopNavigation.kt
@@ -20,13 +20,13 @@
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
-import androidx.tv.foundation.ExperimentalTvFoundationApi
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.Tab
import androidx.tv.material3.TabRow
@@ -34,66 +34,69 @@
import kotlinx.coroutines.delay
enum class Navigation(val displayName: String, val action: @Composable () -> Unit) {
- StandardNavigationDrawer("Standard Navigation Drawer", { StandardNavigationDrawer() }),
- ModalNavigationDrawer("Modal Navigation Drawer", { ModalNavigationDrawer() }),
- LazyRowsAndColumns("Lazy Rows and Columns", { LazyRowsAndColumns() }),
- FeaturedCarousel("Featured Carousel", { FeaturedCarouselContent() }),
- ImmersiveList("Immersive List", { ImmersiveListContent() }),
- TextField("Text Field", { TextFieldContent() }),
- StickyHeader("Sticky Header", { StickyHeaderContent() }),
+ StandardNavigationDrawer("Standard Navigation Drawer", { StandardNavigationDrawer() }),
+ ModalNavigationDrawer("Modal Navigation Drawer", { ModalNavigationDrawer() }),
+ LazyRowsAndColumns("Lazy Rows and Columns", { LazyRowsAndColumns() }),
+ FeaturedCarousel("Featured Carousel", { FeaturedCarouselContent() }),
+ ImmersiveList("Immersive List", { ImmersiveListContent() }),
+ TextField("Text Field", { TextFieldContent() }),
+ StickyHeader("Sticky Header", { StickyHeaderContent() }),
}
@Composable
internal fun TopNavigation(
- updateSelectedTab: (Navigation) -> Unit = {},
+ updateSelectedTab: (Navigation) -> Unit = {},
) {
- var selectedTabIndex by remember { mutableStateOf(0) }
- val tabs = Navigation.values().map { it.displayName }
+ var selectedTabIndex by remember { mutableStateOf(0) }
+ val tabs = Navigation.values().map { it.displayName }
- // Pill indicator
- PillIndicatorTabRow(
- tabs = tabs,
- selectedTabIndex = selectedTabIndex,
- updateSelectedTab = { selectedTabIndex = it }
- )
+ // Pill indicator
+ PillIndicatorTabRow(
+ tabs = tabs,
+ selectedTabIndex = selectedTabIndex,
+ updateSelectedTab = { selectedTabIndex = it }
+ )
- LaunchedEffect(selectedTabIndex) {
- // Only update the tab after 250 milliseconds to avoid loading intermediate tabs while
- // fast scrolling in the TabRow
- delay(250)
- updateSelectedTab(Navigation.values()[selectedTabIndex])
- }
+ LaunchedEffect(selectedTabIndex) {
+ // Only update the tab after 250 milliseconds to avoid loading intermediate tabs while
+ // fast scrolling in the TabRow
+ delay(250)
+ updateSelectedTab(Navigation.values()[selectedTabIndex])
+ }
}
/**
* Pill indicator tab row for reference
*/
-@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalTvFoundationApi::class)
+@OptIn(ExperimentalTvMaterial3Api::class)
@Composable
fun PillIndicatorTabRow(
- tabs: List<String>,
- selectedTabIndex: Int,
- updateSelectedTab: (Int) -> Unit
+ tabs: List<String>,
+ selectedTabIndex: Int,
+ updateSelectedTab: (Int) -> Unit
) {
- FocusGroup {
- TabRow(selectedTabIndex = selectedTabIndex) {
- tabs.forEachIndexed { index, tab ->
- Tab(
- selected = index == selectedTabIndex,
- onFocus = { updateSelectedTab(index) },
- modifier =
- if (tab == Navigation.StandardNavigationDrawer.displayName)
- Modifier.initiallyFocused()
- else
- Modifier.restorableFocus()
- ) {
- Text(
- text = tab,
- fontSize = 12.sp,
- modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
- )
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
+
+ TabRow(
+ selectedTabIndex = selectedTabIndex,
+ modifier = Modifier
+ .then(focusRestorerModifiers.parentModifier)
+ ) {
+ tabs.forEachIndexed { index, tab ->
+ key(index) {
+ Tab(
+ selected = index == selectedTabIndex,
+ onFocus = { updateSelectedTab(index) },
+ modifier = Modifier
+ .ifElse(index == 0, focusRestorerModifiers.childModifier)
+ ) {
+ Text(
+ text = tab,
+ fontSize = 12.sp,
+ modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
+ )
+ }
+ }
}
- }
}
- }
}
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/createCustomInitialFocusRestorerModifiers.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/createCustomInitialFocusRestorerModifiers.kt
new file mode 100644
index 0000000..3f3acbf
--- /dev/null
+++ b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/createCustomInitialFocusRestorerModifiers.kt
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.tv.integration.playground
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.focus.focusProperties
+import androidx.compose.ui.focus.focusRequester
+
+/**
+ * Assign the parentModifier to the container of items and assign the childModifier to the
+ * item that needs to first gain focus. For example, if you want the item at index 0 to get
+ * focus for the first time, you can do the following:
+ *
+ * LazyRow(modifier.then(modifiers.parentModifier) {
+ * item1(modifier.then(modifiers.childModifier) {...}
+ * item2 {...}
+ * item3 {...}
+ * ...
+ * }
+ */
+data class FocusRequesterModifiers(
+ val parentModifier: Modifier,
+ val childModifier: Modifier
+)
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Composable
+fun createCustomInitialFocusRestorerModifiers(): FocusRequesterModifiers {
+ val focusRequester = remember { FocusRequester() }
+ val childFocusRequester = remember { FocusRequester() }
+
+ val parentModifier = Modifier
+ .focusRequester(focusRequester)
+ .focusProperties {
+ exit = {
+ focusRequester.saveFocusedChild()
+ FocusRequester.Default
+ }
+ enter = {
+ if (!focusRequester.restoreFocusedChild())
+ childFocusRequester
+ else
+ FocusRequester.Cancel
+ }
+ }
+
+ val childModifier = Modifier.focusRequester(childFocusRequester)
+
+ return FocusRequesterModifiers(parentModifier, childModifier)
+}
diff --git a/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ifElse.kt b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ifElse.kt
new file mode 100644
index 0000000..eaeee61
--- /dev/null
+++ b/tv/integration-tests/playground/src/main/java/androidx/tv/integration/playground/ifElse.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.tv.integration.playground
+
+import androidx.compose.ui.Modifier
+
+/**
+ * Thanks, Plex 🦄 :)
+ */
+fun Modifier.ifElse(
+ condition: () -> Boolean,
+ ifTrueModifier: Modifier,
+ ifFalseModifier: Modifier = Modifier
+): Modifier = then(if (condition()) ifTrueModifier else ifFalseModifier)
+
+fun Modifier.ifElse(
+ condition: Boolean,
+ ifTrueModifier: Modifier,
+ ifFalseModifier: Modifier = Modifier
+): Modifier = ifElse({ condition }, ifTrueModifier, ifFalseModifier)
\ No newline at end of file
diff --git a/tv/integration-tests/presentation/build.gradle b/tv/integration-tests/presentation/build.gradle
index 142f5a0..5a9de93 100644
--- a/tv/integration-tests/presentation/build.gradle
+++ b/tv/integration-tests/presentation/build.gradle
@@ -39,6 +39,14 @@
implementation(project(":tv:tv-foundation"))
implementation(project(":tv:tv-material"))
+
+ // pull latest compose (if build fails in future, just comment the following compose deps until
+ // we fix this package)
+ implementation(project(":compose:animation:animation"))
+ implementation(project(":compose:runtime:runtime"))
+ implementation(project(":compose:ui:ui"))
+ implementation(project(":compose:foundation:foundation-layout"))
+ implementation(project(":compose:ui:ui"))
}
androidx {
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppLazyRow.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppLazyRow.kt
index 455dc59..07834cd 100644
--- a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppLazyRow.kt
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppLazyRow.kt
@@ -43,6 +43,8 @@
val paddingLeft = 58.dp
var hasFocus by remember { mutableStateOf(false) }
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
+
Column(modifier = modifier.onFocusChanged { hasFocus = it.hasFocus }) {
Text(
text = title,
@@ -55,7 +57,8 @@
TvLazyRow(
contentPadding = PaddingValues(horizontal = paddingLeft),
- horizontalArrangement = Arrangement.spacedBy(20.dp)
+ horizontalArrangement = Arrangement.spacedBy(20.dp),
+ modifier = focusRestorerModifiers.parentModifier,
) {
items.forEachIndexed { index, movie ->
item {
@@ -63,6 +66,7 @@
movie = movie,
index = index,
modifier = Modifier
+ .ifElse(index == 0, focusRestorerModifiers.childModifier)
)
}
}
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppTabRow.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppTabRow.kt
index b1a566e..a571a11 100644
--- a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppTabRow.kt
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/AppTabRow.kt
@@ -20,6 +20,7 @@
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.key
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@@ -38,12 +39,15 @@
onSelectedTabIndexChange: (Int) -> Unit,
modifier: Modifier = Modifier
) {
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
+
AlignmentCenter(horizontalAxis = true) {
- FocusGroup {
- TabRow(
- selectedTabIndex = selectedTabIndex,
- separator = { Spacer(modifier = Modifier.width(4.dp)) },
- modifier = modifier.padding(top = 20.dp),
+ TabRow(
+ selectedTabIndex = selectedTabIndex,
+ separator = { Spacer(modifier = Modifier.width(4.dp)) },
+ modifier = modifier
+ .padding(top = 20.dp)
+ .then(focusRestorerModifiers.parentModifier),
// indicator = @Composable { tabPositions ->
// tabPositions.getOrNull(selectedTabIndex)?.let {
// TabRowDefaults.PillIndicator(
@@ -52,12 +56,9 @@
// )
// }
// }
- ) {
- tabs.forEachIndexed { index, tabLabel ->
- val tabModifier = Modifier.restorableFocus()
- val firstTabModifier = Modifier.initiallyFocused()
- val isFirstTab = index == 0
-
+ ) {
+ tabs.forEachIndexed { index, tabLabel ->
+ key(index) {
Tab(
selected = selectedTabIndex == index,
onFocus = { onSelectedTabIndexChange(index) },
@@ -65,7 +66,8 @@
contentColor = LocalContentColor.current,
// selectedContentColor = Color(0xFF313033),
),
- modifier = if (isFirstTab) firstTabModifier else tabModifier
+ modifier = Modifier
+ .ifElse(index == 0, focusRestorerModifiers.childModifier),
) {
Text(
text = tabLabel,
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/FocusGroup.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/FocusGroup.kt
deleted file mode 100644
index 928dcf9..0000000
--- a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/FocusGroup.kt
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package androidx.tv.integration.presentation
-
-import android.annotation.SuppressLint
-import android.util.Log
-import androidx.compose.foundation.focusable
-import androidx.compose.foundation.layout.Box
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.DisposableEffect
-import androidx.compose.runtime.MutableState
-import androidx.compose.runtime.Stable
-import androidx.compose.runtime.currentCompositeKeyHash
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberUpdatedState
-import androidx.compose.runtime.saveable.rememberSaveable
-import androidx.compose.ui.ExperimentalComposeUiApi
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.focus.FocusDirection
-import androidx.compose.ui.focus.FocusRequester
-import androidx.compose.ui.focus.focusRequester
-import androidx.compose.ui.focus.onFocusChanged
-import androidx.compose.ui.platform.LocalFocusManager
-
-/**
- * Composable container that provides modifier extensions to allow focus to be restored to the
- * element that was previously focused within the TvFocusGroup.
- *
- * @param modifier the modifier to apply to this group.
- * @param content the content that is present within the group and can use focus-group modifier
- * extensions.
- */
-@OptIn(ExperimentalComposeUiApi::class)
-@Composable
-fun FocusGroup(
- modifier: Modifier = Modifier,
- content: @Composable FocusGroupScope.() -> Unit
-) {
- val focusManager = LocalFocusManager.current
- val focusGroupKeyHash = currentCompositeKeyHash
-
- // TODO: Is this the intended way to call rememberSaveable
- // with key set to parentHash?
- val previousFocusedItemHash: MutableState<Int?> = rememberSaveable(
- key = focusGroupKeyHash.toString()
- ) {
- mutableStateOf(null)
- }
-
- val state = FocusGroupState(previousFocusedItemHash = previousFocusedItemHash)
-
- Box(
- modifier = modifier
- .onFocusChanged {
- if (it.isFocused) {
- if (state.noRecordedState()) {
- focusManager.moveFocus(FocusDirection.Enter)
- } else {
- if (state.focusRequester != FocusRequester.Default) {
- try {
- state.focusRequester.requestFocus()
- } catch (e: Exception) {
- Log.w("TvFocusGroup", "TvFocusGroup: Failed to request focus", e)
- }
- } else {
- focusManager.moveFocus(FocusDirection.Enter)
- }
- }
- }
- }
- .focusable(),
- content = { FocusGroupScope(state).content() }
- )
-}
-
-/**
- * Scope containing the modifier extensions to be used within [FocusGroup].
- */
-class FocusGroupScope internal constructor(private val state: FocusGroupState) {
- private var currentFocusableIdIndex = 0
-
- private fun generateUniqueFocusableId(): Int = currentFocusableIdIndex++
-
- /**
- * Modifier that records if the item was in focus before it moved out of the group. When focus
- * enters the [FocusGroup], the item will be returned focus.
- */
- @SuppressLint("ComposableModifierFactory")
- @Composable
- fun Modifier.restorableFocus(): Modifier =
- this.restorableFocus(focusId = rememberSaveable { generateUniqueFocusableId() })
-
- /**
- * Modifier that marks the current composable as the item to gain focus initially when focus
- * enters the [FocusGroup]. When focus enters the [FocusGroup], the item will be returned focus.
- */
- @SuppressLint("ComposableModifierFactory")
- @Composable
- fun Modifier.initiallyFocused(): Modifier {
- val focusId = rememberSaveable { generateUniqueFocusableId() }
- if (state.noRecordedState()) {
- state.recordFocusedItemHash(focusId)
- }
- return this.restorableFocus(focusId)
- }
-
- @SuppressLint("ComposableModifierFactory")
- @OptIn(ExperimentalComposeUiApi::class)
- @Composable
- private fun Modifier.restorableFocus(focusId: Int): Modifier {
- val focusRequester = remember { FocusRequester() }
- var isFocused = remember { false }
- val isCurrentlyFocused by rememberUpdatedState(isFocused)
- val focusManager = LocalFocusManager.current
- state.associatedWith(focusId, focusRequester)
- DisposableEffect(Unit) {
- onDispose {
- state.clearDisposedFocusRequester(focusId)
- if (isCurrentlyFocused) {
- focusManager.moveFocus(FocusDirection.Exit)
- focusManager.moveFocus(FocusDirection.Enter)
- }
- }
- }
-
- return this
- .focusRequester(focusRequester)
- .onFocusChanged {
- isFocused = it.isFocused || it.hasFocus
- if (isFocused) {
- state.recordFocusedItemHash(focusId)
- state.associatedWith(focusId, focusRequester)
- }
- }
- }
-}
-
-@Stable
-internal class FocusGroupState(
- private var previousFocusedItemHash: MutableState<Int?>
-) {
- internal var focusRequester: FocusRequester = FocusRequester.Default
- private set
-
- internal fun recordFocusedItemHash(itemHash: Int) {
- previousFocusedItemHash.value = itemHash
- }
-
- internal fun clearDisposedFocusRequester(itemHash: Int) {
- if (previousFocusedItemHash.value == itemHash) {
- focusRequester = FocusRequester.Default
- }
- }
-
- internal fun associatedWith(itemHash: Int, focusRequester: FocusRequester) {
- if (previousFocusedItemHash.value == itemHash) {
- this.focusRequester = focusRequester
- }
- }
-
- internal fun noRecordedState(): Boolean =
- previousFocusedItemHash.value == null && focusRequester == FocusRequester.Default
-}
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ShowsGrid.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ShowsGrid.kt
index c9f982d..eecb500 100644
--- a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ShowsGrid.kt
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ShowsGrid.kt
@@ -24,7 +24,6 @@
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.runtime.Composable
@@ -40,7 +39,6 @@
import androidx.tv.foundation.lazy.grid.TvLazyHorizontalGrid
import androidx.tv.material3.Text
-@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun ShowsGrid(modifier: Modifier = Modifier) {
var keyword by remember { mutableStateOf("") }
@@ -88,28 +86,27 @@
}
}
- FocusGroup {
- TvLazyHorizontalGrid(
- rows = TvGridCells.Fixed(3),
- contentPadding = PaddingValues(horizontal = 58.dp),
- verticalArrangement = Arrangement.spacedBy(10.dp),
- modifier = Modifier
- .fillMaxSize()
- .bringIntoViewIfChildrenAreFocused(),
- ) {
- items(movies.size) {
- val movie = movies[it]
- val isFirstItem = it == 0
- val itemModifier = Modifier.restorableFocus()
- val firstItemModifier = Modifier.initiallyFocused()
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
- Box(modifier = Modifier.padding(end = 30.dp)) {
- ImageCard(
- movie,
- customCardWidth = 150.dp,
- modifier = if (isFirstItem) firstItemModifier else itemModifier
- )
- }
+ TvLazyHorizontalGrid(
+ rows = TvGridCells.Fixed(3),
+ contentPadding = PaddingValues(horizontal = 58.dp),
+ verticalArrangement = Arrangement.spacedBy(10.dp),
+ modifier = Modifier
+ .fillMaxSize()
+ .bringIntoViewIfChildrenAreFocused()
+ .then(focusRestorerModifiers.parentModifier),
+ ) {
+ items(movies.size) {
+ val movie = movies[it]
+
+ Box(modifier = Modifier.padding(end = 30.dp)) {
+ ImageCard(
+ movie,
+ customCardWidth = 150.dp,
+ modifier = Modifier
+ .ifElse(it == 0, focusRestorerModifiers.childModifier),
+ )
}
}
}
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/Sidebar.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/Sidebar.kt
index 882b27b..562a149 100644
--- a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/Sidebar.kt
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/Sidebar.kt
@@ -16,8 +16,9 @@
package androidx.tv.integration.presentation
+import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
-import androidx.compose.foundation.focusable
+import androidx.compose.foundation.focusGroup
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
@@ -33,6 +34,7 @@
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
@@ -47,7 +49,7 @@
import androidx.tv.material3.ExperimentalTvMaterial3Api
import androidx.tv.material3.Icon
-@OptIn(ExperimentalTvMaterial3Api::class)
+@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalFoundationApi::class)
@Composable
fun Sidebar(
selectedIndex: Int,
@@ -101,30 +103,37 @@
}
}
- FocusGroup {
- Column(
- modifier = Modifier
- .width(60.dp)
- .fillMaxHeight()
- .background(pageColor)
- .focusable(false),
- horizontalAlignment = Alignment.CenterHorizontally,
- verticalArrangement = Arrangement.Center,
- ) {
+ val focusRestorerModifiers = createCustomInitialFocusRestorerModifiers()
+
+ Column(
+ modifier = Modifier
+ .width(60.dp)
+ .fillMaxHeight()
+ .background(pageColor)
+ .then(focusRestorerModifiers.parentModifier)
+ .focusGroup(),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ verticalArrangement = Arrangement.Center,
+ ) {
+ key(0) {
drawIcon(
imageVector = Icons.Outlined.Home,
index = 0,
- modifier = Modifier.initiallyFocused(),
+ modifier = focusRestorerModifiers.childModifier,
)
+ }
+ key(1) {
drawIcon(
imageVector = Icons.Outlined.Movie,
index = 1,
- modifier = Modifier.restorableFocus(),
+ modifier = Modifier,
)
+ }
+ key(2) {
drawIcon(
imageVector = Icons.Outlined.Tv,
index = 2,
- modifier = Modifier.restorableFocus(),
+ modifier = Modifier,
)
}
}
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/createCustomInitialFocusRestorerModifiers.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/createCustomInitialFocusRestorerModifiers.kt
new file mode 100644
index 0000000..6b00a52
--- /dev/null
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/createCustomInitialFocusRestorerModifiers.kt
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.tv.integration.presentation
+
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.remember
+import androidx.compose.ui.ExperimentalComposeUiApi
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.focus.focusProperties
+import androidx.compose.ui.focus.focusRequester
+
+/**
+ * Assign the parentModifier to the container of items and assign the childModifier to the
+ * item that needs to first gain focus. For example, if you want the item at index 0 to get
+ * focus for the first time, you can do the following:
+ *
+ * LazyRow(modifier.then(modifiers.parentModifier) {
+ * item1(modifier.then(modifiers.childModifier) {...}
+ * item2 {...}
+ * item3 {...}
+ * ...
+ * }
+ */
+data class FocusRequesterModifiers(
+ val parentModifier: Modifier,
+ val childModifier: Modifier
+)
+
+@OptIn(ExperimentalComposeUiApi::class)
+@Composable
+fun createCustomInitialFocusRestorerModifiers(): FocusRequesterModifiers {
+ val focusRequester = remember { FocusRequester() }
+ val childFocusRequester = remember { FocusRequester() }
+
+ val parentModifier = Modifier
+ .focusRequester(focusRequester)
+ .focusProperties {
+ exit = {
+ focusRequester.saveFocusedChild()
+ FocusRequester.Default
+ }
+ enter = {
+ if (!focusRequester.restoreFocusedChild())
+ childFocusRequester
+ else
+ FocusRequester.Cancel
+ }
+ }
+
+ val childModifier = Modifier.focusRequester(childFocusRequester)
+
+ return FocusRequesterModifiers(parentModifier, childModifier)
+}
diff --git a/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ifElse.kt b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ifElse.kt
new file mode 100644
index 0000000..4a29855
--- /dev/null
+++ b/tv/integration-tests/presentation/src/main/java/androidx/tv/integration/presentation/ifElse.kt
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.tv.integration.presentation
+
+import androidx.compose.ui.Modifier
+
+/**
+ * Thanks, Plex 🦄 :)
+ */
+fun Modifier.ifElse(
+ condition: () -> Boolean,
+ ifTrueModifier: Modifier,
+ ifFalseModifier: Modifier = Modifier
+): Modifier = then(if (condition()) ifTrueModifier else ifFalseModifier)
+
+fun Modifier.ifElse(
+ condition: Boolean,
+ ifTrueModifier: Modifier,
+ ifFalseModifier: Modifier = Modifier
+): Modifier = ifElse({ condition }, ifTrueModifier, ifFalseModifier)
\ No newline at end of file
diff --git a/tv/samples/src/main/java/androidx/tv/samples/TabRowSamples.kt b/tv/samples/src/main/java/androidx/tv/samples/TabRowSamples.kt
index b9d11bd..96c9535 100644
--- a/tv/samples/src/main/java/androidx/tv/samples/TabRowSamples.kt
+++ b/tv/samples/src/main/java/androidx/tv/samples/TabRowSamples.kt
@@ -26,10 +26,13 @@
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
+import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
+import androidx.compose.ui.focus.focusRestorer
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
@@ -45,7 +48,7 @@
/**
* Tab row with a Pill indicator
*/
-@OptIn(ExperimentalTvMaterial3Api::class)
+@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@Sampled
fun PillIndicatorTabRow() {
@@ -55,17 +58,20 @@
TabRow(
selectedTabIndex = selectedTabIndex,
separator = { Spacer(modifier = Modifier.width(12.dp)) },
+ modifier = Modifier.focusRestorer()
) {
tabs.forEachIndexed { index, tab ->
- Tab(
- selected = index == selectedTabIndex,
- onFocus = { selectedTabIndex = index },
- ) {
- Text(
- text = tab,
- fontSize = 12.sp,
- modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
- )
+ key(index) {
+ Tab(
+ selected = index == selectedTabIndex,
+ onFocus = { selectedTabIndex = index },
+ ) {
+ Text(
+ text = tab,
+ fontSize = 12.sp,
+ modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
+ )
+ }
}
}
}
@@ -74,7 +80,7 @@
/**
* Tab row with an Underlined indicator
*/
-@OptIn(ExperimentalTvMaterial3Api::class)
+@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@Sampled
fun UnderlinedIndicatorTabRow() {
@@ -88,19 +94,22 @@
TabRowDefaults.UnderlinedIndicator(
currentTabPosition = tabPositions[selectedTabIndex]
)
- }
+ },
+ modifier = Modifier.focusRestorer()
) {
tabs.forEachIndexed { index, tab ->
- Tab(
- selected = index == selectedTabIndex,
- onFocus = { selectedTabIndex = index },
- colors = TabDefaults.underlinedIndicatorTabColors(),
- ) {
- Text(
- text = tab,
- fontSize = 12.sp,
- modifier = Modifier.padding(bottom = 4.dp)
- )
+ key(index) {
+ Tab(
+ selected = index == selectedTabIndex,
+ onFocus = { selectedTabIndex = index },
+ colors = TabDefaults.underlinedIndicatorTabColors(),
+ ) {
+ Text(
+ text = tab,
+ fontSize = 12.sp,
+ modifier = Modifier.padding(bottom = 4.dp)
+ )
+ }
}
}
}
@@ -109,7 +118,7 @@
/**
* Tab row with delay between tab changes
*/
-@OptIn(ExperimentalTvMaterial3Api::class)
+@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@Sampled
fun TabRowWithDebounce() {
@@ -128,17 +137,20 @@
TabRow(
selectedTabIndex = selectedTabIndex,
separator = { Spacer(modifier = Modifier.width(12.dp)) },
+ modifier = Modifier.focusRestorer()
) {
tabs.forEachIndexed { index, tab ->
- Tab(
- selected = index == selectedTabIndex,
- onFocus = { selectedTabIndex = index },
- ) {
- Text(
- text = tab,
- fontSize = 12.sp,
- modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
- )
+ key(index) {
+ Tab(
+ selected = index == selectedTabIndex,
+ onFocus = { selectedTabIndex = index },
+ ) {
+ Text(
+ text = tab,
+ fontSize = 12.sp,
+ modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
+ )
+ }
}
}
}
@@ -147,7 +159,7 @@
/**
* Tab changes onClick instead of onFocus
*/
-@OptIn(ExperimentalTvMaterial3Api::class)
+@OptIn(ExperimentalTvMaterial3Api::class, ExperimentalComposeUiApi::class)
@Composable
@Sampled
fun OnClickNavigation() {
@@ -180,22 +192,25 @@
TabRowDefaults.PillIndicator(
currentTabPosition = tabPositions[activeTabIndex]
)
- }
+ },
+ modifier = Modifier.focusRestorer()
) {
repeat(bgColors.size) {
- Tab(
- selected = activeTabIndex == it,
- onFocus = { focusedTabIndex = it },
- onClick = {
- focusedTabIndex = it
- activeTabIndex = it
+ key(it) {
+ Tab(
+ selected = activeTabIndex == it,
+ onFocus = { focusedTabIndex = it },
+ onClick = {
+ focusedTabIndex = it
+ activeTabIndex = it
+ }
+ ) {
+ Text(
+ text = "Tab ${it + 1}",
+ fontSize = 12.sp,
+ modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
+ )
}
- ) {
- Text(
- text = "Tab ${it + 1}",
- fontSize = 12.sp,
- modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp)
- )
}
}
}
diff --git a/wear/compose/compose-foundation/build.gradle b/wear/compose/compose-foundation/build.gradle
index c00ea3b..749bb3c 100644
--- a/wear/compose/compose-foundation/build.gradle
+++ b/wear/compose/compose-foundation/build.gradle
@@ -33,7 +33,7 @@
implementation(libs.kotlinStdlib)
implementation(project(":compose:foundation:foundation-layout"))
implementation(project(":compose:ui:ui-util"))
- implementation(project(":core:core"))
+ implementation("androidx.core:core:1.11.0-beta02")
implementation("androidx.profileinstaller:profileinstaller:1.3.0")
testImplementation(libs.testRules)
diff --git a/wear/compose/compose-material3/api/current.txt b/wear/compose/compose-material3/api/current.txt
index 2142a1b..f9659e1 100644
--- a/wear/compose/compose-material3/api/current.txt
+++ b/wear/compose/compose-material3/api/current.txt
@@ -210,6 +210,10 @@
method @androidx.compose.runtime.Composable public static void MaterialTheme(optional androidx.wear.compose.material3.ColorScheme colorScheme, optional androidx.wear.compose.material3.Typography typography, optional androidx.wear.compose.material3.Shapes shapes, kotlin.jvm.functions.Function0<kotlin.Unit> content);
}
+ public final class RangeSemanticsKt {
+ method public static androidx.compose.ui.Modifier rangeSemantics(androidx.compose.ui.Modifier, float value, boolean enabled, kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit> onValueChange, kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> valueRange, int steps);
+ }
+
public final class ShapeDefaults {
method public androidx.compose.foundation.shape.RoundedCornerShape getExtraLarge();
method public androidx.compose.foundation.shape.RoundedCornerShape getExtraSmall();
@@ -247,6 +251,19 @@
property public final androidx.compose.ui.graphics.Shape small;
}
+ public final class StepperDefaults {
+ method public androidx.compose.ui.graphics.vector.ImageVector getDecrease();
+ method public androidx.compose.ui.graphics.vector.ImageVector getIncrease();
+ property public final androidx.compose.ui.graphics.vector.ImageVector Decrease;
+ property public final androidx.compose.ui.graphics.vector.ImageVector Increase;
+ field public static final androidx.wear.compose.material3.StepperDefaults INSTANCE;
+ }
+
+ public final class StepperKt {
+ method @androidx.compose.runtime.Composable public static void Stepper(float value, kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit> onValueChange, int steps, kotlin.jvm.functions.Function0<kotlin.Unit> decreaseIcon, kotlin.jvm.functions.Function0<kotlin.Unit> increaseIcon, optional androidx.compose.ui.Modifier modifier, optional kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> valueRange, optional long backgroundColor, optional long contentColor, optional long iconColor, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void Stepper(int value, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onValueChange, kotlin.ranges.IntProgression valueProgression, kotlin.jvm.functions.Function0<kotlin.Unit> decreaseIcon, kotlin.jvm.functions.Function0<kotlin.Unit> increaseIcon, optional androidx.compose.ui.Modifier modifier, optional long backgroundColor, optional long contentColor, optional long iconColor, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
+ }
+
@androidx.compose.runtime.Immutable public final class TextButtonColors {
ctor public TextButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
}
diff --git a/wear/compose/compose-material3/api/restricted_current.txt b/wear/compose/compose-material3/api/restricted_current.txt
index 2142a1b..f9659e1 100644
--- a/wear/compose/compose-material3/api/restricted_current.txt
+++ b/wear/compose/compose-material3/api/restricted_current.txt
@@ -210,6 +210,10 @@
method @androidx.compose.runtime.Composable public static void MaterialTheme(optional androidx.wear.compose.material3.ColorScheme colorScheme, optional androidx.wear.compose.material3.Typography typography, optional androidx.wear.compose.material3.Shapes shapes, kotlin.jvm.functions.Function0<kotlin.Unit> content);
}
+ public final class RangeSemanticsKt {
+ method public static androidx.compose.ui.Modifier rangeSemantics(androidx.compose.ui.Modifier, float value, boolean enabled, kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit> onValueChange, kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> valueRange, int steps);
+ }
+
public final class ShapeDefaults {
method public androidx.compose.foundation.shape.RoundedCornerShape getExtraLarge();
method public androidx.compose.foundation.shape.RoundedCornerShape getExtraSmall();
@@ -247,6 +251,19 @@
property public final androidx.compose.ui.graphics.Shape small;
}
+ public final class StepperDefaults {
+ method public androidx.compose.ui.graphics.vector.ImageVector getDecrease();
+ method public androidx.compose.ui.graphics.vector.ImageVector getIncrease();
+ property public final androidx.compose.ui.graphics.vector.ImageVector Decrease;
+ property public final androidx.compose.ui.graphics.vector.ImageVector Increase;
+ field public static final androidx.wear.compose.material3.StepperDefaults INSTANCE;
+ }
+
+ public final class StepperKt {
+ method @androidx.compose.runtime.Composable public static void Stepper(float value, kotlin.jvm.functions.Function1<? super java.lang.Float,kotlin.Unit> onValueChange, int steps, kotlin.jvm.functions.Function0<kotlin.Unit> decreaseIcon, kotlin.jvm.functions.Function0<kotlin.Unit> increaseIcon, optional androidx.compose.ui.Modifier modifier, optional kotlin.ranges.ClosedFloatingPointRange<java.lang.Float> valueRange, optional long backgroundColor, optional long contentColor, optional long iconColor, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
+ method @androidx.compose.runtime.Composable public static void Stepper(int value, kotlin.jvm.functions.Function1<? super java.lang.Integer,kotlin.Unit> onValueChange, kotlin.ranges.IntProgression valueProgression, kotlin.jvm.functions.Function0<kotlin.Unit> decreaseIcon, kotlin.jvm.functions.Function0<kotlin.Unit> increaseIcon, optional androidx.compose.ui.Modifier modifier, optional long backgroundColor, optional long contentColor, optional long iconColor, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.BoxScope,kotlin.Unit> content);
+ }
+
@androidx.compose.runtime.Immutable public final class TextButtonColors {
ctor public TextButtonColors(long containerColor, long contentColor, long disabledContainerColor, long disabledContentColor);
}
diff --git a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
index c24447b..555b6b2 100644
--- a/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
+++ b/wear/compose/compose-material3/integration-tests/src/main/java/androidx/wear/compose/material3/demos/WearMaterial3Demos.kt
@@ -20,6 +20,9 @@
import androidx.wear.compose.integration.demos.common.ComposableDemo
import androidx.wear.compose.integration.demos.common.DemoCategory
import androidx.wear.compose.material3.samples.FixedFontSize
+import androidx.wear.compose.material3.samples.StepperSample
+import androidx.wear.compose.material3.samples.StepperWithIntegerSample
+import androidx.wear.compose.material3.samples.StepperWithRangeSemanticsSample
val WearMaterial3Demos = DemoCategory(
"Material 3",
@@ -47,6 +50,31 @@
ComposableDemo("Icon Button") {
IconButtonDemo()
},
+ DemoCategory(
+ "Stepper",
+ listOf(
+ DemoCategory(
+ "Samples",
+ listOf(
+ ComposableDemo("Stepper") {
+ Centralize { StepperSample() }
+ },
+ ComposableDemo("Integer Stepper") {
+ Centralize { StepperWithIntegerSample() }
+ },
+ ComposableDemo("Stepper with rangeSemantics") {
+ Centralize { StepperWithRangeSemanticsSample() }
+ }
+ )
+ ),
+ DemoCategory(
+ "Demos",
+ listOf(
+ // Add Stepper demos here
+ )
+ )
+ )
+ ),
ComposableDemo(
title = "Fixed Font Size"
) {
diff --git a/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/StepperSample.kt b/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/StepperSample.kt
new file mode 100644
index 0000000..0ca665d
--- /dev/null
+++ b/wear/compose/compose-material3/samples/src/main/java/androidx/wear/compose/material3/samples/StepperSample.kt
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.wear.compose.material3.samples
+
+import androidx.annotation.Sampled
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.Modifier
+import androidx.wear.compose.material3.Icon
+import androidx.wear.compose.material3.Stepper
+import androidx.wear.compose.material3.StepperDefaults
+import androidx.wear.compose.material3.Text
+import androidx.wear.compose.material3.rangeSemantics
+
+@Sampled
+@Composable
+fun StepperSample() {
+ var value by remember { mutableStateOf(2f) }
+ Stepper(
+ value = value,
+ onValueChange = { value = it },
+ valueRange = 1f..4f,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ steps = 7
+ ) { Text("Value: $value") }
+}
+
+@Sampled
+@Composable
+fun StepperWithIntegerSample() {
+ var value by remember { mutableStateOf(2) }
+ Stepper(
+ value = value,
+ onValueChange = { value = it },
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ valueProgression = 1..10
+ ) { Text("Value: $value") }
+}
+
+@Sampled
+@Composable
+fun StepperWithRangeSemanticsSample() {
+ var value by remember { mutableStateOf(2f) }
+ val valueRange = 1f..4f
+ val onValueChange = { i: Float -> value = i }
+ val steps = 7
+
+ Stepper(
+ value = value,
+ onValueChange = onValueChange,
+ valueRange = valueRange,
+ modifier = Modifier.rangeSemantics(value, true, onValueChange, valueRange, steps),
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ steps = steps,
+ ) { Text("Value: $value") }
+}
diff --git a/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/StepperTest.kt b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/StepperTest.kt
new file mode 100644
index 0000000..c683c09
--- /dev/null
+++ b/wear/compose/compose-material3/src/androidTest/kotlin/androidx/wear/compose/material3/StepperTest.kt
@@ -0,0 +1,676 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.wear.compose.material3
+
+import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Star
+import androidx.compose.runtime.MutableState
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.geometry.Offset
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.semantics.ProgressBarRangeInfo
+import androidx.compose.ui.test.assertContentDescriptionContains
+import androidx.compose.ui.test.assertHasNoClickAction
+import androidx.compose.ui.test.assertRangeInfoEquals
+import androidx.compose.ui.test.assertTopPositionInRootIsEqualTo
+import androidx.compose.ui.test.click
+import androidx.compose.ui.test.getUnclippedBoundsInRoot
+import androidx.compose.ui.test.junit4.ComposeContentTestRule
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onChild
+import androidx.compose.ui.test.onChildAt
+import androidx.compose.ui.test.onNodeWithContentDescription
+import androidx.compose.ui.test.onNodeWithTag
+import androidx.compose.ui.test.onParent
+import androidx.compose.ui.test.onRoot
+import androidx.compose.ui.test.performTouchInput
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.height
+import com.google.common.truth.Truth
+import kotlin.math.roundToInt
+import org.junit.Assert.assertEquals
+import org.junit.Rule
+import org.junit.Test
+
+public class StepperTest {
+ @get:Rule
+ public val rule = createComposeRule()
+
+ @Test
+ public fun supports_testtag() {
+ rule.setContentWithTheme {
+ Stepper(
+ value = 1f,
+ onValueChange = {},
+ steps = 5,
+ increaseIcon = {},
+ decreaseIcon = {},
+ modifier = Modifier.testTag(TEST_TAG)
+ ) {}
+ }
+
+ rule.onNodeWithTag(TEST_TAG).assertExists()
+ }
+
+ @Test
+ public fun coerces_value_top_limit() = rule.setNewValueAndCheck(
+ range = 0f..10f,
+ steps = 4,
+ initialValue = 4f,
+ newValue = 20f,
+ expectedFinalValue = 10f
+ )
+
+ @Test
+ public fun coerces_value_lower_limit() = rule.setNewValueAndCheck(
+ range = 0f..10f,
+ steps = 4,
+ initialValue = 4f,
+ newValue = -20f,
+ expectedFinalValue = 0f
+ )
+
+ @Test(expected = IllegalArgumentException::class)
+ public fun throws_when_steps_negative() {
+ rule.setContent {
+ Stepper(
+ value = 0f,
+ onValueChange = {},
+ increaseIcon = {},
+ decreaseIcon = {},
+ steps = -1
+ ) {}
+ }
+ }
+
+ @Test
+ public fun coerce_value_exactly() = rule.setNewValueAndCheck(
+ range = 0f..1f,
+ steps = 4,
+ initialValue = 0f,
+ // Allowed values are only 0, 0.2, 0.4, 0.6, 0.8, 1
+ newValue = 0.6f,
+ expectedFinalValue = 0.6f
+ )
+
+ @Test
+ public fun coerce_value_to_previous() = rule.setNewValueAndCheck(
+ range = 0f..1f,
+ steps = 4,
+ initialValue = 0f,
+ // Allowed values are only 0, 0.2, 0.4, 0.6, 0.8, 1
+ newValue = 0.65f,
+ expectedFinalValue = 0.6f
+ )
+
+ @Test
+ public fun coerce_value_to_next() = rule.setNewValueAndCheck(
+ range = 0f..1f,
+ steps = 4,
+ initialValue = 0f,
+ // Allowed values are only 0, 0.2, 0.4, 0.6, 0.8, 1
+ newValue = 0.55f,
+ expectedFinalValue = 0.6f
+ )
+
+ @Test
+ public fun decreases_value_by_clicking_bottom() {
+ val state = mutableStateOf(2f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ // The clickable area for a decrease button takes bottom 35% of the screen
+ rule.onNodeWithTag(TEST_TAG).performTouchInput {
+ click(Offset(width / 2f, height - 15f))
+ }
+
+ rule.runOnIdle {
+ Truth.assertThat(state.value).isWithin(0.001f).of(1f)
+ }
+ }
+
+ @Test
+ public fun increases_value_by_clicking_top() {
+ val state = mutableStateOf(2f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ // The clickable area for an increase button takes top 35% of the screen
+ rule.onNodeWithTag(TEST_TAG).performTouchInput { click(Offset(width / 2f, 15f)) }
+
+ rule.runOnIdle {
+ Truth.assertThat(state.value).isWithin(0.001f).of(3f)
+ }
+ }
+
+ @Test
+ public fun reaches_min_clicking_bottom() {
+ // Start one step above the minimum.
+ val state = mutableStateOf(2f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ // The clickable area for a decrease button takes bottom 35% of the screen
+ rule.onNodeWithTag(TEST_TAG).performTouchInput { click(Offset(width / 2f, height - 15f)) }
+
+ rule.runOnIdle {
+ Truth.assertThat(state.value).isWithin(0.001f).of(1f)
+ }
+ }
+
+ @Test
+ public fun reaches_max_clicking_top() {
+ // Start one step below the maximum.
+ val state = mutableStateOf(3f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ // The clickable area for an increase button takes top 35% of the screen
+ rule.onNodeWithTag(TEST_TAG).performTouchInput { click(Offset(width / 2f, 15f)) }
+
+ rule.runOnIdle {
+ Truth.assertThat(state.value).isWithin(0.001f).of(4f)
+ }
+ }
+
+ @Test
+ public fun disables_decrease_when_minimum_value_reached() {
+ val state = mutableStateOf(1f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ rule.onNodeWithContentDescription(DECREASE).onParent().assertHasNoClickAction()
+ }
+
+ @Test
+ public fun disables_increase_when_maximum_value_reached() {
+ val state = mutableStateOf(4f)
+ val range = 1f..4f
+
+ rule.initDefaultStepper(state, range, 2)
+
+ rule.onNodeWithContentDescription(INCREASE).onParent().assertHasNoClickAction()
+ }
+
+ @Test
+ public fun colors_decrease_icon_with_disabled_alpha() =
+ verifyDisabledColors(increase = false, value = 1f)
+
+ @Test
+ public fun colors_increase_icon_with_disabled_alpha() =
+ verifyDisabledColors(increase = true, value = 4f)
+
+ @Test
+ public fun sets_custom_decrease_icon() {
+ val iconTag = "iconTag_test"
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = Modifier.testTag(TEST_TAG),
+ value = 0f,
+ steps = 5,
+ onValueChange = { },
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = {
+ Icon(
+ modifier = Modifier.testTag(iconTag),
+ imageVector = Icons.Default.Star,
+ contentDescription = ""
+ )
+ },
+ ) {}
+ }
+ val unclippedBoundsInRoot = rule.onRoot().getUnclippedBoundsInRoot()
+
+ rule.waitForIdle()
+ rule.onNodeWithTag(iconTag, true)
+ .assertExists()
+ .assertTopPositionInRootIsEqualTo(
+ unclippedBoundsInRoot.height -
+ BorderVerticalMargin - DefaultIconHeight
+ )
+ }
+
+ @Test
+ public fun sets_custom_increase_icon() {
+ val iconTag = "iconTag_test"
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = Modifier.testTag(TEST_TAG),
+ value = 0f,
+ steps = 5,
+ onValueChange = { },
+ increaseIcon = {
+ Icon(
+ modifier = Modifier.testTag(iconTag),
+ imageVector = Icons.Default.Star,
+ contentDescription = ""
+ )
+ },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ ) {}
+ }
+ rule.waitForIdle()
+ rule.onNodeWithTag(iconTag, true)
+ .assertExists()
+ .assertTopPositionInRootIsEqualTo(BorderVerticalMargin)
+ }
+
+ @Test
+ public fun sets_content() {
+ val contentTag = "contentTag_test"
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = Modifier.testTag(TEST_TAG),
+ value = 0f,
+ steps = 5,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ onValueChange = { },
+ ) {
+ Text("Testing", modifier = Modifier
+ .testTag(contentTag)
+ .fillMaxHeight())
+ }
+ }
+
+ val rootHeight = rule.onRoot().getUnclippedBoundsInRoot().height
+
+ rule.waitForIdle()
+ rule.onNodeWithTag(contentTag, true)
+ .assertExists()
+ .assertTopPositionInRootIsEqualTo(
+ // Position of the content is a weight(35%) of (top button minus 2 spacers 8dp each)
+ // plus 1 spacer
+ (rootHeight - VerticalMargin * 2) * ButtonWeight + VerticalMargin
+ )
+ }
+
+ @Test
+ public fun sets_custom_description_for_increase_icon() {
+ val testContentDescription = "testContentDescription"
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = Modifier.testTag(TEST_TAG),
+ value = 0f,
+ steps = 5,
+ increaseIcon = { Icon(StepperDefaults.Increase, testContentDescription) },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ onValueChange = { },
+ ) {}
+ }
+
+ rule.waitForIdle()
+ rule.onNodeWithTag(TEST_TAG, true)
+ // 0 is the index of increase button, 1 - decrease button, content is empty
+ .onChildAt(0)
+ .onChild()
+ .assertContentDescriptionContains(testContentDescription)
+ }
+
+ @Test
+ public fun sets_custom_description_for_decrease_icon() {
+ val testContentDescription = "testContentDescription"
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = Modifier.testTag(TEST_TAG),
+ value = 0f,
+ steps = 5,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, testContentDescription) },
+ onValueChange = { },
+ ) {}
+ }
+
+ rule.waitForIdle()
+ rule.onNodeWithTag(TEST_TAG, true)
+ // 0 is the index of increase button, 1 - decrease button, content is empty
+ .onChildAt(1)
+ .onChild()
+ .assertContentDescriptionContains(testContentDescription)
+ }
+
+ @Test(expected = java.lang.AssertionError::class)
+ fun does_not_support_stepper_range_semantics_by_default() {
+ val value = 1f
+ val steps = 5
+ val valueRange = 0f..(steps + 1).toFloat()
+
+ val modifier = Modifier.testTag(TEST_TAG)
+
+ rule.setContentWithTheme {
+ Stepper(
+ modifier = modifier,
+ value = value,
+ steps = steps,
+ valueRange = valueRange,
+ onValueChange = { },
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ ) {}
+ }
+ rule.waitForIdle()
+ // Should throw assertion error for assertRangeInfoEquals
+ rule.onNodeWithTag(TEST_TAG, true)
+ .assertExists()
+ .assertRangeInfoEquals(ProgressBarRangeInfo(value, valueRange, steps))
+ }
+
+ @Test
+ fun enable_stepper_semantics_using_modifier() {
+ val value = 1f
+ val steps = 5
+ val valueRange = 0f..(steps + 1).toFloat()
+
+ rule.setContentWithTheme {
+ Stepper(
+ value = value,
+ steps = steps,
+ valueRange = valueRange,
+ onValueChange = { },
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ modifier = Modifier
+ .testTag(TEST_TAG)
+ .rangeSemantics(value, true, {}, valueRange, steps)
+ ) {}
+ }
+ rule.waitForIdle()
+ rule.onNodeWithTag(TEST_TAG, true)
+ .assertExists()
+ .assertRangeInfoEquals(ProgressBarRangeInfo(value, valueRange, steps))
+ }
+
+ private fun verifyDisabledColors(increase: Boolean, value: Float) {
+ val state = mutableStateOf(value)
+ var expectedIconColor = Color.Transparent
+ var actualIconColor = Color.Transparent
+ var expectedAlpha = 0f
+ var actualAlpha = 0f
+
+ rule.setContentWithTheme {
+ expectedIconColor = MaterialTheme.colorScheme.primary.copy(
+ alpha = ContentAlpha.disabled
+ )
+ expectedAlpha = expectedIconColor.alpha
+ Stepper(
+ value = state.value,
+ onValueChange = { state.value = it },
+ valueRange = 1f..4f,
+ steps = 2,
+ iconColor = MaterialTheme.colorScheme.primary,
+ increaseIcon = {
+ if (increase) {
+ actualIconColor = LocalContentColor.current
+ actualAlpha = LocalContentAlpha.current
+ }
+ },
+ decreaseIcon = {
+ if (!increase) {
+ actualIconColor = LocalContentColor.current
+ actualAlpha = LocalContentAlpha.current
+ }
+ },
+ modifier = Modifier.testTag(TEST_TAG)
+ ) {}
+ }
+
+ assertEquals(expectedIconColor, actualIconColor)
+ assertEquals(expectedAlpha, actualAlpha)
+ }
+
+ private val BorderVerticalMargin = 22.dp
+ private val VerticalMargin = 8.dp
+ private val ButtonWeight = .35f
+ private val DefaultIconHeight = 24.dp
+}
+
+public class IntegerStepperTest {
+ @get:Rule
+ public val rule = createComposeRule()
+
+ @Test
+ public fun supports_testtag() {
+ rule.setContentWithTheme {
+ Stepper(
+ value = 1,
+ onValueChange = {},
+ valueProgression = 0..5,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ modifier = Modifier.testTag(TEST_TAG)
+ ) {}
+ }
+
+ rule.onNodeWithTag(TEST_TAG).assertExists()
+ }
+
+ @Test
+ public fun coerces_value_top_limit() = rule.setNewValueAndCheck(
+ progression = 0..10,
+ initialValue = 4,
+ newValue = 20,
+ expectedFinalValue = 10
+ )
+
+ @Test
+ public fun coerces_value_lower_limit() = rule.setNewValueAndCheck(
+ progression = 0..10,
+ initialValue = 4,
+ newValue = -20,
+ expectedFinalValue = 0
+ )
+
+ @Test
+ public fun coerce_value_exactly() = rule.setNewValueAndCheck(
+ progression = IntProgression.fromClosedRange(0, 12, 3),
+ initialValue = 0,
+ newValue = 3,
+ expectedFinalValue = 3
+ )
+
+ @Test
+ public fun coerce_value_to_previous() = rule.setNewValueAndCheck(
+ progression = IntProgression.fromClosedRange(0, 12, 3),
+ initialValue = 0,
+ newValue = 4,
+ expectedFinalValue = 3
+ )
+
+ @Test
+ public fun coerce_value_to_next() = rule.setNewValueAndCheck(
+ progression = IntProgression.fromClosedRange(0, 12, 3),
+ initialValue = 0,
+ newValue = 5,
+ expectedFinalValue = 6
+ )
+
+ @Test(expected = java.lang.AssertionError::class)
+ fun does_not_support_stepper_range_semantics_by_default() {
+ val value = 1
+ val valueProgression = 0..10
+
+ rule.setContentWithTheme {
+ Stepper(
+ value = value,
+ onValueChange = {},
+ valueProgression = valueProgression,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ modifier = Modifier.testTag(TEST_TAG)
+ ) {}
+ }
+ rule.waitForIdle()
+ // Should throw assertion error for assertRangeInfoEquals
+ rule.onNodeWithTag(TEST_TAG, true)
+ .assertExists()
+ .assertRangeInfoEquals(
+ ProgressBarRangeInfo(
+ value.toFloat(),
+ valueProgression.first.toFloat()..valueProgression.last.toFloat(),
+ valueProgression.stepsNumber()
+ )
+ )
+ }
+
+ @Test()
+ fun enable_stepper_semantics_using_modifier() {
+ val value = 1
+ val valueProgression = 0..10
+
+ rule.setContentWithTheme {
+ Stepper(
+ value = value,
+ onValueChange = {},
+ valueProgression = valueProgression,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ modifier = Modifier
+ .testTag(TEST_TAG)
+ .rangeSemantics(
+ value.toFloat(),
+ true, {},
+ valueProgression.first.toFloat()..valueProgression.last.toFloat(),
+ valueProgression.stepsNumber()
+ )
+ ) {}
+ }
+ rule.waitForIdle()
+
+ rule.onNodeWithTag(TEST_TAG, true)
+ .assertExists()
+ .assertRangeInfoEquals(
+ ProgressBarRangeInfo(
+ value.toFloat(),
+ valueProgression.first.toFloat()..valueProgression.last.toFloat(),
+ valueProgression.stepsNumber()
+ )
+ )
+ }
+}
+
+private fun ComposeContentTestRule.setNewValueAndCheck(
+ range: ClosedFloatingPointRange<Float>,
+ steps: Int,
+ initialValue: Float,
+ newValue: Float,
+ expectedFinalValue: Float
+) {
+ val state = mutableStateOf(initialValue)
+
+ initDefaultStepper(state, range, steps)
+
+ runOnIdle { state.value = newValue }
+ onNodeWithTag(TEST_TAG, true)
+ .assertRangeInfoEquals(ProgressBarRangeInfo(expectedFinalValue, range, steps))
+
+ // State value is not coerced to expectedValue - thus we expect it to be equal to
+ // the last set value, which is newValue
+ waitForIdle()
+ assertEquals(newValue, state.value)
+}
+
+private fun ComposeContentTestRule.initDefaultStepper(
+ state: MutableState<Float>,
+ valueRange: ClosedFloatingPointRange<Float>,
+ steps: Int
+) {
+ val onValueChange: (Float) -> Unit = { state.value = it }
+
+ setContentWithTheme {
+ Stepper(
+ value = state.value,
+ onValueChange = onValueChange,
+ valueRange = valueRange,
+ steps = steps,
+ increaseIcon = { Icon(StepperDefaults.Increase, INCREASE) },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, DECREASE) },
+ modifier = Modifier
+ .testTag(TEST_TAG)
+ .rangeSemantics(state.value, true, onValueChange, valueRange, steps)
+ ) {}
+ }
+}
+
+private fun ComposeContentTestRule.setNewValueAndCheck(
+ progression: IntProgression,
+ initialValue: Int,
+ newValue: Int,
+ expectedFinalValue: Int
+) {
+ val state = mutableStateOf(initialValue)
+
+ initDefaultStepper(state, progression)
+
+ runOnIdle { state.value = newValue }
+ onNodeWithTag(TEST_TAG)
+ .assertRangeInfoEquals(
+ ProgressBarRangeInfo(
+ expectedFinalValue.toFloat(),
+ progression.first.toFloat()..progression.last.toFloat(),
+ progression.stepsNumber()
+ )
+ )
+
+ // State value is not coerced to expectedValue - thus we expect it to be equal to
+ // the last set value, which is newValue
+ waitForIdle()
+ assertEquals(newValue, state.value)
+}
+
+private fun ComposeContentTestRule.initDefaultStepper(
+ state: MutableState<Int>,
+ valueProgression: IntProgression,
+) {
+ val onValueChange: (Int) -> Unit = { state.value = it }
+ val steps = valueProgression.stepsNumber()
+ val valueRange = valueProgression.first.toFloat()..valueProgression.last.toFloat()
+
+ setContentWithTheme {
+ Stepper(
+ value = state.value,
+ onValueChange = onValueChange,
+ valueProgression = valueProgression,
+ increaseIcon = { Icon(StepperDefaults.Increase, "Increase") },
+ decreaseIcon = { Icon(StepperDefaults.Decrease, "Decrease") },
+ modifier = Modifier
+ .testTag(TEST_TAG)
+ .rangeSemantics(
+ state.value.toFloat(),
+ true,
+ { onValueChange(it.roundToInt()) },
+ valueRange,
+ steps
+ )
+ ) {}
+ }
+}
+
+private val INCREASE = "increase"
+private val DECREASE = "decrease"
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RangeSemantics.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RangeSemantics.kt
new file mode 100644
index 0000000..f0dc43c
--- /dev/null
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/RangeSemantics.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.wear.compose.material3
+
+import androidx.compose.foundation.progressSemantics
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.semantics.disabled
+import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.semantics.setProgress
+import androidx.wear.compose.materialcore.RangeDefaults
+
+/**
+ * Modifier to add semantics signifying progress of the Stepper/Slider.
+ *
+ * @param value Current value of the ProgressIndicator/Slider. If outside of [valueRange] provided,
+ * value will be coerced to this range. Must not be NaN.
+ * @param enabled If false then semantics will not be added.
+ * @param onValueChange Lambda which updates [value].
+ * @param valueRange Range of values that value can take. Passed [value] will be coerced to this
+ * range.
+ * @param steps If greater than 0, specifies the amounts of discrete values, evenly distributed
+ * between across the whole value range. If 0, any value from the range specified is allowed.
+ * Must not be negative.
+ */
+public fun Modifier.rangeSemantics(
+ value: Float,
+ enabled: Boolean,
+ @Suppress("PrimitiveInLambda")
+ onValueChange: (Float) -> Unit,
+ valueRange: ClosedFloatingPointRange<Float>,
+ steps: Int
+): Modifier {
+ val step = RangeDefaults.snapValueToStep(value, valueRange, steps)
+ return semantics(mergeDescendants = true) {
+ if (!enabled) disabled()
+ setProgress(
+ action = { targetValue ->
+ val newStepIndex = RangeDefaults.snapValueToStep(targetValue, valueRange, steps)
+ if (step == newStepIndex) {
+ false
+ } else {
+ onValueChange(targetValue)
+ true
+ }
+ }
+ )
+ }.progressSemantics(
+ RangeDefaults.calculateCurrentStepValue(step, steps, valueRange), valueRange, steps
+ )
+}
+
+internal fun IntProgression.stepsNumber(): Int = (last - first) / step - 1
diff --git a/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Stepper.kt b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Stepper.kt
new file mode 100644
index 0000000..5504418
--- /dev/null
+++ b/wear/compose/compose-material3/src/main/java/androidx/wear/compose/material3/Stepper.kt
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.wear.compose.material3
+
+import androidx.compose.foundation.layout.BoxScope
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Add
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.vector.ImageVector
+import kotlin.math.roundToInt
+
+/**
+ * [Stepper] allows users to make a selection from a range of values.
+ * It's a full-screen control with increase button on the top, decrease button on the bottom and
+ * a slot (expected to have either [Text] or [Button]) in the middle.
+ * Value can be increased and decreased by clicking on the increase and decrease buttons.
+ * Buttons can have custom icons - [decreaseIcon] and [increaseIcon].
+ * Step value is calculated as the difference between min and max values divided by [steps]+1.
+ * Stepper itself doesn't show the current value but can be displayed via the content slot or
+ * [PositionIndicator] if required.
+ * If [value] is not equal to any step value, then it will be coerced to the closest step value.
+ * However, the [value] itself will not be changed and [onValueChange] in this case will
+ * not be triggered.
+ * To add range semantics on Stepper, use [Modifier.rangeSemantics].
+ *
+ * Example of a simple [Stepper]:
+ * @sample androidx.wear.compose.material3.samples.StepperSample
+ *
+ * Example of a [Stepper] with range semantics:
+ * @sample androidx.wear.compose.material3.samples.StepperWithRangeSemanticsSample
+ *
+ * @param value Current value of the Stepper. If outside of [valueRange] provided, value will be
+ * coerced to this range.
+ * @param onValueChange Lambda in which value should be updated
+ * @param steps Specifies the number of discrete values, excluding min and max values, evenly
+ * distributed across the whole value range. Must not be negative. If 0, stepper will have only
+ * min and max values and no steps in between
+ * @param decreaseIcon A slot for an icon which is placed on the decrease (bottom) button
+ * @param increaseIcon A slot for an icon which is placed on the increase (top) button
+ * @param modifier Modifiers for the Stepper layout
+ * @param valueRange Range of values that Stepper value can take. Passed [value] will be coerced to
+ * this range
+ * @param backgroundColor [Color] representing the background color for the stepper.
+ * @param contentColor [Color] representing the color for [content] in the middle.
+ * @param iconColor Icon tint [Color] which used by [increaseIcon] and [decreaseIcon]
+ * that defaults to [contentColor], unless specifically overridden.
+ * @param content Content body for the Stepper.
+ */
+@Composable
+fun Stepper(
+ value: Float,
+ @Suppress("PrimitiveInLambda")
+ onValueChange: (Float) -> Unit,
+ steps: Int,
+ decreaseIcon: @Composable () -> Unit,
+ increaseIcon: @Composable () -> Unit,
+ modifier: Modifier = Modifier,
+ valueRange: ClosedFloatingPointRange<Float> = 0f..(steps + 1).toFloat(),
+ backgroundColor: Color = MaterialTheme.colorScheme.background,
+ contentColor: Color = MaterialTheme.colorScheme.onSurface,
+ iconColor: Color = contentColor,
+ content: @Composable BoxScope.() -> Unit
+) {
+ androidx.wear.compose.materialcore.Stepper(
+ value = value,
+ onValueChange = onValueChange,
+ steps = steps,
+ decreaseIcon = decreaseIcon,
+ increaseIcon = increaseIcon,
+ valueRange = valueRange,
+ modifier = modifier,
+ backgroundColor = backgroundColor,
+ enabledButtonProviderValues = arrayOf(
+ LocalContentColor provides iconColor,
+ LocalContentAlpha provides iconColor.alpha
+ ),
+ disabledButtonProviderValues = arrayOf(
+ LocalContentColor provides iconColor.copy(alpha = ContentAlpha.disabled),
+ LocalContentAlpha provides iconColor.copy(alpha = ContentAlpha.disabled).alpha
+ )
+ ) {
+ CompositionLocalProvider(
+ LocalContentColor provides contentColor
+ ) {
+ content()
+ }
+ }
+}
+
+/**
+ * [Stepper] allows users to make a selection from a range of values.
+ * It's a full-screen control with increase button on the top, decrease button on the bottom and
+ * a slot (expected to have either [Text] or [Button]) in the middle.
+ * Value can be increased and decreased by clicking on the increase and decrease buttons.
+ * Buttons can have custom icons - [decreaseIcon] and [increaseIcon].
+ * Stepper itself doesn't show the current value but can be displayed via the content slot or
+ * [PositionIndicator] if required.
+ * To add range semantics on Stepper, use [Modifier.rangeSemantics].
+ *
+ * Example of a [Stepper] with integer values:
+ * @sample androidx.wear.compose.material3.samples.StepperWithIntegerSample
+ *
+ * A number of steps is calculated as the difference between max and min values of
+ * [valueProgression] divided by [valueProgression].step - 1.
+ * For example, with a range of 100..120 and a step 5,
+ * number of steps will be (120-100)/ 5 - 1 = 3. Steps are 100(first), 105, 110, 115, 120(last)
+ *
+ * If [valueProgression] range is not equally divisible by [valueProgression].step,
+ * then [valueProgression].last will be adjusted to the closest divisible value in the range.
+ * For example, 1..13 range and a step = 5, steps will be 1(first) , 6 , 11(last)
+ *
+ * If [value] is not equal to any step value, then it will be coerced to the closest step value.
+ * However, the [value] itself will not be changed and [onValueChange] in this case will
+ * not be triggered.
+ *
+ * @param value Current value of the Stepper. If outside of [valueProgression] provided, value will be
+ * coerced to this range.
+ * @param onValueChange Lambda in which value should be updated
+ * @param valueProgression Progression of values that Stepper value can take. Consists of
+ * rangeStart, rangeEnd and step. Range will be equally divided by step size
+ * @param decreaseIcon A slot for an icon which is placed on the decrease (bottom) button
+ * @param increaseIcon A slot for an icon which is placed on the increase (top) button
+ * @param modifier Modifiers for the Stepper layout
+ * @param backgroundColor [Color] representing the background color for the stepper.
+ * @param contentColor [Color] representing the color for [content] in the middle.
+ * @param iconColor Icon tint [Color] which used by [increaseIcon] and [decreaseIcon]
+ * that defaults to [contentColor], unless specifically overridden.
+ * @param content Content body for the Stepper.
+ */
+@Composable
+fun Stepper(
+ value: Int,
+ @Suppress("PrimitiveInLambda")
+ onValueChange: (Int) -> Unit,
+ valueProgression: IntProgression,
+ decreaseIcon: @Composable () -> Unit,
+ increaseIcon: @Composable () -> Unit,
+ modifier: Modifier = Modifier,
+ backgroundColor: Color = MaterialTheme.colorScheme.background,
+ contentColor: Color = MaterialTheme.colorScheme.onSurface,
+ iconColor: Color = contentColor,
+ content: @Composable BoxScope.() -> Unit
+) {
+ Stepper(
+ value = value.toFloat(),
+ onValueChange = { onValueChange(it.roundToInt()) },
+ steps = valueProgression.stepsNumber(),
+ modifier = modifier,
+ valueRange = valueProgression.first.toFloat()..valueProgression.last.toFloat(),
+ decreaseIcon = decreaseIcon,
+ increaseIcon = increaseIcon,
+ backgroundColor = backgroundColor,
+ contentColor = contentColor,
+ iconColor = iconColor,
+ content = content
+ )
+}
+
+/**
+ * Defaults used by stepper.
+ */
+public object StepperDefaults {
+ /**
+ * Decrease [ImageVector].
+ */
+ public val Decrease = androidx.wear.compose.materialcore.RangeIcons.Minus
+
+ /**
+ * Increase [ImageVector].
+ */
+ public val Increase = Icons.Filled.Add
+}
diff --git a/wear/protolayout/protolayout-expression-pipeline/api/1.0.0-beta01.txt b/wear/protolayout/protolayout-expression-pipeline/api/1.0.0-beta01.txt
new file mode 100644
index 0000000..59d2661b
--- /dev/null
+++ b/wear/protolayout/protolayout-expression-pipeline/api/1.0.0-beta01.txt
@@ -0,0 +1,80 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.expression.pipeline {
+
+ public interface BoundDynamicType extends java.lang.AutoCloseable {
+ method @UiThread public void close();
+ method @UiThread public void startEvaluation();
+ }
+
+ public abstract class DynamicTypeBindingRequest {
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicBool(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Boolean!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicColor(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Integer!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicDuration(androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.time.Duration!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicFloat(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Float!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicInstant(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.time.Instant!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicInt32(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Integer!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicString(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString, android.icu.util.ULocale, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.String!>);
+ }
+
+ public class DynamicTypeEvaluator {
+ ctor public DynamicTypeEvaluator(androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config);
+ method public androidx.wear.protolayout.expression.pipeline.BoundDynamicType bind(androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest) throws androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.EvaluationException;
+ }
+
+ public static final class DynamicTypeEvaluator.Config {
+ method public androidx.wear.protolayout.expression.pipeline.QuotaManager? getAnimationQuotaManager();
+ method @VisibleForTesting public java.util.function.Supplier<java.time.Instant!>? getClock();
+ method public androidx.wear.protolayout.expression.pipeline.QuotaManager? getDynamicTypesQuotaManager();
+ method public java.util.Map<androidx.wear.protolayout.expression.PlatformDataKey<?>!,androidx.wear.protolayout.expression.pipeline.PlatformDataProvider!> getPlatformDataProviders();
+ method public androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier? getPlatformTimeUpdateNotifier();
+ method public androidx.wear.protolayout.expression.pipeline.StateStore? getStateStore();
+ }
+
+ public static final class DynamicTypeEvaluator.Config.Builder {
+ ctor public DynamicTypeEvaluator.Config.Builder();
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder addPlatformDataProvider(androidx.wear.protolayout.expression.pipeline.PlatformDataProvider, java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>!>);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config build();
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setAnimationQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager);
+ method @VisibleForTesting public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setClock(java.util.function.Supplier<java.time.Instant!>);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setDynamicTypesQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setPlatformTimeUpdateNotifier(androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setStateStore(androidx.wear.protolayout.expression.pipeline.StateStore);
+ }
+
+ public static class DynamicTypeEvaluator.EvaluationException extends java.lang.Exception {
+ ctor public DynamicTypeEvaluator.EvaluationException(String);
+ }
+
+ public interface DynamicTypeValueReceiver<T> {
+ method public void onData(T);
+ method public void onInvalidated();
+ }
+
+ public interface PlatformDataProvider {
+ method public void clearReceiver();
+ method public void setReceiver(java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.PlatformDataReceiver);
+ }
+
+ public interface PlatformDataReceiver {
+ method public void onData(androidx.wear.protolayout.expression.PlatformDataValues);
+ method public void onInvalidated(java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>!>);
+ }
+
+ public interface PlatformTimeUpdateNotifier {
+ method public void clearReceiver();
+ method public void setReceiver(java.util.concurrent.Executor, Runnable);
+ }
+
+ public interface QuotaManager {
+ method public void releaseQuota(int);
+ method public boolean tryAcquireQuota(int);
+ }
+
+ public final class StateStore {
+ method public static androidx.wear.protolayout.expression.pipeline.StateStore create(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ method public static int getMaxStateEntryCount();
+ method @UiThread public void setAppStateEntryValues(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-expression-pipeline/api/res-1.0.0-beta01.txt b/wear/protolayout/protolayout-expression-pipeline/api/res-1.0.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/protolayout/protolayout-expression-pipeline/api/res-1.0.0-beta01.txt
diff --git a/wear/protolayout/protolayout-expression-pipeline/api/restricted_1.0.0-beta01.txt b/wear/protolayout/protolayout-expression-pipeline/api/restricted_1.0.0-beta01.txt
new file mode 100644
index 0000000..6fb0986
--- /dev/null
+++ b/wear/protolayout/protolayout-expression-pipeline/api/restricted_1.0.0-beta01.txt
@@ -0,0 +1,82 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.expression.pipeline {
+
+ public interface BoundDynamicType extends java.lang.AutoCloseable {
+ method @UiThread public void close();
+ method @UiThread public void startEvaluation();
+ }
+
+ public abstract class DynamicTypeBindingRequest {
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicBool(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Boolean!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicColor(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Integer!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicDuration(androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.time.Duration!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicFloat(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Float!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicInstant(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.time.Instant!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicInt32(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.Integer!>);
+ method public static androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest forDynamicString(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString, android.icu.util.ULocale, java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.DynamicTypeValueReceiver<java.lang.String!>);
+ }
+
+ public class DynamicTypeEvaluator {
+ ctor public DynamicTypeEvaluator(androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config);
+ method public androidx.wear.protolayout.expression.pipeline.BoundDynamicType bind(androidx.wear.protolayout.expression.pipeline.DynamicTypeBindingRequest) throws androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.EvaluationException;
+ }
+
+ public static final class DynamicTypeEvaluator.Config {
+ method public androidx.wear.protolayout.expression.pipeline.QuotaManager? getAnimationQuotaManager();
+ method @VisibleForTesting public java.util.function.Supplier<java.time.Instant!>? getClock();
+ method public androidx.wear.protolayout.expression.pipeline.QuotaManager? getDynamicTypesQuotaManager();
+ method public java.util.Map<androidx.wear.protolayout.expression.PlatformDataKey<?>!,androidx.wear.protolayout.expression.pipeline.PlatformDataProvider!> getPlatformDataProviders();
+ method public androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier? getPlatformTimeUpdateNotifier();
+ method public androidx.wear.protolayout.expression.pipeline.StateStore? getStateStore();
+ }
+
+ public static final class DynamicTypeEvaluator.Config.Builder {
+ ctor public DynamicTypeEvaluator.Config.Builder();
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder addPlatformDataProvider(androidx.wear.protolayout.expression.pipeline.PlatformDataProvider, java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>!>);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config build();
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setAnimationQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager);
+ method @VisibleForTesting public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setClock(java.util.function.Supplier<java.time.Instant!>);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setDynamicTypesQuotaManager(androidx.wear.protolayout.expression.pipeline.QuotaManager);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setPlatformTimeUpdateNotifier(androidx.wear.protolayout.expression.pipeline.PlatformTimeUpdateNotifier);
+ method public androidx.wear.protolayout.expression.pipeline.DynamicTypeEvaluator.Config.Builder setStateStore(androidx.wear.protolayout.expression.pipeline.StateStore);
+ }
+
+ public static class DynamicTypeEvaluator.EvaluationException extends java.lang.Exception {
+ ctor public DynamicTypeEvaluator.EvaluationException(String);
+ }
+
+ public interface DynamicTypeValueReceiver<T> {
+ method public void onData(T);
+ method public void onInvalidated();
+ }
+
+ public interface PlatformDataProvider {
+ method public void clearReceiver();
+ method public void setReceiver(java.util.concurrent.Executor, androidx.wear.protolayout.expression.pipeline.PlatformDataReceiver);
+ }
+
+ public interface PlatformDataReceiver {
+ method public void onData(androidx.wear.protolayout.expression.PlatformDataValues);
+ method public void onInvalidated(java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>!>);
+ }
+
+ public interface PlatformTimeUpdateNotifier {
+ method public void clearReceiver();
+ method public void setReceiver(java.util.concurrent.Executor, Runnable);
+ }
+
+ public interface QuotaManager {
+ method public void releaseQuota(int);
+ method public boolean tryAcquireQuota(int);
+ }
+
+ public final class StateStore {
+ ctor @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public StateStore(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.proto.DynamicDataProto.DynamicDataValue!>);
+ method public static androidx.wear.protolayout.expression.pipeline.StateStore create(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ method public static int getMaxStateEntryCount();
+ method @UiThread public void setAppStateEntryValues(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) @UiThread public void setAppStateEntryValuesProto(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.proto.DynamicDataProto.DynamicDataValue!>);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-expression-pipeline/src/test/java/androidx/wear/protolayout/expression/pipeline/InstantNodesTest.java b/wear/protolayout/protolayout-expression-pipeline/src/test/java/androidx/wear/protolayout/expression/pipeline/InstantNodesTest.java
index 6933726..70cc286 100644
--- a/wear/protolayout/protolayout-expression-pipeline/src/test/java/androidx/wear/protolayout/expression/pipeline/InstantNodesTest.java
+++ b/wear/protolayout/protolayout-expression-pipeline/src/test/java/androidx/wear/protolayout/expression/pipeline/InstantNodesTest.java
@@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
@@ -26,27 +27,16 @@
import androidx.wear.protolayout.expression.pipeline.InstantNodes.PlatformTimeSourceNode;
import androidx.wear.protolayout.expression.proto.FixedProto.FixedInstant;
-import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.junit.MockitoJUnit;
-import org.mockito.junit.MockitoRule;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.Executor;
@RunWith(AndroidJUnit4.class)
public class InstantNodesTest {
-
- @Rule public final MockitoRule mockito = MockitoJUnit.rule();
-
- @Captor ArgumentCaptor<Runnable> mReceiverCaptor;
- @Captor ArgumentCaptor<Executor> mExecutor;
-
@Test
public void testFixedInstant() {
List<Instant> results = new ArrayList<>();
@@ -73,8 +63,9 @@
node.init();
assertThat(timeSource.getRegisterConsumersCount()).isEqualTo(1);
- verify(notifier).setReceiver(mExecutor.capture(), mReceiverCaptor.capture());
- mReceiverCaptor.getValue().run(); // Ticking.
+ ArgumentCaptor<Runnable> receiverCaptor = ArgumentCaptor.forClass(Runnable.class);
+ verify(notifier).setReceiver(any(), receiverCaptor.capture());
+ receiverCaptor.getValue().run(); // Ticking.
assertThat(results).containsExactly(Instant.ofEpochSecond(1234567L));
node.destroy();
diff --git a/wear/protolayout/protolayout-expression/api/1.0.0-beta01.txt b/wear/protolayout/protolayout-expression/api/1.0.0-beta01.txt
new file mode 100644
index 0000000..1203940
--- /dev/null
+++ b/wear/protolayout/protolayout-expression/api/1.0.0-beta01.txt
@@ -0,0 +1,375 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.expression {
+
+ public final class AnimationParameterBuilders {
+ field public static final int REPEAT_MODE_RESTART = 1; // 0x1
+ field public static final int REPEAT_MODE_REVERSE = 2; // 0x2
+ field public static final int REPEAT_MODE_UNKNOWN = 0; // 0x0
+ }
+
+ public static final class AnimationParameterBuilders.AnimationParameters {
+ method @IntRange(from=0) public long getDelayMillis();
+ method @IntRange(from=0) public long getDurationMillis();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing? getEasing();
+ }
+
+ public static final class AnimationParameterBuilders.AnimationParameters.Builder {
+ ctor public AnimationParameterBuilders.AnimationParameters.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setDelayMillis(@IntRange(from=0) long);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setDurationMillis(@IntRange(from=0) long);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setEasing(androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing);
+ }
+
+ public static final class AnimationParameterBuilders.AnimationSpec {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getAnimationParameters();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable? getRepeatable();
+ }
+
+ public static final class AnimationParameterBuilders.AnimationSpec.Builder {
+ ctor public AnimationParameterBuilders.AnimationSpec.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec.Builder setAnimationParameters(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec.Builder setRepeatable(androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable);
+ }
+
+ public static interface AnimationParameterBuilders.Easing {
+ method public static androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing cubicBezier(float, float, float, float);
+ method public static androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing fromByteArray(byte[]);
+ method public default byte[] toEasingByteArray();
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing FAST_OUT_LINEAR_IN_EASING;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing FAST_OUT_SLOW_IN_EASING;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing LINEAR_OUT_SLOW_IN_EASING;
+ }
+
+ public static final class AnimationParameterBuilders.Repeatable {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getForwardRepeatOverride();
+ method public int getIterations();
+ method public int getRepeatMode();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getReverseRepeatOverride();
+ method public boolean hasInfiniteIteration();
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable INFINITE_REPEATABLE_WITH_RESTART;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable INFINITE_REPEATABLE_WITH_REVERSE;
+ }
+
+ public static final class AnimationParameterBuilders.Repeatable.Builder {
+ ctor public AnimationParameterBuilders.Repeatable.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setForwardRepeatOverride(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setIterations(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setRepeatMode(int);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setReverseRepeatOverride(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ }
+
+ public final class AppDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> extends androidx.wear.protolayout.expression.DynamicDataKey<T> {
+ ctor public AppDataKey(String);
+ }
+
+ public class ConditionScopes {
+ }
+
+ public static class ConditionScopes.ConditionScope<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType, RawT> {
+ method public androidx.wear.protolayout.expression.ConditionScopes.IfTrueScope<T!,RawT!> use(RawT!);
+ method public androidx.wear.protolayout.expression.ConditionScopes.IfTrueScope<T!,RawT!> use(T!);
+ }
+
+ public static class ConditionScopes.IfTrueScope<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType, RawT> {
+ method public T! elseUse(RawT!);
+ method public T! elseUse(T!);
+ }
+
+ public final class DynamicBuilders {
+ }
+
+ public static interface DynamicBuilders.DynamicBool extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool and(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool constant(boolean);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool negate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool or(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicBoolByteArray();
+ method public default int toDynamicBoolByteArray(byte[]);
+ method public default int toDynamicBoolByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicColor extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(@ColorInt int, @ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(@ColorInt int, @ColorInt int, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor constant(@ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!,java.lang.Integer!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicColorByteArray();
+ method public default int toDynamicColorByteArray(byte[]);
+ method public default int toDynamicColorByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicDuration extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getHoursPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getIntDaysPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getMinutesPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getSecondsPart();
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration!,java.time.Duration!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicDurationByteArray();
+ method public default int toDynamicDurationByteArray(byte[]);
+ method public default int toDynamicDurationByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntDays();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntHours();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntMinutes();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntSeconds();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration withSecondsPrecision(java.time.Duration);
+ }
+
+ public static interface DynamicBuilders.DynamicFloat extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(float, float);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(float, float, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 asInt();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat constant(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(float);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!,java.lang.Float!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(float);
+ method public default byte[] toDynamicFloatByteArray();
+ method public default int toDynamicFloatByteArray(byte[]);
+ method public default int toDynamicFloatByteArray(byte[], int, int);
+ }
+
+ public static class DynamicBuilders.DynamicFloat.FloatFormatter {
+ method @IntRange(from=0) public int getMaxFractionDigits();
+ method @IntRange(from=0) public int getMinFractionDigits();
+ method @IntRange(from=0) public int getMinIntegerDigits();
+ method public boolean isGroupingUsed();
+ }
+
+ public static final class DynamicBuilders.DynamicFloat.FloatFormatter.Builder {
+ ctor public DynamicBuilders.DynamicFloat.FloatFormatter.Builder();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter build();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setGroupingUsed(boolean);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMaxFractionDigits(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinFractionDigits(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinIntegerDigits(@IntRange(from=0) int);
+ }
+
+ public static interface DynamicBuilders.DynamicInstant extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration durationUntil(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant!,java.time.Instant!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant platformTimeWithSecondsPrecision();
+ method public default byte[] toDynamicInstantByteArray();
+ method public default int toDynamicInstantByteArray(byte[]);
+ method public default int toDynamicInstantByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant withSecondsPrecision(java.time.Instant);
+ }
+
+ public static interface DynamicBuilders.DynamicInt32 extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(int, int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(int, int, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat asFloat();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 constant(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 div(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 minus(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!,java.lang.Integer!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 plus(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 rem(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 times(int);
+ method public default byte[] toDynamicInt32ByteArray();
+ method public default int toDynamicInt32ByteArray(byte[]);
+ method public default int toDynamicInt32ByteArray(byte[], int, int);
+ }
+
+ public static class DynamicBuilders.DynamicInt32.IntFormatter {
+ method @IntRange(from=0) public int getMinIntegerDigits();
+ method public boolean isGroupingUsed();
+ }
+
+ public static final class DynamicBuilders.DynamicInt32.IntFormatter.Builder {
+ ctor public DynamicBuilders.DynamicInt32.IntFormatter.Builder();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter build();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter.Builder setGroupingUsed(boolean);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter.Builder setMinIntegerDigits(@IntRange(from=0) int);
+ }
+
+ public static interface DynamicBuilders.DynamicString extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString concat(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString constant(String);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!,java.lang.String!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicStringByteArray();
+ method public default int toDynamicStringByteArray(byte[]);
+ method public default int toDynamicStringByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicType {
+ }
+
+ public final class DynamicDataBuilders {
+ }
+
+ public static interface DynamicDataBuilders.DynamicDataValue<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> {
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool!> fromBool(boolean);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?> fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?> fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!> fromColor(@ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> fromFloat(float);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!> fromInt(int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!> fromString(String);
+ method public default byte[] toDynamicDataValueByteArray();
+ method public default int toDynamicDataValueByteArray(byte[]);
+ method public default int toDynamicDataValueByteArray(byte[], int, int);
+ }
+
+ public abstract class DynamicDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> {
+ method public String getKey();
+ method public String getNamespace();
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface ExperimentalProtoLayoutExtensionApi {
+ }
+
+ public final class PlatformDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> extends androidx.wear.protolayout.expression.DynamicDataKey<T> {
+ ctor public PlatformDataKey(String, String);
+ }
+
+ public final class PlatformDataValues {
+ method public java.util.Map<androidx.wear.protolayout.expression.PlatformDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!> getAll();
+ method public static <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.expression.PlatformDataValues of(androidx.wear.protolayout.expression.PlatformDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ }
+
+ public static final class PlatformDataValues.Builder {
+ ctor public PlatformDataValues.Builder();
+ method public androidx.wear.protolayout.expression.PlatformDataValues build();
+ method public <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.expression.PlatformDataValues.Builder put(androidx.wear.protolayout.expression.PlatformDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ }
+
+ public class PlatformHealthSources {
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyCalories();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyDistanceMeters();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyFloors();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 dailySteps();
+ method @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy heartRateAccuracy();
+ method @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat heartRateBpm();
+ field public static final int HEART_RATE_ACCURACY_HIGH = 5; // 0x5
+ field public static final int HEART_RATE_ACCURACY_LOW = 3; // 0x3
+ field public static final int HEART_RATE_ACCURACY_MEDIUM = 4; // 0x4
+ field public static final int HEART_RATE_ACCURACY_NO_CONTACT = 1; // 0x1
+ field public static final int HEART_RATE_ACCURACY_UNKNOWN = 0; // 0x0
+ field public static final int HEART_RATE_ACCURACY_UNRELIABLE = 2; // 0x2
+ }
+
+ public static final class PlatformHealthSources.DynamicHeartRateAccuracy implements androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 {
+ method public static androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy constant(int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy!> dynamicDataValueOf(int);
+ }
+
+ public static class PlatformHealthSources.Keys {
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_CALORIES;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_DISTANCE_METERS;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_FLOORS;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!> DAILY_STEPS;
+ field @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy!> HEART_RATE_ACCURACY;
+ field @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> HEART_RATE_BPM;
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface ProtoLayoutExperimental {
+ }
+
+ public final class VersionBuilders {
+ }
+
+ public static final class VersionBuilders.VersionInfo {
+ method public int getMajor();
+ method public int getMinor();
+ }
+
+ public static final class VersionBuilders.VersionInfo.Builder {
+ ctor public VersionBuilders.VersionInfo.Builder();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo build();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo.Builder setMajor(int);
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo.Builder setMinor(int);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-expression/api/res-1.0.0-beta01.txt b/wear/protolayout/protolayout-expression/api/res-1.0.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/protolayout/protolayout-expression/api/res-1.0.0-beta01.txt
diff --git a/wear/protolayout/protolayout-expression/api/restricted_1.0.0-beta01.txt b/wear/protolayout/protolayout-expression/api/restricted_1.0.0-beta01.txt
new file mode 100644
index 0000000..1203940
--- /dev/null
+++ b/wear/protolayout/protolayout-expression/api/restricted_1.0.0-beta01.txt
@@ -0,0 +1,375 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.expression {
+
+ public final class AnimationParameterBuilders {
+ field public static final int REPEAT_MODE_RESTART = 1; // 0x1
+ field public static final int REPEAT_MODE_REVERSE = 2; // 0x2
+ field public static final int REPEAT_MODE_UNKNOWN = 0; // 0x0
+ }
+
+ public static final class AnimationParameterBuilders.AnimationParameters {
+ method @IntRange(from=0) public long getDelayMillis();
+ method @IntRange(from=0) public long getDurationMillis();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing? getEasing();
+ }
+
+ public static final class AnimationParameterBuilders.AnimationParameters.Builder {
+ ctor public AnimationParameterBuilders.AnimationParameters.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setDelayMillis(@IntRange(from=0) long);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setDurationMillis(@IntRange(from=0) long);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters.Builder setEasing(androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing);
+ }
+
+ public static final class AnimationParameterBuilders.AnimationSpec {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getAnimationParameters();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable? getRepeatable();
+ }
+
+ public static final class AnimationParameterBuilders.AnimationSpec.Builder {
+ ctor public AnimationParameterBuilders.AnimationSpec.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec.Builder setAnimationParameters(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec.Builder setRepeatable(androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable);
+ }
+
+ public static interface AnimationParameterBuilders.Easing {
+ method public static androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing cubicBezier(float, float, float, float);
+ method public static androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing fromByteArray(byte[]);
+ method public default byte[] toEasingByteArray();
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing FAST_OUT_LINEAR_IN_EASING;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing FAST_OUT_SLOW_IN_EASING;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Easing LINEAR_OUT_SLOW_IN_EASING;
+ }
+
+ public static final class AnimationParameterBuilders.Repeatable {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getForwardRepeatOverride();
+ method public int getIterations();
+ method public int getRepeatMode();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters? getReverseRepeatOverride();
+ method public boolean hasInfiniteIteration();
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable INFINITE_REPEATABLE_WITH_RESTART;
+ field public static final androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable INFINITE_REPEATABLE_WITH_REVERSE;
+ }
+
+ public static final class AnimationParameterBuilders.Repeatable.Builder {
+ ctor public AnimationParameterBuilders.Repeatable.Builder();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable build();
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setForwardRepeatOverride(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setIterations(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setRepeatMode(int);
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.Repeatable.Builder setReverseRepeatOverride(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationParameters);
+ }
+
+ public final class AppDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> extends androidx.wear.protolayout.expression.DynamicDataKey<T> {
+ ctor public AppDataKey(String);
+ }
+
+ public class ConditionScopes {
+ }
+
+ public static class ConditionScopes.ConditionScope<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType, RawT> {
+ method public androidx.wear.protolayout.expression.ConditionScopes.IfTrueScope<T!,RawT!> use(RawT!);
+ method public androidx.wear.protolayout.expression.ConditionScopes.IfTrueScope<T!,RawT!> use(T!);
+ }
+
+ public static class ConditionScopes.IfTrueScope<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType, RawT> {
+ method public T! elseUse(RawT!);
+ method public T! elseUse(T!);
+ }
+
+ public final class DynamicBuilders {
+ }
+
+ public static interface DynamicBuilders.DynamicBool extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool and(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool constant(boolean);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool negate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool or(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicBoolByteArray();
+ method public default int toDynamicBoolByteArray(byte[]);
+ method public default int toDynamicBoolByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicColor extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(@ColorInt int, @ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor animate(@ColorInt int, @ColorInt int, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor constant(@ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!,java.lang.Integer!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicColorByteArray();
+ method public default int toDynamicColorByteArray(byte[]);
+ method public default int toDynamicColorByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicDuration extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getHoursPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getIntDaysPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getMinutesPart();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 getSecondsPart();
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration!,java.time.Duration!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicDurationByteArray();
+ method public default int toDynamicDurationByteArray(byte[]);
+ method public default int toDynamicDurationByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntDays();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntHours();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntMinutes();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 toIntSeconds();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration withSecondsPrecision(java.time.Duration);
+ }
+
+ public static interface DynamicBuilders.DynamicFloat extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(float, float);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat animate(float, float, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 asInt();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat constant(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(float);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!,java.lang.Float!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(float);
+ method public default byte[] toDynamicFloatByteArray();
+ method public default int toDynamicFloatByteArray(byte[]);
+ method public default int toDynamicFloatByteArray(byte[], int, int);
+ }
+
+ public static class DynamicBuilders.DynamicFloat.FloatFormatter {
+ method @IntRange(from=0) public int getMaxFractionDigits();
+ method @IntRange(from=0) public int getMinFractionDigits();
+ method @IntRange(from=0) public int getMinIntegerDigits();
+ method public boolean isGroupingUsed();
+ }
+
+ public static final class DynamicBuilders.DynamicFloat.FloatFormatter.Builder {
+ ctor public DynamicBuilders.DynamicFloat.FloatFormatter.Builder();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter build();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setGroupingUsed(boolean);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMaxFractionDigits(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinFractionDigits(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat.FloatFormatter.Builder setMinIntegerDigits(@IntRange(from=0) int);
+ }
+
+ public static interface DynamicBuilders.DynamicInstant extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicDuration durationUntil(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant!,java.time.Instant!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant platformTimeWithSecondsPrecision();
+ method public default byte[] toDynamicInstantByteArray();
+ method public default int toDynamicInstantByteArray(byte[]);
+ method public default int toDynamicInstantByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInstant withSecondsPrecision(java.time.Instant);
+ }
+
+ public static interface DynamicBuilders.DynamicInt32 extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(int, int);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 animate(int, int, androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat asFloat();
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 constant(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 div(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat div(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 div(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool eq(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format();
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString format(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 fromByteArray(byte[], int, int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gt(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool gte(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lt(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool lte(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 minus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat minus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 minus(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool ne(int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!,java.lang.Integer!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 plus(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat plus(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 plus(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 rem(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat rem(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 rem(int);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 times(androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat times(float);
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 times(int);
+ method public default byte[] toDynamicInt32ByteArray();
+ method public default int toDynamicInt32ByteArray(byte[]);
+ method public default int toDynamicInt32ByteArray(byte[], int, int);
+ }
+
+ public static class DynamicBuilders.DynamicInt32.IntFormatter {
+ method @IntRange(from=0) public int getMinIntegerDigits();
+ method public boolean isGroupingUsed();
+ }
+
+ public static final class DynamicBuilders.DynamicInt32.IntFormatter.Builder {
+ ctor public DynamicBuilders.DynamicInt32.IntFormatter.Builder();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter build();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter.Builder setGroupingUsed(boolean);
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32.IntFormatter.Builder setMinIntegerDigits(@IntRange(from=0) int);
+ }
+
+ public static interface DynamicBuilders.DynamicString extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType {
+ method public default androidx.wear.protolayout.expression.DynamicBuilders.DynamicString concat(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString constant(String);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString from(androidx.wear.protolayout.expression.DynamicDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!>);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicString fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.ConditionScopes.ConditionScope<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!,java.lang.String!> onCondition(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public default byte[] toDynamicStringByteArray();
+ method public default int toDynamicStringByteArray(byte[]);
+ method public default int toDynamicStringByteArray(byte[], int, int);
+ }
+
+ public static interface DynamicBuilders.DynamicType {
+ }
+
+ public final class DynamicDataBuilders {
+ }
+
+ public static interface DynamicDataBuilders.DynamicDataValue<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> {
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool!> fromBool(boolean);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?> fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?> fromByteArray(byte[], int, int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor!> fromColor(@ColorInt int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> fromFloat(float);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!> fromInt(int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.DynamicBuilders.DynamicString!> fromString(String);
+ method public default byte[] toDynamicDataValueByteArray();
+ method public default int toDynamicDataValueByteArray(byte[]);
+ method public default int toDynamicDataValueByteArray(byte[], int, int);
+ }
+
+ public abstract class DynamicDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> {
+ method public String getKey();
+ method public String getNamespace();
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface ExperimentalProtoLayoutExtensionApi {
+ }
+
+ public final class PlatformDataKey<T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> extends androidx.wear.protolayout.expression.DynamicDataKey<T> {
+ ctor public PlatformDataKey(String, String);
+ }
+
+ public final class PlatformDataValues {
+ method public java.util.Map<androidx.wear.protolayout.expression.PlatformDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!> getAll();
+ method public static <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.expression.PlatformDataValues of(androidx.wear.protolayout.expression.PlatformDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ }
+
+ public static final class PlatformDataValues.Builder {
+ ctor public PlatformDataValues.Builder();
+ method public androidx.wear.protolayout.expression.PlatformDataValues build();
+ method public <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.expression.PlatformDataValues.Builder put(androidx.wear.protolayout.expression.PlatformDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ }
+
+ public class PlatformHealthSources {
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyCalories();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyDistanceMeters();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat dailyFloors();
+ method @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 dailySteps();
+ method @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy heartRateAccuracy();
+ method @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat heartRateBpm();
+ field public static final int HEART_RATE_ACCURACY_HIGH = 5; // 0x5
+ field public static final int HEART_RATE_ACCURACY_LOW = 3; // 0x3
+ field public static final int HEART_RATE_ACCURACY_MEDIUM = 4; // 0x4
+ field public static final int HEART_RATE_ACCURACY_NO_CONTACT = 1; // 0x1
+ field public static final int HEART_RATE_ACCURACY_UNKNOWN = 0; // 0x0
+ field public static final int HEART_RATE_ACCURACY_UNRELIABLE = 2; // 0x2
+ }
+
+ public static final class PlatformHealthSources.DynamicHeartRateAccuracy implements androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32 {
+ method public static androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy constant(int);
+ method public static androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy!> dynamicDataValueOf(int);
+ }
+
+ public static class PlatformHealthSources.Keys {
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_CALORIES;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_DISTANCE_METERS;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> DAILY_FLOORS;
+ field @RequiresPermission(android.Manifest.permission.ACTIVITY_RECOGNITION) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicInt32!> DAILY_STEPS;
+ field @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.PlatformHealthSources.DynamicHeartRateAccuracy!> HEART_RATE_ACCURACY;
+ field @RequiresPermission(android.Manifest.permission.BODY_SENSORS) public static final androidx.wear.protolayout.expression.PlatformDataKey<androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat!> HEART_RATE_BPM;
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface ProtoLayoutExperimental {
+ }
+
+ public final class VersionBuilders {
+ }
+
+ public static final class VersionBuilders.VersionInfo {
+ method public int getMajor();
+ method public int getMinor();
+ }
+
+ public static final class VersionBuilders.VersionInfo.Builder {
+ ctor public VersionBuilders.VersionInfo.Builder();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo build();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo.Builder setMajor(int);
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo.Builder setMinor(int);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-material/api/1.0.0-beta01.txt b/wear/protolayout/protolayout-material/api/1.0.0-beta01.txt
new file mode 100644
index 0000000..4f36b35
--- /dev/null
+++ b/wear/protolayout/protolayout-material/api/1.0.0-beta01.txt
@@ -0,0 +1,320 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.material {
+
+ public class Button implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Button? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ButtonColors getButtonColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method public String? getIconContent();
+ method public String? getImageContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getSize();
+ method public String? getTextContent();
+ }
+
+ public static final class Button.Builder {
+ ctor public Button.Builder(android.content.Context, androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method public androidx.wear.protolayout.material.Button build();
+ method public androidx.wear.protolayout.material.Button.Builder setButtonColors(androidx.wear.protolayout.material.ButtonColors);
+ method public androidx.wear.protolayout.material.Button.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.Button.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.Button.Builder setCustomContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.Button.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setIconContent(String, androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.Button.Builder setImageContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.Button.Builder setSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.material.Button.Builder setTextContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setTextContent(String, int);
+ }
+
+ public class ButtonColors {
+ ctor public ButtonColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ButtonColors(@ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getBackgroundColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getContentColor();
+ method public static androidx.wear.protolayout.material.ButtonColors primaryButtonColors(androidx.wear.protolayout.material.Colors);
+ method public static androidx.wear.protolayout.material.ButtonColors secondaryButtonColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ButtonDefaults {
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp recommendedIconSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp recommendedIconSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_SIZE;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp EXTRA_LARGE_SIZE;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp LARGE_SIZE;
+ field public static final androidx.wear.protolayout.material.ButtonColors PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ButtonColors SECONDARY_COLORS;
+ }
+
+ public class Chip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Chip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getHeight();
+ method public int getHorizontalAlignment();
+ method public String? getIconContent();
+ method public String? getPrimaryLabelContent();
+ method public String? getSecondaryLabelContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ public static final class Chip.Builder {
+ ctor public Chip.Builder(android.content.Context, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.Chip build();
+ method public androidx.wear.protolayout.material.Chip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method public androidx.wear.protolayout.material.Chip.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.Chip.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.Chip.Builder setCustomContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.Chip.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.material.Chip.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setPrimaryLabelContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setSecondaryLabelContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.material.Chip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class ChipColors {
+ ctor public ChipColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ChipColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ChipColors(@ColorInt int, @ColorInt int);
+ ctor public ChipColors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getBackgroundColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getContentColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getIconColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getSecondaryContentColor();
+ method public static androidx.wear.protolayout.material.ChipColors primaryChipColors(androidx.wear.protolayout.material.Colors);
+ method public static androidx.wear.protolayout.material.ChipColors secondaryChipColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ChipDefaults {
+ field public static final androidx.wear.protolayout.material.ChipColors COMPACT_PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors COMPACT_SECONDARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors SECONDARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors TITLE_PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors TITLE_SECONDARY_COLORS;
+ }
+
+ public class CircularProgressIndicator implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.CircularProgressIndicator? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ProgressIndicatorColors getCircularProgressIndicatorColors();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getEndAngle();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getProgress();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getStartAngle();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp getStrokeWidth();
+ }
+
+ public static final class CircularProgressIndicator.Builder {
+ ctor public CircularProgressIndicator.Builder();
+ method public androidx.wear.protolayout.material.CircularProgressIndicator build();
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setCircularProgressIndicatorColors(androidx.wear.protolayout.material.ProgressIndicatorColors);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setEndAngle(float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setProgress(androidx.wear.protolayout.TypeBuilders.FloatProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setProgress(@FloatRange(from=0, to=1) float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStartAngle(float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStrokeWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class Colors {
+ ctor public Colors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @ColorInt public int getOnPrimary();
+ method @ColorInt public int getOnSurface();
+ method @ColorInt public int getPrimary();
+ method @ColorInt public int getSurface();
+ field public static final androidx.wear.protolayout.material.Colors DEFAULT;
+ }
+
+ public class CompactChip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.CompactChip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public String? getIconContent();
+ method public String getText();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ }
+
+ public static final class CompactChip.Builder {
+ ctor public CompactChip.Builder(android.content.Context, String, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.CompactChip build();
+ method public androidx.wear.protolayout.material.CompactChip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.CompactChip.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.CompactChip.Builder setIconContent(String);
+ }
+
+ public class ProgressIndicatorColors {
+ ctor public ProgressIndicatorColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ProgressIndicatorColors(@ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getIndicatorColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getTrackColor();
+ method public static androidx.wear.protolayout.material.ProgressIndicatorColors progressIndicatorColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ProgressIndicatorDefaults {
+ field public static final androidx.wear.protolayout.material.ProgressIndicatorColors DEFAULT_COLORS;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_STROKE_WIDTH;
+ field public static final float GAP_END_ANGLE = 156.1f;
+ field public static final float GAP_START_ANGLE = -156.1f;
+ }
+
+ public class Text implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Text? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getColor();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle getFontStyle();
+ method public float getLineHeight();
+ method public int getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers getModifiers();
+ method public int getMultilineAlignment();
+ method public int getOverflow();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp getText();
+ method public int getWeight();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ method public boolean isItalic();
+ method public boolean isUnderline();
+ }
+
+ public static final class Text.Builder {
+ ctor public Text.Builder(android.content.Context, androidx.wear.protolayout.TypeBuilders.StringProp, androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint);
+ ctor public Text.Builder(android.content.Context, String);
+ method public androidx.wear.protolayout.material.Text build();
+ method public androidx.wear.protolayout.material.Text.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.Text.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setItalic(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.material.Text.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.material.Text.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.material.Text.Builder setOverflow(int);
+ method public androidx.wear.protolayout.material.Text.Builder setTypography(int);
+ method public androidx.wear.protolayout.material.Text.Builder setUnderline(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setWeight(int);
+ }
+
+ public class TitleChip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.TitleChip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public int getHorizontalAlignment();
+ method public String? getIconContent();
+ method public String getText();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getWidth();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ }
+
+ public static final class TitleChip.Builder {
+ ctor public TitleChip.Builder(android.content.Context, String, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.TitleChip build();
+ method public androidx.wear.protolayout.material.TitleChip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.TitleChip.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class Typography {
+ field public static final int TYPOGRAPHY_BODY1 = 7; // 0x7
+ field public static final int TYPOGRAPHY_BODY2 = 8; // 0x8
+ field public static final int TYPOGRAPHY_BUTTON = 9; // 0x9
+ field public static final int TYPOGRAPHY_CAPTION1 = 10; // 0xa
+ field public static final int TYPOGRAPHY_CAPTION2 = 11; // 0xb
+ field public static final int TYPOGRAPHY_CAPTION3 = 12; // 0xc
+ field public static final int TYPOGRAPHY_DISPLAY1 = 1; // 0x1
+ field public static final int TYPOGRAPHY_DISPLAY2 = 2; // 0x2
+ field public static final int TYPOGRAPHY_DISPLAY3 = 3; // 0x3
+ field public static final int TYPOGRAPHY_TITLE1 = 4; // 0x4
+ field public static final int TYPOGRAPHY_TITLE2 = 5; // 0x5
+ field public static final int TYPOGRAPHY_TITLE3 = 6; // 0x6
+ }
+
+}
+
+package androidx.wear.protolayout.material.layouts {
+
+ public class EdgeContentLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.EdgeContentLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getEdgeContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ }
+
+ public static final class EdgeContentLayout.Builder {
+ ctor public EdgeContentLayout.Builder(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout build();
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setEdgeContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setPrimaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setSecondaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ }
+
+ public class LayoutDefaults {
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_VERTICAL_SPACER_HEIGHT;
+ field public static final float EDGE_CONTENT_LAYOUT_PADDING_ABOVE_MAIN_CONTENT_DP = 6.0f;
+ field public static final float EDGE_CONTENT_LAYOUT_PADDING_BELOW_MAIN_CONTENT_DP = 8.0f;
+ field @Deprecated public static final int MULTI_BUTTON_MAX_NUMBER = 7; // 0x7
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp MULTI_SLOT_LAYOUT_HORIZONTAL_SPACER_WIDTH;
+ }
+
+ public static final class LayoutDefaults.MultiButtonLayoutDefaults {
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_1_BUTTON;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_2_BUTTONS;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_3_PLUS_BUTTONS;
+ field public static final int MAX_BUTTONS = 7; // 0x7
+ }
+
+ public class MultiButtonLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.MultiButtonLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getButtonContents();
+ method public int getFiveButtonDistribution();
+ field public static final int FIVE_BUTTON_DISTRIBUTION_BOTTOM_HEAVY = 2; // 0x2
+ field public static final int FIVE_BUTTON_DISTRIBUTION_TOP_HEAVY = 1; // 0x1
+ }
+
+ public static final class MultiButtonLayout.Builder {
+ ctor public MultiButtonLayout.Builder();
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout.Builder addButtonContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout build();
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout.Builder setFiveButtonDistribution(int);
+ }
+
+ public class MultiSlotLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.MultiSlotLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getHorizontalSpacerWidth();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getSlotContents();
+ }
+
+ public static final class MultiSlotLayout.Builder {
+ ctor public MultiSlotLayout.Builder();
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout.Builder addSlotContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout build();
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout.Builder setHorizontalSpacerWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class PrimaryLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.PrimaryLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryChipContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getVerticalSpacerHeight();
+ }
+
+ public static final class PrimaryLayout.Builder {
+ ctor public PrimaryLayout.Builder(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout build();
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setPrimaryChipContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setPrimaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setSecondaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setVerticalSpacerHeight(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-material/api/res-1.0.0-beta01.txt b/wear/protolayout/protolayout-material/api/res-1.0.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/protolayout/protolayout-material/api/res-1.0.0-beta01.txt
diff --git a/wear/protolayout/protolayout-material/api/restricted_1.0.0-beta01.txt b/wear/protolayout/protolayout-material/api/restricted_1.0.0-beta01.txt
new file mode 100644
index 0000000..4f36b35
--- /dev/null
+++ b/wear/protolayout/protolayout-material/api/restricted_1.0.0-beta01.txt
@@ -0,0 +1,320 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.material {
+
+ public class Button implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Button? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ButtonColors getButtonColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method public String? getIconContent();
+ method public String? getImageContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getSize();
+ method public String? getTextContent();
+ }
+
+ public static final class Button.Builder {
+ ctor public Button.Builder(android.content.Context, androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method public androidx.wear.protolayout.material.Button build();
+ method public androidx.wear.protolayout.material.Button.Builder setButtonColors(androidx.wear.protolayout.material.ButtonColors);
+ method public androidx.wear.protolayout.material.Button.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.Button.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.Button.Builder setCustomContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.Button.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setIconContent(String, androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.Button.Builder setImageContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.Button.Builder setSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.material.Button.Builder setTextContent(String);
+ method public androidx.wear.protolayout.material.Button.Builder setTextContent(String, int);
+ }
+
+ public class ButtonColors {
+ ctor public ButtonColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ButtonColors(@ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getBackgroundColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getContentColor();
+ method public static androidx.wear.protolayout.material.ButtonColors primaryButtonColors(androidx.wear.protolayout.material.Colors);
+ method public static androidx.wear.protolayout.material.ButtonColors secondaryButtonColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ButtonDefaults {
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp recommendedIconSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp recommendedIconSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_SIZE;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp EXTRA_LARGE_SIZE;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp LARGE_SIZE;
+ field public static final androidx.wear.protolayout.material.ButtonColors PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ButtonColors SECONDARY_COLORS;
+ }
+
+ public class Chip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Chip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getHeight();
+ method public int getHorizontalAlignment();
+ method public String? getIconContent();
+ method public String? getPrimaryLabelContent();
+ method public String? getSecondaryLabelContent();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ public static final class Chip.Builder {
+ ctor public Chip.Builder(android.content.Context, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.Chip build();
+ method public androidx.wear.protolayout.material.Chip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method public androidx.wear.protolayout.material.Chip.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.Chip.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.Chip.Builder setCustomContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.Chip.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.material.Chip.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setPrimaryLabelContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setSecondaryLabelContent(String);
+ method public androidx.wear.protolayout.material.Chip.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.material.Chip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class ChipColors {
+ ctor public ChipColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ChipColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ChipColors(@ColorInt int, @ColorInt int);
+ ctor public ChipColors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getBackgroundColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getContentColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getIconColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getSecondaryContentColor();
+ method public static androidx.wear.protolayout.material.ChipColors primaryChipColors(androidx.wear.protolayout.material.Colors);
+ method public static androidx.wear.protolayout.material.ChipColors secondaryChipColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ChipDefaults {
+ field public static final androidx.wear.protolayout.material.ChipColors COMPACT_PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors COMPACT_SECONDARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors SECONDARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors TITLE_PRIMARY_COLORS;
+ field public static final androidx.wear.protolayout.material.ChipColors TITLE_SECONDARY_COLORS;
+ }
+
+ public class CircularProgressIndicator implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.CircularProgressIndicator? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ProgressIndicatorColors getCircularProgressIndicatorColors();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getEndAngle();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getProgress();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp getStartAngle();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp getStrokeWidth();
+ }
+
+ public static final class CircularProgressIndicator.Builder {
+ ctor public CircularProgressIndicator.Builder();
+ method public androidx.wear.protolayout.material.CircularProgressIndicator build();
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setCircularProgressIndicatorColors(androidx.wear.protolayout.material.ProgressIndicatorColors);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setContentDescription(CharSequence);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setEndAngle(float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setProgress(androidx.wear.protolayout.TypeBuilders.FloatProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setProgress(@FloatRange(from=0, to=1) float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStartAngle(float);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStrokeWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.material.CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class Colors {
+ ctor public Colors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @ColorInt public int getOnPrimary();
+ method @ColorInt public int getOnSurface();
+ method @ColorInt public int getPrimary();
+ method @ColorInt public int getSurface();
+ field public static final androidx.wear.protolayout.material.Colors DEFAULT;
+ }
+
+ public class CompactChip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.CompactChip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public String? getIconContent();
+ method public String getText();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ }
+
+ public static final class CompactChip.Builder {
+ ctor public CompactChip.Builder(android.content.Context, String, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.CompactChip build();
+ method public androidx.wear.protolayout.material.CompactChip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.CompactChip.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.CompactChip.Builder setIconContent(String);
+ }
+
+ public class ProgressIndicatorColors {
+ ctor public ProgressIndicatorColors(androidx.wear.protolayout.ColorBuilders.ColorProp, androidx.wear.protolayout.ColorBuilders.ColorProp);
+ ctor public ProgressIndicatorColors(@ColorInt int, @ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getIndicatorColor();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getTrackColor();
+ method public static androidx.wear.protolayout.material.ProgressIndicatorColors progressIndicatorColors(androidx.wear.protolayout.material.Colors);
+ }
+
+ public class ProgressIndicatorDefaults {
+ field public static final androidx.wear.protolayout.material.ProgressIndicatorColors DEFAULT_COLORS;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_STROKE_WIDTH;
+ field public static final float GAP_END_ANGLE = 156.1f;
+ field public static final float GAP_START_ANGLE = -156.1f;
+ }
+
+ public class Text implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.Text? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp getColor();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle getFontStyle();
+ method public float getLineHeight();
+ method public int getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers getModifiers();
+ method public int getMultilineAlignment();
+ method public int getOverflow();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp getText();
+ method public int getWeight();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ method public boolean isItalic();
+ method public boolean isUnderline();
+ }
+
+ public static final class Text.Builder {
+ ctor public Text.Builder(android.content.Context, androidx.wear.protolayout.TypeBuilders.StringProp, androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint);
+ ctor public Text.Builder(android.content.Context, String);
+ method public androidx.wear.protolayout.material.Text build();
+ method public androidx.wear.protolayout.material.Text.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.Text.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setItalic(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.material.Text.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.material.Text.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.material.Text.Builder setOverflow(int);
+ method public androidx.wear.protolayout.material.Text.Builder setTypography(int);
+ method public androidx.wear.protolayout.material.Text.Builder setUnderline(boolean);
+ method public androidx.wear.protolayout.material.Text.Builder setWeight(int);
+ }
+
+ public class TitleChip implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.TitleChip? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.ChipColors getChipColors();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable getClickable();
+ method public int getHorizontalAlignment();
+ method public String? getIconContent();
+ method public String getText();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension getWidth();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public boolean hasExcludeFontPadding();
+ }
+
+ public static final class TitleChip.Builder {
+ ctor public TitleChip.Builder(android.content.Context, String, androidx.wear.protolayout.ModifiersBuilders.Clickable, androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.TitleChip build();
+ method public androidx.wear.protolayout.material.TitleChip.Builder setChipColors(androidx.wear.protolayout.material.ChipColors);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.material.TitleChip.Builder setExcludeFontPadding(boolean);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setIconContent(String);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.material.TitleChip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class Typography {
+ field public static final int TYPOGRAPHY_BODY1 = 7; // 0x7
+ field public static final int TYPOGRAPHY_BODY2 = 8; // 0x8
+ field public static final int TYPOGRAPHY_BUTTON = 9; // 0x9
+ field public static final int TYPOGRAPHY_CAPTION1 = 10; // 0xa
+ field public static final int TYPOGRAPHY_CAPTION2 = 11; // 0xb
+ field public static final int TYPOGRAPHY_CAPTION3 = 12; // 0xc
+ field public static final int TYPOGRAPHY_DISPLAY1 = 1; // 0x1
+ field public static final int TYPOGRAPHY_DISPLAY2 = 2; // 0x2
+ field public static final int TYPOGRAPHY_DISPLAY3 = 3; // 0x3
+ field public static final int TYPOGRAPHY_TITLE1 = 4; // 0x4
+ field public static final int TYPOGRAPHY_TITLE2 = 5; // 0x5
+ field public static final int TYPOGRAPHY_TITLE3 = 6; // 0x6
+ }
+
+}
+
+package androidx.wear.protolayout.material.layouts {
+
+ public class EdgeContentLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.EdgeContentLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getEdgeContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ }
+
+ public static final class EdgeContentLayout.Builder {
+ ctor public EdgeContentLayout.Builder(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout build();
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setEdgeContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setPrimaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.EdgeContentLayout.Builder setSecondaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ }
+
+ public class LayoutDefaults {
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp DEFAULT_VERTICAL_SPACER_HEIGHT;
+ field public static final float EDGE_CONTENT_LAYOUT_PADDING_ABOVE_MAIN_CONTENT_DP = 6.0f;
+ field public static final float EDGE_CONTENT_LAYOUT_PADDING_BELOW_MAIN_CONTENT_DP = 8.0f;
+ field @Deprecated public static final int MULTI_BUTTON_MAX_NUMBER = 7; // 0x7
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp MULTI_SLOT_LAYOUT_HORIZONTAL_SPACER_WIDTH;
+ }
+
+ public static final class LayoutDefaults.MultiButtonLayoutDefaults {
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_1_BUTTON;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_2_BUTTONS;
+ field public static final androidx.wear.protolayout.DimensionBuilders.DpProp BUTTON_SIZE_FOR_3_PLUS_BUTTONS;
+ field public static final int MAX_BUTTONS = 7; // 0x7
+ }
+
+ public class MultiButtonLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.MultiButtonLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getButtonContents();
+ method public int getFiveButtonDistribution();
+ field public static final int FIVE_BUTTON_DISTRIBUTION_BOTTOM_HEAVY = 2; // 0x2
+ field public static final int FIVE_BUTTON_DISTRIBUTION_TOP_HEAVY = 1; // 0x1
+ }
+
+ public static final class MultiButtonLayout.Builder {
+ ctor public MultiButtonLayout.Builder();
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout.Builder addButtonContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout build();
+ method public androidx.wear.protolayout.material.layouts.MultiButtonLayout.Builder setFiveButtonDistribution(int);
+ }
+
+ public class MultiSlotLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.MultiSlotLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getHorizontalSpacerWidth();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getSlotContents();
+ }
+
+ public static final class MultiSlotLayout.Builder {
+ ctor public MultiSlotLayout.Builder();
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout.Builder addSlotContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout build();
+ method public androidx.wear.protolayout.material.layouts.MultiSlotLayout.Builder setHorizontalSpacerWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public class PrimaryLayout implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public static androidx.wear.protolayout.material.layouts.PrimaryLayout? fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryChipContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getVerticalSpacerHeight();
+ }
+
+ public static final class PrimaryLayout.Builder {
+ ctor public PrimaryLayout.Builder(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout build();
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setPrimaryChipContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setPrimaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setSecondaryLabelTextContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.material.layouts.PrimaryLayout.Builder setVerticalSpacerHeight(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout-renderer/api/1.0.0-beta01.txt b/wear/protolayout/protolayout-renderer/api/1.0.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/wear/protolayout/protolayout-renderer/api/1.0.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/wear/protolayout/protolayout-renderer/api/res-1.0.0-beta01.txt b/wear/protolayout/protolayout-renderer/api/res-1.0.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/protolayout/protolayout-renderer/api/res-1.0.0-beta01.txt
diff --git a/wear/protolayout/protolayout-renderer/api/restricted_1.0.0-beta01.txt b/wear/protolayout/protolayout-renderer/api/restricted_1.0.0-beta01.txt
new file mode 100644
index 0000000..e393e1d
--- /dev/null
+++ b/wear/protolayout/protolayout-renderer/api/restricted_1.0.0-beta01.txt
@@ -0,0 +1,34 @@
+// Signature format: 4.0
+package androidx.wear.protolayout.renderer.impl {
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public class ProtoLayoutViewInstance implements java.lang.AutoCloseable {
+ ctor public ProtoLayoutViewInstance(androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.Config);
+ method public void close() throws java.lang.Exception;
+ method @UiThread public void detach(android.view.ViewGroup);
+ method @UiThread public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> renderAndAttach(androidx.wear.protolayout.proto.LayoutElementProto.Layout, androidx.wear.protolayout.proto.ResourceProto.Resources, android.view.ViewGroup);
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final class ProtoLayoutViewInstance.Config {
+ method public com.google.common.util.concurrent.ListeningExecutorService getBgExecutorService();
+ method public String getClickableIdExtra();
+ method public androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.LoadActionListener getLoadActionListener();
+ method public java.util.Map<androidx.wear.protolayout.expression.pipeline.PlatformDataProvider!,java.util.Set<androidx.wear.protolayout.expression.PlatformDataKey<?>!>!> getPlatformDataProviders();
+ method public androidx.wear.protolayout.expression.pipeline.StateStore? getStateStore();
+ method public android.content.Context getUiContext();
+ method public com.google.common.util.concurrent.ListeningExecutorService getUiExecutorService();
+ }
+
+ @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX) public static final class ProtoLayoutViewInstance.Config.Builder {
+ ctor public ProtoLayoutViewInstance.Config.Builder(android.content.Context, com.google.common.util.concurrent.ListeningExecutorService, com.google.common.util.concurrent.ListeningExecutorService, String);
+ method public androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.Config.Builder addPlatformDataProvider(androidx.wear.protolayout.expression.pipeline.PlatformDataProvider, androidx.wear.protolayout.expression.PlatformDataKey<?>!...);
+ method public androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.Config build();
+ method public androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.Config.Builder setLoadActionListener(androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.LoadActionListener);
+ method public androidx.wear.protolayout.renderer.impl.ProtoLayoutViewInstance.Config.Builder setStateStore(androidx.wear.protolayout.expression.pipeline.StateStore);
+ }
+
+ public static interface ProtoLayoutViewInstance.LoadActionListener {
+ method public void onClick(androidx.wear.protolayout.proto.StateProto.State);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout/api/1.0.0-beta01.txt b/wear/protolayout/protolayout/api/1.0.0-beta01.txt
new file mode 100644
index 0000000..4089bc7
--- /dev/null
+++ b/wear/protolayout/protolayout/api/1.0.0-beta01.txt
@@ -0,0 +1,1295 @@
+// Signature format: 4.0
+package androidx.wear.protolayout {
+
+ public final class ActionBuilders {
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra booleanExtra(boolean);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra doubleExtra(double);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidIntExtra intExtra(int);
+ method public static androidx.wear.protolayout.ActionBuilders.LaunchAction launchAction(android.content.ComponentName);
+ method public static androidx.wear.protolayout.ActionBuilders.LaunchAction launchAction(android.content.ComponentName, java.util.Map<java.lang.String!,androidx.wear.protolayout.ActionBuilders.AndroidExtra!>);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidLongExtra longExtra(long);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidStringExtra stringExtra(String);
+ }
+
+ public static interface ActionBuilders.Action {
+ }
+
+ public static final class ActionBuilders.AndroidActivity {
+ method public String getClassName();
+ method public java.util.Map<java.lang.String!,androidx.wear.protolayout.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
+ method public String getPackageName();
+ }
+
+ public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor public ActionBuilders.AndroidActivity.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.protolayout.ActionBuilders.AndroidExtra);
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder setClassName(String);
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder setPackageName(String);
+ }
+
+ public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public boolean getValue();
+ }
+
+ public static final class ActionBuilders.AndroidBooleanExtra.Builder {
+ ctor public ActionBuilders.AndroidBooleanExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
+ }
+
+ public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public double getValue();
+ }
+
+ public static final class ActionBuilders.AndroidDoubleExtra.Builder {
+ ctor public ActionBuilders.AndroidDoubleExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
+ }
+
+ public static interface ActionBuilders.AndroidExtra {
+ }
+
+ public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public int getValue();
+ }
+
+ public static final class ActionBuilders.AndroidIntExtra.Builder {
+ ctor public ActionBuilders.AndroidIntExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidIntExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidIntExtra.Builder setValue(int);
+ }
+
+ public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public long getValue();
+ }
+
+ public static final class ActionBuilders.AndroidLongExtra.Builder {
+ ctor public ActionBuilders.AndroidLongExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidLongExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidLongExtra.Builder setValue(long);
+ }
+
+ public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public String getValue();
+ }
+
+ public static final class ActionBuilders.AndroidStringExtra.Builder {
+ ctor public ActionBuilders.AndroidStringExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidStringExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidStringExtra.Builder setValue(String);
+ }
+
+ public static final class ActionBuilders.LaunchAction implements androidx.wear.protolayout.ActionBuilders.Action {
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity? getAndroidActivity();
+ }
+
+ public static final class ActionBuilders.LaunchAction.Builder {
+ ctor public ActionBuilders.LaunchAction.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.LaunchAction build();
+ method public androidx.wear.protolayout.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.protolayout.ActionBuilders.AndroidActivity);
+ }
+
+ public static final class ActionBuilders.LoadAction implements androidx.wear.protolayout.ActionBuilders.Action {
+ method public androidx.wear.protolayout.StateBuilders.State? getRequestState();
+ }
+
+ public static final class ActionBuilders.LoadAction.Builder {
+ ctor public ActionBuilders.LoadAction.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.LoadAction build();
+ method public androidx.wear.protolayout.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.protolayout.StateBuilders.State);
+ }
+
+ public final class ColorBuilders {
+ method public static androidx.wear.protolayout.ColorBuilders.ColorProp argb(@ColorInt int);
+ }
+
+ public static final class ColorBuilders.ColorProp {
+ method @ColorInt public int getArgb();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor? getDynamicValue();
+ }
+
+ public static final class ColorBuilders.ColorProp.Builder {
+ ctor @Deprecated public ColorBuilders.ColorProp.Builder();
+ ctor public ColorBuilders.ColorProp.Builder(@ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp build();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor);
+ }
+
+ public final class DeviceParametersBuilders {
+ field public static final int DEVICE_PLATFORM_UNDEFINED = 0; // 0x0
+ field public static final int DEVICE_PLATFORM_WEAR_OS = 1; // 0x1
+ field public static final int SCREEN_SHAPE_RECT = 2; // 0x2
+ field public static final int SCREEN_SHAPE_ROUND = 1; // 0x1
+ field public static final int SCREEN_SHAPE_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class DeviceParametersBuilders.Capabilities {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public long getMinimumFreshnessLimitMillis();
+ }
+
+ public static final class DeviceParametersBuilders.Capabilities.Builder {
+ ctor public DeviceParametersBuilders.Capabilities.Builder();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities.Builder setMinimumFreshnessLimitMillis(long);
+ }
+
+ public static final class DeviceParametersBuilders.DeviceParameters {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities? getCapabilities();
+ method public int getDevicePlatform();
+ method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getFontScale();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo getRendererSchemaVersion();
+ method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
+ method public int getScreenShape();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenWidthDp();
+ }
+
+ public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor public DeviceParametersBuilders.DeviceParameters.Builder();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setCapabilities(androidx.wear.protolayout.DeviceParametersBuilders.Capabilities);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setFontScale(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setRendererSchemaVersion(androidx.wear.protolayout.expression.VersionBuilders.VersionInfo);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ }
+
+ public final class DimensionBuilders {
+ method public static androidx.wear.protolayout.DimensionBuilders.DegreesProp degrees(float);
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp dp(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public static androidx.wear.protolayout.DimensionBuilders.EmProp em(float);
+ method public static androidx.wear.protolayout.DimensionBuilders.EmProp em(int);
+ method public static androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp expand();
+ method public static androidx.wear.protolayout.DimensionBuilders.SpProp sp(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ method public static androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp wrap();
+ }
+
+ public static final class DimensionBuilders.AngularLayoutConstraint {
+ method public int getAngularAlignment();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.AngularLayoutConstraint.Builder {
+ ctor public DimensionBuilders.AngularLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint.Builder setAngularAlignment(int);
+ }
+
+ public static interface DimensionBuilders.ContainerDimension {
+ }
+
+ public static final class DimensionBuilders.DegreesProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method public float getValue();
+ }
+
+ public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DegreesProp.Builder();
+ ctor public DimensionBuilders.DegreesProp.Builder(float);
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp.Builder setValue(float);
+ }
+
+ public static final class DimensionBuilders.DpProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension androidx.wear.protolayout.DimensionBuilders.ExtensionDimension androidx.wear.protolayout.DimensionBuilders.ImageDimension androidx.wear.protolayout.DimensionBuilders.SpacerDimension {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.DpProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DpProp.Builder();
+ ctor public DimensionBuilders.DpProp.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public static final class DimensionBuilders.EmProp {
+ method public float getValue();
+ }
+
+ public static final class DimensionBuilders.EmProp.Builder {
+ ctor public DimensionBuilders.EmProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp.Builder setValue(float);
+ }
+
+ public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension androidx.wear.protolayout.DimensionBuilders.ImageDimension {
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp? getLayoutWeight();
+ }
+
+ public static final class DimensionBuilders.ExpandedDimensionProp.Builder {
+ ctor public DimensionBuilders.ExpandedDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp.Builder setLayoutWeight(androidx.wear.protolayout.TypeBuilders.FloatProp);
+ }
+
+ @androidx.wear.protolayout.expression.ExperimentalProtoLayoutExtensionApi public static interface DimensionBuilders.ExtensionDimension {
+ }
+
+ public static final class DimensionBuilders.HorizontalLayoutConstraint {
+ method public int getHorizontalAlignment();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.HorizontalLayoutConstraint.Builder {
+ ctor public DimensionBuilders.HorizontalLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint.Builder setHorizontalAlignment(int);
+ }
+
+ public static interface DimensionBuilders.ImageDimension {
+ }
+
+ public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ImageDimension {
+ method @IntRange(from=0) public int getAspectRatioHeight();
+ method @IntRange(from=0) public int getAspectRatioWidth();
+ }
+
+ public static final class DimensionBuilders.ProportionalDimensionProp.Builder {
+ ctor public DimensionBuilders.ProportionalDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
+ }
+
+ public static final class DimensionBuilders.SpProp {
+ method @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.SpProp.Builder {
+ ctor public DimensionBuilders.SpProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ }
+
+ public static interface DimensionBuilders.SpacerDimension {
+ }
+
+ public static final class DimensionBuilders.VerticalLayoutConstraint {
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ method public int getVerticalAlignment();
+ }
+
+ public static final class DimensionBuilders.VerticalLayoutConstraint.Builder {
+ ctor public DimensionBuilders.VerticalLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint.Builder setVerticalAlignment(int);
+ }
+
+ public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getMinimumSize();
+ }
+
+ public static final class DimensionBuilders.WrappedDimensionProp.Builder {
+ ctor public DimensionBuilders.WrappedDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp.Builder setMinimumSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public final class LayoutElementBuilders {
+ field public static final int ANGULAR_ALIGNMENT_CENTER = 2; // 0x2
+ field public static final int ANGULAR_ALIGNMENT_END = 3; // 0x3
+ field public static final int ANGULAR_ALIGNMENT_START = 1; // 0x1
+ field public static final int ANGULAR_ALIGNMENT_UNDEFINED = 0; // 0x0
+ field public static final int ARC_ANCHOR_CENTER = 2; // 0x2
+ field public static final int ARC_ANCHOR_END = 3; // 0x3
+ field public static final int ARC_ANCHOR_START = 1; // 0x1
+ field public static final int ARC_ANCHOR_UNDEFINED = 0; // 0x0
+ field public static final int CONTENT_SCALE_MODE_CROP = 2; // 0x2
+ field public static final int CONTENT_SCALE_MODE_FILL_BOUNDS = 3; // 0x3
+ field public static final int CONTENT_SCALE_MODE_FIT = 1; // 0x1
+ field public static final int CONTENT_SCALE_MODE_UNDEFINED = 0; // 0x0
+ field public static final int FONT_VARIANT_BODY = 2; // 0x2
+ field public static final int FONT_VARIANT_TITLE = 1; // 0x1
+ field public static final int FONT_VARIANT_UNDEFINED = 0; // 0x0
+ field public static final int FONT_WEIGHT_BOLD = 700; // 0x2bc
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int FONT_WEIGHT_MEDIUM = 500; // 0x1f4
+ field public static final int FONT_WEIGHT_NORMAL = 400; // 0x190
+ field public static final int FONT_WEIGHT_UNDEFINED = 0; // 0x0
+ field public static final int HORIZONTAL_ALIGN_CENTER = 2; // 0x2
+ field public static final int HORIZONTAL_ALIGN_END = 5; // 0x5
+ field public static final int HORIZONTAL_ALIGN_LEFT = 1; // 0x1
+ field public static final int HORIZONTAL_ALIGN_RIGHT = 3; // 0x3
+ field public static final int HORIZONTAL_ALIGN_START = 4; // 0x4
+ field public static final int HORIZONTAL_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int SPAN_VERTICAL_ALIGN_BOTTOM = 1; // 0x1
+ field public static final int SPAN_VERTICAL_ALIGN_TEXT_BASELINE = 2; // 0x2
+ field public static final int SPAN_VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int STROKE_CAP_BUTT = 1; // 0x1
+ field public static final int STROKE_CAP_ROUND = 2; // 0x2
+ field public static final int STROKE_CAP_SQUARE = 3; // 0x3
+ field public static final int STROKE_CAP_UNDEFINED = 0; // 0x0
+ field public static final int TEXT_ALIGN_CENTER = 2; // 0x2
+ field public static final int TEXT_ALIGN_END = 3; // 0x3
+ field public static final int TEXT_ALIGN_START = 1; // 0x1
+ field public static final int TEXT_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int TEXT_OVERFLOW_ELLIPSIZE_END = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int TEXT_OVERFLOW_MARQUEE = 3; // 0x3
+ field public static final int TEXT_OVERFLOW_TRUNCATE = 1; // 0x1
+ field public static final int TEXT_OVERFLOW_UNDEFINED = 0; // 0x0
+ field public static final int VERTICAL_ALIGN_BOTTOM = 3; // 0x3
+ field public static final int VERTICAL_ALIGN_CENTER = 2; // 0x2
+ field public static final int VERTICAL_ALIGN_TOP = 1; // 0x1
+ field public static final int VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class LayoutElementBuilders.AndroidTextStyle {
+ method public boolean getExcludeFontPadding();
+ }
+
+ public static final class LayoutElementBuilders.AndroidTextStyle.Builder {
+ ctor public LayoutElementBuilders.AndroidTextStyle.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle.Builder setExcludeFontPadding(boolean);
+ }
+
+ public static final class LayoutElementBuilders.Arc implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getAnchorAngle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint? getLayoutConstraintsForDynamicAnchorAngle();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlign();
+ }
+
+ public static final class LayoutElementBuilders.Arc.Builder {
+ ctor public LayoutElementBuilders.Arc.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorType(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setLayoutConstraintsForDynamicAnchorAngle(androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
+ }
+
+ public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getRotateContents();
+ }
+
+ public static final class LayoutElementBuilders.ArcAdapter.Builder {
+ ctor public LayoutElementBuilders.ArcAdapter.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
+ }
+
+ public static final class LayoutElementBuilders.ArcAnchorTypeProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
+ }
+
+ public static interface LayoutElementBuilders.ArcLayoutElement {
+ }
+
+ public static final class LayoutElementBuilders.ArcLine implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint? getLayoutConstraintsForDynamicLength();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getLength();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp? getStrokeCap();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getThickness();
+ }
+
+ public static final class LayoutElementBuilders.ArcLine.Builder {
+ ctor public LayoutElementBuilders.ArcLine.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setLayoutConstraintsForDynamicLength(androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setStrokeCap(androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setStrokeCap(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getLength();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getThickness();
+ }
+
+ public static final class LayoutElementBuilders.ArcSpacer.Builder {
+ ctor public LayoutElementBuilders.ArcSpacer.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.ArcText implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.ArcText.Builder {
+ ctor public LayoutElementBuilders.ArcText.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.Box implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Box.Builder {
+ ctor public LayoutElementBuilders.Box.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.ColorFilter {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getTint();
+ }
+
+ public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor public LayoutElementBuilders.ColorFilter.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ }
+
+ public static final class LayoutElementBuilders.Column implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Column.Builder {
+ ctor public LayoutElementBuilders.Column.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.ContentScaleModeProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor public LayoutElementBuilders.ContentScaleModeProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
+ }
+
+ @androidx.wear.protolayout.expression.ExperimentalProtoLayoutExtensionApi public static final class LayoutElementBuilders.ExtensionLayoutElement implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public String getExtensionId();
+ method public androidx.wear.protolayout.DimensionBuilders.ExtensionDimension? getHeight();
+ method public byte[] getPayload();
+ method public androidx.wear.protolayout.DimensionBuilders.ExtensionDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.ExtensionLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ExtensionLayoutElement.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setExtensionId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ExtensionDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setPayload(byte[]);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ExtensionDimension);
+ }
+
+ public static final class LayoutElementBuilders.FontStyle {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getItalic();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp? getLetterSpacing();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getSize();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getUnderline();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp? getVariant();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp? getWeight();
+ }
+
+ public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor public LayoutElementBuilders.FontStyle.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.protolayout.DimensionBuilders.EmProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setVariant(androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setVariant(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setWeight(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyles {
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class LayoutElementBuilders.FontVariantProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.FontVariantProp.Builder {
+ ctor public LayoutElementBuilders.FontVariantProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.FontWeightProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor public LayoutElementBuilders.FontWeightProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.HorizontalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Image implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter? getColorFilter();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
+ method public androidx.wear.protolayout.DimensionBuilders.ImageDimension? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getResourceId();
+ method public androidx.wear.protolayout.DimensionBuilders.ImageDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Image.Builder {
+ ctor public LayoutElementBuilders.Image.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setColorFilter(androidx.wear.protolayout.LayoutElementBuilders.ColorFilter);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ImageDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setResourceId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ImageDimension);
+ }
+
+ public static final class LayoutElementBuilders.Layout {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static androidx.wear.protolayout.LayoutElementBuilders.Layout? fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.LayoutElementBuilders.Layout fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getRoot();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public byte[] toByteArray();
+ }
+
+ public static final class LayoutElementBuilders.Layout.Builder {
+ ctor public LayoutElementBuilders.Layout.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ }
+
+ public static interface LayoutElementBuilders.LayoutElement {
+ }
+
+ public static final class LayoutElementBuilders.Row implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Row.Builder {
+ ctor public LayoutElementBuilders.Row.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.Spacer implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.SpacerDimension? getHeight();
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint? getLayoutConstraintsForDynamicHeight();
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint? getLayoutConstraintsForDynamicWidth();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.SpacerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Spacer.Builder {
+ ctor public LayoutElementBuilders.Spacer.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.SpacerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setLayoutConstraintsForDynamicHeight(androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setLayoutConstraintsForDynamicWidth(androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.SpacerDimension);
+ }
+
+ public static interface LayoutElementBuilders.Span {
+ }
+
+ public static final class LayoutElementBuilders.SpanImage implements androidx.wear.protolayout.LayoutElementBuilders.Span {
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getResourceId();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.SpanImage.Builder {
+ ctor public LayoutElementBuilders.SpanImage.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.SpanModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.SpanText implements androidx.wear.protolayout.LayoutElementBuilders.Span {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle? getAndroidTextStyle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.SpanText.Builder {
+ ctor public LayoutElementBuilders.SpanText.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setAndroidTextStyle(androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.SpanModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Spannable implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getLineHeight();
+ method @IntRange(from=0xffffffff) @androidx.wear.protolayout.expression.ProtoLayoutExperimental public int getMarqueeIterations();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop? getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getMultilineAlignment();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.Span!> getSpans();
+ }
+
+ public static final class LayoutElementBuilders.Spannable.Builder {
+ ctor public LayoutElementBuilders.Spannable.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.protolayout.LayoutElementBuilders.Span);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMarqueeIterations(@IntRange(from=0xffffffff) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.protolayout.TypeBuilders.Int32Prop);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setOverflow(int);
+ }
+
+ public static final class LayoutElementBuilders.StrokeCapProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.StrokeCapProp.Builder {
+ ctor public LayoutElementBuilders.StrokeCapProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Text implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle? getAndroidTextStyle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint? getLayoutConstraintsForDynamicText();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getLineHeight();
+ method @IntRange(from=0xffffffff) @androidx.wear.protolayout.expression.ProtoLayoutExperimental public int getMarqueeIterations();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop? getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp? getMultilineAlignment();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.Text.Builder {
+ ctor public LayoutElementBuilders.Text.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setAndroidTextStyle(androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setLayoutConstraintsForDynamicText(androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMarqueeIterations(@IntRange(from=0xffffffff) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.protolayout.TypeBuilders.Int32Prop);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setOverflow(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.TextAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.TextAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.TextOverflowProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor public LayoutElementBuilders.TextOverflowProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.VerticalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.VerticalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
+ }
+
+ public final class ModifiersBuilders {
+ field public static final int SEMANTICS_ROLE_BUTTON = 2; // 0x2
+ field public static final int SEMANTICS_ROLE_CHECKBOX = 3; // 0x3
+ field public static final int SEMANTICS_ROLE_IMAGE = 1; // 0x1
+ field public static final int SEMANTICS_ROLE_NONE = 0; // 0x0
+ field public static final int SEMANTICS_ROLE_RADIOBUTTON = 5; // 0x5
+ field public static final int SEMANTICS_ROLE_SWITCH = 4; // 0x4
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_BOTTOM_TO_TOP = 4; // 0x4
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_LEFT_TO_RIGHT = 1; // 0x1
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_RIGHT_TO_LEFT = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_TOP_TO_BOTTOM = 3; // 0x3
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_UNDEFINED = 0; // 0x0
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_TO_INSIDE = 1; // 0x1
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_TO_OUTSIDE = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.AnimatedVisibility {
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition? getEnterTransition();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition? getExitTransition();
+ }
+
+ public static final class ModifiersBuilders.AnimatedVisibility.Builder {
+ ctor public ModifiersBuilders.AnimatedVisibility.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility build();
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility.Builder setEnterTransition(androidx.wear.protolayout.ModifiersBuilders.EnterTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility.Builder setExitTransition(androidx.wear.protolayout.ModifiersBuilders.ExitTransition);
+ }
+
+ public static final class ModifiersBuilders.ArcModifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor public ModifiersBuilders.ArcModifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.protolayout.ModifiersBuilders.Semantics);
+ }
+
+ public static final class ModifiersBuilders.Background {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner? getCorner();
+ }
+
+ public static final class ModifiersBuilders.Background.Builder {
+ ctor public ModifiersBuilders.Background.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Background build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Background.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Background.Builder setCorner(androidx.wear.protolayout.ModifiersBuilders.Corner);
+ }
+
+ public static final class ModifiersBuilders.Border {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getWidth();
+ }
+
+ public static final class ModifiersBuilders.Border.Builder {
+ ctor public ModifiersBuilders.Border.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Border.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class ModifiersBuilders.Clickable {
+ method public String getId();
+ method public androidx.wear.protolayout.ActionBuilders.Action? getOnClick();
+ }
+
+ public static final class ModifiersBuilders.Clickable.Builder {
+ ctor public ModifiersBuilders.Clickable.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable.Builder setId(String);
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.protolayout.ActionBuilders.Action);
+ }
+
+ public static final class ModifiersBuilders.Corner {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getRadius();
+ }
+
+ public static final class ModifiersBuilders.Corner.Builder {
+ ctor public ModifiersBuilders.Corner.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.DefaultContentTransitions {
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition fadeIn();
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition fadeInSlideIn(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition fadeOut();
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition fadeOutSlideOut(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition slideIn(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition slideOut(int);
+ }
+
+ public static final class ModifiersBuilders.ElementMetadata {
+ method public byte[] getTagData();
+ }
+
+ public static final class ModifiersBuilders.ElementMetadata.Builder {
+ ctor public ModifiersBuilders.ElementMetadata.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata.Builder setTagData(byte[]);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.EnterTransition {
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition? getFadeIn();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition? getSlideIn();
+ }
+
+ public static final class ModifiersBuilders.EnterTransition.Builder {
+ ctor public ModifiersBuilders.EnterTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition.Builder setFadeIn(androidx.wear.protolayout.ModifiersBuilders.FadeInTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition.Builder setSlideIn(androidx.wear.protolayout.ModifiersBuilders.SlideInTransition);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.ExitTransition {
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition? getFadeOut();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition? getSlideOut();
+ }
+
+ public static final class ModifiersBuilders.ExitTransition.Builder {
+ ctor public ModifiersBuilders.ExitTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition.Builder setFadeOut(androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition.Builder setSlideOut(androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.FadeInTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method @FloatRange(from=0.0, to=1.0) public float getInitialAlpha();
+ }
+
+ public static final class ModifiersBuilders.FadeInTransition.Builder {
+ ctor public ModifiersBuilders.FadeInTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition.Builder setInitialAlpha(@FloatRange(from=0.0, to=1.0) float);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.FadeOutTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method @FloatRange(from=0.0, to=1.0) public float getTargetAlpha();
+ }
+
+ public static final class ModifiersBuilders.FadeOutTransition.Builder {
+ ctor public ModifiersBuilders.FadeOutTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition.Builder setTargetAlpha(@FloatRange(from=0.0, to=1.0) float);
+ }
+
+ public static final class ModifiersBuilders.Modifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Background? getBackground();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border? getBorder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility? getContentUpdateAnimation();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata? getMetadata();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding? getPadding();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor public ModifiersBuilders.Modifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.protolayout.ModifiersBuilders.Background);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.protolayout.ModifiersBuilders.Border);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setContentUpdateAnimation(androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setMetadata(androidx.wear.protolayout.ModifiersBuilders.ElementMetadata);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.protolayout.ModifiersBuilders.Padding);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.protolayout.ModifiersBuilders.Semantics);
+ }
+
+ public static final class ModifiersBuilders.Padding {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getBottom();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getEnd();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getRtlAware();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getStart();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getTop();
+ }
+
+ public static final class ModifiersBuilders.Padding.Builder {
+ ctor public ModifiersBuilders.Padding.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setAll(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setStart(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setTop(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class ModifiersBuilders.Semantics {
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public int getRole();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getStateDescription();
+ }
+
+ public static final class ModifiersBuilders.Semantics.Builder {
+ ctor public ModifiersBuilders.Semantics.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setContentDescription(String);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setRole(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setStateDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static interface ModifiersBuilders.SlideBound {
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideInTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method public int getDirection();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideBound? getInitialSlideBound();
+ }
+
+ public static final class ModifiersBuilders.SlideInTransition.Builder {
+ ctor public ModifiersBuilders.SlideInTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setDirection(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setInitialSlideBound(androidx.wear.protolayout.ModifiersBuilders.SlideBound);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideOutTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method public int getDirection();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideBound? getTargetSlideBound();
+ }
+
+ public static final class ModifiersBuilders.SlideOutTransition.Builder {
+ ctor public ModifiersBuilders.SlideOutTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setDirection(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setTargetSlideBound(androidx.wear.protolayout.ModifiersBuilders.SlideBound);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideParentBound implements androidx.wear.protolayout.ModifiersBuilders.SlideBound {
+ method public int getSnapTo();
+ }
+
+ public static final class ModifiersBuilders.SlideParentBound.Builder {
+ ctor public ModifiersBuilders.SlideParentBound.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideParentBound build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideParentBound.Builder setSnapTo(int);
+ }
+
+ public static final class ModifiersBuilders.SpanModifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ }
+
+ public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor public ModifiersBuilders.SpanModifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ }
+
+ public final class ResourceBuilders {
+ field public static final int ANIMATED_IMAGE_FORMAT_AVD = 1; // 0x1
+ field public static final int ANIMATED_IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ field public static final int IMAGE_FORMAT_ARGB_8888 = 2; // 0x2
+ field public static final int IMAGE_FORMAT_RGB_565 = 1; // 0x1
+ field public static final int IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ResourceBuilders.AndroidAnimatedImageResourceByResId {
+ method public int getAnimatedImageFormat();
+ method @DrawableRes public int getResourceId();
+ method public androidx.wear.protolayout.TriggerBuilders.Trigger? getStartTrigger();
+ }
+
+ public static final class ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setAnimatedImageFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setStartTrigger(androidx.wear.protolayout.TriggerBuilders.Trigger);
+ }
+
+ public static final class ResourceBuilders.AndroidImageResourceByResId {
+ method @DrawableRes public int getResourceId();
+ }
+
+ public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId {
+ method public int getAnimatedImageFormat();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getProgress();
+ method @DrawableRes public int getResourceId();
+ }
+
+ public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setAnimatedImageFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setProgress(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ public static final class ResourceBuilders.ImageResource {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId? getAndroidAnimatedResourceByResId();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId? getAndroidSeekableAnimatedResourceByResId();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource? getInlineResource();
+ }
+
+ public static final class ResourceBuilders.ImageResource.Builder {
+ ctor public ResourceBuilders.ImageResource.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidAnimatedResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId);
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidSeekableAnimatedResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId);
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.protolayout.ResourceBuilders.InlineImageResource);
+ }
+
+ public static final class ResourceBuilders.InlineImageResource {
+ method public byte[] getData();
+ method public int getFormat();
+ method @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
+ method @Dimension(unit=androidx.annotation.Dimension.PX) public int getWidthPx();
+ }
+
+ public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor public ResourceBuilders.InlineImageResource.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource build();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ }
+
+ public static final class ResourceBuilders.Resources {
+ method public java.util.Map<java.lang.String!,androidx.wear.protolayout.ResourceBuilders.ImageResource!> getIdToImageMapping();
+ method public String getVersion();
+ }
+
+ public static final class ResourceBuilders.Resources.Builder {
+ ctor public ResourceBuilders.Resources.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.protolayout.ResourceBuilders.ImageResource);
+ method public androidx.wear.protolayout.ResourceBuilders.Resources build();
+ method public androidx.wear.protolayout.ResourceBuilders.Resources.Builder setVersion(String);
+ }
+
+ public final class StateBuilders {
+ }
+
+ public static final class StateBuilders.State {
+ method public java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!> getKeyToValueMapping();
+ method public String getLastClickableId();
+ method public static int getMaxStateEntryCount();
+ }
+
+ public static final class StateBuilders.State.Builder {
+ ctor public StateBuilders.State.Builder();
+ method public <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.StateBuilders.State.Builder addKeyToValueMapping(androidx.wear.protolayout.expression.AppDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ method public androidx.wear.protolayout.StateBuilders.State build();
+ }
+
+ public final class TimelineBuilders {
+ }
+
+ public static final class TimelineBuilders.TimeInterval {
+ method public long getEndMillis();
+ method public long getStartMillis();
+ }
+
+ public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor public TimelineBuilders.TimeInterval.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval build();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
+ }
+
+ public static final class TimelineBuilders.Timeline {
+ method public static androidx.wear.protolayout.TimelineBuilders.Timeline fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public java.util.List<androidx.wear.protolayout.TimelineBuilders.TimelineEntry!> getTimelineEntries();
+ }
+
+ public static final class TimelineBuilders.Timeline.Builder {
+ ctor public TimelineBuilders.Timeline.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.protolayout.TimelineBuilders.TimelineEntry);
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline build();
+ }
+
+ public static final class TimelineBuilders.TimelineEntry {
+ method public static androidx.wear.protolayout.TimelineBuilders.TimelineEntry fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout? getLayout();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval? getValidity();
+ }
+
+ public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor public TimelineBuilders.TimelineEntry.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry build();
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.protolayout.LayoutElementBuilders.Layout);
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.protolayout.TimelineBuilders.TimeInterval);
+ }
+
+ public final class TriggerBuilders {
+ method public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnConditionMetTrigger(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnLoadTrigger();
+ }
+
+ public static interface TriggerBuilders.Trigger {
+ }
+
+ public final class TypeBuilders {
+ }
+
+ public static final class TypeBuilders.BoolProp {
+ method public boolean getValue();
+ }
+
+ public static final class TypeBuilders.BoolProp.Builder {
+ ctor public TypeBuilders.BoolProp.Builder();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp build();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp.Builder setValue(boolean);
+ }
+
+ public static final class TypeBuilders.FloatProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method public float getValue();
+ }
+
+ public static final class TypeBuilders.FloatProp.Builder {
+ ctor @Deprecated public TypeBuilders.FloatProp.Builder();
+ ctor public TypeBuilders.FloatProp.Builder(float);
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp build();
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp.Builder setValue(float);
+ }
+
+ public static final class TypeBuilders.Int32Prop {
+ method public int getValue();
+ }
+
+ public static final class TypeBuilders.Int32Prop.Builder {
+ ctor public TypeBuilders.Int32Prop.Builder();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop build();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop.Builder setValue(int);
+ }
+
+ public static final class TypeBuilders.StringLayoutConstraint {
+ method public int getAlignment();
+ method public String getPatternForLayout();
+ }
+
+ public static final class TypeBuilders.StringLayoutConstraint.Builder {
+ ctor public TypeBuilders.StringLayoutConstraint.Builder(String);
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint build();
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint.Builder setAlignment(int);
+ }
+
+ public static final class TypeBuilders.StringProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicString? getDynamicValue();
+ method public String getValue();
+ }
+
+ public static final class TypeBuilders.StringProp.Builder {
+ ctor @Deprecated public TypeBuilders.StringProp.Builder();
+ ctor public TypeBuilders.StringProp.Builder(String);
+ method public androidx.wear.protolayout.TypeBuilders.StringProp build();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString);
+ method public androidx.wear.protolayout.TypeBuilders.StringProp.Builder setValue(String);
+ }
+
+}
+
diff --git a/wear/protolayout/protolayout/api/res-1.0.0-beta01.txt b/wear/protolayout/protolayout/api/res-1.0.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/protolayout/protolayout/api/res-1.0.0-beta01.txt
diff --git a/wear/protolayout/protolayout/api/restricted_1.0.0-beta01.txt b/wear/protolayout/protolayout/api/restricted_1.0.0-beta01.txt
new file mode 100644
index 0000000..4089bc7
--- /dev/null
+++ b/wear/protolayout/protolayout/api/restricted_1.0.0-beta01.txt
@@ -0,0 +1,1295 @@
+// Signature format: 4.0
+package androidx.wear.protolayout {
+
+ public final class ActionBuilders {
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra booleanExtra(boolean);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra doubleExtra(double);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidIntExtra intExtra(int);
+ method public static androidx.wear.protolayout.ActionBuilders.LaunchAction launchAction(android.content.ComponentName);
+ method public static androidx.wear.protolayout.ActionBuilders.LaunchAction launchAction(android.content.ComponentName, java.util.Map<java.lang.String!,androidx.wear.protolayout.ActionBuilders.AndroidExtra!>);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidLongExtra longExtra(long);
+ method public static androidx.wear.protolayout.ActionBuilders.AndroidStringExtra stringExtra(String);
+ }
+
+ public static interface ActionBuilders.Action {
+ }
+
+ public static final class ActionBuilders.AndroidActivity {
+ method public String getClassName();
+ method public java.util.Map<java.lang.String!,androidx.wear.protolayout.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
+ method public String getPackageName();
+ }
+
+ public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor public ActionBuilders.AndroidActivity.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.protolayout.ActionBuilders.AndroidExtra);
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder setClassName(String);
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity.Builder setPackageName(String);
+ }
+
+ public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public boolean getValue();
+ }
+
+ public static final class ActionBuilders.AndroidBooleanExtra.Builder {
+ ctor public ActionBuilders.AndroidBooleanExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
+ }
+
+ public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public double getValue();
+ }
+
+ public static final class ActionBuilders.AndroidDoubleExtra.Builder {
+ ctor public ActionBuilders.AndroidDoubleExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
+ }
+
+ public static interface ActionBuilders.AndroidExtra {
+ }
+
+ public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public int getValue();
+ }
+
+ public static final class ActionBuilders.AndroidIntExtra.Builder {
+ ctor public ActionBuilders.AndroidIntExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidIntExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidIntExtra.Builder setValue(int);
+ }
+
+ public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public long getValue();
+ }
+
+ public static final class ActionBuilders.AndroidLongExtra.Builder {
+ ctor public ActionBuilders.AndroidLongExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidLongExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidLongExtra.Builder setValue(long);
+ }
+
+ public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.protolayout.ActionBuilders.AndroidExtra {
+ method public String getValue();
+ }
+
+ public static final class ActionBuilders.AndroidStringExtra.Builder {
+ ctor public ActionBuilders.AndroidStringExtra.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidStringExtra build();
+ method public androidx.wear.protolayout.ActionBuilders.AndroidStringExtra.Builder setValue(String);
+ }
+
+ public static final class ActionBuilders.LaunchAction implements androidx.wear.protolayout.ActionBuilders.Action {
+ method public androidx.wear.protolayout.ActionBuilders.AndroidActivity? getAndroidActivity();
+ }
+
+ public static final class ActionBuilders.LaunchAction.Builder {
+ ctor public ActionBuilders.LaunchAction.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.LaunchAction build();
+ method public androidx.wear.protolayout.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.protolayout.ActionBuilders.AndroidActivity);
+ }
+
+ public static final class ActionBuilders.LoadAction implements androidx.wear.protolayout.ActionBuilders.Action {
+ method public androidx.wear.protolayout.StateBuilders.State? getRequestState();
+ }
+
+ public static final class ActionBuilders.LoadAction.Builder {
+ ctor public ActionBuilders.LoadAction.Builder();
+ method public androidx.wear.protolayout.ActionBuilders.LoadAction build();
+ method public androidx.wear.protolayout.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.protolayout.StateBuilders.State);
+ }
+
+ public final class ColorBuilders {
+ method public static androidx.wear.protolayout.ColorBuilders.ColorProp argb(@ColorInt int);
+ }
+
+ public static final class ColorBuilders.ColorProp {
+ method @ColorInt public int getArgb();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor? getDynamicValue();
+ }
+
+ public static final class ColorBuilders.ColorProp.Builder {
+ ctor @Deprecated public ColorBuilders.ColorProp.Builder();
+ ctor public ColorBuilders.ColorProp.Builder(@ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp build();
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicColor);
+ }
+
+ public final class DeviceParametersBuilders {
+ field public static final int DEVICE_PLATFORM_UNDEFINED = 0; // 0x0
+ field public static final int DEVICE_PLATFORM_WEAR_OS = 1; // 0x1
+ field public static final int SCREEN_SHAPE_RECT = 2; // 0x2
+ field public static final int SCREEN_SHAPE_ROUND = 1; // 0x1
+ field public static final int SCREEN_SHAPE_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class DeviceParametersBuilders.Capabilities {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public long getMinimumFreshnessLimitMillis();
+ }
+
+ public static final class DeviceParametersBuilders.Capabilities.Builder {
+ ctor public DeviceParametersBuilders.Capabilities.Builder();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities.Builder setMinimumFreshnessLimitMillis(long);
+ }
+
+ public static final class DeviceParametersBuilders.DeviceParameters {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.Capabilities? getCapabilities();
+ method public int getDevicePlatform();
+ method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getFontScale();
+ method public androidx.wear.protolayout.expression.VersionBuilders.VersionInfo getRendererSchemaVersion();
+ method @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
+ method public int getScreenShape();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenWidthDp();
+ }
+
+ public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor public DeviceParametersBuilders.DeviceParameters.Builder();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setCapabilities(androidx.wear.protolayout.DeviceParametersBuilders.Capabilities);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setFontScale(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setRendererSchemaVersion(androidx.wear.protolayout.expression.VersionBuilders.VersionInfo);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int);
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ }
+
+ public final class DimensionBuilders {
+ method public static androidx.wear.protolayout.DimensionBuilders.DegreesProp degrees(float);
+ method public static androidx.wear.protolayout.DimensionBuilders.DpProp dp(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public static androidx.wear.protolayout.DimensionBuilders.EmProp em(float);
+ method public static androidx.wear.protolayout.DimensionBuilders.EmProp em(int);
+ method public static androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp expand();
+ method public static androidx.wear.protolayout.DimensionBuilders.SpProp sp(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ method public static androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp wrap();
+ }
+
+ public static final class DimensionBuilders.AngularLayoutConstraint {
+ method public int getAngularAlignment();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.AngularLayoutConstraint.Builder {
+ ctor public DimensionBuilders.AngularLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint.Builder setAngularAlignment(int);
+ }
+
+ public static interface DimensionBuilders.ContainerDimension {
+ }
+
+ public static final class DimensionBuilders.DegreesProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method public float getValue();
+ }
+
+ public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DegreesProp.Builder();
+ ctor public DimensionBuilders.DegreesProp.Builder(float);
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp.Builder setValue(float);
+ }
+
+ public static final class DimensionBuilders.DpProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension androidx.wear.protolayout.DimensionBuilders.ExtensionDimension androidx.wear.protolayout.DimensionBuilders.ImageDimension androidx.wear.protolayout.DimensionBuilders.SpacerDimension {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.DpProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DpProp.Builder();
+ ctor public DimensionBuilders.DpProp.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ public static final class DimensionBuilders.EmProp {
+ method public float getValue();
+ }
+
+ public static final class DimensionBuilders.EmProp.Builder {
+ ctor public DimensionBuilders.EmProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp.Builder setValue(float);
+ }
+
+ public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension androidx.wear.protolayout.DimensionBuilders.ImageDimension {
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp? getLayoutWeight();
+ }
+
+ public static final class DimensionBuilders.ExpandedDimensionProp.Builder {
+ ctor public DimensionBuilders.ExpandedDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.ExpandedDimensionProp.Builder setLayoutWeight(androidx.wear.protolayout.TypeBuilders.FloatProp);
+ }
+
+ @androidx.wear.protolayout.expression.ExperimentalProtoLayoutExtensionApi public static interface DimensionBuilders.ExtensionDimension {
+ }
+
+ public static final class DimensionBuilders.HorizontalLayoutConstraint {
+ method public int getHorizontalAlignment();
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.HorizontalLayoutConstraint.Builder {
+ ctor public DimensionBuilders.HorizontalLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint.Builder setHorizontalAlignment(int);
+ }
+
+ public static interface DimensionBuilders.ImageDimension {
+ }
+
+ public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ImageDimension {
+ method @IntRange(from=0) public int getAspectRatioHeight();
+ method @IntRange(from=0) public int getAspectRatioWidth();
+ }
+
+ public static final class DimensionBuilders.ProportionalDimensionProp.Builder {
+ ctor public DimensionBuilders.ProportionalDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
+ method public androidx.wear.protolayout.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
+ }
+
+ public static final class DimensionBuilders.SpProp {
+ method @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
+ }
+
+ public static final class DimensionBuilders.SpProp.Builder {
+ ctor public DimensionBuilders.SpProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ }
+
+ public static interface DimensionBuilders.SpacerDimension {
+ }
+
+ public static final class DimensionBuilders.VerticalLayoutConstraint {
+ method @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ method public int getVerticalAlignment();
+ }
+
+ public static final class DimensionBuilders.VerticalLayoutConstraint.Builder {
+ ctor public DimensionBuilders.VerticalLayoutConstraint.Builder(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint build();
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint.Builder setVerticalAlignment(int);
+ }
+
+ public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.protolayout.DimensionBuilders.ContainerDimension {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getMinimumSize();
+ }
+
+ public static final class DimensionBuilders.WrappedDimensionProp.Builder {
+ ctor public DimensionBuilders.WrappedDimensionProp.Builder();
+ method public androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp build();
+ method public androidx.wear.protolayout.DimensionBuilders.WrappedDimensionProp.Builder setMinimumSize(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public final class LayoutElementBuilders {
+ field public static final int ANGULAR_ALIGNMENT_CENTER = 2; // 0x2
+ field public static final int ANGULAR_ALIGNMENT_END = 3; // 0x3
+ field public static final int ANGULAR_ALIGNMENT_START = 1; // 0x1
+ field public static final int ANGULAR_ALIGNMENT_UNDEFINED = 0; // 0x0
+ field public static final int ARC_ANCHOR_CENTER = 2; // 0x2
+ field public static final int ARC_ANCHOR_END = 3; // 0x3
+ field public static final int ARC_ANCHOR_START = 1; // 0x1
+ field public static final int ARC_ANCHOR_UNDEFINED = 0; // 0x0
+ field public static final int CONTENT_SCALE_MODE_CROP = 2; // 0x2
+ field public static final int CONTENT_SCALE_MODE_FILL_BOUNDS = 3; // 0x3
+ field public static final int CONTENT_SCALE_MODE_FIT = 1; // 0x1
+ field public static final int CONTENT_SCALE_MODE_UNDEFINED = 0; // 0x0
+ field public static final int FONT_VARIANT_BODY = 2; // 0x2
+ field public static final int FONT_VARIANT_TITLE = 1; // 0x1
+ field public static final int FONT_VARIANT_UNDEFINED = 0; // 0x0
+ field public static final int FONT_WEIGHT_BOLD = 700; // 0x2bc
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int FONT_WEIGHT_MEDIUM = 500; // 0x1f4
+ field public static final int FONT_WEIGHT_NORMAL = 400; // 0x190
+ field public static final int FONT_WEIGHT_UNDEFINED = 0; // 0x0
+ field public static final int HORIZONTAL_ALIGN_CENTER = 2; // 0x2
+ field public static final int HORIZONTAL_ALIGN_END = 5; // 0x5
+ field public static final int HORIZONTAL_ALIGN_LEFT = 1; // 0x1
+ field public static final int HORIZONTAL_ALIGN_RIGHT = 3; // 0x3
+ field public static final int HORIZONTAL_ALIGN_START = 4; // 0x4
+ field public static final int HORIZONTAL_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int SPAN_VERTICAL_ALIGN_BOTTOM = 1; // 0x1
+ field public static final int SPAN_VERTICAL_ALIGN_TEXT_BASELINE = 2; // 0x2
+ field public static final int SPAN_VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int STROKE_CAP_BUTT = 1; // 0x1
+ field public static final int STROKE_CAP_ROUND = 2; // 0x2
+ field public static final int STROKE_CAP_SQUARE = 3; // 0x3
+ field public static final int STROKE_CAP_UNDEFINED = 0; // 0x0
+ field public static final int TEXT_ALIGN_CENTER = 2; // 0x2
+ field public static final int TEXT_ALIGN_END = 3; // 0x3
+ field public static final int TEXT_ALIGN_START = 1; // 0x1
+ field public static final int TEXT_ALIGN_UNDEFINED = 0; // 0x0
+ field public static final int TEXT_OVERFLOW_ELLIPSIZE_END = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int TEXT_OVERFLOW_MARQUEE = 3; // 0x3
+ field public static final int TEXT_OVERFLOW_TRUNCATE = 1; // 0x1
+ field public static final int TEXT_OVERFLOW_UNDEFINED = 0; // 0x0
+ field public static final int VERTICAL_ALIGN_BOTTOM = 3; // 0x3
+ field public static final int VERTICAL_ALIGN_CENTER = 2; // 0x2
+ field public static final int VERTICAL_ALIGN_TOP = 1; // 0x1
+ field public static final int VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class LayoutElementBuilders.AndroidTextStyle {
+ method public boolean getExcludeFontPadding();
+ }
+
+ public static final class LayoutElementBuilders.AndroidTextStyle.Builder {
+ ctor public LayoutElementBuilders.AndroidTextStyle.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle.Builder setExcludeFontPadding(boolean);
+ }
+
+ public static final class LayoutElementBuilders.Arc implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getAnchorAngle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint? getLayoutConstraintsForDynamicAnchorAngle();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlign();
+ }
+
+ public static final class LayoutElementBuilders.Arc.Builder {
+ ctor public LayoutElementBuilders.Arc.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setAnchorType(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setLayoutConstraintsForDynamicAnchorAngle(androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
+ }
+
+ public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getContent();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getRotateContents();
+ }
+
+ public static final class LayoutElementBuilders.ArcAdapter.Builder {
+ ctor public LayoutElementBuilders.ArcAdapter.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
+ }
+
+ public static final class LayoutElementBuilders.ArcAnchorTypeProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
+ }
+
+ public static interface LayoutElementBuilders.ArcLayoutElement {
+ }
+
+ public static final class LayoutElementBuilders.ArcLine implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint? getLayoutConstraintsForDynamicLength();
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getLength();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp? getStrokeCap();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getThickness();
+ }
+
+ public static final class LayoutElementBuilders.ArcLine.Builder {
+ ctor public LayoutElementBuilders.ArcLine.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setLayoutConstraintsForDynamicLength(androidx.wear.protolayout.DimensionBuilders.AngularLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setStrokeCap(androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setStrokeCap(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.DegreesProp? getLength();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getThickness();
+ }
+
+ public static final class LayoutElementBuilders.ArcSpacer.Builder {
+ ctor public LayoutElementBuilders.ArcSpacer.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.protolayout.DimensionBuilders.DegreesProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.ArcText implements androidx.wear.protolayout.LayoutElementBuilders.ArcLayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.ArcText.Builder {
+ ctor public LayoutElementBuilders.ArcText.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.ArcModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ArcText.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.Box implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Box.Builder {
+ ctor public LayoutElementBuilders.Box.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.ColorFilter {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getTint();
+ }
+
+ public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor public LayoutElementBuilders.ColorFilter.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ }
+
+ public static final class LayoutElementBuilders.Column implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Column.Builder {
+ ctor public LayoutElementBuilders.Column.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.ContentScaleModeProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor public LayoutElementBuilders.ContentScaleModeProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
+ }
+
+ @androidx.wear.protolayout.expression.ExperimentalProtoLayoutExtensionApi public static final class LayoutElementBuilders.ExtensionLayoutElement implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public String getExtensionId();
+ method public androidx.wear.protolayout.DimensionBuilders.ExtensionDimension? getHeight();
+ method public byte[] getPayload();
+ method public androidx.wear.protolayout.DimensionBuilders.ExtensionDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.ExtensionLayoutElement.Builder {
+ ctor public LayoutElementBuilders.ExtensionLayoutElement.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setExtensionId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ExtensionDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setPayload(byte[]);
+ method public androidx.wear.protolayout.LayoutElementBuilders.ExtensionLayoutElement.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ExtensionDimension);
+ }
+
+ public static final class LayoutElementBuilders.FontStyle {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getItalic();
+ method public androidx.wear.protolayout.DimensionBuilders.EmProp? getLetterSpacing();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getSize();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getUnderline();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp? getVariant();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp? getWeight();
+ }
+
+ public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor public LayoutElementBuilders.FontStyle.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.protolayout.DimensionBuilders.EmProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setVariant(androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setVariant(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder setWeight(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyles {
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.protolayout.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class LayoutElementBuilders.FontVariantProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.FontVariantProp.Builder {
+ ctor public LayoutElementBuilders.FontVariantProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontVariantProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.FontWeightProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor public LayoutElementBuilders.FontWeightProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.HorizontalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Image implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.LayoutElementBuilders.ColorFilter? getColorFilter();
+ method public androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
+ method public androidx.wear.protolayout.DimensionBuilders.ImageDimension? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getResourceId();
+ method public androidx.wear.protolayout.DimensionBuilders.ImageDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Image.Builder {
+ ctor public LayoutElementBuilders.Image.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setColorFilter(androidx.wear.protolayout.LayoutElementBuilders.ColorFilter);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.protolayout.LayoutElementBuilders.ContentScaleModeProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ImageDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setResourceId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ImageDimension);
+ }
+
+ public static final class LayoutElementBuilders.Layout {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static androidx.wear.protolayout.LayoutElementBuilders.Layout? fromByteArray(byte[]);
+ method public static androidx.wear.protolayout.LayoutElementBuilders.Layout fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.LayoutElement? getRoot();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public byte[] toByteArray();
+ }
+
+ public static final class LayoutElementBuilders.Layout.Builder {
+ ctor public LayoutElementBuilders.Layout.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ }
+
+ public static interface LayoutElementBuilders.LayoutElement {
+ }
+
+ public static final class LayoutElementBuilders.Row implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.LayoutElement!> getContents();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Row.Builder {
+ ctor public LayoutElementBuilders.Row.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder addContent(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.ContainerDimension);
+ }
+
+ public static final class LayoutElementBuilders.Spacer implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.SpacerDimension? getHeight();
+ method public androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint? getLayoutConstraintsForDynamicHeight();
+ method public androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint? getLayoutConstraintsForDynamicWidth();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.DimensionBuilders.SpacerDimension? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.Spacer.Builder {
+ ctor public LayoutElementBuilders.Spacer.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.SpacerDimension);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setLayoutConstraintsForDynamicHeight(androidx.wear.protolayout.DimensionBuilders.VerticalLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setLayoutConstraintsForDynamicWidth(androidx.wear.protolayout.DimensionBuilders.HorizontalLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.SpacerDimension);
+ }
+
+ public static interface LayoutElementBuilders.Span {
+ }
+
+ public static final class LayoutElementBuilders.SpanImage implements androidx.wear.protolayout.LayoutElementBuilders.Span {
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getHeight();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getResourceId();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getWidth();
+ }
+
+ public static final class LayoutElementBuilders.SpanImage.Builder {
+ ctor public LayoutElementBuilders.SpanImage.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.SpanModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class LayoutElementBuilders.SpanText implements androidx.wear.protolayout.LayoutElementBuilders.Span {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle? getAndroidTextStyle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers? getModifiers();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.SpanText.Builder {
+ ctor public LayoutElementBuilders.SpanText.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setAndroidTextStyle(androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.SpanModifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanText.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Spannable implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getLineHeight();
+ method @IntRange(from=0xffffffff) @androidx.wear.protolayout.expression.ProtoLayoutExperimental public int getMarqueeIterations();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop? getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp? getMultilineAlignment();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method public java.util.List<androidx.wear.protolayout.LayoutElementBuilders.Span!> getSpans();
+ }
+
+ public static final class LayoutElementBuilders.Spannable.Builder {
+ ctor public LayoutElementBuilders.Spannable.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.protolayout.LayoutElementBuilders.Span);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMarqueeIterations(@IntRange(from=0xffffffff) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.protolayout.TypeBuilders.Int32Prop);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.protolayout.LayoutElementBuilders.HorizontalAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Spannable.Builder setOverflow(int);
+ }
+
+ public static final class LayoutElementBuilders.StrokeCapProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.StrokeCapProp.Builder {
+ ctor public LayoutElementBuilders.StrokeCapProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.StrokeCapProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.Text implements androidx.wear.protolayout.LayoutElementBuilders.LayoutElement {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle? getAndroidTextStyle();
+ method public androidx.wear.protolayout.LayoutElementBuilders.FontStyle? getFontStyle();
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint? getLayoutConstraintsForDynamicText();
+ method public androidx.wear.protolayout.DimensionBuilders.SpProp? getLineHeight();
+ method @IntRange(from=0xffffffff) @androidx.wear.protolayout.expression.ProtoLayoutExperimental public int getMarqueeIterations();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop? getMaxLines();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers? getModifiers();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp? getMultilineAlignment();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getText();
+ }
+
+ public static final class LayoutElementBuilders.Text.Builder {
+ ctor public LayoutElementBuilders.Text.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setAndroidTextStyle(androidx.wear.protolayout.LayoutElementBuilders.AndroidTextStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.protolayout.LayoutElementBuilders.FontStyle);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setLayoutConstraintsForDynamicText(androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.protolayout.DimensionBuilders.SpProp);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMarqueeIterations(@IntRange(from=0xffffffff) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.protolayout.TypeBuilders.Int32Prop);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.protolayout.ModifiersBuilders.Modifiers);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setOverflow(int);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setText(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Text.Builder setText(String);
+ }
+
+ public static final class LayoutElementBuilders.TextAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.TextAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.TextOverflowProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor public LayoutElementBuilders.TextOverflowProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
+ }
+
+ public static final class LayoutElementBuilders.VerticalAlignmentProp {
+ method public int getValue();
+ }
+
+ public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor public LayoutElementBuilders.VerticalAlignmentProp.Builder();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp build();
+ method public androidx.wear.protolayout.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
+ }
+
+ public final class ModifiersBuilders {
+ field public static final int SEMANTICS_ROLE_BUTTON = 2; // 0x2
+ field public static final int SEMANTICS_ROLE_CHECKBOX = 3; // 0x3
+ field public static final int SEMANTICS_ROLE_IMAGE = 1; // 0x1
+ field public static final int SEMANTICS_ROLE_NONE = 0; // 0x0
+ field public static final int SEMANTICS_ROLE_RADIOBUTTON = 5; // 0x5
+ field public static final int SEMANTICS_ROLE_SWITCH = 4; // 0x4
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_BOTTOM_TO_TOP = 4; // 0x4
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_LEFT_TO_RIGHT = 1; // 0x1
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_RIGHT_TO_LEFT = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_TOP_TO_BOTTOM = 3; // 0x3
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_DIRECTION_UNDEFINED = 0; // 0x0
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_TO_INSIDE = 1; // 0x1
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_TO_OUTSIDE = 2; // 0x2
+ field @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final int SLIDE_PARENT_SNAP_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.AnimatedVisibility {
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition? getEnterTransition();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition? getExitTransition();
+ }
+
+ public static final class ModifiersBuilders.AnimatedVisibility.Builder {
+ ctor public ModifiersBuilders.AnimatedVisibility.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility build();
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility.Builder setEnterTransition(androidx.wear.protolayout.ModifiersBuilders.EnterTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility.Builder setExitTransition(androidx.wear.protolayout.ModifiersBuilders.ExitTransition);
+ }
+
+ public static final class ModifiersBuilders.ArcModifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor public ModifiersBuilders.ArcModifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method public androidx.wear.protolayout.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.protolayout.ModifiersBuilders.Semantics);
+ }
+
+ public static final class ModifiersBuilders.Background {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner? getCorner();
+ }
+
+ public static final class ModifiersBuilders.Background.Builder {
+ ctor public ModifiersBuilders.Background.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Background build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Background.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Background.Builder setCorner(androidx.wear.protolayout.ModifiersBuilders.Corner);
+ }
+
+ public static final class ModifiersBuilders.Border {
+ method public androidx.wear.protolayout.ColorBuilders.ColorProp? getColor();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getWidth();
+ }
+
+ public static final class ModifiersBuilders.Border.Builder {
+ ctor public ModifiersBuilders.Border.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border.Builder setColor(androidx.wear.protolayout.ColorBuilders.ColorProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Border.Builder setWidth(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class ModifiersBuilders.Clickable {
+ method public String getId();
+ method public androidx.wear.protolayout.ActionBuilders.Action? getOnClick();
+ }
+
+ public static final class ModifiersBuilders.Clickable.Builder {
+ ctor public ModifiersBuilders.Clickable.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable.Builder setId(String);
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.protolayout.ActionBuilders.Action);
+ }
+
+ public static final class ModifiersBuilders.Corner {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getRadius();
+ }
+
+ public static final class ModifiersBuilders.Corner.Builder {
+ ctor public ModifiersBuilders.Corner.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.DefaultContentTransitions {
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition fadeIn();
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition fadeInSlideIn(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition fadeOut();
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition fadeOutSlideOut(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.EnterTransition slideIn(int);
+ method public static androidx.wear.protolayout.ModifiersBuilders.ExitTransition slideOut(int);
+ }
+
+ public static final class ModifiersBuilders.ElementMetadata {
+ method public byte[] getTagData();
+ }
+
+ public static final class ModifiersBuilders.ElementMetadata.Builder {
+ ctor public ModifiersBuilders.ElementMetadata.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata.Builder setTagData(byte[]);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.EnterTransition {
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition? getFadeIn();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition? getSlideIn();
+ }
+
+ public static final class ModifiersBuilders.EnterTransition.Builder {
+ ctor public ModifiersBuilders.EnterTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition.Builder setFadeIn(androidx.wear.protolayout.ModifiersBuilders.FadeInTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.EnterTransition.Builder setSlideIn(androidx.wear.protolayout.ModifiersBuilders.SlideInTransition);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.ExitTransition {
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition? getFadeOut();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition? getSlideOut();
+ }
+
+ public static final class ModifiersBuilders.ExitTransition.Builder {
+ ctor public ModifiersBuilders.ExitTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition.Builder setFadeOut(androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition);
+ method public androidx.wear.protolayout.ModifiersBuilders.ExitTransition.Builder setSlideOut(androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.FadeInTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method @FloatRange(from=0.0, to=1.0) public float getInitialAlpha();
+ }
+
+ public static final class ModifiersBuilders.FadeInTransition.Builder {
+ ctor public ModifiersBuilders.FadeInTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeInTransition.Builder setInitialAlpha(@FloatRange(from=0.0, to=1.0) float);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.FadeOutTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method @FloatRange(from=0.0, to=1.0) public float getTargetAlpha();
+ }
+
+ public static final class ModifiersBuilders.FadeOutTransition.Builder {
+ ctor public ModifiersBuilders.FadeOutTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.FadeOutTransition.Builder setTargetAlpha(@FloatRange(from=0.0, to=1.0) float);
+ }
+
+ public static final class ModifiersBuilders.Modifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Background? getBackground();
+ method public androidx.wear.protolayout.ModifiersBuilders.Border? getBorder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility? getContentUpdateAnimation();
+ method public androidx.wear.protolayout.ModifiersBuilders.ElementMetadata? getMetadata();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding? getPadding();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor public ModifiersBuilders.Modifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.protolayout.ModifiersBuilders.Background);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.protolayout.ModifiersBuilders.Border);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setContentUpdateAnimation(androidx.wear.protolayout.ModifiersBuilders.AnimatedVisibility);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setMetadata(androidx.wear.protolayout.ModifiersBuilders.ElementMetadata);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.protolayout.ModifiersBuilders.Padding);
+ method public androidx.wear.protolayout.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.protolayout.ModifiersBuilders.Semantics);
+ }
+
+ public static final class ModifiersBuilders.Padding {
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getBottom();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getEnd();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp? getRtlAware();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getStart();
+ method public androidx.wear.protolayout.DimensionBuilders.DpProp? getTop();
+ }
+
+ public static final class ModifiersBuilders.Padding.Builder {
+ ctor public ModifiersBuilders.Padding.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setAll(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.protolayout.TypeBuilders.BoolProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setStart(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Padding.Builder setTop(androidx.wear.protolayout.DimensionBuilders.DpProp);
+ }
+
+ public static final class ModifiersBuilders.Semantics {
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getContentDescription();
+ method public int getRole();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp? getStateDescription();
+ }
+
+ public static final class ModifiersBuilders.Semantics.Builder {
+ ctor public ModifiersBuilders.Semantics.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics build();
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setContentDescription(String);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setRole(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder setStateDescription(androidx.wear.protolayout.TypeBuilders.StringProp);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static interface ModifiersBuilders.SlideBound {
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideInTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method public int getDirection();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideBound? getInitialSlideBound();
+ }
+
+ public static final class ModifiersBuilders.SlideInTransition.Builder {
+ ctor public ModifiersBuilders.SlideInTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setDirection(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideInTransition.Builder setInitialSlideBound(androidx.wear.protolayout.ModifiersBuilders.SlideBound);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideOutTransition {
+ method public androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec? getAnimationSpec();
+ method public int getDirection();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideBound? getTargetSlideBound();
+ }
+
+ public static final class ModifiersBuilders.SlideOutTransition.Builder {
+ ctor public ModifiersBuilders.SlideOutTransition.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setAnimationSpec(androidx.wear.protolayout.expression.AnimationParameterBuilders.AnimationSpec);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setDirection(int);
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideOutTransition.Builder setTargetSlideBound(androidx.wear.protolayout.ModifiersBuilders.SlideBound);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ModifiersBuilders.SlideParentBound implements androidx.wear.protolayout.ModifiersBuilders.SlideBound {
+ method public int getSnapTo();
+ }
+
+ public static final class ModifiersBuilders.SlideParentBound.Builder {
+ ctor public ModifiersBuilders.SlideParentBound.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideParentBound build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SlideParentBound.Builder setSnapTo(int);
+ }
+
+ public static final class ModifiersBuilders.SpanModifiers {
+ method public androidx.wear.protolayout.ModifiersBuilders.Clickable? getClickable();
+ }
+
+ public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor public ModifiersBuilders.SpanModifiers.Builder();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers build();
+ method public androidx.wear.protolayout.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.protolayout.ModifiersBuilders.Clickable);
+ }
+
+ public final class ResourceBuilders {
+ field public static final int ANIMATED_IMAGE_FORMAT_AVD = 1; // 0x1
+ field public static final int ANIMATED_IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ field public static final int IMAGE_FORMAT_ARGB_8888 = 2; // 0x2
+ field public static final int IMAGE_FORMAT_RGB_565 = 1; // 0x1
+ field public static final int IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ResourceBuilders.AndroidAnimatedImageResourceByResId {
+ method public int getAnimatedImageFormat();
+ method @DrawableRes public int getResourceId();
+ method public androidx.wear.protolayout.TriggerBuilders.Trigger? getStartTrigger();
+ }
+
+ public static final class ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setAnimatedImageFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId.Builder setStartTrigger(androidx.wear.protolayout.TriggerBuilders.Trigger);
+ }
+
+ public static final class ResourceBuilders.AndroidImageResourceByResId {
+ method @DrawableRes public int getResourceId();
+ }
+
+ public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ @androidx.wear.protolayout.expression.ProtoLayoutExperimental public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId {
+ method public int getAnimatedImageFormat();
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getProgress();
+ method @DrawableRes public int getResourceId();
+ }
+
+ public static final class ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder {
+ ctor public ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId build();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setAnimatedImageFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setProgress(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ public static final class ResourceBuilders.ImageResource {
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId? getAndroidAnimatedResourceByResId();
+ method public androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId? getAndroidSeekableAnimatedResourceByResId();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource? getInlineResource();
+ }
+
+ public static final class ResourceBuilders.ImageResource.Builder {
+ ctor public ResourceBuilders.ImageResource.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource build();
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidAnimatedResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidAnimatedImageResourceByResId);
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidImageResourceByResId);
+ method @androidx.wear.protolayout.expression.ProtoLayoutExperimental public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setAndroidSeekableAnimatedResourceByResId(androidx.wear.protolayout.ResourceBuilders.AndroidSeekableAnimatedImageResourceByResId);
+ method public androidx.wear.protolayout.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.protolayout.ResourceBuilders.InlineImageResource);
+ }
+
+ public static final class ResourceBuilders.InlineImageResource {
+ method public byte[] getData();
+ method public int getFormat();
+ method @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
+ method @Dimension(unit=androidx.annotation.Dimension.PX) public int getWidthPx();
+ }
+
+ public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor public ResourceBuilders.InlineImageResource.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource build();
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setFormat(int);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ method public androidx.wear.protolayout.ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ }
+
+ public static final class ResourceBuilders.Resources {
+ method public java.util.Map<java.lang.String!,androidx.wear.protolayout.ResourceBuilders.ImageResource!> getIdToImageMapping();
+ method public String getVersion();
+ }
+
+ public static final class ResourceBuilders.Resources.Builder {
+ ctor public ResourceBuilders.Resources.Builder();
+ method public androidx.wear.protolayout.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.protolayout.ResourceBuilders.ImageResource);
+ method public androidx.wear.protolayout.ResourceBuilders.Resources build();
+ method public androidx.wear.protolayout.ResourceBuilders.Resources.Builder setVersion(String);
+ }
+
+ public final class StateBuilders {
+ }
+
+ public static final class StateBuilders.State {
+ method public java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!> getKeyToValueMapping();
+ method public String getLastClickableId();
+ method public static int getMaxStateEntryCount();
+ }
+
+ public static final class StateBuilders.State.Builder {
+ ctor public StateBuilders.State.Builder();
+ method public <T extends androidx.wear.protolayout.expression.DynamicBuilders.DynamicType> androidx.wear.protolayout.StateBuilders.State.Builder addKeyToValueMapping(androidx.wear.protolayout.expression.AppDataKey<T!>, androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<T!>);
+ method public androidx.wear.protolayout.StateBuilders.State build();
+ }
+
+ public final class TimelineBuilders {
+ }
+
+ public static final class TimelineBuilders.TimeInterval {
+ method public long getEndMillis();
+ method public long getStartMillis();
+ }
+
+ public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor public TimelineBuilders.TimeInterval.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval build();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
+ }
+
+ public static final class TimelineBuilders.Timeline {
+ method public static androidx.wear.protolayout.TimelineBuilders.Timeline fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public java.util.List<androidx.wear.protolayout.TimelineBuilders.TimelineEntry!> getTimelineEntries();
+ }
+
+ public static final class TimelineBuilders.Timeline.Builder {
+ ctor public TimelineBuilders.Timeline.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.protolayout.TimelineBuilders.TimelineEntry);
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline build();
+ }
+
+ public static final class TimelineBuilders.TimelineEntry {
+ method public static androidx.wear.protolayout.TimelineBuilders.TimelineEntry fromLayoutElement(androidx.wear.protolayout.LayoutElementBuilders.LayoutElement);
+ method public androidx.wear.protolayout.LayoutElementBuilders.Layout? getLayout();
+ method public androidx.wear.protolayout.TimelineBuilders.TimeInterval? getValidity();
+ }
+
+ public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor public TimelineBuilders.TimelineEntry.Builder();
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry build();
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.protolayout.LayoutElementBuilders.Layout);
+ method public androidx.wear.protolayout.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.protolayout.TimelineBuilders.TimeInterval);
+ }
+
+ public final class TriggerBuilders {
+ method public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnConditionMetTrigger(androidx.wear.protolayout.expression.DynamicBuilders.DynamicBool);
+ method public static androidx.wear.protolayout.TriggerBuilders.Trigger createOnLoadTrigger();
+ }
+
+ public static interface TriggerBuilders.Trigger {
+ }
+
+ public final class TypeBuilders {
+ }
+
+ public static final class TypeBuilders.BoolProp {
+ method public boolean getValue();
+ }
+
+ public static final class TypeBuilders.BoolProp.Builder {
+ ctor public TypeBuilders.BoolProp.Builder();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp build();
+ method public androidx.wear.protolayout.TypeBuilders.BoolProp.Builder setValue(boolean);
+ }
+
+ public static final class TypeBuilders.FloatProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat? getDynamicValue();
+ method public float getValue();
+ }
+
+ public static final class TypeBuilders.FloatProp.Builder {
+ ctor @Deprecated public TypeBuilders.FloatProp.Builder();
+ ctor public TypeBuilders.FloatProp.Builder(float);
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp build();
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicFloat);
+ method public androidx.wear.protolayout.TypeBuilders.FloatProp.Builder setValue(float);
+ }
+
+ public static final class TypeBuilders.Int32Prop {
+ method public int getValue();
+ }
+
+ public static final class TypeBuilders.Int32Prop.Builder {
+ ctor public TypeBuilders.Int32Prop.Builder();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop build();
+ method public androidx.wear.protolayout.TypeBuilders.Int32Prop.Builder setValue(int);
+ }
+
+ public static final class TypeBuilders.StringLayoutConstraint {
+ method public int getAlignment();
+ method public String getPatternForLayout();
+ }
+
+ public static final class TypeBuilders.StringLayoutConstraint.Builder {
+ ctor public TypeBuilders.StringLayoutConstraint.Builder(String);
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint build();
+ method public androidx.wear.protolayout.TypeBuilders.StringLayoutConstraint.Builder setAlignment(int);
+ }
+
+ public static final class TypeBuilders.StringProp {
+ method public androidx.wear.protolayout.expression.DynamicBuilders.DynamicString? getDynamicValue();
+ method public String getValue();
+ }
+
+ public static final class TypeBuilders.StringProp.Builder {
+ ctor @Deprecated public TypeBuilders.StringProp.Builder();
+ ctor public TypeBuilders.StringProp.Builder(String);
+ method public androidx.wear.protolayout.TypeBuilders.StringProp build();
+ method public androidx.wear.protolayout.TypeBuilders.StringProp.Builder setDynamicValue(androidx.wear.protolayout.expression.DynamicBuilders.DynamicString);
+ method public androidx.wear.protolayout.TypeBuilders.StringProp.Builder setValue(String);
+ }
+
+}
+
diff --git a/wear/tiles/tiles-material/api/1.2.0-beta01.txt b/wear/tiles/tiles-material/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..85c110b
--- /dev/null
+++ b/wear/tiles/tiles-material/api/1.2.0-beta01.txt
@@ -0,0 +1,298 @@
+// Signature format: 4.0
+package androidx.wear.tiles.material {
+
+ @Deprecated public class Button implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Button? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ButtonColors getButtonColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method @Deprecated public String? getIconContent();
+ method @Deprecated public String? getImageContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getSize();
+ method @Deprecated public String? getTextContent();
+ }
+
+ @Deprecated public static final class Button.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Button.Builder(android.content.Context, androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.material.Button build();
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setButtonColors(androidx.wear.tiles.material.ButtonColors);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setCustomContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setIconContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setIconContent(String, androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setImageContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setSize(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setTextContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setTextContent(String, int);
+ }
+
+ @Deprecated public class ButtonColors {
+ ctor @Deprecated public ButtonColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ButtonColors(@ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getBackgroundColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getContentColor();
+ method @Deprecated public static androidx.wear.tiles.material.ButtonColors primaryButtonColors(androidx.wear.tiles.material.Colors);
+ method @Deprecated public static androidx.wear.tiles.material.ButtonColors secondaryButtonColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ButtonDefaults {
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp recommendedIconSize(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp recommendedIconSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp EXTRA_LARGE_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp LARGE_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.material.ButtonColors PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ButtonColors SECONDARY_COLORS;
+ }
+
+ @Deprecated public class Chip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Chip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getHeight();
+ method @Deprecated public int getHorizontalAlignment();
+ method @Deprecated public String? getIconContent();
+ method @Deprecated public String? getPrimaryLabelContent();
+ method @Deprecated public String? getSecondaryLabelContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ @Deprecated public static final class Chip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Chip.Builder(android.content.Context, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.Chip build();
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setCustomContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setIconContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setPrimaryLabelContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setSecondaryLabelContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class ChipColors {
+ ctor @Deprecated public ChipColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ChipColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ChipColors(@ColorInt int, @ColorInt int);
+ ctor @Deprecated public ChipColors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getBackgroundColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getContentColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getIconColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getSecondaryContentColor();
+ method @Deprecated public static androidx.wear.tiles.material.ChipColors primaryChipColors(androidx.wear.tiles.material.Colors);
+ method @Deprecated public static androidx.wear.tiles.material.ChipColors secondaryChipColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ChipDefaults {
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors COMPACT_PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors COMPACT_SECONDARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors SECONDARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors TITLE_PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors TITLE_SECONDARY_COLORS;
+ }
+
+ @Deprecated public class CircularProgressIndicator implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.CircularProgressIndicator? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ProgressIndicatorColors getCircularProgressIndicatorColors();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getEndAngle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getProgress();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getStartAngle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp getStrokeWidth();
+ }
+
+ @Deprecated public static final class CircularProgressIndicator.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public CircularProgressIndicator.Builder();
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator build();
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setCircularProgressIndicatorColors(androidx.wear.tiles.material.ProgressIndicatorColors);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setEndAngle(float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setProgress(@FloatRange(from=0, to=1) float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStartAngle(float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStrokeWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class Colors {
+ ctor @Deprecated public Colors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @Deprecated @ColorInt public int getOnPrimary();
+ method @Deprecated @ColorInt public int getOnSurface();
+ method @Deprecated @ColorInt public int getPrimary();
+ method @Deprecated @ColorInt public int getSurface();
+ field @Deprecated public static final androidx.wear.tiles.material.Colors DEFAULT;
+ }
+
+ @Deprecated public class CompactChip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.CompactChip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public String getText();
+ }
+
+ @Deprecated public static final class CompactChip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public CompactChip.Builder(android.content.Context, String, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.CompactChip build();
+ method @Deprecated public androidx.wear.tiles.material.CompactChip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ }
+
+ @Deprecated public class ProgressIndicatorColors {
+ ctor @Deprecated public ProgressIndicatorColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ProgressIndicatorColors(@ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getIndicatorColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getTrackColor();
+ method @Deprecated public static androidx.wear.tiles.material.ProgressIndicatorColors progressIndicatorColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ProgressIndicatorDefaults {
+ field @Deprecated public static final androidx.wear.tiles.material.ProgressIndicatorColors DEFAULT_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_STROKE_WIDTH;
+ field @Deprecated public static final float GAP_END_ANGLE = 156.1f;
+ field @Deprecated public static final float GAP_START_ANGLE = -156.1f;
+ }
+
+ @Deprecated public class Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Text? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getColor();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle getFontStyle();
+ method @Deprecated public float getLineHeight();
+ method @Deprecated public int getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers getModifiers();
+ method @Deprecated public int getMultilineAlignment();
+ method @Deprecated public int getOverflow();
+ method @Deprecated public String getText();
+ method @Deprecated public int getWeight();
+ method @Deprecated public boolean isItalic();
+ method @Deprecated public boolean isUnderline();
+ }
+
+ @Deprecated public static final class Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Text.Builder(android.content.Context, String);
+ method @Deprecated public androidx.wear.tiles.material.Text build();
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setItalic(boolean);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setOverflow(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setTypography(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setUnderline(boolean);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setWeight(int);
+ }
+
+ @Deprecated public class TitleChip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.TitleChip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public int getHorizontalAlignment();
+ method @Deprecated public String getText();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ @Deprecated public static final class TitleChip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public TitleChip.Builder(android.content.Context, String, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip build();
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class Typography {
+ field @Deprecated public static final int TYPOGRAPHY_BODY1 = 7; // 0x7
+ field @Deprecated public static final int TYPOGRAPHY_BODY2 = 8; // 0x8
+ field @Deprecated public static final int TYPOGRAPHY_BUTTON = 9; // 0x9
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION1 = 10; // 0xa
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION2 = 11; // 0xb
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION3 = 12; // 0xc
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY1 = 1; // 0x1
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY2 = 2; // 0x2
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY3 = 3; // 0x3
+ field @Deprecated public static final int TYPOGRAPHY_TITLE1 = 4; // 0x4
+ field @Deprecated public static final int TYPOGRAPHY_TITLE2 = 5; // 0x5
+ field @Deprecated public static final int TYPOGRAPHY_TITLE3 = 6; // 0x6
+ }
+
+}
+
+package androidx.wear.tiles.material.layouts {
+
+ @Deprecated public class EdgeContentLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.EdgeContentLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getEdgeContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ }
+
+ @Deprecated public static final class EdgeContentLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public EdgeContentLayout.Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setEdgeContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ }
+
+ @Deprecated public class LayoutDefaults {
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_VERTICAL_SPACER_HEIGHT;
+ field @Deprecated public static final float EDGE_CONTENT_LAYOUT_PADDING_ABOVE_MAIN_CONTENT_DP = 6.0f;
+ field @Deprecated public static final float EDGE_CONTENT_LAYOUT_PADDING_BELOW_MAIN_CONTENT_DP = 8.0f;
+ field @Deprecated public static final int MULTI_BUTTON_MAX_NUMBER = 7; // 0x7
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp MULTI_SLOT_LAYOUT_HORIZONTAL_SPACER_WIDTH;
+ }
+
+ @Deprecated public class MultiButtonLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.MultiButtonLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getButtonContents();
+ method @Deprecated public int getFiveButtonDistribution();
+ field @Deprecated public static final int FIVE_BUTTON_DISTRIBUTION_BOTTOM_HEAVY = 2; // 0x2
+ field @Deprecated public static final int FIVE_BUTTON_DISTRIBUTION_TOP_HEAVY = 1; // 0x1
+ }
+
+ @Deprecated public static final class MultiButtonLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public MultiButtonLayout.Builder();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout.Builder addButtonContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout.Builder setFiveButtonDistribution(int);
+ }
+
+ @Deprecated public class MultiSlotLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.MultiSlotLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getHorizontalSpacerWidth();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getSlotContents();
+ }
+
+ @Deprecated public static final class MultiSlotLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public MultiSlotLayout.Builder();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout.Builder addSlotContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout.Builder setHorizontalSpacerWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class PrimaryLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.PrimaryLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryChipContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getVerticalSpacerHeight();
+ }
+
+ @Deprecated public static final class PrimaryLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public PrimaryLayout.Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setPrimaryChipContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setVerticalSpacerHeight(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+}
+
diff --git a/wear/tiles/tiles-material/api/res-1.2.0-beta01.txt b/wear/tiles/tiles-material/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/tiles/tiles-material/api/res-1.2.0-beta01.txt
diff --git a/wear/tiles/tiles-material/api/restricted_1.2.0-beta01.txt b/wear/tiles/tiles-material/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..85c110b
--- /dev/null
+++ b/wear/tiles/tiles-material/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,298 @@
+// Signature format: 4.0
+package androidx.wear.tiles.material {
+
+ @Deprecated public class Button implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Button? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ButtonColors getButtonColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method @Deprecated public String? getIconContent();
+ method @Deprecated public String? getImageContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getSize();
+ method @Deprecated public String? getTextContent();
+ }
+
+ @Deprecated public static final class Button.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Button.Builder(android.content.Context, androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.material.Button build();
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setButtonColors(androidx.wear.tiles.material.ButtonColors);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setCustomContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setIconContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setIconContent(String, androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setImageContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setSize(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setTextContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Button.Builder setTextContent(String, int);
+ }
+
+ @Deprecated public class ButtonColors {
+ ctor @Deprecated public ButtonColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ButtonColors(@ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getBackgroundColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getContentColor();
+ method @Deprecated public static androidx.wear.tiles.material.ButtonColors primaryButtonColors(androidx.wear.tiles.material.Colors);
+ method @Deprecated public static androidx.wear.tiles.material.ButtonColors secondaryButtonColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ButtonDefaults {
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp recommendedIconSize(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp recommendedIconSize(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp EXTRA_LARGE_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp LARGE_SIZE;
+ field @Deprecated public static final androidx.wear.tiles.material.ButtonColors PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ButtonColors SECONDARY_COLORS;
+ }
+
+ @Deprecated public class Chip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Chip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getCustomContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getHeight();
+ method @Deprecated public int getHorizontalAlignment();
+ method @Deprecated public String? getIconContent();
+ method @Deprecated public String? getPrimaryLabelContent();
+ method @Deprecated public String? getSecondaryLabelContent();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ @Deprecated public static final class Chip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Chip.Builder(android.content.Context, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.Chip build();
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setCustomContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setIconContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setPrimaryLabelContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setSecondaryLabelContent(String);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.material.Chip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class ChipColors {
+ ctor @Deprecated public ChipColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ChipColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ChipColors(@ColorInt int, @ColorInt int);
+ ctor @Deprecated public ChipColors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getBackgroundColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getContentColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getIconColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getSecondaryContentColor();
+ method @Deprecated public static androidx.wear.tiles.material.ChipColors primaryChipColors(androidx.wear.tiles.material.Colors);
+ method @Deprecated public static androidx.wear.tiles.material.ChipColors secondaryChipColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ChipDefaults {
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors COMPACT_PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors COMPACT_SECONDARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors SECONDARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors TITLE_PRIMARY_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.material.ChipColors TITLE_SECONDARY_COLORS;
+ }
+
+ @Deprecated public class CircularProgressIndicator implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.CircularProgressIndicator? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ProgressIndicatorColors getCircularProgressIndicatorColors();
+ method @Deprecated public CharSequence? getContentDescription();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getEndAngle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getProgress();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp getStartAngle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp getStrokeWidth();
+ }
+
+ @Deprecated public static final class CircularProgressIndicator.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public CircularProgressIndicator.Builder();
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator build();
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setCircularProgressIndicatorColors(androidx.wear.tiles.material.ProgressIndicatorColors);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setContentDescription(CharSequence);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setEndAngle(float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setProgress(@FloatRange(from=0, to=1) float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStartAngle(float);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStrokeWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.material.CircularProgressIndicator.Builder setStrokeWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class Colors {
+ ctor @Deprecated public Colors(@ColorInt int, @ColorInt int, @ColorInt int, @ColorInt int);
+ method @Deprecated @ColorInt public int getOnPrimary();
+ method @Deprecated @ColorInt public int getOnSurface();
+ method @Deprecated @ColorInt public int getPrimary();
+ method @Deprecated @ColorInt public int getSurface();
+ field @Deprecated public static final androidx.wear.tiles.material.Colors DEFAULT;
+ }
+
+ @Deprecated public class CompactChip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.CompactChip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public String getText();
+ }
+
+ @Deprecated public static final class CompactChip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public CompactChip.Builder(android.content.Context, String, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.CompactChip build();
+ method @Deprecated public androidx.wear.tiles.material.CompactChip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ }
+
+ @Deprecated public class ProgressIndicatorColors {
+ ctor @Deprecated public ProgressIndicatorColors(androidx.wear.tiles.ColorBuilders.ColorProp, androidx.wear.tiles.ColorBuilders.ColorProp);
+ ctor @Deprecated public ProgressIndicatorColors(@ColorInt int, @ColorInt int);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getIndicatorColor();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getTrackColor();
+ method @Deprecated public static androidx.wear.tiles.material.ProgressIndicatorColors progressIndicatorColors(androidx.wear.tiles.material.Colors);
+ }
+
+ @Deprecated public class ProgressIndicatorDefaults {
+ field @Deprecated public static final androidx.wear.tiles.material.ProgressIndicatorColors DEFAULT_COLORS;
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_STROKE_WIDTH;
+ field @Deprecated public static final float GAP_END_ANGLE = 156.1f;
+ field @Deprecated public static final float GAP_START_ANGLE = -156.1f;
+ }
+
+ @Deprecated public class Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.Text? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp getColor();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle getFontStyle();
+ method @Deprecated public float getLineHeight();
+ method @Deprecated public int getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers getModifiers();
+ method @Deprecated public int getMultilineAlignment();
+ method @Deprecated public int getOverflow();
+ method @Deprecated public String getText();
+ method @Deprecated public int getWeight();
+ method @Deprecated public boolean isItalic();
+ method @Deprecated public boolean isUnderline();
+ }
+
+ @Deprecated public static final class Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public Text.Builder(android.content.Context, String);
+ method @Deprecated public androidx.wear.tiles.material.Text build();
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setItalic(boolean);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setOverflow(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setTypography(int);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setUnderline(boolean);
+ method @Deprecated public androidx.wear.tiles.material.Text.Builder setWeight(int);
+ }
+
+ @Deprecated public class TitleChip implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.TitleChip? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.ChipColors getChipColors();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable getClickable();
+ method @Deprecated public int getHorizontalAlignment();
+ method @Deprecated public String getText();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension getWidth();
+ }
+
+ @Deprecated public static final class TitleChip.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public TitleChip.Builder(android.content.Context, String, androidx.wear.tiles.ModifiersBuilders.Clickable, androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip build();
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setChipColors(androidx.wear.tiles.material.ChipColors);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.material.TitleChip.Builder setWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class Typography {
+ field @Deprecated public static final int TYPOGRAPHY_BODY1 = 7; // 0x7
+ field @Deprecated public static final int TYPOGRAPHY_BODY2 = 8; // 0x8
+ field @Deprecated public static final int TYPOGRAPHY_BUTTON = 9; // 0x9
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION1 = 10; // 0xa
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION2 = 11; // 0xb
+ field @Deprecated public static final int TYPOGRAPHY_CAPTION3 = 12; // 0xc
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY1 = 1; // 0x1
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY2 = 2; // 0x2
+ field @Deprecated public static final int TYPOGRAPHY_DISPLAY3 = 3; // 0x3
+ field @Deprecated public static final int TYPOGRAPHY_TITLE1 = 4; // 0x4
+ field @Deprecated public static final int TYPOGRAPHY_TITLE2 = 5; // 0x5
+ field @Deprecated public static final int TYPOGRAPHY_TITLE3 = 6; // 0x6
+ }
+
+}
+
+package androidx.wear.tiles.material.layouts {
+
+ @Deprecated public class EdgeContentLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.EdgeContentLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getEdgeContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ }
+
+ @Deprecated public static final class EdgeContentLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public EdgeContentLayout.Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setEdgeContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.EdgeContentLayout.Builder setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ }
+
+ @Deprecated public class LayoutDefaults {
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp DEFAULT_VERTICAL_SPACER_HEIGHT;
+ field @Deprecated public static final float EDGE_CONTENT_LAYOUT_PADDING_ABOVE_MAIN_CONTENT_DP = 6.0f;
+ field @Deprecated public static final float EDGE_CONTENT_LAYOUT_PADDING_BELOW_MAIN_CONTENT_DP = 8.0f;
+ field @Deprecated public static final int MULTI_BUTTON_MAX_NUMBER = 7; // 0x7
+ field @Deprecated public static final androidx.wear.tiles.DimensionBuilders.DpProp MULTI_SLOT_LAYOUT_HORIZONTAL_SPACER_WIDTH;
+ }
+
+ @Deprecated public class MultiButtonLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.MultiButtonLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getButtonContents();
+ method @Deprecated public int getFiveButtonDistribution();
+ field @Deprecated public static final int FIVE_BUTTON_DISTRIBUTION_BOTTOM_HEAVY = 2; // 0x2
+ field @Deprecated public static final int FIVE_BUTTON_DISTRIBUTION_TOP_HEAVY = 1; // 0x1
+ }
+
+ @Deprecated public static final class MultiButtonLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public MultiButtonLayout.Builder();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout.Builder addButtonContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiButtonLayout.Builder setFiveButtonDistribution(int);
+ }
+
+ @Deprecated public class MultiSlotLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.MultiSlotLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getHorizontalSpacerWidth();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getSlotContents();
+ }
+
+ @Deprecated public static final class MultiSlotLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public MultiSlotLayout.Builder();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout.Builder addSlotContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.MultiSlotLayout.Builder setHorizontalSpacerWidth(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public class PrimaryLayout implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public static androidx.wear.tiles.material.layouts.PrimaryLayout? fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryChipContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getPrimaryLabelTextContent();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getSecondaryLabelTextContent();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getVerticalSpacerHeight();
+ }
+
+ @Deprecated public static final class PrimaryLayout.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public PrimaryLayout.Builder(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout build();
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setPrimaryChipContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setPrimaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setSecondaryLabelTextContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.material.layouts.PrimaryLayout.Builder setVerticalSpacerHeight(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+}
+
diff --git a/wear/tiles/tiles-renderer/api/1.2.0-beta01.txt b/wear/tiles/tiles-renderer/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..2d38960
--- /dev/null
+++ b/wear/tiles/tiles-renderer/api/1.2.0-beta01.txt
@@ -0,0 +1,93 @@
+// Signature format: 4.0
+package androidx.wear.tiles.client {
+
+ public interface TileClient {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources!> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile!> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest);
+ method public default com.google.common.util.concurrent.ListenableFuture<androidx.wear.protolayout.ResourceBuilders.Resources!> requestTileResourcesAsync(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileRemovedEvent();
+ }
+
+}
+
+package androidx.wear.tiles.connection {
+
+ public final class DefaultTileClient implements androidx.wear.tiles.client.TileClient {
+ ctor public DefaultTileClient(android.content.Context context, android.content.ComponentName componentName, java.util.concurrent.Executor executor);
+ ctor public DefaultTileClient(android.content.Context context, android.content.ComponentName componentName, kotlinx.coroutines.CoroutineScope coroutineScope, kotlinx.coroutines.CoroutineDispatcher coroutineDispatcher);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileRemovedEvent();
+ }
+
+}
+
+package androidx.wear.tiles.manager {
+
+ public final class TileUiClient implements java.lang.AutoCloseable {
+ ctor public TileUiClient(android.content.Context context, android.content.ComponentName component, android.view.ViewGroup parentView);
+ method @MainThread public void close();
+ method @MainThread public void connect();
+ }
+
+}
+
+package androidx.wear.tiles.renderer {
+
+ public final class TileRenderer {
+ ctor @Deprecated public TileRenderer(android.content.Context, androidx.wear.tiles.LayoutElementBuilders.Layout, androidx.wear.tiles.ResourceBuilders.Resources, java.util.concurrent.Executor, androidx.wear.tiles.renderer.TileRenderer.LoadActionListener);
+ ctor @Deprecated public TileRenderer(android.content.Context, androidx.wear.tiles.LayoutElementBuilders.Layout, @StyleRes int, androidx.wear.tiles.ResourceBuilders.Resources, java.util.concurrent.Executor, androidx.wear.tiles.renderer.TileRenderer.LoadActionListener);
+ ctor public TileRenderer(android.content.Context, java.util.concurrent.Executor, java.util.function.Consumer<androidx.wear.protolayout.StateBuilders.State!>);
+ method @Deprecated public android.view.View? inflate(android.view.ViewGroup);
+ method public com.google.common.util.concurrent.ListenableFuture<android.view.View!> inflateAsync(androidx.wear.protolayout.LayoutElementBuilders.Layout, androidx.wear.protolayout.ResourceBuilders.Resources, android.view.ViewGroup);
+ method public void setState(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ }
+
+ @Deprecated public static interface TileRenderer.LoadActionListener {
+ method @Deprecated public void onClick(androidx.wear.tiles.StateBuilders.State);
+ }
+
+}
+
+package androidx.wear.tiles.timeline {
+
+ public final class TilesTimelineCache {
+ ctor public TilesTimelineCache(androidx.wear.protolayout.TimelineBuilders.Timeline);
+ ctor @Deprecated public TilesTimelineCache(androidx.wear.tiles.TimelineBuilders.Timeline);
+ method @MainThread public androidx.wear.protolayout.TimelineBuilders.TimelineEntry? findClosestTileTimelineEntry(long);
+ method @Deprecated @MainThread public androidx.wear.tiles.TimelineBuilders.TimelineEntry? findClosestTimelineEntry(long);
+ method @MainThread public long findCurrentTimelineEntryExpiry(androidx.wear.protolayout.TimelineBuilders.TimelineEntry, long);
+ method @Deprecated @MainThread public long findCurrentTimelineEntryExpiry(androidx.wear.tiles.TimelineBuilders.TimelineEntry, long);
+ method @MainThread public androidx.wear.protolayout.TimelineBuilders.TimelineEntry? findTileTimelineEntryForTime(long);
+ method @Deprecated @MainThread public androidx.wear.tiles.TimelineBuilders.TimelineEntry? findTimelineEntryForTime(long);
+ }
+
+ public class TilesTimelineManager implements java.lang.AutoCloseable {
+ ctor public TilesTimelineManager(android.app.AlarmManager, androidx.wear.tiles.timeline.TilesTimelineManager.Clock, androidx.wear.protolayout.TimelineBuilders.Timeline, int, java.util.concurrent.Executor, androidx.wear.tiles.timeline.TilesTimelineManager.LayoutUpdateListener);
+ ctor @Deprecated public TilesTimelineManager(android.app.AlarmManager, androidx.wear.tiles.timeline.TilesTimelineManager.Clock, androidx.wear.tiles.TimelineBuilders.Timeline, int, java.util.concurrent.Executor, androidx.wear.tiles.timeline.TilesTimelineManager.Listener);
+ method public void close();
+ method public void init();
+ }
+
+ public static interface TilesTimelineManager.Clock {
+ method public long getCurrentTimeMillis();
+ }
+
+ public static interface TilesTimelineManager.LayoutUpdateListener {
+ method public void onLayoutUpdate(int, androidx.wear.protolayout.LayoutElementBuilders.Layout);
+ }
+
+ @Deprecated public static interface TilesTimelineManager.Listener {
+ method @Deprecated public void onLayoutUpdate(int, androidx.wear.tiles.LayoutElementBuilders.Layout);
+ }
+
+}
+
diff --git a/wear/tiles/tiles-renderer/api/res-1.2.0-beta01.txt b/wear/tiles/tiles-renderer/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/tiles/tiles-renderer/api/res-1.2.0-beta01.txt
diff --git a/wear/tiles/tiles-renderer/api/restricted_1.2.0-beta01.txt b/wear/tiles/tiles-renderer/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..2d38960
--- /dev/null
+++ b/wear/tiles/tiles-renderer/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,93 @@
+// Signature format: 4.0
+package androidx.wear.tiles.client {
+
+ public interface TileClient {
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer!> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources!> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile!> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest);
+ method public default com.google.common.util.concurrent.ListenableFuture<androidx.wear.protolayout.ResourceBuilders.Resources!> requestTileResourcesAsync(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void!> sendOnTileRemovedEvent();
+ }
+
+}
+
+package androidx.wear.tiles.connection {
+
+ public final class DefaultTileClient implements androidx.wear.tiles.client.TileClient {
+ ctor public DefaultTileClient(android.content.Context context, android.content.ComponentName componentName, java.util.concurrent.Executor executor);
+ ctor public DefaultTileClient(android.content.Context context, android.content.ComponentName componentName, kotlinx.coroutines.CoroutineScope coroutineScope, kotlinx.coroutines.CoroutineDispatcher coroutineDispatcher);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileRemovedEvent();
+ }
+
+}
+
+package androidx.wear.tiles.manager {
+
+ public final class TileUiClient implements java.lang.AutoCloseable {
+ ctor public TileUiClient(android.content.Context context, android.content.ComponentName component, android.view.ViewGroup parentView);
+ method @MainThread public void close();
+ method @MainThread public void connect();
+ }
+
+}
+
+package androidx.wear.tiles.renderer {
+
+ public final class TileRenderer {
+ ctor @Deprecated public TileRenderer(android.content.Context, androidx.wear.tiles.LayoutElementBuilders.Layout, androidx.wear.tiles.ResourceBuilders.Resources, java.util.concurrent.Executor, androidx.wear.tiles.renderer.TileRenderer.LoadActionListener);
+ ctor @Deprecated public TileRenderer(android.content.Context, androidx.wear.tiles.LayoutElementBuilders.Layout, @StyleRes int, androidx.wear.tiles.ResourceBuilders.Resources, java.util.concurrent.Executor, androidx.wear.tiles.renderer.TileRenderer.LoadActionListener);
+ ctor public TileRenderer(android.content.Context, java.util.concurrent.Executor, java.util.function.Consumer<androidx.wear.protolayout.StateBuilders.State!>);
+ method @Deprecated public android.view.View? inflate(android.view.ViewGroup);
+ method public com.google.common.util.concurrent.ListenableFuture<android.view.View!> inflateAsync(androidx.wear.protolayout.LayoutElementBuilders.Layout, androidx.wear.protolayout.ResourceBuilders.Resources, android.view.ViewGroup);
+ method public void setState(java.util.Map<androidx.wear.protolayout.expression.AppDataKey<?>!,androidx.wear.protolayout.expression.DynamicDataBuilders.DynamicDataValue<?>!>);
+ }
+
+ @Deprecated public static interface TileRenderer.LoadActionListener {
+ method @Deprecated public void onClick(androidx.wear.tiles.StateBuilders.State);
+ }
+
+}
+
+package androidx.wear.tiles.timeline {
+
+ public final class TilesTimelineCache {
+ ctor public TilesTimelineCache(androidx.wear.protolayout.TimelineBuilders.Timeline);
+ ctor @Deprecated public TilesTimelineCache(androidx.wear.tiles.TimelineBuilders.Timeline);
+ method @MainThread public androidx.wear.protolayout.TimelineBuilders.TimelineEntry? findClosestTileTimelineEntry(long);
+ method @Deprecated @MainThread public androidx.wear.tiles.TimelineBuilders.TimelineEntry? findClosestTimelineEntry(long);
+ method @MainThread public long findCurrentTimelineEntryExpiry(androidx.wear.protolayout.TimelineBuilders.TimelineEntry, long);
+ method @Deprecated @MainThread public long findCurrentTimelineEntryExpiry(androidx.wear.tiles.TimelineBuilders.TimelineEntry, long);
+ method @MainThread public androidx.wear.protolayout.TimelineBuilders.TimelineEntry? findTileTimelineEntryForTime(long);
+ method @Deprecated @MainThread public androidx.wear.tiles.TimelineBuilders.TimelineEntry? findTimelineEntryForTime(long);
+ }
+
+ public class TilesTimelineManager implements java.lang.AutoCloseable {
+ ctor public TilesTimelineManager(android.app.AlarmManager, androidx.wear.tiles.timeline.TilesTimelineManager.Clock, androidx.wear.protolayout.TimelineBuilders.Timeline, int, java.util.concurrent.Executor, androidx.wear.tiles.timeline.TilesTimelineManager.LayoutUpdateListener);
+ ctor @Deprecated public TilesTimelineManager(android.app.AlarmManager, androidx.wear.tiles.timeline.TilesTimelineManager.Clock, androidx.wear.tiles.TimelineBuilders.Timeline, int, java.util.concurrent.Executor, androidx.wear.tiles.timeline.TilesTimelineManager.Listener);
+ method public void close();
+ method public void init();
+ }
+
+ public static interface TilesTimelineManager.Clock {
+ method public long getCurrentTimeMillis();
+ }
+
+ public static interface TilesTimelineManager.LayoutUpdateListener {
+ method public void onLayoutUpdate(int, androidx.wear.protolayout.LayoutElementBuilders.Layout);
+ }
+
+ @Deprecated public static interface TilesTimelineManager.Listener {
+ method @Deprecated public void onLayoutUpdate(int, androidx.wear.tiles.LayoutElementBuilders.Layout);
+ }
+
+}
+
diff --git a/wear/tiles/tiles-testing/api/1.2.0-beta01.txt b/wear/tiles/tiles-testing/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..17cae9a
--- /dev/null
+++ b/wear/tiles/tiles-testing/api/1.2.0-beta01.txt
@@ -0,0 +1,17 @@
+// Signature format: 4.0
+package androidx.wear.tiles.testing {
+
+ public final class TestTileClient<T extends androidx.wear.tiles.TileService> implements androidx.wear.tiles.client.TileClient {
+ ctor public TestTileClient(T service, java.util.concurrent.Executor executor);
+ ctor public TestTileClient(T service, kotlinx.coroutines.CoroutineScope coroutineScope, kotlinx.coroutines.CoroutineDispatcher coroutineDispatcher);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileRemovedEvent();
+ }
+
+}
+
diff --git a/wear/tiles/tiles-testing/api/res-1.2.0-beta01.txt b/wear/tiles/tiles-testing/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/tiles/tiles-testing/api/res-1.2.0-beta01.txt
diff --git a/wear/tiles/tiles-testing/api/restricted_1.2.0-beta01.txt b/wear/tiles/tiles-testing/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..17cae9a
--- /dev/null
+++ b/wear/tiles/tiles-testing/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,17 @@
+// Signature format: 4.0
+package androidx.wear.tiles.testing {
+
+ public final class TestTileClient<T extends androidx.wear.tiles.TileService> implements androidx.wear.tiles.client.TileClient {
+ ctor public TestTileClient(T service, java.util.concurrent.Executor executor);
+ ctor public TestTileClient(T service, kotlinx.coroutines.CoroutineScope coroutineScope, kotlinx.coroutines.CoroutineDispatcher coroutineDispatcher);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Integer> requestApiVersion();
+ method @Deprecated public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources> requestResources(androidx.wear.tiles.RequestBuilders.ResourcesRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile> requestTile(androidx.wear.tiles.RequestBuilders.TileRequest requestParams);
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileAddedEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileEnterEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileLeaveEvent();
+ method public com.google.common.util.concurrent.ListenableFuture<java.lang.Void> sendOnTileRemovedEvent();
+ }
+
+}
+
diff --git a/wear/tiles/tiles-testing/build.gradle b/wear/tiles/tiles-testing/build.gradle
index e0ff8e58..c1b3d58 100644
--- a/wear/tiles/tiles-testing/build.gradle
+++ b/wear/tiles/tiles-testing/build.gradle
@@ -38,7 +38,7 @@
implementation(libs.kotlinCoroutinesCore)
implementation(libs.kotlinCoroutinesAndroid)
implementation(libs.robolectric)
- implementation(libs.testCore)
+ implementation("androidx.test:core:1.5.0")
testImplementation(libs.testExtJunit)
testImplementation(libs.testExtTruth)
diff --git a/wear/tiles/tiles-tooling/api/1.2.0-beta01.txt b/wear/tiles/tiles-tooling/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/wear/tiles/tiles-tooling/api/1.2.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/wear/tiles/tiles-tooling/api/res-1.2.0-beta01.txt b/wear/tiles/tiles-tooling/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/tiles/tiles-tooling/api/res-1.2.0-beta01.txt
diff --git a/wear/tiles/tiles-tooling/api/restricted_1.2.0-beta01.txt b/wear/tiles/tiles-tooling/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/wear/tiles/tiles-tooling/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/wear/tiles/tiles/api/1.2.0-beta01.txt b/wear/tiles/tiles/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..5f0bde2
--- /dev/null
+++ b/wear/tiles/tiles/api/1.2.0-beta01.txt
@@ -0,0 +1,1128 @@
+// Signature format: 4.0
+package androidx.wear.tiles {
+
+ @Deprecated public final class ActionBuilders {
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra booleanExtra(boolean);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra doubleExtra(double);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidIntExtra intExtra(int);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidLongExtra longExtra(long);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidStringExtra stringExtra(String);
+ }
+
+ @Deprecated public static interface ActionBuilders.Action {
+ }
+
+ @Deprecated public static interface ActionBuilders.Action.Builder {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.Action build();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidActivity {
+ method @Deprecated public String getClassName();
+ method @Deprecated public java.util.Map<java.lang.String!,androidx.wear.tiles.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
+ method @Deprecated public String getPackageName();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidActivity.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra);
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setClassName(String);
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setPackageName(String);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public boolean getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidBooleanExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidBooleanExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public double getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidDoubleExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidDoubleExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
+ }
+
+ @Deprecated public static interface ActionBuilders.AndroidExtra {
+ }
+
+ @Deprecated public static interface ActionBuilders.AndroidExtra.Builder {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidExtra build();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidIntExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidIntExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidIntExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder setValue(int);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public long getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidLongExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidLongExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidLongExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder setValue(long);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public String getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidStringExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidStringExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidStringExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder setValue(String);
+ }
+
+ @Deprecated public static final class ActionBuilders.LaunchAction implements androidx.wear.tiles.ActionBuilders.Action {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity? getAndroidActivity();
+ }
+
+ @Deprecated public static final class ActionBuilders.LaunchAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor @Deprecated public ActionBuilders.LaunchAction.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LaunchAction build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity);
+ }
+
+ @Deprecated public static final class ActionBuilders.LoadAction implements androidx.wear.tiles.ActionBuilders.Action {
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State? getRequestState();
+ }
+
+ @Deprecated public static final class ActionBuilders.LoadAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor @Deprecated public ActionBuilders.LoadAction.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LoadAction build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State);
+ }
+
+ @Deprecated public final class ColorBuilders {
+ method @Deprecated public static androidx.wear.tiles.ColorBuilders.ColorProp argb(@ColorInt int);
+ }
+
+ @Deprecated public static final class ColorBuilders.ColorProp {
+ method @Deprecated @ColorInt public int getArgb();
+ }
+
+ @Deprecated public static final class ColorBuilders.ColorProp.Builder {
+ ctor @Deprecated public ColorBuilders.ColorProp.Builder();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp build();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
+ }
+
+ @Deprecated public final class DeviceParametersBuilders {
+ field @Deprecated public static final int DEVICE_PLATFORM_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int DEVICE_PLATFORM_WEAR_OS = 1; // 0x1
+ field @Deprecated public static final int SCREEN_SHAPE_RECT = 2; // 0x2
+ field @Deprecated public static final int SCREEN_SHAPE_ROUND = 1; // 0x1
+ field @Deprecated public static final int SCREEN_SHAPE_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class DeviceParametersBuilders.DeviceParameters {
+ method @Deprecated public int getDevicePlatform();
+ method @Deprecated @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
+ method @Deprecated public int getScreenShape();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenWidthDp();
+ }
+
+ @Deprecated public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor @Deprecated public DeviceParametersBuilders.DeviceParameters.Builder();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters build();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ }
+
+ @Deprecated public final class DimensionBuilders {
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DegreesProp degrees(float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp dp(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.EmProp em(float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.EmProp em(int);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp expand();
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.SpProp sp(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp wrap();
+ }
+
+ @Deprecated public static interface DimensionBuilders.ContainerDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.ContainerDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DegreesProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DegreesProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.DpProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension androidx.wear.tiles.DimensionBuilders.SpacerDimension {
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DpProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.DpProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.EmProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.EmProp.Builder {
+ ctor @Deprecated public DimensionBuilders.EmProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension {
+ }
+
+ @Deprecated public static final class DimensionBuilders.ExpandedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.ExpandedDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp build();
+ }
+
+ @Deprecated public static interface DimensionBuilders.ImageDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.ImageDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.tiles.DimensionBuilders.ImageDimension {
+ method @Deprecated @IntRange(from=0) public int getAspectRatioHeight();
+ method @Deprecated @IntRange(from=0) public int getAspectRatioWidth();
+ }
+
+ @Deprecated public static final class DimensionBuilders.ProportionalDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.ProportionalDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
+ }
+
+ @Deprecated public static final class DimensionBuilders.SpProp {
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.SpProp.Builder {
+ ctor @Deprecated public DimensionBuilders.SpProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ }
+
+ @Deprecated public static interface DimensionBuilders.SpacerDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.SpacerDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension {
+ }
+
+ @Deprecated public static final class DimensionBuilders.WrappedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.WrappedDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp build();
+ }
+
+ public final class EventBuilders {
+ }
+
+ public static final class EventBuilders.TileAddEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileAddEvent.Builder {
+ ctor public EventBuilders.TileAddEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileAddEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileAddEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileEnterEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileEnterEvent.Builder {
+ ctor public EventBuilders.TileEnterEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileEnterEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileEnterEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileLeaveEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileLeaveEvent.Builder {
+ ctor public EventBuilders.TileLeaveEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileLeaveEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileLeaveEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileRemoveEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileRemoveEvent.Builder {
+ ctor public EventBuilders.TileRemoveEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileRemoveEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileRemoveEvent.Builder setTileId(int);
+ }
+
+ @Deprecated public final class LayoutElementBuilders {
+ field @Deprecated public static final int ARC_ANCHOR_CENTER = 2; // 0x2
+ field @Deprecated public static final int ARC_ANCHOR_END = 3; // 0x3
+ field @Deprecated public static final int ARC_ANCHOR_START = 1; // 0x1
+ field @Deprecated public static final int ARC_ANCHOR_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int CONTENT_SCALE_MODE_CROP = 2; // 0x2
+ field @Deprecated public static final int CONTENT_SCALE_MODE_FILL_BOUNDS = 3; // 0x3
+ field @Deprecated public static final int CONTENT_SCALE_MODE_FIT = 1; // 0x1
+ field @Deprecated public static final int CONTENT_SCALE_MODE_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int FONT_VARIANT_BODY = 2; // 0x2
+ field @Deprecated public static final int FONT_VARIANT_TITLE = 1; // 0x1
+ field @Deprecated public static final int FONT_VARIANT_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int FONT_WEIGHT_BOLD = 700; // 0x2bc
+ field @Deprecated @androidx.wear.tiles.TilesExperimental public static final int FONT_WEIGHT_MEDIUM = 500; // 0x1f4
+ field @Deprecated public static final int FONT_WEIGHT_NORMAL = 400; // 0x190
+ field @Deprecated public static final int FONT_WEIGHT_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int HORIZONTAL_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int HORIZONTAL_ALIGN_END = 5; // 0x5
+ field @Deprecated public static final int HORIZONTAL_ALIGN_LEFT = 1; // 0x1
+ field @Deprecated public static final int HORIZONTAL_ALIGN_RIGHT = 3; // 0x3
+ field @Deprecated public static final int HORIZONTAL_ALIGN_START = 4; // 0x4
+ field @Deprecated public static final int HORIZONTAL_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_BOTTOM = 1; // 0x1
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_TEXT_BASELINE = 2; // 0x2
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int TEXT_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int TEXT_ALIGN_END = 3; // 0x3
+ field @Deprecated public static final int TEXT_ALIGN_START = 1; // 0x1
+ field @Deprecated public static final int TEXT_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int TEXT_OVERFLOW_ELLIPSIZE_END = 2; // 0x2
+ field @Deprecated public static final int TEXT_OVERFLOW_TRUNCATE = 1; // 0x1
+ field @Deprecated public static final int TEXT_OVERFLOW_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int VERTICAL_ALIGN_BOTTOM = 3; // 0x3
+ field @Deprecated public static final int VERTICAL_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int VERTICAL_ALIGN_TOP = 1; // 0x1
+ field @Deprecated public static final int VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Arc implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getAnchorAngle();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlign();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Arc.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Arc.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getRotateContents();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAdapter.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcAdapter.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAnchorTypeProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.ArcLayoutElement {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.ArcLayoutElement.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcLine implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcLine.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcLine.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcSpacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcSpacer.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcText implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcText.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcText.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Box implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Box.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Box.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ColorFilter {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getTint();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ColorFilter.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Column implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Column.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Column.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ContentScaleModeProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ContentScaleModeProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyle {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getItalic();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp? getLetterSpacing();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getSize();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getUnderline();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp? getVariant();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp? getWeight();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontStyle.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setVariant(androidx.wear.tiles.LayoutElementBuilders.FontVariantProp);
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setVariant(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(int);
+ }
+
+ @Deprecated public static class LayoutElementBuilders.FontStyles {
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ }
+
+ @Deprecated @androidx.wear.tiles.TilesExperimental public static final class LayoutElementBuilders.FontVariantProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontVariantProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontVariantProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontWeightProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontWeightProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.HorizontalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Image implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter? getColorFilter();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getResourceId();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Image.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Image.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setColorFilter(androidx.wear.tiles.LayoutElementBuilders.ColorFilter);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(String);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Layout {
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public static androidx.wear.tiles.LayoutElementBuilders.Layout? fromByteArray(byte[]);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.Layout fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getRoot();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public byte[] toByteArray();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Layout.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Layout.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.LayoutElement {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.LayoutElement.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Row implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Row.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Row.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spacer implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Spacer.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.Span {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.Span.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Span build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanImage implements androidx.wear.tiles.LayoutElementBuilders.Span {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getResourceId();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanImage.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanImage.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanText implements androidx.wear.tiles.LayoutElementBuilders.Span {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanText.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanText.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spannable implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getMultilineAlignment();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.Span!> getSpans();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spannable.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Spannable.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp? getMultilineAlignment();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Text.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.TextAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextOverflowProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.TextOverflowProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.VerticalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.VerticalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public final class ModifiersBuilders {
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ArcModifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.ArcModifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Background {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner? getCorner();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Background.Builder {
+ ctor @Deprecated public ModifiersBuilders.Background.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Border {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Border.Builder {
+ ctor @Deprecated public ModifiersBuilders.Border.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Clickable {
+ method @Deprecated public String getId();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.Action? getOnClick();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Clickable.Builder {
+ ctor @Deprecated public ModifiersBuilders.Clickable.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setId(String);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Corner {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getRadius();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Corner.Builder {
+ ctor @Deprecated public ModifiersBuilders.Corner.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ElementMetadata {
+ method @Deprecated public byte[] getTagData();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ElementMetadata.Builder {
+ ctor @Deprecated public ModifiersBuilders.ElementMetadata.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata.Builder setTagData(byte[]);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Modifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background? getBackground();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border? getBorder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata? getMetadata();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding? getPadding();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.Modifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setMetadata(androidx.wear.tiles.ModifiersBuilders.ElementMetadata);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Padding {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getBottom();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getEnd();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getRtlAware();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getStart();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getTop();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Padding.Builder {
+ ctor @Deprecated public ModifiersBuilders.Padding.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Semantics {
+ method @Deprecated public String getContentDescription();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Semantics.Builder {
+ ctor @Deprecated public ModifiersBuilders.Semantics.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics.Builder setContentDescription(String);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.SpanModifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.SpanModifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ }
+
+ public final class RequestBuilders {
+ }
+
+ public static final class RequestBuilders.ResourcesRequest {
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters getDeviceConfiguration();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
+ method public java.util.List<java.lang.String!> getResourceIds();
+ method public int getTileId();
+ method public String getVersion();
+ }
+
+ public static final class RequestBuilders.ResourcesRequest.Builder {
+ ctor public RequestBuilders.ResourcesRequest.Builder();
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder addResourceId(String);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest build();
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceConfiguration(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setTileId(int);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setVersion(String);
+ }
+
+ public static final class RequestBuilders.TileRequest {
+ method public androidx.wear.protolayout.StateBuilders.State getCurrentState();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters getDeviceConfiguration();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State? getState();
+ method public int getTileId();
+ }
+
+ public static final class RequestBuilders.TileRequest.Builder {
+ ctor public RequestBuilders.TileRequest.Builder();
+ method public androidx.wear.tiles.RequestBuilders.TileRequest build();
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setCurrentState(androidx.wear.protolayout.StateBuilders.State);
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceConfiguration(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State);
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setTileId(int);
+ }
+
+ @Deprecated public final class ResourceBuilders {
+ field @Deprecated public static final int IMAGE_FORMAT_RGB_565 = 1; // 0x1
+ field @Deprecated public static final int IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class ResourceBuilders.AndroidImageResourceByResId {
+ method @Deprecated @DrawableRes public int getResourceId();
+ }
+
+ @Deprecated public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor @Deprecated public ResourceBuilders.AndroidImageResourceByResId.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ @Deprecated public static final class ResourceBuilders.ImageResource {
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource? getInlineResource();
+ }
+
+ @Deprecated public static final class ResourceBuilders.ImageResource.Builder {
+ ctor @Deprecated public ResourceBuilders.ImageResource.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource);
+ }
+
+ @Deprecated public static final class ResourceBuilders.InlineImageResource {
+ method @Deprecated public byte[] getData();
+ method @Deprecated public int getFormat();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.PX) public int getWidthPx();
+ }
+
+ @Deprecated public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor @Deprecated public ResourceBuilders.InlineImageResource.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setFormat(int);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ }
+
+ @Deprecated public static final class ResourceBuilders.Resources {
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public static androidx.wear.tiles.ResourceBuilders.Resources? fromByteArray(byte[]);
+ method @Deprecated public java.util.Map<java.lang.String!,androidx.wear.tiles.ResourceBuilders.ImageResource!> getIdToImageMapping();
+ method @Deprecated public String getVersion();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public byte[] toByteArray();
+ }
+
+ @Deprecated public static final class ResourceBuilders.Resources.Builder {
+ ctor @Deprecated public ResourceBuilders.Resources.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources.Builder setVersion(String);
+ }
+
+ @Deprecated public final class StateBuilders {
+ }
+
+ @Deprecated public static final class StateBuilders.State {
+ method @Deprecated public String getLastClickableId();
+ }
+
+ @Deprecated public static final class StateBuilders.State.Builder {
+ ctor @Deprecated public StateBuilders.State.Builder();
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State build();
+ }
+
+ public final class TileBuilders {
+ }
+
+ public static final class TileBuilders.Tile {
+ method public long getFreshnessIntervalMillis();
+ method public String getResourcesVersion();
+ method public androidx.wear.protolayout.StateBuilders.State? getState();
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline? getTileTimeline();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline? getTimeline();
+ }
+
+ public static final class TileBuilders.Tile.Builder {
+ ctor public TileBuilders.Tile.Builder();
+ method public androidx.wear.tiles.TileBuilders.Tile build();
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setFreshnessIntervalMillis(long);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setResourcesVersion(String);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setState(androidx.wear.protolayout.StateBuilders.State);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setTileTimeline(androidx.wear.protolayout.TimelineBuilders.Timeline);
+ method @Deprecated public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline);
+ }
+
+ public abstract class TileService extends android.app.Service {
+ ctor public TileService();
+ method public static androidx.wear.tiles.TileUpdateRequester getUpdater(android.content.Context);
+ method public android.os.IBinder? onBind(android.content.Intent);
+ method @Deprecated @MainThread protected com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources!> onResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method @MainThread protected void onTileAddEvent(androidx.wear.tiles.EventBuilders.TileAddEvent);
+ method @MainThread protected void onTileEnterEvent(androidx.wear.tiles.EventBuilders.TileEnterEvent);
+ method @MainThread protected void onTileLeaveEvent(androidx.wear.tiles.EventBuilders.TileLeaveEvent);
+ method @MainThread protected void onTileRemoveEvent(androidx.wear.tiles.EventBuilders.TileRemoveEvent);
+ method @MainThread protected abstract com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile!> onTileRequest(androidx.wear.tiles.RequestBuilders.TileRequest);
+ method @MainThread protected com.google.common.util.concurrent.ListenableFuture<androidx.wear.protolayout.ResourceBuilders.Resources!> onTileResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ field public static final String ACTION_BIND_TILE_PROVIDER = "androidx.wear.tiles.action.BIND_TILE_PROVIDER";
+ field public static final String EXTRA_CLICKABLE_ID = "androidx.wear.tiles.extra.CLICKABLE_ID";
+ field public static final String METADATA_PREVIEW_KEY = "androidx.wear.tiles.PREVIEW";
+ }
+
+ public interface TileUpdateRequester {
+ method public void requestUpdate(Class<? extends androidx.wear.tiles.TileService>);
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface TilesExperimental {
+ }
+
+ @Deprecated public final class TimelineBuilders {
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimeInterval {
+ method @Deprecated public long getEndMillis();
+ method @Deprecated public long getStartMillis();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor @Deprecated public TimelineBuilders.TimeInterval.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval build();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
+ }
+
+ @Deprecated public static final class TimelineBuilders.Timeline {
+ method @Deprecated public static androidx.wear.tiles.TimelineBuilders.Timeline fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public java.util.List<androidx.wear.tiles.TimelineBuilders.TimelineEntry!> getTimelineEntries();
+ }
+
+ @Deprecated public static final class TimelineBuilders.Timeline.Builder {
+ ctor @Deprecated public TimelineBuilders.Timeline.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline build();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimelineEntry {
+ method @Deprecated public static androidx.wear.tiles.TimelineBuilders.TimelineEntry fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout? getLayout();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval? getValidity();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor @Deprecated public TimelineBuilders.TimelineEntry.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry build();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval);
+ }
+
+ @Deprecated public final class TypeBuilders {
+ }
+
+ @Deprecated public static final class TypeBuilders.BoolProp {
+ method @Deprecated public boolean getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.BoolProp.Builder {
+ ctor @Deprecated public TypeBuilders.BoolProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp.Builder setValue(boolean);
+ }
+
+ @Deprecated public static final class TypeBuilders.FloatProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.FloatProp.Builder {
+ ctor @Deprecated public TypeBuilders.FloatProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.FloatProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.FloatProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class TypeBuilders.Int32Prop {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.Int32Prop.Builder {
+ ctor @Deprecated public TypeBuilders.Int32Prop.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop.Builder setValue(int);
+ }
+
+ @Deprecated public static final class TypeBuilders.StringProp {
+ method @Deprecated public String getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.StringProp.Builder {
+ ctor @Deprecated public TypeBuilders.StringProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp.Builder setValue(String);
+ }
+
+}
+
diff --git a/wear/tiles/tiles/api/res-1.2.0-beta01.txt b/wear/tiles/tiles/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/wear/tiles/tiles/api/res-1.2.0-beta01.txt
diff --git a/wear/tiles/tiles/api/restricted_1.2.0-beta01.txt b/wear/tiles/tiles/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..5f0bde2
--- /dev/null
+++ b/wear/tiles/tiles/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,1128 @@
+// Signature format: 4.0
+package androidx.wear.tiles {
+
+ @Deprecated public final class ActionBuilders {
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra booleanExtra(boolean);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra doubleExtra(double);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidIntExtra intExtra(int);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidLongExtra longExtra(long);
+ method @Deprecated public static androidx.wear.tiles.ActionBuilders.AndroidStringExtra stringExtra(String);
+ }
+
+ @Deprecated public static interface ActionBuilders.Action {
+ }
+
+ @Deprecated public static interface ActionBuilders.Action.Builder {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.Action build();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidActivity {
+ method @Deprecated public String getClassName();
+ method @Deprecated public java.util.Map<java.lang.String!,androidx.wear.tiles.ActionBuilders.AndroidExtra!> getKeyToExtraMapping();
+ method @Deprecated public String getPackageName();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidActivity.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidActivity.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder addKeyToExtraMapping(String, androidx.wear.tiles.ActionBuilders.AndroidExtra);
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setClassName(String);
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity.Builder setPackageName(String);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidBooleanExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public boolean getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidBooleanExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidBooleanExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidBooleanExtra.Builder setValue(boolean);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidDoubleExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public double getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidDoubleExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidDoubleExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidDoubleExtra.Builder setValue(double);
+ }
+
+ @Deprecated public static interface ActionBuilders.AndroidExtra {
+ }
+
+ @Deprecated public static interface ActionBuilders.AndroidExtra.Builder {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidExtra build();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidIntExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidIntExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidIntExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidIntExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidIntExtra.Builder setValue(int);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidLongExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public long getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidLongExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidLongExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidLongExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidLongExtra.Builder setValue(long);
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidStringExtra implements androidx.wear.tiles.ActionBuilders.AndroidExtra {
+ method @Deprecated public String getValue();
+ }
+
+ @Deprecated public static final class ActionBuilders.AndroidStringExtra.Builder implements androidx.wear.tiles.ActionBuilders.AndroidExtra.Builder {
+ ctor @Deprecated public ActionBuilders.AndroidStringExtra.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidStringExtra build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidStringExtra.Builder setValue(String);
+ }
+
+ @Deprecated public static final class ActionBuilders.LaunchAction implements androidx.wear.tiles.ActionBuilders.Action {
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.AndroidActivity? getAndroidActivity();
+ }
+
+ @Deprecated public static final class ActionBuilders.LaunchAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor @Deprecated public ActionBuilders.LaunchAction.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LaunchAction build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LaunchAction.Builder setAndroidActivity(androidx.wear.tiles.ActionBuilders.AndroidActivity);
+ }
+
+ @Deprecated public static final class ActionBuilders.LoadAction implements androidx.wear.tiles.ActionBuilders.Action {
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State? getRequestState();
+ }
+
+ @Deprecated public static final class ActionBuilders.LoadAction.Builder implements androidx.wear.tiles.ActionBuilders.Action.Builder {
+ ctor @Deprecated public ActionBuilders.LoadAction.Builder();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LoadAction build();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.LoadAction.Builder setRequestState(androidx.wear.tiles.StateBuilders.State);
+ }
+
+ @Deprecated public final class ColorBuilders {
+ method @Deprecated public static androidx.wear.tiles.ColorBuilders.ColorProp argb(@ColorInt int);
+ }
+
+ @Deprecated public static final class ColorBuilders.ColorProp {
+ method @Deprecated @ColorInt public int getArgb();
+ }
+
+ @Deprecated public static final class ColorBuilders.ColorProp.Builder {
+ ctor @Deprecated public ColorBuilders.ColorProp.Builder();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp build();
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp.Builder setArgb(@ColorInt int);
+ }
+
+ @Deprecated public final class DeviceParametersBuilders {
+ field @Deprecated public static final int DEVICE_PLATFORM_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int DEVICE_PLATFORM_WEAR_OS = 1; // 0x1
+ field @Deprecated public static final int SCREEN_SHAPE_RECT = 2; // 0x2
+ field @Deprecated public static final int SCREEN_SHAPE_ROUND = 1; // 0x1
+ field @Deprecated public static final int SCREEN_SHAPE_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class DeviceParametersBuilders.DeviceParameters {
+ method @Deprecated public int getDevicePlatform();
+ method @Deprecated @FloatRange(from=0.0, fromInclusive=false, toInclusive=false) public float getScreenDensity();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenHeightDp();
+ method @Deprecated public int getScreenShape();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public int getScreenWidthDp();
+ }
+
+ @Deprecated public static final class DeviceParametersBuilders.DeviceParameters.Builder {
+ ctor @Deprecated public DeviceParametersBuilders.DeviceParameters.Builder();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters build();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setDevicePlatform(int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenDensity(@FloatRange(from=0.0, fromInclusive=false, toInclusive=false) float);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenHeightDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenShape(int);
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters.Builder setScreenWidthDp(@Dimension(unit=androidx.annotation.Dimension.DP) int);
+ }
+
+ @Deprecated public final class DimensionBuilders {
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DegreesProp degrees(float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.DpProp dp(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.EmProp em(float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.EmProp em(int);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp expand();
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.SpProp sp(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ method @Deprecated public static androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp wrap();
+ }
+
+ @Deprecated public static interface DimensionBuilders.ContainerDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.ContainerDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DegreesProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DegreesProp.Builder {
+ ctor @Deprecated public DimensionBuilders.DegreesProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.DpProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension androidx.wear.tiles.DimensionBuilders.SpacerDimension {
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.DP) public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.DpProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder androidx.wear.tiles.DimensionBuilders.SpacerDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.DpProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.DP) float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.EmProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.EmProp.Builder {
+ ctor @Deprecated public DimensionBuilders.EmProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class DimensionBuilders.ExpandedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension androidx.wear.tiles.DimensionBuilders.ImageDimension {
+ }
+
+ @Deprecated public static final class DimensionBuilders.ExpandedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.ExpandedDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ExpandedDimensionProp build();
+ }
+
+ @Deprecated public static interface DimensionBuilders.ImageDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.ImageDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.ProportionalDimensionProp implements androidx.wear.tiles.DimensionBuilders.ImageDimension {
+ method @Deprecated @IntRange(from=0) public int getAspectRatioHeight();
+ method @Deprecated @IntRange(from=0) public int getAspectRatioWidth();
+ }
+
+ @Deprecated public static final class DimensionBuilders.ProportionalDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ImageDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.ProportionalDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioHeight(@IntRange(from=0) int);
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ProportionalDimensionProp.Builder setAspectRatioWidth(@IntRange(from=0) int);
+ }
+
+ @Deprecated public static final class DimensionBuilders.SpProp {
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.SP) public float getValue();
+ }
+
+ @Deprecated public static final class DimensionBuilders.SpProp.Builder {
+ ctor @Deprecated public DimensionBuilders.SpProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp build();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp.Builder setValue(@Dimension(unit=androidx.annotation.Dimension.SP) float);
+ }
+
+ @Deprecated public static interface DimensionBuilders.SpacerDimension {
+ }
+
+ @Deprecated public static interface DimensionBuilders.SpacerDimension.Builder {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension build();
+ }
+
+ @Deprecated public static final class DimensionBuilders.WrappedDimensionProp implements androidx.wear.tiles.DimensionBuilders.ContainerDimension {
+ }
+
+ @Deprecated public static final class DimensionBuilders.WrappedDimensionProp.Builder implements androidx.wear.tiles.DimensionBuilders.ContainerDimension.Builder {
+ ctor @Deprecated public DimensionBuilders.WrappedDimensionProp.Builder();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.WrappedDimensionProp build();
+ }
+
+ public final class EventBuilders {
+ }
+
+ public static final class EventBuilders.TileAddEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileAddEvent.Builder {
+ ctor public EventBuilders.TileAddEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileAddEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileAddEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileEnterEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileEnterEvent.Builder {
+ ctor public EventBuilders.TileEnterEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileEnterEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileEnterEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileLeaveEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileLeaveEvent.Builder {
+ ctor public EventBuilders.TileLeaveEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileLeaveEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileLeaveEvent.Builder setTileId(int);
+ }
+
+ public static final class EventBuilders.TileRemoveEvent {
+ method public int getTileId();
+ }
+
+ public static final class EventBuilders.TileRemoveEvent.Builder {
+ ctor public EventBuilders.TileRemoveEvent.Builder();
+ method public androidx.wear.tiles.EventBuilders.TileRemoveEvent build();
+ method public androidx.wear.tiles.EventBuilders.TileRemoveEvent.Builder setTileId(int);
+ }
+
+ @Deprecated public final class LayoutElementBuilders {
+ field @Deprecated public static final int ARC_ANCHOR_CENTER = 2; // 0x2
+ field @Deprecated public static final int ARC_ANCHOR_END = 3; // 0x3
+ field @Deprecated public static final int ARC_ANCHOR_START = 1; // 0x1
+ field @Deprecated public static final int ARC_ANCHOR_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int CONTENT_SCALE_MODE_CROP = 2; // 0x2
+ field @Deprecated public static final int CONTENT_SCALE_MODE_FILL_BOUNDS = 3; // 0x3
+ field @Deprecated public static final int CONTENT_SCALE_MODE_FIT = 1; // 0x1
+ field @Deprecated public static final int CONTENT_SCALE_MODE_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int FONT_VARIANT_BODY = 2; // 0x2
+ field @Deprecated public static final int FONT_VARIANT_TITLE = 1; // 0x1
+ field @Deprecated public static final int FONT_VARIANT_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int FONT_WEIGHT_BOLD = 700; // 0x2bc
+ field @Deprecated @androidx.wear.tiles.TilesExperimental public static final int FONT_WEIGHT_MEDIUM = 500; // 0x1f4
+ field @Deprecated public static final int FONT_WEIGHT_NORMAL = 400; // 0x190
+ field @Deprecated public static final int FONT_WEIGHT_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int HORIZONTAL_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int HORIZONTAL_ALIGN_END = 5; // 0x5
+ field @Deprecated public static final int HORIZONTAL_ALIGN_LEFT = 1; // 0x1
+ field @Deprecated public static final int HORIZONTAL_ALIGN_RIGHT = 3; // 0x3
+ field @Deprecated public static final int HORIZONTAL_ALIGN_START = 4; // 0x4
+ field @Deprecated public static final int HORIZONTAL_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_BOTTOM = 1; // 0x1
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_TEXT_BASELINE = 2; // 0x2
+ field @Deprecated public static final int SPAN_VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int TEXT_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int TEXT_ALIGN_END = 3; // 0x3
+ field @Deprecated public static final int TEXT_ALIGN_START = 1; // 0x1
+ field @Deprecated public static final int TEXT_ALIGN_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int TEXT_OVERFLOW_ELLIPSIZE_END = 2; // 0x2
+ field @Deprecated public static final int TEXT_OVERFLOW_TRUNCATE = 1; // 0x1
+ field @Deprecated public static final int TEXT_OVERFLOW_UNDEFINED = 0; // 0x0
+ field @Deprecated public static final int VERTICAL_ALIGN_BOTTOM = 3; // 0x3
+ field @Deprecated public static final int VERTICAL_ALIGN_CENTER = 2; // 0x2
+ field @Deprecated public static final int VERTICAL_ALIGN_TOP = 1; // 0x1
+ field @Deprecated public static final int VERTICAL_ALIGN_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Arc implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getAnchorAngle();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp? getAnchorType();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlign();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Arc.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Arc.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorAngle(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setAnchorType(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Arc.Builder setVerticalAlign(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAdapter implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getContent();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getRotateContents();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAdapter.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcAdapter.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAdapter.Builder setRotateContents(boolean);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAnchorTypeProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcAnchorTypeProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcAnchorTypeProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcAnchorTypeProp.Builder setValue(int);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.ArcLayoutElement {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.ArcLayoutElement.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcLine implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcLine.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcLine.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcLine.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcSpacer implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DegreesProp? getLength();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getThickness();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcSpacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcSpacer.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setLength(androidx.wear.tiles.DimensionBuilders.DegreesProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcSpacer.Builder setThickness(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcText implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ArcText.Builder implements androidx.wear.tiles.LayoutElementBuilders.ArcLayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ArcText.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.ArcModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ArcText.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Box implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Box.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Box.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setVerticalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Box.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ColorFilter {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getTint();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ColorFilter.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ColorFilter.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter.Builder setTint(androidx.wear.tiles.ColorBuilders.ColorProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Column implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getHorizontalAlignment();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Column.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Column.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setHorizontalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Column.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ContentScaleModeProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.ContentScaleModeProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.ContentScaleModeProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyle {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getItalic();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.EmProp? getLetterSpacing();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getSize();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getUnderline();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp? getVariant();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp? getWeight();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontStyle.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontStyle.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setItalic(boolean);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setLetterSpacing(androidx.wear.tiles.DimensionBuilders.EmProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setSize(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setUnderline(boolean);
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setVariant(androidx.wear.tiles.LayoutElementBuilders.FontVariantProp);
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setVariant(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(androidx.wear.tiles.LayoutElementBuilders.FontWeightProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder setWeight(int);
+ }
+
+ @Deprecated public static class LayoutElementBuilders.FontStyles {
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder body2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder button(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder caption2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder display3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title1(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title2(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.FontStyle.Builder title3(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ }
+
+ @Deprecated @androidx.wear.tiles.TilesExperimental public static final class LayoutElementBuilders.FontVariantProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontVariantProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontVariantProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontVariantProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontWeightProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.FontWeightProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.FontWeightProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontWeightProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.HorizontalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.HorizontalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.HorizontalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Image implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ColorFilter? getColorFilter();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp? getContentScaleMode();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getResourceId();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ImageDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Image.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Image.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setColorFilter(androidx.wear.tiles.LayoutElementBuilders.ColorFilter);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(androidx.wear.tiles.LayoutElementBuilders.ContentScaleModeProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setContentScaleMode(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ImageDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setResourceId(String);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Image.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ImageDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Layout {
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public static androidx.wear.tiles.LayoutElementBuilders.Layout? fromByteArray(byte[]);
+ method @Deprecated public static androidx.wear.tiles.LayoutElementBuilders.Layout fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement? getRoot();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public byte[] toByteArray();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Layout.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Layout.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout.Builder setRoot(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.LayoutElement {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.LayoutElement.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.LayoutElement build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Row implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.LayoutElement!> getContents();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp? getVerticalAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.ContainerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Row.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Row.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder addContent(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setHeight(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setVerticalAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Row.Builder setWidth(androidx.wear.tiles.DimensionBuilders.ContainerDimension);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spacer implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpacerDimension? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spacer.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Spacer.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setHeight(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spacer.Builder setWidth(androidx.wear.tiles.DimensionBuilders.SpacerDimension);
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.Span {
+ }
+
+ @Deprecated public static interface LayoutElementBuilders.Span.Builder {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Span build();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanImage implements androidx.wear.tiles.LayoutElementBuilders.Span {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp? getAlignment();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getHeight();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getResourceId();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanImage.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanImage.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setHeight(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setResourceId(String);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanImage.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanText implements androidx.wear.tiles.LayoutElementBuilders.Span {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanText.Builder implements androidx.wear.tiles.LayoutElementBuilders.Span.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanText.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.SpanModifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanText.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanVerticalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.SpanVerticalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.SpanVerticalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.SpanVerticalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spannable implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp? getMultilineAlignment();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method @Deprecated public java.util.List<androidx.wear.tiles.LayoutElementBuilders.Span!> getSpans();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Spannable.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Spannable.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder addSpan(androidx.wear.tiles.LayoutElementBuilders.Span);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.HorizontalAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Spannable.Builder setOverflow(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Text implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement {
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.FontStyle? getFontStyle();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.SpProp? getLineHeight();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop? getMaxLines();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers? getModifiers();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp? getMultilineAlignment();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp? getOverflow();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp? getText();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.Text.Builder implements androidx.wear.tiles.LayoutElementBuilders.LayoutElement.Builder {
+ ctor @Deprecated public LayoutElementBuilders.Text.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setFontStyle(androidx.wear.tiles.LayoutElementBuilders.FontStyle);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setLineHeight(androidx.wear.tiles.DimensionBuilders.SpProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(androidx.wear.tiles.TypeBuilders.Int32Prop);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMaxLines(@IntRange(from=1) int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setModifiers(androidx.wear.tiles.ModifiersBuilders.Modifiers);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setMultilineAlignment(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setOverflow(int);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setText(androidx.wear.tiles.TypeBuilders.StringProp);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Text.Builder setText(String);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.TextAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextOverflowProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.TextOverflowProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.TextOverflowProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.TextOverflowProp.Builder setValue(int);
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.VerticalAlignmentProp {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class LayoutElementBuilders.VerticalAlignmentProp.Builder {
+ ctor @Deprecated public LayoutElementBuilders.VerticalAlignmentProp.Builder();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp build();
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.VerticalAlignmentProp.Builder setValue(int);
+ }
+
+ @Deprecated public final class ModifiersBuilders {
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ArcModifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ArcModifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.ArcModifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ArcModifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Background {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner? getCorner();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Background.Builder {
+ ctor @Deprecated public ModifiersBuilders.Background.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background.Builder setCorner(androidx.wear.tiles.ModifiersBuilders.Corner);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Border {
+ method @Deprecated public androidx.wear.tiles.ColorBuilders.ColorProp? getColor();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getWidth();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Border.Builder {
+ ctor @Deprecated public ModifiersBuilders.Border.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border.Builder setColor(androidx.wear.tiles.ColorBuilders.ColorProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border.Builder setWidth(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Clickable {
+ method @Deprecated public String getId();
+ method @Deprecated public androidx.wear.tiles.ActionBuilders.Action? getOnClick();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Clickable.Builder {
+ ctor @Deprecated public ModifiersBuilders.Clickable.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setId(String);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable.Builder setOnClick(androidx.wear.tiles.ActionBuilders.Action);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Corner {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getRadius();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Corner.Builder {
+ ctor @Deprecated public ModifiersBuilders.Corner.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Corner.Builder setRadius(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ElementMetadata {
+ method @Deprecated public byte[] getTagData();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.ElementMetadata.Builder {
+ ctor @Deprecated public ModifiersBuilders.ElementMetadata.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata.Builder setTagData(byte[]);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Modifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Background? getBackground();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Border? getBorder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.ElementMetadata? getMetadata();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding? getPadding();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics? getSemantics();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Modifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.Modifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBackground(androidx.wear.tiles.ModifiersBuilders.Background);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setBorder(androidx.wear.tiles.ModifiersBuilders.Border);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setMetadata(androidx.wear.tiles.ModifiersBuilders.ElementMetadata);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setPadding(androidx.wear.tiles.ModifiersBuilders.Padding);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Modifiers.Builder setSemantics(androidx.wear.tiles.ModifiersBuilders.Semantics);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Padding {
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getBottom();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getEnd();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp? getRtlAware();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getStart();
+ method @Deprecated public androidx.wear.tiles.DimensionBuilders.DpProp? getTop();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Padding.Builder {
+ ctor @Deprecated public ModifiersBuilders.Padding.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setAll(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setBottom(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setEnd(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(androidx.wear.tiles.TypeBuilders.BoolProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setRtlAware(boolean);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setStart(androidx.wear.tiles.DimensionBuilders.DpProp);
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Padding.Builder setTop(androidx.wear.tiles.DimensionBuilders.DpProp);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Semantics {
+ method @Deprecated public String getContentDescription();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.Semantics.Builder {
+ ctor @Deprecated public ModifiersBuilders.Semantics.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Semantics.Builder setContentDescription(String);
+ }
+
+ @Deprecated public static final class ModifiersBuilders.SpanModifiers {
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.Clickable? getClickable();
+ }
+
+ @Deprecated public static final class ModifiersBuilders.SpanModifiers.Builder {
+ ctor @Deprecated public ModifiersBuilders.SpanModifiers.Builder();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers build();
+ method @Deprecated public androidx.wear.tiles.ModifiersBuilders.SpanModifiers.Builder setClickable(androidx.wear.tiles.ModifiersBuilders.Clickable);
+ }
+
+ public final class RequestBuilders {
+ }
+
+ public static final class RequestBuilders.ResourcesRequest {
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters getDeviceConfiguration();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
+ method public java.util.List<java.lang.String!> getResourceIds();
+ method public int getTileId();
+ method public String getVersion();
+ }
+
+ public static final class RequestBuilders.ResourcesRequest.Builder {
+ ctor public RequestBuilders.ResourcesRequest.Builder();
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder addResourceId(String);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest build();
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceConfiguration(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setTileId(int);
+ method public androidx.wear.tiles.RequestBuilders.ResourcesRequest.Builder setVersion(String);
+ }
+
+ public static final class RequestBuilders.TileRequest {
+ method public androidx.wear.protolayout.StateBuilders.State getCurrentState();
+ method public androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters getDeviceConfiguration();
+ method @Deprecated public androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters? getDeviceParameters();
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State? getState();
+ method public int getTileId();
+ }
+
+ public static final class RequestBuilders.TileRequest.Builder {
+ ctor public RequestBuilders.TileRequest.Builder();
+ method public androidx.wear.tiles.RequestBuilders.TileRequest build();
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setCurrentState(androidx.wear.protolayout.StateBuilders.State);
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceConfiguration(androidx.wear.protolayout.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setDeviceParameters(androidx.wear.tiles.DeviceParametersBuilders.DeviceParameters);
+ method @Deprecated public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setState(androidx.wear.tiles.StateBuilders.State);
+ method public androidx.wear.tiles.RequestBuilders.TileRequest.Builder setTileId(int);
+ }
+
+ @Deprecated public final class ResourceBuilders {
+ field @Deprecated public static final int IMAGE_FORMAT_RGB_565 = 1; // 0x1
+ field @Deprecated public static final int IMAGE_FORMAT_UNDEFINED = 0; // 0x0
+ }
+
+ @Deprecated public static final class ResourceBuilders.AndroidImageResourceByResId {
+ method @Deprecated @DrawableRes public int getResourceId();
+ }
+
+ @Deprecated public static final class ResourceBuilders.AndroidImageResourceByResId.Builder {
+ ctor @Deprecated public ResourceBuilders.AndroidImageResourceByResId.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId.Builder setResourceId(@DrawableRes int);
+ }
+
+ @Deprecated public static final class ResourceBuilders.ImageResource {
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId? getAndroidResourceByResId();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource? getInlineResource();
+ }
+
+ @Deprecated public static final class ResourceBuilders.ImageResource.Builder {
+ ctor @Deprecated public ResourceBuilders.ImageResource.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setAndroidResourceByResId(androidx.wear.tiles.ResourceBuilders.AndroidImageResourceByResId);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.ImageResource.Builder setInlineResource(androidx.wear.tiles.ResourceBuilders.InlineImageResource);
+ }
+
+ @Deprecated public static final class ResourceBuilders.InlineImageResource {
+ method @Deprecated public byte[] getData();
+ method @Deprecated public int getFormat();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.PX) public int getHeightPx();
+ method @Deprecated @Dimension(unit=androidx.annotation.Dimension.PX) public int getWidthPx();
+ }
+
+ @Deprecated public static final class ResourceBuilders.InlineImageResource.Builder {
+ ctor @Deprecated public ResourceBuilders.InlineImageResource.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setData(byte[]);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setFormat(int);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setHeightPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.InlineImageResource.Builder setWidthPx(@Dimension(unit=androidx.annotation.Dimension.PX) int);
+ }
+
+ @Deprecated public static final class ResourceBuilders.Resources {
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public static androidx.wear.tiles.ResourceBuilders.Resources? fromByteArray(byte[]);
+ method @Deprecated public java.util.Map<java.lang.String!,androidx.wear.tiles.ResourceBuilders.ImageResource!> getIdToImageMapping();
+ method @Deprecated public String getVersion();
+ method @Deprecated @androidx.wear.tiles.TilesExperimental public byte[] toByteArray();
+ }
+
+ @Deprecated public static final class ResourceBuilders.Resources.Builder {
+ ctor @Deprecated public ResourceBuilders.Resources.Builder();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources.Builder addIdToImageMapping(String, androidx.wear.tiles.ResourceBuilders.ImageResource);
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources build();
+ method @Deprecated public androidx.wear.tiles.ResourceBuilders.Resources.Builder setVersion(String);
+ }
+
+ @Deprecated public final class StateBuilders {
+ }
+
+ @Deprecated public static final class StateBuilders.State {
+ method @Deprecated public String getLastClickableId();
+ }
+
+ @Deprecated public static final class StateBuilders.State.Builder {
+ ctor @Deprecated public StateBuilders.State.Builder();
+ method @Deprecated public androidx.wear.tiles.StateBuilders.State build();
+ }
+
+ public final class TileBuilders {
+ }
+
+ public static final class TileBuilders.Tile {
+ method public long getFreshnessIntervalMillis();
+ method public String getResourcesVersion();
+ method public androidx.wear.protolayout.StateBuilders.State? getState();
+ method public androidx.wear.protolayout.TimelineBuilders.Timeline? getTileTimeline();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline? getTimeline();
+ }
+
+ public static final class TileBuilders.Tile.Builder {
+ ctor public TileBuilders.Tile.Builder();
+ method public androidx.wear.tiles.TileBuilders.Tile build();
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setFreshnessIntervalMillis(long);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setResourcesVersion(String);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setState(androidx.wear.protolayout.StateBuilders.State);
+ method public androidx.wear.tiles.TileBuilders.Tile.Builder setTileTimeline(androidx.wear.protolayout.TimelineBuilders.Timeline);
+ method @Deprecated public androidx.wear.tiles.TileBuilders.Tile.Builder setTimeline(androidx.wear.tiles.TimelineBuilders.Timeline);
+ }
+
+ public abstract class TileService extends android.app.Service {
+ ctor public TileService();
+ method public static androidx.wear.tiles.TileUpdateRequester getUpdater(android.content.Context);
+ method public android.os.IBinder? onBind(android.content.Intent);
+ method @Deprecated @MainThread protected com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.ResourceBuilders.Resources!> onResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ method @MainThread protected void onTileAddEvent(androidx.wear.tiles.EventBuilders.TileAddEvent);
+ method @MainThread protected void onTileEnterEvent(androidx.wear.tiles.EventBuilders.TileEnterEvent);
+ method @MainThread protected void onTileLeaveEvent(androidx.wear.tiles.EventBuilders.TileLeaveEvent);
+ method @MainThread protected void onTileRemoveEvent(androidx.wear.tiles.EventBuilders.TileRemoveEvent);
+ method @MainThread protected abstract com.google.common.util.concurrent.ListenableFuture<androidx.wear.tiles.TileBuilders.Tile!> onTileRequest(androidx.wear.tiles.RequestBuilders.TileRequest);
+ method @MainThread protected com.google.common.util.concurrent.ListenableFuture<androidx.wear.protolayout.ResourceBuilders.Resources!> onTileResourcesRequest(androidx.wear.tiles.RequestBuilders.ResourcesRequest);
+ field public static final String ACTION_BIND_TILE_PROVIDER = "androidx.wear.tiles.action.BIND_TILE_PROVIDER";
+ field public static final String EXTRA_CLICKABLE_ID = "androidx.wear.tiles.extra.CLICKABLE_ID";
+ field public static final String METADATA_PREVIEW_KEY = "androidx.wear.tiles.PREVIEW";
+ }
+
+ public interface TileUpdateRequester {
+ method public void requestUpdate(Class<? extends androidx.wear.tiles.TileService>);
+ }
+
+ @RequiresOptIn(level=androidx.annotation.RequiresOptIn.Level.ERROR) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.CLASS) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.TYPE, java.lang.annotation.ElementType.FIELD}) public @interface TilesExperimental {
+ }
+
+ @Deprecated public final class TimelineBuilders {
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimeInterval {
+ method @Deprecated public long getEndMillis();
+ method @Deprecated public long getStartMillis();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimeInterval.Builder {
+ ctor @Deprecated public TimelineBuilders.TimeInterval.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval build();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setEndMillis(long);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval.Builder setStartMillis(long);
+ }
+
+ @Deprecated public static final class TimelineBuilders.Timeline {
+ method @Deprecated public static androidx.wear.tiles.TimelineBuilders.Timeline fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public java.util.List<androidx.wear.tiles.TimelineBuilders.TimelineEntry!> getTimelineEntries();
+ }
+
+ @Deprecated public static final class TimelineBuilders.Timeline.Builder {
+ ctor @Deprecated public TimelineBuilders.Timeline.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline.Builder addTimelineEntry(androidx.wear.tiles.TimelineBuilders.TimelineEntry);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.Timeline build();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimelineEntry {
+ method @Deprecated public static androidx.wear.tiles.TimelineBuilders.TimelineEntry fromLayoutElement(androidx.wear.tiles.LayoutElementBuilders.LayoutElement);
+ method @Deprecated public androidx.wear.tiles.LayoutElementBuilders.Layout? getLayout();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimeInterval? getValidity();
+ }
+
+ @Deprecated public static final class TimelineBuilders.TimelineEntry.Builder {
+ ctor @Deprecated public TimelineBuilders.TimelineEntry.Builder();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry build();
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setLayout(androidx.wear.tiles.LayoutElementBuilders.Layout);
+ method @Deprecated public androidx.wear.tiles.TimelineBuilders.TimelineEntry.Builder setValidity(androidx.wear.tiles.TimelineBuilders.TimeInterval);
+ }
+
+ @Deprecated public final class TypeBuilders {
+ }
+
+ @Deprecated public static final class TypeBuilders.BoolProp {
+ method @Deprecated public boolean getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.BoolProp.Builder {
+ ctor @Deprecated public TypeBuilders.BoolProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.BoolProp.Builder setValue(boolean);
+ }
+
+ @Deprecated public static final class TypeBuilders.FloatProp {
+ method @Deprecated public float getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.FloatProp.Builder {
+ ctor @Deprecated public TypeBuilders.FloatProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.FloatProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.FloatProp.Builder setValue(float);
+ }
+
+ @Deprecated public static final class TypeBuilders.Int32Prop {
+ method @Deprecated public int getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.Int32Prop.Builder {
+ ctor @Deprecated public TypeBuilders.Int32Prop.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.Int32Prop.Builder setValue(int);
+ }
+
+ @Deprecated public static final class TypeBuilders.StringProp {
+ method @Deprecated public String getValue();
+ }
+
+ @Deprecated public static final class TypeBuilders.StringProp.Builder {
+ ctor @Deprecated public TypeBuilders.StringProp.Builder();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp build();
+ method @Deprecated public androidx.wear.tiles.TypeBuilders.StringProp.Builder setValue(String);
+ }
+
+}
+
diff --git a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaPresentation.java b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaPresentation.java
index ddb8e8a..0ce24b8 100644
--- a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaPresentation.java
+++ b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaPresentation.java
@@ -25,7 +25,7 @@
* An interface representing a container in an extension window area in which app content can be
* shown.
*
- * @since {@link androidx.window.extensions.WindowExtensions#VENDOR_API_LEVEL_3}
+ * Since {@link androidx.window.extensions.WindowExtensions#VENDOR_API_LEVEL_3}
* @see WindowAreaComponent#getRearDisplayPresentation()
*/
public interface ExtensionWindowAreaPresentation {
diff --git a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaStatus.java b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaStatus.java
index 2f521bc..0dcd47f 100644
--- a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaStatus.java
+++ b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/ExtensionWindowAreaStatus.java
@@ -23,7 +23,7 @@
/**
* Interface to provide information around the current status of a window area feature.
*
- * @since {@link androidx.window.extensions.WindowExtensions#VENDOR_API_LEVEL_3}
+ * Since {@link androidx.window.extensions.WindowExtensions#VENDOR_API_LEVEL_3}
* @see WindowAreaComponent#addRearDisplayPresentationStatusListener
*/
public interface ExtensionWindowAreaStatus {
diff --git a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/WindowAreaComponent.java b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/WindowAreaComponent.java
index e20584c..e5705ac 100644
--- a/window/extensions/extensions/src/main/java/androidx/window/extensions/area/WindowAreaComponent.java
+++ b/window/extensions/extensions/src/main/java/androidx/window/extensions/area/WindowAreaComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 The Android Open Source Project
+ * Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@
* @see WindowExtensions#getWindowLayoutComponent()
*/
public interface WindowAreaComponent {
+
/**
* WindowArea status constant to signify that the feature is
* unsupported on this device. Could be due to the device not supporting that
diff --git a/window/window-demos/demo/src/main/AndroidManifest.xml b/window/window-demos/demo/src/main/AndroidManifest.xml
index dff69ac..230cb82 100644
--- a/window/window-demos/demo/src/main/AndroidManifest.xml
+++ b/window/window-demos/demo/src/main/AndroidManifest.xml
@@ -220,6 +220,34 @@
android:taskAffinity="androidx.window.demo.split_device_state_activity_affinity">
</activity>
+ <!-- The demo app to show how to change layout with runtime APIs -->
+ <activity
+ android:name=".embedding.SplitAttributesToggleMainActivity"
+ android:exported="true"
+ android:label="Split Toggle at Runtime"
+ android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density|touchscreen"
+ android:taskAffinity="androidx.window.demo.split_attributes_toggle_activity_affinity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+ <activity
+ android:name=".embedding.SplitAttributesTogglePrimaryActivity"
+ android:label="Split Toggle Activity A"
+ android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density|touchscreen"
+ android:taskAffinity="androidx.window.demo.split_attributes_toggle_activity_affinity" />
+ <activity
+ android:name=".embedding.SplitAttributesToggleSecondaryActivity"
+ android:label="Split Toggle Activity B"
+ android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density|touchscreen"
+ android:taskAffinity="androidx.window.demo.split_attributes_toggle_activity_affinity" />
+ <activity
+ android:name=".embedding.SplitAttributesTogglePlaceholderActivity"
+ android:label="Split Toggle Placeholder"
+ android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density|touchscreen"
+ android:taskAffinity="androidx.window.demo.split_attributes_toggle_activity_affinity" />
+
<!-- The demo app that shows various IME-related use cases -->
<activity android:name=".ImeActivity"
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateCallbackActivity.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateCallbackActivity.kt
index bd39f74..2122cbd 100644
--- a/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateCallbackActivity.kt
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateCallbackActivity.kt
@@ -16,6 +16,7 @@
package androidx.window.demo.coresdk
+import android.content.ComponentCallbacks
import android.content.Context
import android.content.res.Configuration
import android.hardware.display.DisplayManager
@@ -36,11 +37,18 @@
/** Activity to show display configuration from different system callbacks. */
class WindowStateCallbackActivity : AppCompatActivity() {
- private lateinit var displayManager: DisplayManager
+ /**
+ * [DisplayManager]s from `Activity` and `Application` are updated from different resource
+ * configurations, so we listen on them separately.
+ */
+ private lateinit var applicationDisplayManager: DisplayManager
+ private lateinit var activityDisplayManager: DisplayManager
private lateinit var handler: Handler
private lateinit var latestUpdateView: WindowStateView
- private lateinit var displayListenerView: WindowStateView
+ private lateinit var applicationDisplayListenerView: WindowStateView
+ private lateinit var activityDisplayListenerView: WindowStateView
+ private lateinit var applicationConfigurationView: WindowStateView
private lateinit var activityConfigurationView: WindowStateView
private lateinit var displayFeatureView: WindowStateView
@@ -56,7 +64,8 @@
}
}
- private val displayListener = object : DisplayListener {
+ /** [DisplayListener] on `Application`. */
+ private val applicationDisplayListener = object : DisplayListener {
override fun onDisplayAdded(displayId: Int) {
}
@@ -65,23 +74,55 @@
override fun onDisplayChanged(displayId: Int) {
if (displayId == DEFAULT_DISPLAY) {
- displayListenerView.onWindowStateCallbackInvoked()
+ applicationDisplayListenerView.onWindowStateCallbackInvoked()
}
}
}
+ /** [DisplayListener] on `Activity`. */
+ private val activityDisplayListener = object : DisplayListener {
+ override fun onDisplayAdded(displayId: Int) {
+ }
+
+ override fun onDisplayRemoved(displayId: Int) {
+ }
+
+ override fun onDisplayChanged(displayId: Int) {
+ if (displayId == DEFAULT_DISPLAY) {
+ activityDisplayListenerView.onWindowStateCallbackInvoked()
+ }
+ }
+ }
+
+ /** [onConfigurationChanged] on `Application`. */
+ private val applicationComponentCallback = object : ComponentCallbacks {
+ override fun onConfigurationChanged(p0: Configuration) {
+ applicationConfigurationView.onWindowStateCallbackInvoked()
+ }
+
+ override fun onLowMemory() {
+ }
+ }
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val viewBinding = ActivityCoresdkWindowStateCallbackLayoutBinding.inflate(layoutInflater)
setContentView(viewBinding.root)
latestUpdateView = viewBinding.latestUpdateView
- displayListenerView = viewBinding.displayListenerView
+ applicationDisplayListenerView = viewBinding.applicationDisplayListenerView
+ activityDisplayListenerView = viewBinding.activityDisplayListenerView
+ applicationConfigurationView = viewBinding.applicationConfigurationView
activityConfigurationView = viewBinding.activityConfigurationView
displayFeatureView = viewBinding.displayFeatureView
- displayManager = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
+ applicationDisplayManager =
+ application.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
+ activityDisplayManager = getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
handler = Handler(Looper.getMainLooper())
- displayManager.registerDisplayListener(displayListener, handler)
+
+ applicationDisplayManager.registerDisplayListener(applicationDisplayListener, handler)
+ activityDisplayManager.registerDisplayListener(activityDisplayListener, handler)
+ application.registerComponentCallbacks(applicationComponentCallback)
// Collect windowInfo when STARTED and stop when STOPPED.
lifecycleScope.launch(Dispatchers.Main) {
lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
@@ -96,7 +137,9 @@
override fun onDestroy() {
super.onDestroy()
- displayManager.unregisterDisplayListener(displayListener)
+ applicationDisplayManager.unregisterDisplayListener(applicationDisplayListener)
+ activityDisplayManager.unregisterDisplayListener(activityDisplayListener)
+ application.unregisterComponentCallbacks(applicationComponentCallback)
}
override fun onResume() {
@@ -110,8 +153,13 @@
handler.removeCallbacks(updateWindowStateIfChanged)
}
+ /** [onConfigurationChanged] on `Activity`. */
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
activityConfigurationView.onWindowStateCallbackInvoked()
}
+
+ companion object {
+ val TAG = WindowStateCallbackActivity::class.simpleName
+ }
}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateView.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateView.kt
index c569e8f..df757f9 100644
--- a/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateView.kt
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/coresdk/WindowStateView.kt
@@ -20,12 +20,14 @@
import android.graphics.Rect
import android.hardware.display.DisplayManager
import android.util.AttributeSet
+import android.util.Log
import android.view.Display.DEFAULT_DISPLAY
import android.view.LayoutInflater
import android.view.WindowManager
import android.widget.LinearLayout
import androidx.window.demo.R
import androidx.window.demo.databinding.WindowStateViewBinding
+import androidx.window.layout.WindowMetricsCalculator
import java.text.SimpleDateFormat
import java.util.Date
@@ -37,29 +39,48 @@
defStyleRes: Int = 0
) : LinearLayout(context, attrs, defStyleAttr, defStyleRes) {
- private val displayManager: DisplayManager
- private val windowManager: WindowManager
+ private var title: String = "N/A"
+
+ /**
+ * [DisplayManager]s and [WindowManager]s from `Activity` and `Application` are updated from
+ * different resource configurations, so we show config from them separately.
+ */
+ private val applicationDisplayManager: DisplayManager
+ private val activityDisplayManager: DisplayManager
+ private val windowMetricsCalculator: WindowMetricsCalculator
private val timestampView: WindowStateConfigView
- private val displayRotationView: WindowStateConfigView
- private val displayBoundsView: WindowStateConfigView
- private val prevDisplayRotationView: WindowStateConfigView
- private val prevDisplayBoundsView: WindowStateConfigView
+ private val applicationDisplayRotationView: WindowStateConfigView
+ private val activityDisplayRotationView: WindowStateConfigView
+ private val applicationDisplayBoundsView: WindowStateConfigView
+ private val activityDisplayBoundsView: WindowStateConfigView
+ private val prevApplicationDisplayRotationView: WindowStateConfigView
+ private val prevActivityDisplayRotationView: WindowStateConfigView
+ private val prevApplicationDisplayBoundsView: WindowStateConfigView
+ private val prevActivityDisplayBoundsView: WindowStateConfigView
private val shouldHidePrevConfig: Boolean
- private var lastDisplayRotation = -1
- private val lastDisplayBounds = Rect()
+ private var lastApplicationDisplayRotation = -1
+ private var lastActivityDisplayRotation = -1
+ private val lastApplicationDisplayBounds = Rect()
+ private val lastActivityDisplayBounds = Rect()
init {
- displayManager = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
- windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
+ applicationDisplayManager =
+ context.applicationContext.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
+ activityDisplayManager = context.getSystemService(Context.DISPLAY_SERVICE) as DisplayManager
+ windowMetricsCalculator = WindowMetricsCalculator.getOrCreate()
val viewBinding = WindowStateViewBinding.inflate(LayoutInflater.from(context), this, true)
timestampView = viewBinding.timestampView
- displayRotationView = viewBinding.displayRotationView
- displayBoundsView = viewBinding.displayBoundsView
- prevDisplayRotationView = viewBinding.prevDisplayRotationView
- prevDisplayBoundsView = viewBinding.prevDisplayBoundsView
+ applicationDisplayRotationView = viewBinding.applicationDisplayRotationView
+ activityDisplayRotationView = viewBinding.activityDisplayRotationView
+ applicationDisplayBoundsView = viewBinding.applicationDisplayBoundsView
+ activityDisplayBoundsView = viewBinding.activityDisplayBoundsView
+ prevApplicationDisplayRotationView = viewBinding.prevApplicationDisplayRotationView
+ prevActivityDisplayRotationView = viewBinding.prevActivityDisplayRotationView
+ prevApplicationDisplayBoundsView = viewBinding.prevApplicationDisplayBoundsView
+ prevActivityDisplayBoundsView = viewBinding.prevActivityDisplayBoundsView
context.theme.obtainStyledAttributes(
attrs,
@@ -68,19 +89,26 @@
try {
getString(R.styleable.WindowStateView_title)?.let {
viewBinding.callbackTitle.text = it
+ title = it
}
shouldHidePrevConfig = getBoolean(
R.styleable.WindowStateView_hidePrevConfig,
false)
if (shouldHidePrevConfig) {
timestampView.visibility = GONE
- displayRotationView.shouldHighlightChange = false
- displayBoundsView.shouldHighlightChange = false
- prevDisplayRotationView.visibility = GONE
- prevDisplayBoundsView.visibility = GONE
+ applicationDisplayRotationView.shouldHighlightChange = false
+ activityDisplayRotationView.shouldHighlightChange = false
+ applicationDisplayBoundsView.shouldHighlightChange = false
+ activityDisplayBoundsView.shouldHighlightChange = false
+ prevApplicationDisplayRotationView.visibility = GONE
+ prevActivityDisplayRotationView.visibility = GONE
+ prevApplicationDisplayBoundsView.visibility = GONE
+ prevActivityDisplayBoundsView.visibility = GONE
} else {
- displayRotationView.shouldHighlightChange = true
- displayBoundsView.shouldHighlightChange = true
+ applicationDisplayRotationView.shouldHighlightChange = true
+ activityDisplayRotationView.shouldHighlightChange = true
+ applicationDisplayBoundsView.shouldHighlightChange = true
+ activityDisplayBoundsView.shouldHighlightChange = true
}
} finally {
recycle()
@@ -90,28 +118,50 @@
/** Called when the corresponding system callback is invoked. */
fun onWindowStateCallbackInvoked() {
- val displayRotation = displayManager.getDisplay(DEFAULT_DISPLAY).rotation
- val displayBounds = windowManager.maximumWindowMetrics.bounds
+ val applicationDisplayRotation =
+ applicationDisplayManager.getDisplay(DEFAULT_DISPLAY).rotation
+ val activityDisplayRotation =
+ activityDisplayManager.getDisplay(DEFAULT_DISPLAY).rotation
+ val applicationDisplayBounds = windowMetricsCalculator
+ .computeMaximumWindowMetrics(context.applicationContext)
+ .bounds
+ val activityDisplayBounds = windowMetricsCalculator
+ .computeMaximumWindowMetrics(context)
+ .bounds
if (shouldHidePrevConfig &&
- displayRotation == lastDisplayRotation &&
- displayBounds == lastDisplayBounds) {
+ applicationDisplayRotation == lastApplicationDisplayRotation &&
+ activityDisplayRotation == lastActivityDisplayRotation &&
+ applicationDisplayBounds == lastApplicationDisplayBounds &&
+ activityDisplayBounds == lastActivityDisplayBounds) {
// Skip if the state is unchanged.
return
}
- timestampView.updateValue(TIME_FORMAT.format(Date()))
- displayRotationView.updateValue(displayRotation.toString())
- displayBoundsView.updateValue(displayBounds.toString())
-
- if (!shouldHidePrevConfig && lastDisplayRotation != -1) {
- // Skip if there is no previous value.
- prevDisplayRotationView.updateValue(lastDisplayRotation.toString())
- prevDisplayBoundsView.updateValue(lastDisplayBounds.toString())
+ if (!shouldHidePrevConfig) {
+ // Debug log for the change title.
+ Log.d(WindowStateCallbackActivity.TAG, title)
}
- lastDisplayRotation = displayRotation
- lastDisplayBounds.set(displayBounds)
+ timestampView.updateValue(TIME_FORMAT.format(Date()))
+ applicationDisplayRotationView.updateValue(applicationDisplayRotation.toString())
+ activityDisplayRotationView.updateValue(activityDisplayRotation.toString())
+ applicationDisplayBoundsView.updateValue(applicationDisplayBounds.toString())
+ activityDisplayBoundsView.updateValue(activityDisplayBounds.toString())
+
+ if (!shouldHidePrevConfig && lastApplicationDisplayRotation != -1) {
+ // Skip if there is no previous value.
+ prevApplicationDisplayRotationView.updateValue(
+ lastApplicationDisplayRotation.toString())
+ prevActivityDisplayRotationView.updateValue(lastActivityDisplayRotation.toString())
+ prevApplicationDisplayBoundsView.updateValue(lastApplicationDisplayBounds.toString())
+ prevActivityDisplayBoundsView.updateValue(lastActivityDisplayBounds.toString())
+ }
+
+ lastApplicationDisplayRotation = applicationDisplayRotation
+ lastActivityDisplayRotation = activityDisplayRotation
+ lastApplicationDisplayBounds.set(applicationDisplayBounds)
+ lastActivityDisplayBounds.set(activityDisplayBounds)
}
companion object {
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/DemoActivityEmbeddingController.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/DemoActivityEmbeddingController.kt
new file mode 100644
index 0000000..d8130d1
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/DemoActivityEmbeddingController.kt
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import androidx.annotation.GuardedBy
+import androidx.window.embedding.SplitAttributes
+import java.util.concurrent.atomic.AtomicBoolean
+import java.util.concurrent.locks.ReentrantLock
+import kotlin.concurrent.withLock
+
+/** A singleton controller to manage the global config. */
+class DemoActivityEmbeddingController private constructor() {
+ private val lock = ReentrantLock()
+
+ /** Indicates that whether to expand the secondary container or not */
+ internal var shouldExpandSecondaryContainer = AtomicBoolean(false)
+
+ internal var splitAttributesCustomizationEnabled = AtomicBoolean(false)
+
+ internal var customizedLayoutDirection: SplitAttributes.LayoutDirection
+ get() {
+ lock.withLock {
+ return layoutDirectionLocked
+ }
+ }
+ set(value) {
+ lock.withLock {
+ layoutDirectionLocked = value
+ }
+ }
+
+ @GuardedBy("lock")
+ private var layoutDirectionLocked = SplitAttributes.LayoutDirection.LOCALE
+
+ internal var customizedSplitType: SplitAttributes.SplitType
+ get() {
+ lock.withLock {
+ return splitTypeLocked
+ }
+ }
+ set(value) {
+ lock.withLock {
+ splitTypeLocked = value
+ }
+ }
+
+ @GuardedBy("lock")
+ private var splitTypeLocked = SplitAttributes.SplitType.SPLIT_TYPE_EQUAL
+
+ companion object {
+ @Volatile
+ private var globalInstance: DemoActivityEmbeddingController? = null
+ private val globalLock = ReentrantLock()
+
+ /**
+ * Obtains the singleton instance of [DemoActivityEmbeddingController].
+ */
+ @JvmStatic
+ fun getInstance(): DemoActivityEmbeddingController {
+ if (globalInstance == null) {
+ globalLock.withLock {
+ if (globalInstance == null) {
+ globalInstance = DemoActivityEmbeddingController()
+ }
+ }
+ }
+ return globalInstance!!
+ }
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/ExampleWindowInitializer.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/ExampleWindowInitializer.kt
index 505a365..a797d43 100644
--- a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/ExampleWindowInitializer.kt
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/ExampleWindowInitializer.kt
@@ -19,6 +19,9 @@
import android.content.Context
import androidx.startup.Initializer
import androidx.window.demo.R
+import androidx.window.demo.embedding.SplitAttributesToggleMainActivity.Companion.PREFIX_FULLSCREEN_TOGGLE
+import androidx.window.demo.embedding.SplitAttributesToggleMainActivity.Companion.PREFIX_PLACEHOLDER
+import androidx.window.demo.embedding.SplitAttributesToggleMainActivity.Companion.TAG_CUSTOMIZED_SPLIT_ATTRIBUTES
import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.SUFFIX_AND_FULLSCREEN_IN_BOOK_MODE
import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP
import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.SUFFIX_REVERSED
@@ -34,6 +37,7 @@
import androidx.window.embedding.SplitAttributes.LayoutDirection.Companion.RIGHT_TO_LEFT
import androidx.window.embedding.SplitAttributes.LayoutDirection.Companion.TOP_TO_BOTTOM
import androidx.window.embedding.SplitAttributes.SplitType.Companion.SPLIT_TYPE_EQUAL
+import androidx.window.embedding.SplitAttributes.SplitType.Companion.SPLIT_TYPE_EXPAND
import androidx.window.embedding.SplitAttributes.SplitType.Companion.SPLIT_TYPE_HINGE
import androidx.window.embedding.SplitAttributesCalculatorParams
import androidx.window.embedding.SplitController
@@ -47,6 +51,8 @@
*/
class ExampleWindowInitializer : Initializer<RuleController> {
+ private val mDemoActivityEmbeddingController = DemoActivityEmbeddingController.getInstance()
+
override fun create(context: Context): RuleController {
SplitController.getInstance(context).apply {
if (isSplitAttributesCalculatorSupported()) {
@@ -68,16 +74,21 @@
private fun sampleSplitAttributesCalculator(
params: SplitAttributesCalculatorParams
): SplitAttributes {
+ val tag = params.splitRuleTag
+ // The SplitAttributes to occupy the whole task bounds
+ val expandContainersAttrs = SplitAttributes.Builder()
+ .setSplitType(SPLIT_TYPE_EXPAND)
+ .build()
+ if (tag?.startsWith(PREFIX_FULLSCREEN_TOGGLE) == true &&
+ mDemoActivityEmbeddingController.shouldExpandSecondaryContainer.get()
+ ) {
+ return expandContainersAttrs
+ }
val isPortrait = params.parentWindowMetrics.isPortrait()
val windowLayoutInfo = params.parentWindowLayoutInfo
val isTabletop = windowLayoutInfo.isTabletop()
val isBookMode = windowLayoutInfo.isBookMode()
val config = params.parentConfiguration
- // The SplitAttributes to occupy the whole task bounds
- val expandContainersAttrs = SplitAttributes.Builder()
- .setSplitType(SplitAttributes.SplitType.SPLIT_TYPE_EXPAND)
- .build()
- val tag = params.splitRuleTag
val shouldReversed = tag?.contains(SUFFIX_REVERSED) ?: false
// Make a copy of the default splitAttributes, but replace the animation background
// color to what is configured in the Demo app.
@@ -85,7 +96,11 @@
.setLayoutDirection(params.defaultSplitAttributes.layoutDirection)
.setSplitType(params.defaultSplitAttributes.splitType)
.build()
- when (tag?.substringBefore(SUFFIX_REVERSED)) {
+ when (tag
+ ?.removePrefix(PREFIX_FULLSCREEN_TOGGLE)
+ ?.removePrefix(PREFIX_PLACEHOLDER)
+ ?.removeSuffix(SUFFIX_REVERSED)
+ ) {
TAG_USE_DEFAULT_SPLIT_ATTRIBUTES, null -> {
return if (params.areDefaultConstraintsSatisfied) {
defaultSplitAttributes
@@ -203,6 +218,12 @@
.build()
}
}
+ TAG_CUSTOMIZED_SPLIT_ATTRIBUTES -> {
+ return SplitAttributes.Builder()
+ .setSplitType(mDemoActivityEmbeddingController.customizedSplitType)
+ .setLayoutDirection(mDemoActivityEmbeddingController.customizedLayoutDirection)
+ .build()
+ }
}
return defaultSplitAttributes
}
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleActivityBase.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleActivityBase.kt
new file mode 100644
index 0000000..ccde719
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleActivityBase.kt
@@ -0,0 +1,116 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import android.os.Bundle
+import android.widget.TextView
+import androidx.appcompat.app.AppCompatActivity
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
+import androidx.window.demo.R
+import androidx.window.embedding.RuleController
+import androidx.window.embedding.SplitAttributes
+import androidx.window.embedding.SplitAttributes.SplitType.Companion.SPLIT_TYPE_EXPAND
+import androidx.window.embedding.SplitController
+import androidx.window.embedding.SplitPairRule
+import androidx.window.embedding.SplitPlaceholderRule
+import androidx.window.embedding.SplitRule
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
+open class SplitAttributesToggleActivityBase : AppCompatActivity() {
+ internal lateinit var splitController: SplitController
+ internal lateinit var ruleController: RuleController
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ splitController = SplitController.getInstance(this)
+ ruleController = RuleController.getInstance(this)
+
+ lifecycleScope.launch {
+ // The block passed to repeatOnLifecycle is executed when the lifecycle
+ // is at least STARTED and is cancelled when the lifecycle is STOPPED.
+ // It automatically restarts the block when the lifecycle is STARTED again.
+ lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
+ splitController.splitInfoList(this@SplitAttributesToggleActivityBase)
+ .map { splitInfoList ->
+ if (splitInfoList.isEmpty()) {
+ EXPAND_ATTRS
+ } else {
+ splitInfoList.last().splitAttributes
+ }
+ }.collect { attrs -> updateSplitAttributesText(attrs) }
+ }
+ }
+ }
+
+ private suspend fun updateSplitAttributesText(splitAttributes: SplitAttributes) =
+ withContext(Dispatchers.Main) {
+ window.decorView.findViewById<TextView>(R.id.activity_pair_split_attributes_text_view)
+ .text = resources.getString(R.string.current_split_attributes) + splitAttributes
+ }
+
+ /** Returns the [SplitRule] this activity participates in. */
+ internal inline fun <reified T : SplitRule> getSplitRule(): T? =
+ ruleController.getRules().find { rule ->
+ if (rule !is T) {
+ return@find false
+ }
+ when (rule) {
+ is SplitPairRule -> {
+ rule.filters.any { filter ->
+ filter.primaryActivityName == componentName ||
+ filter.secondaryActivityName == componentName
+ }
+ }
+
+ is SplitPlaceholderRule -> {
+ rule.filters.any { filter -> filter.matchesActivity(this) } ||
+ rule.placeholderIntent.component == componentName
+ }
+
+ else -> false
+ }
+ } as? T?
+
+ companion object {
+ internal val EXPAND_ATTRS = SplitAttributes.Builder()
+ .setSplitType(SPLIT_TYPE_EXPAND)
+ .build()
+ internal val CUSTOMIZED_SPLIT_TYPES_TEXT = arrayOf(
+ "ratio(0.3)",
+ "ratio(0.5)",
+ "ratio(0.7)",
+ "expand",
+ )
+ internal val CUSTOMIZED_SPLIT_TYPES_VALUE = arrayOf(
+ SplitAttributes.SplitType.ratio(0.3f),
+ SplitAttributes.SplitType.SPLIT_TYPE_EQUAL,
+ SplitAttributes.SplitType.ratio(0.7f),
+ SPLIT_TYPE_EXPAND,
+ )
+ internal val CUSTOMIZED_LAYOUT_DIRECTIONS_TEXT = arrayOf("locale", "bottom_to_top")
+ internal val CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE = arrayOf(
+ SplitAttributes.LayoutDirection.LOCALE,
+ SplitAttributes.LayoutDirection.BOTTOM_TO_TOP,
+ )
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleMainActivity.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleMainActivity.kt
new file mode 100644
index 0000000..1ee12e7
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleMainActivity.kt
@@ -0,0 +1,426 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import android.content.ComponentName
+import android.content.Intent
+import android.os.Bundle
+import android.view.View
+import android.widget.AdapterView
+import android.widget.ArrayAdapter
+import android.widget.CompoundButton
+import android.widget.RadioGroup
+import androidx.collection.ArraySet
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
+import androidx.window.core.ExperimentalWindowApi
+import androidx.window.demo.R
+import androidx.window.demo.databinding.ActivitySplitAttributesTogglePrimaryActivityBinding
+import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP
+import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.TAG_SHOW_FULLSCREEN_IN_PORTRAIT
+import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.TAG_USE_DEFAULT_SPLIT_ATTRIBUTES
+import androidx.window.embedding.ActivityEmbeddingController
+import androidx.window.embedding.ActivityFilter
+import androidx.window.embedding.EmbeddingRule
+import androidx.window.embedding.SplitPairFilter
+import androidx.window.embedding.SplitPairRule
+import androidx.window.embedding.SplitPlaceholderRule
+import androidx.window.embedding.SplitRule
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.withContext
+
+@OptIn(ExperimentalWindowApi::class)
+open class SplitAttributesToggleMainActivity : SplitAttributesToggleActivityBase(),
+ View.OnClickListener, RadioGroup.OnCheckedChangeListener, AdapterView.OnItemSelectedListener,
+ CompoundButton.OnCheckedChangeListener {
+
+ protected lateinit var viewBinding: ActivitySplitAttributesTogglePrimaryActivityBinding
+ private val pendingRules = ArraySet<EmbeddingRule>()
+
+ internal lateinit var activityEmbeddingController: ActivityEmbeddingController
+
+ private val demoActivityEmbeddingController = DemoActivityEmbeddingController.getInstance()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ viewBinding = ActivitySplitAttributesTogglePrimaryActivityBinding.inflate(layoutInflater)
+ setContentView(viewBinding.root)
+
+ val placeholderFoldingAwareAttrsRadioButton =
+ viewBinding.placeholderUseFoldingAwareSplitAttributes
+ val splitRuleFoldingAwareAttrsRadioButton =
+ viewBinding.splitRuleUseFoldingAwareSplitAttributes
+
+ activityEmbeddingController = ActivityEmbeddingController.getInstance(this)
+
+ if (!splitController.isSplitAttributesCalculatorSupported()) {
+ placeholderFoldingAwareAttrsRadioButton.isEnabled = false
+ viewBinding.placeholderUseCustomizedSplitAttributes.isEnabled = false
+ splitRuleFoldingAwareAttrsRadioButton.isEnabled = false
+ viewBinding.splitRuleUseCustomizedSplitAttributes.isEnabled = false
+ }
+ viewBinding.startPrimaryActivityButton.setOnClickListener(this)
+ viewBinding.useStickyPlaceholderCheckBox.setOnCheckedChangeListener(this)
+ viewBinding.usePlaceholderCheckBox.setOnCheckedChangeListener(this)
+ viewBinding.placeholderSplitLayoutOption.setOnCheckedChangeListener(this)
+ val placeholderSplitTypeSpinner = viewBinding.placeholderSplitTypeSpinner
+ placeholderSplitTypeSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_SPLIT_TYPES_TEXT,
+ )
+ placeholderSplitTypeSpinner.onItemSelectedListener = this
+ val placeholderLayoutDirectionSpinner = viewBinding.placeholderLayoutDirectionSpinner
+ placeholderLayoutDirectionSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_LAYOUT_DIRECTIONS_TEXT,
+ )
+ placeholderLayoutDirectionSpinner.onItemSelectedListener = this
+
+ viewBinding.startActivityPairButton.setOnClickListener(this)
+ viewBinding.useSplitRuleCheckBox.setOnCheckedChangeListener(this)
+ viewBinding.splitRuleSplitLayoutOption.setOnCheckedChangeListener(this)
+ val splitRuleSplitTypeSpinner = viewBinding.splitRuleSplitTypeSpinner
+ splitRuleSplitTypeSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_SPLIT_TYPES_TEXT,
+ )
+ splitRuleSplitTypeSpinner.onItemSelectedListener = this
+ val splitRuleLayoutDirectionSpinner = viewBinding.splitRuleLayoutDirectionSpinner
+ splitRuleLayoutDirectionSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_LAYOUT_DIRECTIONS_TEXT,
+ )
+ splitRuleLayoutDirectionSpinner.onItemSelectedListener = this
+
+ lifecycleScope.launch {
+ // The block passed to repeatOnLifecycle is executed when the lifecycle
+ // is at least STARTED and is cancelled when the lifecycle is STOPPED.
+ // It automatically restarts the block when the lifecycle is STARTED again.
+ lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
+ splitController.splitInfoList(this@SplitAttributesToggleMainActivity)
+ .collect { updateUiFromRules() }
+ }
+ }
+ }
+
+ open suspend fun updateUiFromRules() {
+ withContext(Dispatchers.Main) {
+ updateWarningMessages()
+ ruleController.getRules().apply {
+ val splitPlaceholderRule = getSplitRule<SplitPlaceholderRule>()
+
+ val hasPlaceholderRule = splitPlaceholderRule != null
+ val usePlaceholderCheckBox = viewBinding.usePlaceholderCheckBox
+
+ var shouldShowSpinner = false
+
+ usePlaceholderCheckBox.isChecked = hasPlaceholderRule
+ onCheckedChanged(usePlaceholderCheckBox, usePlaceholderCheckBox.isChecked)
+ viewBinding.useStickyPlaceholderCheckBox.isChecked =
+ splitPlaceholderRule?.isSticky ?: false
+ viewBinding.placeholderSplitLayoutOption.check(
+ when (
+ splitPlaceholderRule?.tag
+ ?.removePrefix(PREFIX_FULLSCREEN_TOGGLE)
+ ?.removePrefix(PREFIX_PLACEHOLDER)
+ ) {
+ TAG_USE_DEFAULT_SPLIT_ATTRIBUTES ->
+ R.id.placeholder_use_default_split_attributes
+ TAG_SHOW_FULLSCREEN_IN_PORTRAIT +
+ SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP ->
+ R.id.placeholder_use_folding_aware_split_attributes
+ TAG_CUSTOMIZED_SPLIT_ATTRIBUTES ->
+ R.id.placeholder_use_customized_split_attributes
+ else -> 0
+ }
+ )
+ if (viewBinding.placeholderSplitLayoutOption.checkedRadioButtonId ==
+ R.id.placeholder_use_customized_split_attributes) {
+ viewBinding.placeholderSplitTypeSpinner.setSelection(
+ CUSTOMIZED_SPLIT_TYPES_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedSplitType
+ )
+ )
+ viewBinding.placeholderSplitTypeSpinner.setSelection(
+ CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedLayoutDirection
+ )
+ )
+ shouldShowSpinner = true
+ }
+
+ val splitPairRule = getSplitRule<SplitPairRule>()
+ val useSplitRuleCheckBox = viewBinding.useSplitRuleCheckBox
+ useSplitRuleCheckBox.isChecked = splitPairRule != null
+ onCheckedChanged(useSplitRuleCheckBox, useSplitRuleCheckBox.isChecked)
+ viewBinding.splitRuleSplitLayoutOption.check(
+ when (
+ splitPairRule?.tag
+ ?.removePrefix(PREFIX_FULLSCREEN_TOGGLE)
+ ?.removePrefix(PREFIX_PLACEHOLDER)
+ ) {
+ TAG_USE_DEFAULT_SPLIT_ATTRIBUTES ->
+ R.id.split_rule_use_single_split_attributes
+ TAG_SHOW_FULLSCREEN_IN_PORTRAIT +
+ SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP ->
+ R.id.split_rule_use_folding_aware_split_attributes
+ TAG_CUSTOMIZED_SPLIT_ATTRIBUTES ->
+ R.id.split_rule_use_customized_split_attributes
+ else -> 0
+ }
+ )
+ if (viewBinding.splitRuleSplitLayoutOption.checkedRadioButtonId ==
+ R.id.split_rule_use_customized_split_attributes) {
+ viewBinding.splitRuleSplitTypeSpinner.setSelection(
+ CUSTOMIZED_SPLIT_TYPES_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedSplitType
+ )
+ )
+ viewBinding.splitRuleLayoutDirectionSpinner.setSelection(
+ CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedLayoutDirection
+ )
+ )
+ shouldShowSpinner = true
+ }
+ demoActivityEmbeddingController.splitAttributesCustomizationEnabled
+ .set(shouldShowSpinner)
+ }
+ }
+ }
+
+ private suspend fun updateWarningMessages() {
+ val warningMessages = StringBuilder().apply {
+ if (!splitController.isSplitAttributesCalculatorSupported()) {
+ append(resources.getString(R.string.split_attributes_calculator_not_supported))
+ append("\n")
+ }
+ if (!activityEmbeddingController.isFinishingActivityStacksSupported()) {
+ append("Finishing secondary activities is not supported on this device!\n")
+ }
+ if (viewBinding.finishSecondaryActivitiesButton.isEnabled &&
+ getSplitRule<SplitPlaceholderRule>() != null
+ ) {
+ append(resources.getString(R.string.show_placeholder_warning))
+ append("\n")
+ }
+ }
+ withContext(Dispatchers.Main) {
+ viewBinding.warningMessageTextView.text = warningMessages
+ }
+ }
+
+ override fun onClick(button: View) {
+ // Update the rules to ruleController before starting the Activity.
+ applyRules()
+ // Set the status to the default.
+ demoActivityEmbeddingController.shouldExpandSecondaryContainer.set(false)
+ val intent = Intent(this, SplitAttributesTogglePrimaryActivity::class.java)
+ when (button.id) {
+ R.id.start_primary_activity_button -> startActivity(intent)
+ R.id.start_activity_pair_button -> {
+ startActivity(intent.putExtra(EXTRA_LAUNCH_SECONDARY, true))
+ }
+ }
+ }
+
+ open fun applyRules() {
+ // Only remove rules with tag specified
+ ruleController.getRules()
+ .filter { rule -> rule.tag?.contains(PREFIX_FULLSCREEN_TOGGLE) ?: false }
+ .forEach { rule -> ruleController.removeRule(rule) }
+
+ for (rule in pendingRules) {
+ ruleController.addRule(rule)
+ }
+ }
+
+ override fun onCheckedChanged(c: CompoundButton, isChecked: Boolean) {
+ val checkBoxId = c.id
+ if (isChecked) {
+ showSubItems(checkBoxId)
+ } else {
+ hideSubItems(checkBoxId)
+ }
+ updatePendingRulesFromUi()
+ }
+
+ private fun showSubItems(checkBoxId: Int) {
+ when (checkBoxId) {
+ R.id.use_placeholder_check_box -> {
+ viewBinding.placeholderChooseLayoutTextView.visibility = View.VISIBLE
+ viewBinding.placeholderSplitLayoutOption.visibility = View.VISIBLE
+ viewBinding.placeholderUseDefaultSplitAttributes.isChecked = true
+ viewBinding.useStickyPlaceholderCheckBox.visibility = View.VISIBLE
+ }
+ R.id.use_split_rule_check_box -> {
+ viewBinding.splitRuleChooseLayoutTextView.visibility = View.VISIBLE
+ viewBinding.splitRuleSplitLayoutOption.visibility = View.VISIBLE
+ viewBinding.splitRuleUseSingleSplitAttributes.isChecked = true
+ }
+ }
+ }
+
+ private fun hideSubItems(checkBoxId: Int) {
+ when (checkBoxId) {
+ R.id.use_placeholder_check_box -> {
+ viewBinding.placeholderChooseLayoutTextView.visibility = View.GONE
+ viewBinding.placeholderSplitLayoutOption.visibility = View.GONE
+ viewBinding.useStickyPlaceholderCheckBox.visibility = View.GONE
+ }
+ R.id.use_split_rule_check_box -> {
+ viewBinding.splitRuleChooseLayoutTextView.visibility = View.GONE
+ viewBinding.splitRuleSplitLayoutOption.visibility = View.GONE
+ }
+ }
+ }
+
+ override fun onCheckedChanged(group: RadioGroup, id: Int) {
+ updatePendingRulesFromUi()
+ updateSpinnerVisibilitiesIfNeeded(id)
+ }
+
+ private fun updatePendingRulesFromUi() {
+ pendingRules.clear()
+ if (viewBinding.usePlaceholderCheckBox.isChecked) {
+ // Create the SplitPlaceholderRule
+ val placeholderFilter = ActivityFilter(
+ ComponentName(
+ this@SplitAttributesToggleMainActivity,
+ SplitAttributesTogglePrimaryActivity::class.java
+ ),
+ intentAction = null,
+ )
+ val placeholderIntent = Intent(
+ this@SplitAttributesToggleMainActivity,
+ SplitAttributesTogglePlaceholderActivity::class.java
+ )
+ val splitPlaceholderRule = SplitPlaceholderRule.Builder(
+ setOf(placeholderFilter),
+ placeholderIntent
+ )
+ .setFinishPrimaryWithPlaceholder(SplitRule.FinishBehavior.ALWAYS)
+ .setTag(
+ PREFIX_FULLSCREEN_TOGGLE + PREFIX_PLACEHOLDER +
+ when (viewBinding.placeholderSplitLayoutOption.checkedRadioButtonId) {
+ R.id.placeholder_use_default_split_attributes ->
+ TAG_USE_DEFAULT_SPLIT_ATTRIBUTES
+ R.id.placeholder_use_folding_aware_split_attributes ->
+ TAG_SHOW_FULLSCREEN_IN_PORTRAIT +
+ SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP
+ R.id.placeholder_use_customized_split_attributes ->
+ TAG_CUSTOMIZED_SPLIT_ATTRIBUTES
+ else -> null
+ }
+ ).setSticky(viewBinding.useStickyPlaceholderCheckBox.isChecked)
+ .build()
+ pendingRules.add(splitPlaceholderRule)
+ }
+ if (viewBinding.useSplitRuleCheckBox.isChecked) {
+ // Create the SplitPairRule
+ val splitActivityFilter = SplitPairFilter(
+ ComponentName(
+ this@SplitAttributesToggleMainActivity,
+ SplitAttributesTogglePrimaryActivity::class.java
+ ),
+ ComponentName(
+ this@SplitAttributesToggleMainActivity,
+ SplitAttributesToggleSecondaryActivity::class.java
+ ),
+ secondaryActivityIntentAction = null,
+ )
+ val splitPairRule = SplitPairRule.Builder(setOf(splitActivityFilter))
+ .setFinishPrimaryWithSecondary(SplitRule.FinishBehavior.ALWAYS)
+ .setFinishSecondaryWithPrimary(SplitRule.FinishBehavior.ALWAYS)
+ .setTag(
+ PREFIX_FULLSCREEN_TOGGLE +
+ when (viewBinding.splitRuleSplitLayoutOption.checkedRadioButtonId) {
+ R.id.split_rule_use_single_split_attributes ->
+ TAG_USE_DEFAULT_SPLIT_ATTRIBUTES
+ R.id.split_rule_use_folding_aware_split_attributes ->
+ TAG_SHOW_FULLSCREEN_IN_PORTRAIT +
+ SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP
+ R.id.split_rule_use_customized_split_attributes ->
+ TAG_CUSTOMIZED_SPLIT_ATTRIBUTES
+ else -> null
+ }
+ ).build()
+ pendingRules.add(splitPairRule)
+ }
+ }
+
+ private fun updateSpinnerVisibilitiesIfNeeded(id: Int) {
+ when (id) {
+ R.id.placeholder_use_customized_split_attributes,
+ R.id.split_rule_use_customized_split_attributes ->
+ updateSpinnerVisibility(id, View.VISIBLE)
+ else -> {
+ updateSpinnerVisibility(R.id.placeholder_use_customized_split_attributes, View.GONE)
+ updateSpinnerVisibility(R.id.split_rule_use_customized_split_attributes, View.GONE)
+ }
+ }
+ }
+
+ private fun updateSpinnerVisibility(id: Int, visibility: Int) {
+ demoActivityEmbeddingController.splitAttributesCustomizationEnabled
+ .set(visibility == View.VISIBLE)
+ when (id) {
+ R.id.placeholder_use_customized_split_attributes -> {
+ viewBinding.placeholderSplitTypeTextView.visibility = visibility
+ viewBinding.placeholderSplitTypeSpinner.visibility = visibility
+ viewBinding.placeholderLayoutDirectionTextView.visibility = visibility
+ viewBinding.placeholderLayoutDirectionSpinner.visibility = visibility
+ }
+ R.id.split_rule_use_customized_split_attributes -> {
+ viewBinding.splitRuleSplitTypeTextView.visibility = visibility
+ viewBinding.splitRuleSplitTypeSpinner.visibility = visibility
+ viewBinding.splitRuleLayoutDirectionTextView.visibility = visibility
+ viewBinding.splitRuleLayoutDirectionSpinner.visibility = visibility
+ }
+ }
+ }
+
+ override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
+ when (parent?.id) {
+ R.id.placeholder_split_type_spinner, R.id.split_rule_split_type_spinner ->
+ demoActivityEmbeddingController.customizedSplitType =
+ CUSTOMIZED_SPLIT_TYPES_VALUE[position]
+ R.id.placeholder_layout_direction_spinner, R.id.split_rule_layout_direction_spinner ->
+ demoActivityEmbeddingController.customizedLayoutDirection =
+ CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE[position]
+ }
+ splitController.invalidateTopVisibleSplitAttributes()
+ }
+
+ override fun onNothingSelected(view: AdapterView<*>?) {
+ // Auto-generated method stub
+ }
+
+ companion object {
+ internal const val PREFIX_FULLSCREEN_TOGGLE = "fullscreen_toggle_"
+ internal const val PREFIX_PLACEHOLDER = "placeholder_"
+ internal const val EXTRA_LAUNCH_SECONDARY = "launch_secondary"
+ internal const val TAG_CUSTOMIZED_SPLIT_ATTRIBUTES = "customized_split_attributes"
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePlaceholderActivity.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePlaceholderActivity.kt
new file mode 100644
index 0000000..e9fc3b7
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePlaceholderActivity.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import android.graphics.Color
+import android.os.Bundle
+
+class SplitAttributesTogglePlaceholderActivity : SplitAttributesToggleSecondaryActivity() {
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ viewBinding.rootSplitActivityLayout.setBackgroundColor(Color.parseColor("#eeeeee"))
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePrimaryActivity.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePrimaryActivity.kt
new file mode 100644
index 0000000..07f269d
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesTogglePrimaryActivity.kt
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import android.app.Activity
+import android.content.Intent
+import android.graphics.Color
+import android.os.Bundle
+import android.view.View
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
+import androidx.window.core.ExperimentalWindowApi
+import androidx.window.demo.R
+import androidx.window.embedding.ActivityStack
+import androidx.window.embedding.SplitInfo
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.launch
+
+@OptIn(ExperimentalWindowApi::class)
+class SplitAttributesTogglePrimaryActivity : SplitAttributesToggleMainActivity(),
+ View.OnClickListener {
+
+ private lateinit var secondaryActivityIntent: Intent
+ private var activityStacks: Set<ActivityStack> = emptySet()
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ viewBinding.rootSplitActivityLayout.setBackgroundColor(Color.parseColor("#e8f5e9"))
+
+ val isRuntimeApiSupported = activityEmbeddingController
+ .isFinishingActivityStacksSupported()
+
+ secondaryActivityIntent = Intent(
+ this,
+ SplitAttributesToggleSecondaryActivity::class.java
+ )
+
+ if (intent.getBooleanExtra(EXTRA_LAUNCH_SECONDARY, false)) {
+ startActivity(secondaryActivityIntent)
+ // Remove the extra in case the secondary activity is started again when the primary
+ // activity is relaunched.
+ intent.removeExtra(EXTRA_LAUNCH_SECONDARY)
+ }
+
+ // Enable to finish secondary ActivityStacks for primary Activity.
+ viewBinding.finishSecondaryActivitiesDivider.visibility = View.VISIBLE
+ val finishSecondaryActivitiesButton =
+ viewBinding.finishSecondaryActivitiesButton.apply {
+ visibility = View.VISIBLE
+ if (!isRuntimeApiSupported) {
+ isEnabled = false
+ } else {
+ setOnClickListener(this@SplitAttributesTogglePrimaryActivity)
+ }
+ }
+
+ lifecycleScope.launch {
+ // The block passed to repeatOnLifecycle is executed when the lifecycle
+ // is at least STARTED and is cancelled when the lifecycle is STOPPED.
+ // It automatically restarts the block when the lifecycle is STARTED again.
+ lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
+ splitController
+ .splitInfoList(this@SplitAttributesTogglePrimaryActivity)
+ .onEach { updateUiFromRules() }
+ .collect { splitInfoList ->
+ finishSecondaryActivitiesButton.isEnabled = splitInfoList.isNotEmpty()
+ activityStacks = splitInfoList.mapTo(mutableSetOf()) { splitInfo ->
+ splitInfo.getTheOtherActivityStack(
+ this@SplitAttributesTogglePrimaryActivity
+ )
+ }
+ }
+ }
+ }
+ }
+
+ private fun SplitInfo.getTheOtherActivityStack(activity: Activity): ActivityStack =
+ if (activity in primaryActivityStack) {
+ secondaryActivityStack
+ } else {
+ primaryActivityStack
+ }
+
+ override fun onClick(button: View) {
+ super.onClick(button)
+ when (button.id) {
+ R.id.finish_secondary_activities_button -> {
+ applyRules()
+ activityEmbeddingController.finishActivityStacks(activityStacks)
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleSecondaryActivity.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleSecondaryActivity.kt
new file mode 100644
index 0000000..502fb72
--- /dev/null
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitAttributesToggleSecondaryActivity.kt
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.window.demo.embedding
+
+import android.graphics.Color
+import android.os.Bundle
+import android.view.View
+import android.widget.AdapterView
+import android.widget.ArrayAdapter
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.lifecycleScope
+import androidx.lifecycle.repeatOnLifecycle
+import androidx.window.core.ExperimentalWindowApi
+import androidx.window.demo.R
+import androidx.window.demo.databinding.ActivitySplitAttributesToggleSecondaryActivityBinding
+import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP
+import androidx.window.demo.embedding.SplitDeviceStateActivityBase.Companion.TAG_SHOW_FULLSCREEN_IN_PORTRAIT
+import androidx.window.embedding.ActivityEmbeddingController
+import androidx.window.embedding.SplitAttributes.SplitType.Companion.SPLIT_TYPE_EXPAND
+import androidx.window.embedding.SplitInfo
+import androidx.window.embedding.SplitPlaceholderRule
+import androidx.window.embedding.SplitRule
+import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.launch
+
+@OptIn(ExperimentalWindowApi::class)
+open class SplitAttributesToggleSecondaryActivity : SplitAttributesToggleActivityBase(),
+ View.OnClickListener, AdapterView.OnItemSelectedListener {
+
+ protected lateinit var viewBinding: ActivitySplitAttributesToggleSecondaryActivityBinding
+
+ private var lastSplitInfo: SplitInfo? = null
+
+ private val demoActivityEmbeddingController = DemoActivityEmbeddingController.getInstance()
+ private lateinit var activityEmbeddingController: ActivityEmbeddingController
+ private var splitAttributesUpdatesSupported: Boolean = false
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ viewBinding = ActivitySplitAttributesToggleSecondaryActivityBinding.inflate(layoutInflater)
+ setContentView(viewBinding.root)
+ val fullscreenToggleButton = viewBinding.fullscreenToggleButton
+
+ viewBinding.rootSplitActivityLayout.setBackgroundColor(Color.parseColor("#fff3e0"))
+
+ // Disable fullscreen mode in case it's enabled by other activities.
+ demoActivityEmbeddingController.shouldExpandSecondaryContainer.set(false)
+
+ activityEmbeddingController = ActivityEmbeddingController.getInstance(this)
+ val splitAttributesCustomizationEnabled = demoActivityEmbeddingController
+ .splitAttributesCustomizationEnabled.get()
+ splitAttributesUpdatesSupported =
+ splitController.isInvalidatingTopVisibleSplitAttributesSupported() &&
+ splitController.isUpdatingSplitAttributesSupported() &&
+ !splitAttributesCustomizationEnabled
+
+ fullscreenToggleButton.apply {
+ // Disable the toggle fullscreen feature if the device doesn't support runtime
+ // SplitAttributes API or split attributes customization is enabled
+ if (!splitAttributesUpdatesSupported) {
+ isEnabled = false
+ } else {
+ setOnClickListener(this@SplitAttributesToggleSecondaryActivity)
+ }
+ }
+
+ if (demoActivityEmbeddingController.splitAttributesCustomizationEnabled.get()) {
+ val splitTypeSpinner = viewBinding.splitTypeSpinner
+ splitTypeSpinner.visibility = View.VISIBLE
+ splitTypeSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_SPLIT_TYPES_TEXT,
+ )
+ splitTypeSpinner.onItemSelectedListener = this
+
+ val layoutDirectionSpinner = viewBinding.layoutDirectionSpinner
+ layoutDirectionSpinner.visibility = View.VISIBLE
+ layoutDirectionSpinner.adapter = ArrayAdapter(
+ this,
+ android.R.layout.simple_spinner_dropdown_item,
+ CUSTOMIZED_LAYOUT_DIRECTIONS_TEXT,
+ )
+ layoutDirectionSpinner.onItemSelectedListener = this
+ }
+
+ lifecycleScope.launch {
+ // The block passed to repeatOnLifecycle is executed when the lifecycle
+ // is at least STARTED and is cancelled when the lifecycle is STOPPED.
+ // It automatically restarts the block when the lifecycle is STARTED again.
+ lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) {
+ splitController.splitInfoList(this@SplitAttributesToggleSecondaryActivity)
+ .onEach {
+ updateWarningMessages()
+ updateSpinnerFromDemoController()
+ }
+ .collect { splitInfoList ->
+ // Empty split info means this activity doesn't participate any split rule:
+ // neither the secondary activity of the split pair rule nor the placeholder
+ // activity of placeholder rule.
+ fullscreenToggleButton.isEnabled = splitAttributesUpdatesSupported &&
+ splitInfoList.isNotEmpty()
+
+ lastSplitInfo = if (splitInfoList.isEmpty()) {
+ null
+ } else {
+ splitInfoList.last()
+ }
+ }
+ }
+ }
+ }
+
+ private fun updateSpinnerFromDemoController() {
+ viewBinding.splitTypeSpinner.setSelection(
+ CUSTOMIZED_SPLIT_TYPES_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedSplitType
+ )
+ )
+ viewBinding.layoutDirectionSpinner.setSelection(
+ CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE.indexOf(
+ demoActivityEmbeddingController.customizedLayoutDirection
+ )
+ )
+ }
+
+ private fun updateWarningMessages() {
+ val warningMessages = StringBuilder().apply {
+ if (!splitAttributesUpdatesSupported) {
+ append("Toggling fullscreen mode is not supported on this device!\n")
+ }
+ val splitPlaceholderRule = getSplitRule<SplitPlaceholderRule>()
+ if (splitPlaceholderRule?.isSticky == false) {
+ append("Placeholder activity may show again " +
+ "when clicking \"TOGGLE FULLSCREEN MODE\". " +
+ "Clear the placeholder rule and launch Activity again " +
+ "to remove placeholder rule.\n")
+ }
+ }
+ viewBinding.warningMessageTextView.text = warningMessages
+ }
+
+ override fun onClick(button: View) {
+ when (button.id) {
+ R.id.fullscreen_toggle_button -> {
+ val splitRule = getSplitRule<SplitRule>() ?: return
+ // Toggle the fullscreen mode and trigger SplitAttributes calculation if
+ // the splitAttributes is customized.
+ if (splitRule.tag?.contains(TAG_SHOW_FULLSCREEN_IN_PORTRAIT +
+ SUFFIX_AND_HORIZONTAL_LAYOUT_IN_TABLETOP) == true
+ ) {
+ val enableFullscreenMode = DemoActivityEmbeddingController.getInstance()
+ .shouldExpandSecondaryContainer
+ enableFullscreenMode.set(!enableFullscreenMode.get())
+ splitController.invalidateTopVisibleSplitAttributes()
+ } else {
+ // Update the top splitInfo if single default split Attributes is used.
+ splitController.updateSplitAttributes(
+ splitInfo = lastSplitInfo ?: return,
+ splitAttributes = if (
+ lastSplitInfo!!.splitAttributes.splitType == SPLIT_TYPE_EXPAND
+ ) {
+ splitRule.defaultSplitAttributes
+ } else {
+ EXPAND_ATTRS
+ }
+ )
+ }
+ }
+ }
+ }
+
+ override fun onItemSelected(parent: AdapterView<*>?, view: View?, position: Int, id: Long) {
+ when (parent?.id) {
+ R.id.split_type_spinner ->
+ demoActivityEmbeddingController.customizedSplitType =
+ CUSTOMIZED_SPLIT_TYPES_VALUE[position]
+ R.id.layout_direction_spinner ->
+ demoActivityEmbeddingController.customizedLayoutDirection =
+ CUSTOMIZED_LAYOUT_DIRECTIONS_VALUE[position]
+ }
+ splitController.invalidateTopVisibleSplitAttributes()
+ }
+
+ override fun onNothingSelected(view: AdapterView<*>?) {
+ // Auto-generated method stub
+ }
+}
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitDeviceStateActivityBase.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitDeviceStateActivityBase.kt
index e95997c..dbb25ec 100644
--- a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitDeviceStateActivityBase.kt
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitDeviceStateActivityBase.kt
@@ -94,7 +94,8 @@
// launched from the primary.
viewBinding.chooseLayoutTextView.visibility = View.GONE
radioGroup.visibility = View.GONE
- viewBinding.launchActivityToSide.text = "Finish this Activity"
+ viewBinding.launchActivityToSide.text = resources
+ .getString(R.string.finish_this_activity)
}
viewBinding.showHorizontalLayoutInTabletopCheckBox.setOnCheckedChangeListener(this)
@@ -111,7 +112,8 @@
viewBinding.splitByHingeWhenSeparatingRadioButton.isEnabled = false
hideAllSubCheckBoxes()
// Add the error message to notify the SplitAttributesCalculator is not available.
- viewBinding.errorMessageTextView.text = "SplitAttributesCalculator is not supported!"
+ viewBinding.warningMessageTextView.text = resources
+ .getString(R.string.split_attributes_calculator_not_supported)
}
lifecycleScope.launch {
@@ -315,7 +317,7 @@
// Don't update the error message if the callback is not supported.
return@withContext
}
- viewBinding.errorMessageTextView.text =
+ viewBinding.warningMessageTextView.text =
if (suggestToFinishItself) {
"Please finish the activity to try other split configurations."
} else {
diff --git a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitPipActivityBase.kt b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitPipActivityBase.kt
index 4ab221f..7e62662 100644
--- a/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitPipActivityBase.kt
+++ b/window/window-demos/demo/src/main/java/androidx/window/demo/embedding/SplitPipActivityBase.kt
@@ -141,7 +141,7 @@
viewBinding.finishSecondaryWithPrimaryCheckBox.isChecked = false
}
}
- if (button.id == R.id.use_place_holder_check_box) {
+ if (button.id == R.id.use_placeholder_check_box) {
if (isChecked) {
viewBinding.useStickyPlaceHolderCheckBox.isEnabled = true
} else {
diff --git a/window/window-demos/demo/src/main/res/layout/activity_coresdk_window_state_callback_layout.xml b/window/window-demos/demo/src/main/res/layout/activity_coresdk_window_state_callback_layout.xml
index 64c3b56..449fe9a 100644
--- a/window/window-demos/demo/src/main/res/layout/activity_coresdk_window_state_callback_layout.xml
+++ b/window/window-demos/demo/src/main/res/layout/activity_coresdk_window_state_callback_layout.xml
@@ -42,12 +42,40 @@
android:layout_marginBottom="10dp"
android:background="#AAAAAA" />
- <!-- Update from DisplayListener. -->
+ <!-- Update from Application DisplayListener. -->
<androidx.window.demo.coresdk.WindowStateView
- android:id="@+id/display_listener_view"
+ android:id="@+id/application_display_listener_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:title="@string/display_listener_title"/>
+ app:title="@string/application_display_listener_title"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+
+ <!-- Update from Activity DisplayListener. -->
+ <androidx.window.demo.coresdk.WindowStateView
+ android:id="@+id/activity_display_listener_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:title="@string/activity_display_listener_title"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+
+ <!-- Update from Application#onConfigurationChanged. -->
+ <androidx.window.demo.coresdk.WindowStateView
+ android:id="@+id/application_configuration_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:title="@string/application_configuration_title"/>
<View
android:layout_width="match_parent"
diff --git a/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_primary_activity.xml b/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_primary_activity.xml
new file mode 100644
index 0000000..cee9425
--- /dev/null
+++ b/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_primary_activity.xml
@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<ScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root_split_activity_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="10dp">
+
+ <TextView
+ android:id="@+id/activity_pair_split_attributes_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/current_split_attributes"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+
+ <Button
+ android:id="@+id/start_primary_activity_button"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_centerHorizontal="true"
+ android:text="Launch A" />
+
+ <CheckBox
+ android:id="@+id/use_placeholder_check_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Use a placeholder for A" />
+ <CheckBox
+ android:id="@+id/use_sticky_placeholder_check_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Placeholder is sticky"
+ android:visibility="gone"/>
+ <TextView
+ android:id="@+id/placeholder_choose_layout_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Choose the configuration to update the layout:"
+ android:visibility="gone"/>
+
+ <RadioGroup
+ android:id="@+id/placeholder_split_layout_option"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone">
+ <RadioButton
+ android:id="@+id/placeholder_use_default_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_default_split_attributes"
+ android:checked="true"/>
+ <RadioButton
+ android:id="@+id/placeholder_use_folding_aware_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_folding_aware_split_attributes"
+ android:checked="false"/>
+ <RadioButton
+ android:id="@+id/placeholder_use_customized_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_customized_split_attributes"
+ android:checked="false"/>
+
+ <TextView
+ android:id="@+id/placeholder_split_type_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_split_type"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/placeholder_split_type_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ <TextView
+ android:id="@+id/placeholder_layout_direction_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_layout_direction"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/placeholder_layout_direction_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ </RadioGroup>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+
+ <Button
+ android:id="@+id/start_activity_pair_button"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_centerHorizontal="true"
+ android:text="Launch A and B" />
+
+ <CheckBox
+ android:id="@+id/use_split_rule_check_box"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Split A With B" />
+
+ <TextView
+ android:id="@+id/split_rule_choose_layout_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="Choose the configuration to update the layout:"
+ android:visibility="gone"/>
+
+ <RadioGroup
+ android:id="@+id/split_rule_split_layout_option"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone">
+ <RadioButton
+ android:id="@+id/split_rule_use_single_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_default_split_attributes"
+ android:checked="true"/>
+ <RadioButton
+ android:id="@+id/split_rule_use_folding_aware_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_folding_aware_split_attributes"
+ android:checked="false"/>
+ <RadioButton
+ android:id="@+id/split_rule_use_customized_split_attributes"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="@string/use_customized_split_attributes"
+ android:checked="false"/>
+
+ <TextView
+ android:id="@+id/split_rule_split_type_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_split_type"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/split_rule_split_type_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ <TextView
+ android:id="@+id/split_rule_layout_direction_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_layout_direction"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/split_rule_layout_direction_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ </RadioGroup>
+
+ <View
+ android:id="@+id/finish_secondary_activities_divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:visibility="gone"
+ android:background="#AAAAAA" />
+
+ <Button
+ android:id="@+id/finish_secondary_activities_button"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_centerHorizontal="true"
+ android:text="Finish secondary activities"
+ android:visibility="gone"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+ <TextView
+ android:id="@+id/warning_message_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ </LinearLayout>
+</ScrollView>
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_secondary_activity.xml b/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_secondary_activity.xml
new file mode 100644
index 0000000..ba65442
--- /dev/null
+++ b/window/window-demos/demo/src/main/res/layout/activity_split_attributes_toggle_secondary_activity.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ Copyright 2023 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/root_split_activity_layout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:padding="10dp">
+
+ <TextView
+ android:id="@+id/activity_pair_split_attributes_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/current_split_attributes"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+
+ <TextView
+ android:id="@+id/split_type_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_split_type"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/split_type_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+ <TextView
+ android:id="@+id/layout_direction_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/choose_layout_direction"
+ android:visibility="gone"/>
+ <Spinner
+ android:id="@+id/layout_direction_spinner"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+
+ <Button
+ android:id="@+id/fullscreen_toggle_button"
+ android:layout_width="wrap_content"
+ android:layout_height="48dp"
+ android:layout_centerHorizontal="true"
+ android:text="Toggle fullscreen mode"/>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dp"
+ android:layout_marginTop="10dp"
+ android:layout_marginBottom="10dp"
+ android:background="#AAAAAA" />
+ <TextView
+ android:id="@+id/warning_message_text_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/res/layout/activity_split_device_state_layout.xml b/window/window-demos/demo/src/main/res/layout/activity_split_device_state_layout.xml
index dcc8ab4..c71a541 100644
--- a/window/window-demos/demo/src/main/res/layout/activity_split_device_state_layout.xml
+++ b/window/window-demos/demo/src/main/res/layout/activity_split_device_state_layout.xml
@@ -54,7 +54,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:text="Use the default split attributes"
+ android:text="@string/use_default_split_attributes"
android:checked="true"/>
<!-- The fullscreen option group -->
@@ -157,7 +157,7 @@
android:layout_marginBottom="10dp"
android:background="#AAAAAA" />
<TextView
- android:id="@+id/error_message_text_view"
+ android:id="@+id/warning_message_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
diff --git a/window/window-demos/demo/src/main/res/layout/window_state_view.xml b/window/window-demos/demo/src/main/res/layout/window_state_view.xml
index 1944b95..4a03bbd 100644
--- a/window/window-demos/demo/src/main/res/layout/window_state_view.xml
+++ b/window/window-demos/demo/src/main/res/layout/window_state_view.xml
@@ -37,32 +37,60 @@
android:layout_height="wrap_content"
app:configName="@string/timestamp_title"/>
- <!-- Display rotation -->
+ <!-- Application Display rotation -->
<androidx.window.demo.coresdk.WindowStateConfigView
- android:id="@+id/display_rotation_view"
+ android:id="@+id/application_display_rotation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:configName="@string/display_rotation_title"/>
+ app:configName="@string/application_display_rotation_title"/>
- <!-- Display bounds -->
+ <!-- Activity Display rotation -->
<androidx.window.demo.coresdk.WindowStateConfigView
- android:id="@+id/display_bounds_view"
+ android:id="@+id/activity_display_rotation_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:configName="@string/display_bounds_title"/>
+ app:configName="@string/activity_display_rotation_title"/>
- <!-- Previous Display rotation -->
+ <!-- Application Display bounds -->
<androidx.window.demo.coresdk.WindowStateConfigView
- android:id="@+id/prev_display_rotation_view"
+ android:id="@+id/application_display_bounds_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:configName="@string/prev_display_rotation_title"/>
+ app:configName="@string/application_display_bounds_title"/>
- <!-- Previous Display bounds -->
+ <!-- Activity Display bounds -->
<androidx.window.demo.coresdk.WindowStateConfigView
- android:id="@+id/prev_display_bounds_view"
+ android:id="@+id/activity_display_bounds_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- app:configName="@string/prev_display_bounds_title"/>
+ app:configName="@string/activity_display_bounds_title"/>
+
+ <!-- Previous Application Display rotation -->
+ <androidx.window.demo.coresdk.WindowStateConfigView
+ android:id="@+id/prev_application_display_rotation_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:configName="@string/prev_application_display_rotation_title"/>
+
+ <!-- Previous Activity Display rotation -->
+ <androidx.window.demo.coresdk.WindowStateConfigView
+ android:id="@+id/prev_activity_display_rotation_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:configName="@string/prev_activity_display_rotation_title"/>
+
+ <!-- Previous Application Display bounds -->
+ <androidx.window.demo.coresdk.WindowStateConfigView
+ android:id="@+id/prev_application_display_bounds_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:configName="@string/prev_application_display_bounds_title"/>
+
+ <!-- Previous Activity Display bounds -->
+ <androidx.window.demo.coresdk.WindowStateConfigView
+ android:id="@+id/prev_activity_display_bounds_view"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:configName="@string/prev_activity_display_bounds_title"/>
</LinearLayout>
\ No newline at end of file
diff --git a/window/window-demos/demo/src/main/res/values/strings.xml b/window/window-demos/demo/src/main/res/values/strings.xml
index e9ce55f..fb13fde 100644
--- a/window/window-demos/demo/src/main/res/values/strings.xml
+++ b/window/window-demos/demo/src/main/res/values/strings.xml
@@ -59,13 +59,27 @@
<string name="install_samples_2">Install window-demos:demo-second-app to launch activities from a different UID.</string>
<string name="toast_split_not_support">Please enable PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED and ensure device supports splits.</string>
<string name="latest_configuration_title">Latest Configuration</string>
- <string name="display_listener_title">DisplayListener#onDisplayChanged</string>
+ <string name="application_display_listener_title">Application DisplayListener#onDisplayChanged</string>
+ <string name="activity_display_listener_title">Activity DisplayListener#onDisplayChanged</string>
+ <string name="application_configuration_title">Application#onConfigurationChanged</string>
<string name="activity_configuration_title">Activity#onConfigurationChanged</string>
<string name="display_feature_title">WindowInfoTracker</string>
<string name="timestamp_title">Timestamp:</string>
- <string name="display_rotation_title">Display Rotation:</string>
- <string name="display_bounds_title">Display Bounds:</string>
- <string name="prev_display_rotation_title">Previous Display Rotation:</string>
- <string name="prev_display_bounds_title">Previous Display Bounds:</string>
+ <string name="application_display_rotation_title">Application Display Rotation:</string>
+ <string name="activity_display_rotation_title">Activity Display Rotation:</string>
+ <string name="application_display_bounds_title">Application Display Bounds:</string>
+ <string name="activity_display_bounds_title">Activity Display Bounds:</string>
+ <string name="prev_application_display_rotation_title">Previous Application Display Rotation:</string>
+ <string name="prev_activity_display_rotation_title">Previous Activity Display Rotation:</string>
+ <string name="prev_application_display_bounds_title">Previous Application Display Bounds:</string>
+ <string name="prev_activity_display_bounds_title">Previous Activity Display Bounds:</string>
<string name="window_state_placeholder">N/A</string>
+ <string name="split_attributes_calculator_not_supported">SplitAttributesCalculator is not supported!</string>
+ <string name="finish_this_activity">Finish this Activity</string>
+ <string name="use_default_split_attributes">Use default split attributes</string>
+ <string name="use_folding_aware_split_attributes">Show fullscreen in portrait and horizontal split in tabletop</string>
+ <string name="use_customized_split_attributes">Use runtime changed split attributes</string>
+ <string name="choose_split_type">Choose the split type</string>
+ <string name="choose_layout_direction">Choose the layout direction</string>
+ <string name="show_placeholder_warning">Placeholder Activity may show (again) because "Use a placeholder for A is checked". Clear the check box to expand Activity A to fill the task by either clicking "FINISH SECONDARY ACTIVITIES".</string>
</resources>
diff --git a/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt b/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
index 4bda6b5..e664813f 100644
--- a/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
+++ b/window/window/src/androidTest/java/androidx/window/area/WindowAreaControllerImplTest.kt
@@ -83,7 +83,7 @@
val extensionComponent = FakeWindowAreaComponent()
val controller = WindowAreaControllerImpl(
windowAreaComponent = extensionComponent,
- vendorApiLevel = 3
+ vendorApiLevel = FEATURE_VENDOR_API_LEVEL
)
extensionComponent.currentRearDisplayStatus = STATUS_UNAVAILABLE
extensionComponent.currentRearDisplayPresentationStatus = STATUS_UNAVAILABLE
@@ -169,7 +169,7 @@
val extensions = FakeWindowAreaComponent()
val controller = WindowAreaControllerImpl(
windowAreaComponent = extensions,
- vendorApiLevel = 3
+ vendorApiLevel = FEATURE_VENDOR_API_LEVEL
)
extensions.currentRearDisplayStatus = STATUS_AVAILABLE
val callback = TestWindowAreaSessionCallback()
@@ -233,7 +233,7 @@
val extensions = FakeWindowAreaComponent()
val controller = WindowAreaControllerImpl(
windowAreaComponent = extensions,
- vendorApiLevel = 2
+ vendorApiLevel = FEATURE_VENDOR_API_LEVEL
)
extensions.currentRearDisplayStatus = initialState
val callback = TestWindowAreaSessionCallback()
@@ -276,7 +276,7 @@
val extensions = FakeWindowAreaComponent()
val controller = WindowAreaControllerImpl(
windowAreaComponent = extensions,
- vendorApiLevel = 3
+ vendorApiLevel = FEATURE_VENDOR_API_LEVEL
)
extensions.updateRearDisplayStatusListeners(STATUS_AVAILABLE)
@@ -440,7 +440,7 @@
val extensionComponent = FakeWindowAreaComponent()
val controller = WindowAreaControllerImpl(
windowAreaComponent = extensionComponent,
- vendorApiLevel = 3
+ vendorApiLevel = FEATURE_VENDOR_API_LEVEL
)
extensionComponent.updateRearDisplayStatusListeners(STATUS_AVAILABLE)
@@ -650,5 +650,7 @@
companion object {
private const val REAR_FACING_BINDER_DESCRIPTION = "TEST_WINDOW_AREA_REAR_FACING"
+
+ private const val FEATURE_VENDOR_API_LEVEL = 3
}
}
\ No newline at end of file
diff --git a/window/window/src/main/java/androidx/window/embedding/SplitAttributes.kt b/window/window/src/main/java/androidx/window/embedding/SplitAttributes.kt
index 4991be0..d0c39b2 100644
--- a/window/window/src/main/java/androidx/window/embedding/SplitAttributes.kt
+++ b/window/window/src/main/java/androidx/window/embedding/SplitAttributes.kt
@@ -50,9 +50,9 @@
* attributes are parsed as [SplitType], [LayoutDirection], and
* [BackgroundColor], respectively. Note that [SplitType.HingeSplitType]
* is not supported XML format.
- * - Using
- * [SplitAttributesCalculator.computeSplitAttributesForParams] to customize
- * the `SplitAttributes` for a given device and window state.
+ * - Set `SplitAttributes` calculation function by
+ * [SplitController.setSplitAttributesCalculator]
+ * to customize the `SplitAttributes` for a given device and window state.
*
* @see SplitAttributes.SplitType
* @see SplitAttributes.LayoutDirection
diff --git a/window/window/src/main/res/values/attrs.xml b/window/window/src/main/res/values/attrs.xml
index a2880ca..5342612 100644
--- a/window/window/src/main/res/values/attrs.xml
+++ b/window/window/src/main/res/values/attrs.xml
@@ -43,7 +43,7 @@
`ActivityRule`. The suggested usage is to set the tag to be able to differentiate between
different rules in the callbacks.
For example, it can be used to compute the right `SplitAttributes` for the given split rule
- in `SplitAttributesCalculator.computeSplitAttributesForParams`. -->
+ in `SplitAttributes` calculator function. -->
<attr name="tag" format="string" />
<!-- An attribute for Activity Embedding rules.
Background color of Activity Embedding window animation if the animation requires a