Merge "Fix a few edge cases in MultiParagraph get functions" into androidx-main
diff --git a/car/app/app/api/current.txt b/car/app/app/api/current.txt
index 8d416e1..075d7bd 100644
--- a/car/app/app/api/current.txt
+++ b/car/app/app/api/current.txt
@@ -1851,16 +1851,16 @@
@androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(7) public final class MapWithContentTemplate implements androidx.car.app.model.Template {
method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Template getContentTemplate();
method public androidx.car.app.navigation.model.MapController? getMapController();
- method public androidx.car.app.model.Template getTemplate();
}
public static final class MapWithContentTemplate.Builder {
ctor public MapWithContentTemplate.Builder();
method public androidx.car.app.navigation.model.MapWithContentTemplate build();
method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setContentTemplate(androidx.car.app.model.Template);
method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setMapController(androidx.car.app.navigation.model.MapController);
- method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setTemplate(androidx.car.app.model.Template);
}
@androidx.car.app.annotations.CarProtocol public final class MessageInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
@@ -2045,16 +2045,6 @@
}
-package androidx.car.app.navigation.model.constraints {
-
- @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(7) public class ContentTemplateConstraints {
- method public void validateOrThrow(androidx.car.app.model.Template);
- field public static final androidx.car.app.navigation.model.constraints.ContentTemplateConstraints MAP_WITH_CONTENT_TEMPLATE_CONSTRAINTS;
- field public static final androidx.car.app.navigation.model.constraints.ContentTemplateConstraints TAB_CONTENTS_CONSTRAINTS;
- }
-
-}
-
package androidx.car.app.notification {
public final class CarAppExtender implements androidx.core.app.NotificationCompat.Extender {
diff --git a/car/app/app/api/restricted_current.txt b/car/app/app/api/restricted_current.txt
index 8d416e1..075d7bd 100644
--- a/car/app/app/api/restricted_current.txt
+++ b/car/app/app/api/restricted_current.txt
@@ -1851,16 +1851,16 @@
@androidx.car.app.annotations.CarProtocol @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(7) public final class MapWithContentTemplate implements androidx.car.app.model.Template {
method public androidx.car.app.model.ActionStrip? getActionStrip();
+ method public androidx.car.app.model.Template getContentTemplate();
method public androidx.car.app.navigation.model.MapController? getMapController();
- method public androidx.car.app.model.Template getTemplate();
}
public static final class MapWithContentTemplate.Builder {
ctor public MapWithContentTemplate.Builder();
method public androidx.car.app.navigation.model.MapWithContentTemplate build();
method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setActionStrip(androidx.car.app.model.ActionStrip);
+ method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setContentTemplate(androidx.car.app.model.Template);
method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setMapController(androidx.car.app.navigation.model.MapController);
- method public androidx.car.app.navigation.model.MapWithContentTemplate.Builder setTemplate(androidx.car.app.model.Template);
}
@androidx.car.app.annotations.CarProtocol public final class MessageInfo implements androidx.car.app.navigation.model.NavigationTemplate.NavigationInfo {
@@ -2045,16 +2045,6 @@
}
-package androidx.car.app.navigation.model.constraints {
-
- @androidx.car.app.annotations.ExperimentalCarApi @androidx.car.app.annotations.RequiresCarApi(7) public class ContentTemplateConstraints {
- method public void validateOrThrow(androidx.car.app.model.Template);
- field public static final androidx.car.app.navigation.model.constraints.ContentTemplateConstraints MAP_WITH_CONTENT_TEMPLATE_CONSTRAINTS;
- field public static final androidx.car.app.navigation.model.constraints.ContentTemplateConstraints TAB_CONTENTS_CONSTRAINTS;
- }
-
-}
-
package androidx.car.app.notification {
public final class CarAppExtender implements androidx.core.app.NotificationCompat.Extender {
diff --git a/car/app/app/src/main/java/androidx/car/app/navigation/model/MapWithContentTemplate.java b/car/app/app/src/main/java/androidx/car/app/navigation/model/MapWithContentTemplate.java
index 45f4f6a..d3cb830 100644
--- a/car/app/app/src/main/java/androidx/car/app/navigation/model/MapWithContentTemplate.java
+++ b/car/app/app/src/main/java/androidx/car/app/navigation/model/MapWithContentTemplate.java
@@ -47,7 +47,7 @@
@Nullable
private final MapController mMapController;
@NonNull
- private final Template mTemplate;
+ private final Template mContentTemplate;
@Nullable
private final ActionStrip mActionStrip;
@@ -57,14 +57,14 @@
*/
MapWithContentTemplate(Builder builder) {
mMapController = builder.mMapController;
- mTemplate = builder.mTemplate;
+ mContentTemplate = builder.mContentTemplate;
mActionStrip = builder.mActionStrip;
}
/** Constructs an empty instance, used by serialization code. */
private MapWithContentTemplate() {
mMapController = null;
- mTemplate = new Template() {
+ mContentTemplate = new Template() {
@Override
public int hashCode() {
return super.hashCode();
@@ -86,11 +86,11 @@
/**
* Returns the {@link Template} content to display in this template.
*
- * @see Builder#setTemplate(Template)
+ * @see Builder#setContentTemplate(Template)
*/
@NonNull
- public Template getTemplate() {
- return mTemplate;
+ public Template getContentTemplate() {
+ return mContentTemplate;
}
/**
@@ -105,7 +105,7 @@
@Override
public int hashCode() {
- return Objects.hash(mMapController, mTemplate, mActionStrip);
+ return Objects.hash(mMapController, mContentTemplate, mActionStrip);
}
@Override
@@ -118,7 +118,7 @@
}
MapWithContentTemplate otherTemplate = (MapWithContentTemplate) other;
- return Objects.equals(mTemplate, otherTemplate.mTemplate)
+ return Objects.equals(mContentTemplate, otherTemplate.mContentTemplate)
&& Objects.equals(mMapController, otherTemplate.mMapController)
&& Objects.equals(mActionStrip, otherTemplate.mActionStrip);
}
@@ -128,7 +128,7 @@
@Nullable
MapController mMapController;
@NonNull
- Template mTemplate = new Template() {};
+ Template mContentTemplate = new Template() {};
@Nullable
ActionStrip mActionStrip;
@@ -165,8 +165,8 @@
* Sets the content to be displayed on top of the map tiles.
*/
@NonNull
- public Builder setTemplate(@NonNull Template template) {
- mTemplate = requireNonNull(template);
+ public Builder setContentTemplate(@NonNull Template template) {
+ mContentTemplate = requireNonNull(template);
return this;
}
@@ -184,15 +184,14 @@
*
* <h4>Requirements</h4>
*
- * @throws NullPointerException if the {@link Template} is null
- * @throws Exception if the template is not one of the allowed Content types
+ * @throws IllegalArgumentException if the template is not one of the allowed Content types
* see {@link ContentTemplateConstraints#MAP_WITH_CONTENT_TEMPLATE_CONSTRAINTS}
* for the list of supported content templates.
*/
@NonNull
public MapWithContentTemplate build() {
ContentTemplateConstraints.MAP_WITH_CONTENT_TEMPLATE_CONSTRAINTS
- .validateOrThrow(mTemplate);
+ .validateOrThrow(mContentTemplate);
return new MapWithContentTemplate(this);
}
diff --git a/car/app/app/src/main/java/androidx/car/app/navigation/model/constraints/ContentTemplateConstraints.java b/car/app/app/src/main/java/androidx/car/app/navigation/model/constraints/ContentTemplateConstraints.java
index 4ee8883..8b84e57 100644
--- a/car/app/app/src/main/java/androidx/car/app/navigation/model/constraints/ContentTemplateConstraints.java
+++ b/car/app/app/src/main/java/androidx/car/app/navigation/model/constraints/ContentTemplateConstraints.java
@@ -17,6 +17,7 @@
package androidx.car.app.navigation.model.constraints;
import androidx.annotation.NonNull;
+import androidx.annotation.RestrictTo;
import androidx.car.app.annotations.ExperimentalCarApi;
import androidx.car.app.annotations.RequiresCarApi;
import androidx.car.app.model.GridTemplate;
@@ -32,6 +33,7 @@
* Encapsulates the constraints to apply when creating a Content {@link Template} within a parent
* template.
*/
+@RestrictTo(RestrictTo.Scope.LIBRARY)
@ExperimentalCarApi
@RequiresCarApi(7)
public class ContentTemplateConstraints {
diff --git a/car/app/app/src/test/java/androidx/car/app/navigation/model/MapWithContentTemplateTest.java b/car/app/app/src/test/java/androidx/car/app/navigation/model/MapWithContentTemplateTest.java
index 03a9cfb..89f9e7c 100644
--- a/car/app/app/src/test/java/androidx/car/app/navigation/model/MapWithContentTemplateTest.java
+++ b/car/app/app/src/test/java/androidx/car/app/navigation/model/MapWithContentTemplateTest.java
@@ -77,21 +77,21 @@
public void createInstance_unsupportedTemplate_throws() {
assertThrows(IllegalArgumentException.class, () ->
new MapWithContentTemplate.Builder()
- .setTemplate(getListTemplate())
+ .setContentTemplate(getListTemplate())
.build());
}
@Test
public void createInstance_gridTemplate_doesNotThrow() {
new MapWithContentTemplate.Builder()
- .setTemplate(getGridTemplate())
+ .setContentTemplate(getGridTemplate())
.build();
}
@Test
public void createInstance_messageTemplate_doesNotThrow() {
new MapWithContentTemplate.Builder()
- .setTemplate(getMessageTemplate())
+ .setContentTemplate(getMessageTemplate())
.build();
}
@@ -104,10 +104,10 @@
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(actionStrip)
- .setTemplate(getMessageTemplate())
+ .setContentTemplate(getMessageTemplate())
.build();
- assertThat(template.getTemplate()).isEqualTo(getMessageTemplate());
+ assertThat(template.getContentTemplate()).isEqualTo(getMessageTemplate());
assertThat(template.getActionStrip()).isEqualTo(actionStrip);
assertThat(template.getMapController().getMapActionStrip()).isEqualTo(mMapActionStrip);
}
@@ -121,10 +121,10 @@
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(actionStrip)
- .setTemplate(getGridTemplate())
+ .setContentTemplate(getGridTemplate())
.build();
- assertThat(template.getTemplate()).isEqualTo(getGridTemplate());
+ assertThat(template.getContentTemplate()).isEqualTo(getGridTemplate());
assertThat(template.getActionStrip()).isEqualTo(actionStrip);
assertThat(template.getMapController().getMapActionStrip()).isEqualTo(mMapActionStrip);
}
@@ -138,13 +138,13 @@
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(actionStrip)
- .setTemplate(getGridTemplate())
+ .setContentTemplate(getGridTemplate())
.build();
assertThat(template).isNotEqualTo(new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(new ActionStrip.Builder().addAction(Action.APP_ICON).build())
- .setTemplate(getGridTemplate())
+ .setContentTemplate(getGridTemplate())
.build());
}
@@ -157,13 +157,13 @@
MapWithContentTemplate template = new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(actionStrip)
- .setTemplate(getGridTemplate())
+ .setContentTemplate(getGridTemplate())
.build();
assertThat(template).isNotEqualTo(new MapWithContentTemplate.Builder()
.setMapController(mapController)
.setActionStrip(actionStrip)
- .setTemplate(getMessageTemplate())
+ .setContentTemplate(getMessageTemplate())
.build());
}
}
diff --git a/compose/animation/animation-core/lint-baseline.xml b/compose/animation/animation-core/lint-baseline.xml
index b433430..9b3a498 100644
--- a/compose/animation/animation-core/lint-baseline.xml
+++ b/compose/animation/animation-core/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PrimitiveInLambda"
@@ -12,6 +12,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateDpAsState has parameter 'finishedListener' with type Function1<? super Dp, Unit>."
+ errorLine1=" finishedListener: ((Dp) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateSizeAsState has parameter 'finishedListener' with type Function1<? super Size, Unit>."
+ errorLine1=" finishedListener: ((Size) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateOffsetAsState has parameter 'finishedListener' with type Function1<? super Offset, Unit>."
+ errorLine1=" finishedListener: ((Offset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntAsState has parameter 'finishedListener' with type Function1<? super Integer, Unit>."
errorLine1=" finishedListener: ((Int) -> Unit)? = null"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -21,6 +48,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntOffsetAsState has parameter 'finishedListener' with type Function1<? super IntOffset, Unit>."
+ errorLine1=" finishedListener: ((IntOffset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntSizeAsState has parameter 'finishedListener' with type Function1<? super IntSize, Unit>."
+ errorLine1=" finishedListener: ((IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateFloatAsState has parameter 'finishedListener' with type Function1<? super Float, ? extends Unit>."
errorLine1=" finishedListener: ((Float) -> Unit)? = null"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
@@ -30,6 +75,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateDpAsState has parameter 'finishedListener' with type Function1<? super Dp, ? extends Unit>."
+ errorLine1=" finishedListener: ((Dp) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateSizeAsState has parameter 'finishedListener' with type Function1<? super Size, ? extends Unit>."
+ errorLine1=" finishedListener: ((Size) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateOffsetAsState has parameter 'finishedListener' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" finishedListener: ((Offset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntAsState has parameter 'finishedListener' with type Function1<? super Integer, ? extends Unit>."
errorLine1=" finishedListener: ((Int) -> Unit)? = null"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -39,6 +111,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntOffsetAsState has parameter 'finishedListener' with type Function1<? super IntOffset, ? extends Unit>."
+ errorLine1=" finishedListener: ((IntOffset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateIntSizeAsState has parameter 'finishedListener' with type Function1<? super IntSize, ? extends Unit>."
+ errorLine1=" finishedListener: ((IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/AnimateAsState.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method withInfiniteAnimationFrameNanos has parameter 'onFrame' with type Function1<? super Long, ? extends R>."
errorLine1="suspend fun <R> withInfiniteAnimationFrameNanos(onFrame: (frameTimeNanos: Long) -> R): R ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -48,6 +138,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'xInflection' with type Function0<? extends Double>."
+ errorLine1=" fun xInflection() = c1 * exp(r1 * tInflection) + c2 * exp(r2 * tInflection)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/core/SpringEstimation.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animate has parameter 'block' with type Function2<? super Float, ? super Float, Unit>."
errorLine1=" block: (value: Float, velocity: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/compose/animation/animation/integration-tests/animation-demos/lint-baseline.xml b/compose/animation/animation/integration-tests/animation-demos/lint-baseline.xml
index ad509bc..cb4c4c7 100644
--- a/compose/animation/animation/integration-tests/animation-demos/lint-baseline.xml
+++ b/compose/animation/animation/integration-tests/animation-demos/lint-baseline.xml
@@ -1,5 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateSize' with type Function1<? super IntSize, ? extends IntSize>."
+ errorLine1=" val calculateSize: (IntSize) -> IntSize ="
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/animation/demos/lookahead/CraneDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateOffset' with type Function2<? super PlacementScope, ? super IntermediateMeasureScope, ? extends IntOffset>."
+ errorLine1=" val calculateOffset: Placeable.PlacementScope.(IntermediateMeasureScope) -> IntOffset = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/animation/demos/lookahead/CraneDemo.kt"/>
+ </issue>
<issue
id="PrimitiveInLambda"
diff --git a/compose/animation/animation/lint-baseline.xml b/compose/animation/animation/lint-baseline.xml
index dae5876..5f05c6f 100644
--- a/compose/animation/animation/lint-baseline.xml
+++ b/compose/animation/animation/lint-baseline.xml
@@ -1,5 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="cli" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method SizeTransform has parameter 'sizeAnimationSpec' with type Function2<? super IntSize, ? super IntSize, ? extends FiniteAnimationSpec<IntSize>>."
+ errorLine1=" sizeAnimationSpec: (initialSize: IntSize, targetSize: IntSize) -> FiniteAnimationSpec<IntSize> ="
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimatedContent.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor SizeTransformImpl has parameter 'sizeAnimationSpec' with type Function2<? super IntSize, ? super IntSize, ? extends FiniteAnimationSpec<IntSize>>."
+ errorLine1=" (initialSize: IntSize, targetSize: IntSize) -> FiniteAnimationSpec<IntSize>"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimatedContent.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<IntSize, IntSize, FiniteAnimationSpec<IntSize>> of 'getSizeAnimationSpec'."
+ errorLine1=" (initialSize: IntSize, targetSize: IntSize) -> FiniteAnimationSpec<IntSize>"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimatedContent.kt"/>
+ </issue>
<issue
id="PrimitiveInLambda"
@@ -21,6 +48,96 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateContentSize has parameter 'finishedListener' with type Function2<? super IntSize, ? super IntSize, Unit>."
+ errorLine1=" finishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor SizeAnimationModifierElement has parameter 'finishedListener' with type Function2<? super IntSize, ? super IntSize, Unit>."
+ errorLine1=" val finishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)?"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<IntSize, IntSize, Unit> of 'getFinishedListener'."
+ errorLine1=" val finishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)?"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor SizeAnimationModifierNode has parameter 'listener' with type Function2<? super IntSize, ? super IntSize, Unit>."
+ errorLine1=" var listener: ((startSize: IntSize, endSize: IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setListener has parameter '<set-?>' with type Function2<? super IntSize, ? super IntSize, Unit>."
+ errorLine1=" var listener: ((startSize: IntSize, endSize: IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<IntSize, IntSize, Unit> of 'getListener'."
+ errorLine1=" var listener: ((startSize: IntSize, endSize: IntSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/AnimationModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method slideIn has parameter 'initialOffset' with type Function1<? super IntSize, IntOffset>."
+ errorLine1=" initialOffset: (fullSize: IntSize) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method slideOut has parameter 'targetOffset' with type Function1<? super IntSize, IntOffset>."
+ errorLine1=" targetOffset: (fullSize: IntSize) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method expandIn has parameter 'initialSize' with type Function1<? super IntSize, IntSize>."
+ errorLine1=" initialSize: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method shrinkOut has parameter 'targetSize' with type Function1<? super IntSize, IntSize>."
+ errorLine1=" targetSize: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method expandHorizontally has parameter 'initialWidth' with type Function1<? super Integer, Integer>."
errorLine1=" initialWidth: (fullWidth: Int) -> Int = { 0 },"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
@@ -91,4 +208,58 @@
file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
</issue>
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor Slide has parameter 'slideOffset' with type Function1<? super IntSize, IntOffset>."
+ errorLine1=" val slideOffset: (fullSize: IntSize) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<IntSize, IntOffset> of 'getSlideOffset'."
+ errorLine1=" val slideOffset: (fullSize: IntSize) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor ChangeSize has parameter 'size' with type Function1<? super IntSize, IntSize>."
+ errorLine1=" val size: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<IntSize, IntSize> of 'getSize'."
+ errorLine1=" val size: (fullSize: IntSize) -> IntSize = { IntSize(0, 0) },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/EnterExitTransition.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateColorAsState has parameter 'finishedListener' with type Function1<? super Color, Unit>."
+ errorLine1=" finishedListener: ((Color) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/SingleValueAnimation.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateColorAsState has parameter 'finishedListener' with type Function1<? super Color, ? extends Unit>."
+ errorLine1=" finishedListener: ((Color) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/animation/SingleValueAnimation.kt"/>
+ </issue>
+
</issues>
diff --git a/compose/foundation/foundation-layout/lint-baseline.xml b/compose/foundation/foundation-layout/lint-baseline.xml
index ecffddb..2fe2fef 100644
--- a/compose/foundation/foundation-layout/lint-baseline.xml
+++ b/compose/foundation/foundation-layout/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PrimitiveInLambda"
@@ -147,6 +147,69 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method offset has parameter 'offset' with type Function1<? super Density, IntOffset>."
+ errorLine1="fun Modifier.offset(offset: Density.() -> IntOffset) = this then"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method absoluteOffset has parameter 'offset' with type Function1<? super Density, IntOffset>."
+ errorLine1=" offset: Density.() -> IntOffset"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor OffsetPxElement has parameter 'offset' with type Function1<? super Density, IntOffset>."
+ errorLine1=" val offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<Density, IntOffset> of 'getOffset'."
+ errorLine1=" val offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor OffsetPxNode has parameter 'offset' with type Function1<? super Density, IntOffset>."
+ errorLine1=" var offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOffset has parameter '<set-?>' with type Function1<? super Density, IntOffset>."
+ errorLine1=" var offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<Density, IntOffset> of 'getOffset'."
+ errorLine1=" var offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Offset.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method alignBy has parameter 'alignmentLineBlock' with type Function1<? super Measured, Integer>."
errorLine1=" fun Modifier.alignBy(alignmentLineBlock: (Measured) -> Int): Modifier"
errorLine2=" ~~~~~~~~~~~~~~~~~">
@@ -399,6 +462,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor WrapContentElement has parameter 'alignmentCallback' with type Function2<? super IntSize, ? super LayoutDirection, IntOffset>."
+ errorLine1=" private val alignmentCallback: (IntSize, LayoutDirection) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor WrapContentNode has parameter 'alignmentCallback' with type Function2<? super IntSize, ? super LayoutDirection, IntOffset>."
+ errorLine1=" var alignmentCallback: (IntSize, LayoutDirection) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setAlignmentCallback has parameter '<set-?>' with type Function2<? super IntSize, ? super LayoutDirection, IntOffset>."
+ errorLine1=" var alignmentCallback: (IntSize, LayoutDirection) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<IntSize, LayoutDirection, IntOffset> of 'getAlignmentCallback'."
+ errorLine1=" var alignmentCallback: (IntSize, LayoutDirection) -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/layout/Size.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DerivedWidthModifier has parameter 'widthCalc' with type Function3<? super WindowInsets, ? super LayoutDirection, ? super Density, Integer>."
errorLine1=" private val widthCalc: WindowInsets.(LayoutDirection, Density) -> Int"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/compose/foundation/foundation/api/current.txt b/compose/foundation/foundation/api/current.txt
index 795ae73..65a7948 100644
--- a/compose/foundation/foundation/api/current.txt
+++ b/compose/foundation/foundation/api/current.txt
@@ -1428,7 +1428,7 @@
}
@androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public fun interface TextEditFilter {
- method public void filter(androidx.compose.foundation.text2.input.TextFieldCharSequence originalValue, androidx.compose.foundation.text2.input.TextFieldBufferWithSelection valueWithChanges);
+ method public void filter(androidx.compose.foundation.text2.input.TextFieldCharSequence originalValue, androidx.compose.foundation.text2.input.TextFieldBuffer valueWithChanges);
method public default androidx.compose.foundation.text.KeyboardOptions? getKeyboardOptions();
property public default androidx.compose.foundation.text.KeyboardOptions? keyboardOptions;
field public static final androidx.compose.foundation.text2.input.TextEditFilter.Companion Companion;
@@ -1441,37 +1441,32 @@
method @androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public static androidx.compose.foundation.text2.input.TextEditFilter then(androidx.compose.foundation.text2.input.TextEditFilter, androidx.compose.foundation.text2.input.TextEditFilter next, optional androidx.compose.foundation.text.KeyboardOptions? keyboardOptions);
}
- @androidx.compose.foundation.ExperimentalFoundationApi public abstract sealed class TextEditResult {
- }
-
- public final class TextEditResultKt {
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterCharAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterCodepointAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterLastChange(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAtEnd(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeCharAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeCodepointAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeFirstChange(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectAll(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectAllChanges(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectCharsIn(androidx.compose.foundation.text2.input.TextFieldBuffer, long range);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectCodepointsIn(androidx.compose.foundation.text2.input.TextFieldBuffer, long range);
- }
-
- @androidx.compose.foundation.ExperimentalFoundationApi public class TextFieldBuffer implements java.lang.Appendable java.lang.CharSequence {
+ @androidx.compose.foundation.ExperimentalFoundationApi public final class TextFieldBuffer implements java.lang.Appendable java.lang.CharSequence {
method public Appendable append(char char);
method public Appendable append(CharSequence? text);
method public Appendable append(CharSequence? text, int start, int end);
method public operator char get(int index);
- method public final androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList getChanges();
- method public final int getCodepointLength();
+ method public androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList getChanges();
+ method public int getCodepointLength();
method public int getLength();
- method @CallSuper protected void onTextWillChange(long rangeToBeReplaced, int newLength);
- method public final void replace(int start, int end, String text);
+ method public long getSelectionInChars();
+ method public long getSelectionInCodepoints();
+ method public boolean hasSelection();
+ method public void placeCursorAfterCharAt(int index);
+ method public void placeCursorAfterCodepointAt(int index);
+ method public void placeCursorBeforeCharAt(int index);
+ method public void placeCursorBeforeCodepointAt(int index);
+ method public void replace(int start, int end, String text);
+ method public void revertAllChanges();
+ method public void selectCharsIn(long range);
+ method public void selectCodepointsIn(long range);
method public CharSequence subSequence(int startIndex, int endIndex);
property public final androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList changes;
property public final int codepointLength;
+ property public final boolean hasSelection;
property public int length;
+ property public final long selectionInChars;
+ property public final long selectionInCodepoints;
}
@androidx.compose.foundation.ExperimentalFoundationApi public static interface TextFieldBuffer.ChangeList {
@@ -1486,27 +1481,8 @@
method @androidx.compose.foundation.ExperimentalFoundationApi public static inline void forEachChange(androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList, kotlin.jvm.functions.Function2<? super androidx.compose.ui.text.TextRange,? super androidx.compose.ui.text.TextRange,kotlin.Unit> block);
method @androidx.compose.foundation.ExperimentalFoundationApi public static inline void forEachChangeReversed(androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList, kotlin.jvm.functions.Function2<? super androidx.compose.ui.text.TextRange,? super androidx.compose.ui.text.TextRange,kotlin.Unit> block);
method @androidx.compose.foundation.ExperimentalFoundationApi public static void insert(androidx.compose.foundation.text2.input.TextFieldBuffer, int index, String text);
- }
-
- @androidx.compose.foundation.ExperimentalFoundationApi public final class TextFieldBufferWithSelection extends androidx.compose.foundation.text2.input.TextFieldBuffer {
- method public boolean getHasSelection();
- method public long getSelectionInChars();
- method public long getSelectionInCodepoints();
- method public void placeCursorAfterCharAt(int index);
- method public void placeCursorAfterCodepointAt(int index);
- method public void placeCursorAfterLastChange();
- method public void placeCursorAtEnd();
- method public void placeCursorBeforeCharAt(int index);
- method public void placeCursorBeforeCodepointAt(int index);
- method public void placeCursorBeforeFirstChange();
- method public void revertAllChanges();
- method public void selectAll();
- method public void selectAllChanges();
- method public void selectCharsIn(long range);
- method public void selectCodepointsIn(long range);
- property public final boolean hasSelection;
- property public final long selectionInChars;
- property public final long selectionInCodepoints;
+ method @androidx.compose.foundation.ExperimentalFoundationApi public static void placeCursorAtEnd(androidx.compose.foundation.text2.input.TextFieldBuffer);
+ method @androidx.compose.foundation.ExperimentalFoundationApi public static void selectAll(androidx.compose.foundation.text2.input.TextFieldBuffer);
}
@androidx.compose.foundation.ExperimentalFoundationApi public sealed interface TextFieldCharSequence extends java.lang.CharSequence {
@@ -1546,7 +1522,7 @@
@androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public final class TextFieldState {
ctor public TextFieldState(optional String initialText, optional long initialSelectionInChars);
- method public inline void edit(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.text2.input.TextFieldBuffer,? extends androidx.compose.foundation.text2.input.TextEditResult> block);
+ method public inline void edit(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.text2.input.TextFieldBuffer,kotlin.Unit> block);
method public androidx.compose.foundation.text2.input.TextFieldCharSequence getText();
property public final androidx.compose.foundation.text2.input.TextFieldCharSequence text;
}
diff --git a/compose/foundation/foundation/api/restricted_current.txt b/compose/foundation/foundation/api/restricted_current.txt
index a8aba41..a4ffd96 100644
--- a/compose/foundation/foundation/api/restricted_current.txt
+++ b/compose/foundation/foundation/api/restricted_current.txt
@@ -1430,7 +1430,7 @@
}
@androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public fun interface TextEditFilter {
- method public void filter(androidx.compose.foundation.text2.input.TextFieldCharSequence originalValue, androidx.compose.foundation.text2.input.TextFieldBufferWithSelection valueWithChanges);
+ method public void filter(androidx.compose.foundation.text2.input.TextFieldCharSequence originalValue, androidx.compose.foundation.text2.input.TextFieldBuffer valueWithChanges);
method public default androidx.compose.foundation.text.KeyboardOptions? getKeyboardOptions();
property public default androidx.compose.foundation.text.KeyboardOptions? keyboardOptions;
field public static final androidx.compose.foundation.text2.input.TextEditFilter.Companion Companion;
@@ -1443,37 +1443,32 @@
method @androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public static androidx.compose.foundation.text2.input.TextEditFilter then(androidx.compose.foundation.text2.input.TextEditFilter, androidx.compose.foundation.text2.input.TextEditFilter next, optional androidx.compose.foundation.text.KeyboardOptions? keyboardOptions);
}
- @androidx.compose.foundation.ExperimentalFoundationApi public abstract sealed class TextEditResult {
- }
-
- public final class TextEditResultKt {
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterCharAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterCodepointAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAfterLastChange(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorAtEnd(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeCharAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeCodepointAt(androidx.compose.foundation.text2.input.TextFieldBuffer, int index);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult placeCursorBeforeFirstChange(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectAll(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectAllChanges(androidx.compose.foundation.text2.input.TextFieldBuffer);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectCharsIn(androidx.compose.foundation.text2.input.TextFieldBuffer, long range);
- method @androidx.compose.foundation.ExperimentalFoundationApi public static androidx.compose.foundation.text2.input.TextEditResult selectCodepointsIn(androidx.compose.foundation.text2.input.TextFieldBuffer, long range);
- }
-
- @androidx.compose.foundation.ExperimentalFoundationApi public class TextFieldBuffer implements java.lang.Appendable java.lang.CharSequence {
+ @androidx.compose.foundation.ExperimentalFoundationApi public final class TextFieldBuffer implements java.lang.Appendable java.lang.CharSequence {
method public Appendable append(char char);
method public Appendable append(CharSequence? text);
method public Appendable append(CharSequence? text, int start, int end);
method public operator char get(int index);
- method public final androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList getChanges();
- method public final int getCodepointLength();
+ method public androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList getChanges();
+ method public int getCodepointLength();
method public int getLength();
- method @CallSuper protected void onTextWillChange(long rangeToBeReplaced, int newLength);
- method public final void replace(int start, int end, String text);
+ method public long getSelectionInChars();
+ method public long getSelectionInCodepoints();
+ method public boolean hasSelection();
+ method public void placeCursorAfterCharAt(int index);
+ method public void placeCursorAfterCodepointAt(int index);
+ method public void placeCursorBeforeCharAt(int index);
+ method public void placeCursorBeforeCodepointAt(int index);
+ method public void replace(int start, int end, String text);
+ method public void revertAllChanges();
+ method public void selectCharsIn(long range);
+ method public void selectCodepointsIn(long range);
method public CharSequence subSequence(int startIndex, int endIndex);
property public final androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList changes;
property public final int codepointLength;
+ property public final boolean hasSelection;
property public int length;
+ property public final long selectionInChars;
+ property public final long selectionInCodepoints;
}
@androidx.compose.foundation.ExperimentalFoundationApi public static interface TextFieldBuffer.ChangeList {
@@ -1488,27 +1483,8 @@
method @androidx.compose.foundation.ExperimentalFoundationApi public static inline void forEachChange(androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList, kotlin.jvm.functions.Function2<? super androidx.compose.ui.text.TextRange,? super androidx.compose.ui.text.TextRange,kotlin.Unit> block);
method @androidx.compose.foundation.ExperimentalFoundationApi public static inline void forEachChangeReversed(androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList, kotlin.jvm.functions.Function2<? super androidx.compose.ui.text.TextRange,? super androidx.compose.ui.text.TextRange,kotlin.Unit> block);
method @androidx.compose.foundation.ExperimentalFoundationApi public static void insert(androidx.compose.foundation.text2.input.TextFieldBuffer, int index, String text);
- }
-
- @androidx.compose.foundation.ExperimentalFoundationApi public final class TextFieldBufferWithSelection extends androidx.compose.foundation.text2.input.TextFieldBuffer {
- method public boolean getHasSelection();
- method public long getSelectionInChars();
- method public long getSelectionInCodepoints();
- method public void placeCursorAfterCharAt(int index);
- method public void placeCursorAfterCodepointAt(int index);
- method public void placeCursorAfterLastChange();
- method public void placeCursorAtEnd();
- method public void placeCursorBeforeCharAt(int index);
- method public void placeCursorBeforeCodepointAt(int index);
- method public void placeCursorBeforeFirstChange();
- method public void revertAllChanges();
- method public void selectAll();
- method public void selectAllChanges();
- method public void selectCharsIn(long range);
- method public void selectCodepointsIn(long range);
- property public final boolean hasSelection;
- property public final long selectionInChars;
- property public final long selectionInCodepoints;
+ method @androidx.compose.foundation.ExperimentalFoundationApi public static void placeCursorAtEnd(androidx.compose.foundation.text2.input.TextFieldBuffer);
+ method @androidx.compose.foundation.ExperimentalFoundationApi public static void selectAll(androidx.compose.foundation.text2.input.TextFieldBuffer);
}
@androidx.compose.foundation.ExperimentalFoundationApi public sealed interface TextFieldCharSequence extends java.lang.CharSequence {
@@ -1548,8 +1524,8 @@
@androidx.compose.foundation.ExperimentalFoundationApi @androidx.compose.runtime.Stable public final class TextFieldState {
ctor public TextFieldState(optional String initialText, optional long initialSelectionInChars);
- method @kotlin.PublishedApi internal void commitEdit(androidx.compose.foundation.text2.input.TextFieldBuffer newValue, androidx.compose.foundation.text2.input.TextEditResult result);
- method public inline void edit(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.text2.input.TextFieldBuffer,? extends androidx.compose.foundation.text2.input.TextEditResult> block);
+ method @kotlin.PublishedApi internal void commitEdit(androidx.compose.foundation.text2.input.TextFieldBuffer newValue);
+ method public inline void edit(kotlin.jvm.functions.Function1<? super androidx.compose.foundation.text2.input.TextFieldBuffer,kotlin.Unit> block);
method public androidx.compose.foundation.text2.input.TextFieldCharSequence getText();
method @kotlin.PublishedApi internal androidx.compose.foundation.text2.input.TextFieldBuffer startEdit(androidx.compose.foundation.text2.input.TextFieldCharSequence value);
property public final androidx.compose.foundation.text2.input.TextFieldCharSequence text;
diff --git a/compose/foundation/foundation/integration-tests/foundation-demos/lint-baseline.xml b/compose/foundation/foundation/integration-tests/foundation-demos/lint-baseline.xml
index 6ac65e5..07ba822 100644
--- a/compose/foundation/foundation/integration-tests/foundation-demos/lint-baseline.xml
+++ b/compose/foundation/foundation/integration-tests/foundation-demos/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PrimitiveInLambda"
@@ -12,6 +12,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'appendWithColor' with type Function2<? super Color, ? super String, ? extends Unit>."
+ errorLine1=" fun appendWithColor(color: Color, text: String) {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/foundation/demos/text/ComposeTextSelection.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberDragDropState has parameter 'onMove' with type Function2<? super Integer, ? super Integer, Unit>."
errorLine1=" onMove: (Int, Int) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
@@ -93,6 +102,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'isValidDistance' with type Function1<? super Float, ? extends Boolean>."
+ errorLine1=" fun Float.isValidDistance(): Boolean {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/foundation/demos/snapping/RowSnapLayoutInfoProvider.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method RowSnappingMainLayout has parameter 'onLayoutSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" onLayoutSizeChanged: (IntSize) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/foundation/demos/snapping/RowSnappingDemos.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberRowSnapLayoutInfoProvider has parameter 'layoutSize' with type Function1<? super Density, Float>."
errorLine1=" layoutSize: Density.() -> Float"
errorLine2=" ~~~~~~~~~~~~~~~~~~~">
@@ -129,6 +156,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method size has parameter 'size' with type Function0<Size>."
+ errorLine1="private fun Modifier.size(size: () -> Size): Modifier = layout { measurable, _ ->"
+ errorLine2=" ~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/foundation/demos/ScrollableFocusedChildDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor ViewPortBasedSnappingLayoutInfoProvider has parameter 'viewPortStep' with type Function0<Float>."
errorLine1=" private val viewPortStep: () -> Float"
errorLine2=" ~~~~~~~~~~~">
diff --git a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2CustomPinFieldDemo.kt b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2CustomPinFieldDemo.kt
index 2fca5e7..6019627 100644
--- a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2CustomPinFieldDemo.kt
+++ b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2CustomPinFieldDemo.kt
@@ -31,7 +31,7 @@
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text2.BasicTextField2
import androidx.compose.foundation.text2.input.TextEditFilter
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
+import androidx.compose.foundation.text2.input.TextFieldBuffer
import androidx.compose.foundation.text2.input.TextFieldCharSequence
import androidx.compose.foundation.text2.input.TextFieldState
import androidx.compose.foundation.text2.input.clearText
@@ -170,7 +170,7 @@
private object OnlyDigitsFilter : TextEditFilter {
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
if (!valueWithChanges.isDigitsOnly()) {
valueWithChanges.revertAllChanges()
diff --git a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2FilterDemos.kt b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2FilterDemos.kt
index f82f6f9..dd2377b 100644
--- a/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2FilterDemos.kt
+++ b/compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text2/BasicTextField2FilterDemos.kt
@@ -32,7 +32,7 @@
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text2.BasicTextField2
import androidx.compose.foundation.text2.input.TextEditFilter
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
+import androidx.compose.foundation.text2.input.TextFieldBuffer
import androidx.compose.foundation.text2.input.TextFieldCharSequence
import androidx.compose.foundation.text2.input.TextFieldState
import androidx.compose.foundation.text2.input.allCaps
@@ -96,7 +96,7 @@
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
if (!valueWithChanges.isDigitsOnly()) {
valueWithChanges.revertAllChanges()
diff --git a/compose/foundation/foundation/lint-baseline.xml b/compose/foundation/foundation/lint-baseline.xml
index 7204fa6..3e9de82 100644
--- a/compose/foundation/foundation/lint-baseline.xml
+++ b/compose/foundation/foundation/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -120,6 +120,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method platformSpecificTextInputSession has parameter 'onImeAction' with type Function1<? super ImeAction, Unit>."
+ errorLine1=" onImeAction: ((ImeAction) -> Unit)?"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/text2/input/internal/AndroidTextInputSession.android.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BasicSecureTextField has parameter 'onSubmit' with type Function1<? super ImeAction, Boolean>."
+ errorLine1=" onSubmit: ((ImeAction) -> Boolean)? = null,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method KeyboardActions has parameter 'onSubmit' with type Function1<? super ImeAction, Boolean>."
+ errorLine1="private fun KeyboardActions(onSubmit: (ImeAction) -> Boolean) = KeyboardActions("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method ClickableText has parameter 'onClick' with type Function1<? super Integer, Unit>."
errorLine1=" onClick: (Int) -> Unit"
errorLine2=" ~~~~~~~~~~~~~">
@@ -147,6 +174,69 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'getOffset' with type Function1<? super Offset, ? extends Integer>."
+ errorLine1=" fun getOffset(positionOffset: Offset): Int? = layoutResult.value"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/ClickableText.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<ImeAction, Unit> of 'getOnImeActionPerformed'."
+ errorLine1=" val onImeActionPerformed: (ImeAction) -> Unit = { imeAction ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method awaitTouchSlopOrCancellation has parameter 'onTouchSlopReached' with type Function2<? super PointerInputChange, ? super Offset, Unit>."
+ errorLine1=" onTouchSlopReached: (change: PointerInputChange, overSlop: Offset) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectDragGestures has parameter 'onDragStart' with type Function1<? super Offset, Unit>."
+ errorLine1=" onDragStart: (Offset) -> Unit = { },"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectDragGestures has parameter 'onDrag' with type Function2<? super PointerInputChange, ? super Offset, Unit>."
+ errorLine1=" onDrag: (change: PointerInputChange, dragAmount: Offset) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectDragGesturesAfterLongPress has parameter 'onDragStart' with type Function1<? super Offset, Unit>."
+ errorLine1=" onDragStart: (Offset) -> Unit = { },"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectDragGesturesAfterLongPress has parameter 'onDrag' with type Function2<? super PointerInputChange, ? super Offset, Unit>."
+ errorLine1=" onDrag: (change: PointerInputChange, dragAmount: Offset) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method awaitVerticalTouchSlopOrCancellation has parameter 'onTouchSlopReached' with type Function2<? super PointerInputChange, ? super Float, Unit>."
errorLine1=" onTouchSlopReached: (change: PointerInputChange, overSlop: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -165,6 +255,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectVerticalDragGestures has parameter 'onDragStart' with type Function1<? super Offset, Unit>."
+ errorLine1=" onDragStart: (Offset) -> Unit = { },"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectVerticalDragGestures has parameter 'onVerticalDrag' with type Function2<? super PointerInputChange, ? super Float, Unit>."
errorLine1=" onVerticalDrag: (change: PointerInputChange, dragAmount: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -192,6 +291,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectHorizontalDragGestures has parameter 'onDragStart' with type Function1<? super Offset, Unit>."
+ errorLine1=" onDragStart: (Offset) -> Unit = { },"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/DragGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectHorizontalDragGestures has parameter 'onHorizontalDrag' with type Function2<? super PointerInputChange, ? super Float, Unit>."
errorLine1=" onHorizontalDrag: (change: PointerInputChange, dragAmount: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -219,6 +327,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method draggable has parameter 'onDragStarted' with type Function3<? super CoroutineScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" onDragStarted: suspend CoroutineScope.(startedPosition: Offset) -> Unit = {},"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method draggable has parameter 'onDragStopped' with type Function3<? super CoroutineScope, ? super Float, ? super Continuation<? super Unit>, ? extends Object>."
errorLine1=" onDragStopped: suspend CoroutineScope.(velocity: Float) -> Unit = {},"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -228,6 +345,69 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DraggableElement has parameter 'onDragStarted' with type Function3<? super CoroutineScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" private val onDragStarted: suspend CoroutineScope.(startedPosition: Offset) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DraggableElement has parameter 'onDragStopped' with type Function3<? super CoroutineScope, ? super Velocity, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" private val onDragStopped: suspend CoroutineScope.(velocity: Velocity) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DraggableNode has parameter 'onDragStarted' with type Function3<? super CoroutineScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" private var onDragStarted: suspend CoroutineScope.(startedPosition: Offset) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DraggableNode has parameter 'onDragStopped' with type Function3<? super CoroutineScope, ? super Velocity, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" private var onDragStopped: suspend CoroutineScope.(velocity: Velocity) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method update has parameter 'onDragStarted' with type Function3<? super CoroutineScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" onDragStarted: suspend CoroutineScope.(startedPosition: Offset) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method update has parameter 'onDragStopped' with type Function3<? super CoroutineScope, ? super Velocity, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" onDragStopped: suspend CoroutineScope.(velocity: Velocity) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'postPointerSlop' with type Function2<? super PointerInputChange, ? super Offset, ? extends Unit>."
+ errorLine1=" val postPointerSlop = { event: PointerInputChange, offset: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Draggable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'motionFromChange' with type Function1<? super PointerInputChange, ? extends Float>."
errorLine1=" val motionFromChange: (PointerInputChange) -> Float = if (orientation == Orientation.Vertical) {"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -255,6 +435,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor GenericShape has parameter 'builder' with type Function3<? super Path, ? super Size, ? super LayoutDirection, Unit>."
+ errorLine1=" private val builder: Path.(size: Size, layoutDirection: LayoutDirection) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/shape/GenericShape.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method items has parameter 'key' with type Function1<? super Integer, ? extends Object>."
errorLine1=" key: ((index: Int) -> Any)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -336,6 +525,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method LazyGrid has parameter 'slots' with type Function2<? super Density, ? super Constraints, LazyGridSlots>."
+ errorLine1=" slots: Density.(Constraints) -> LazyGridSlots,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measurePolicy = rememberLazyGridMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, MeasureResult> of 'rememberLazyGridMeasurePolicy'."
+ errorLine1="private fun rememberLazyGridMeasurePolicy("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberLazyGridMeasurePolicy has parameter 'slots' with type Function2<? super Density, ? super Constraints, LazyGridSlots>."
+ errorLine1=" slots: Density.(Constraints) -> LazyGridSlots,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'lineOf' with type Function1<? super Integer, ? extends Integer>."
errorLine1=" val lineOf: (Int) -> Int = {"
errorLine2=" ~~~~~~~~~~~~">
@@ -345,6 +570,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, LazyGridSlots> of 'rememberColumnWidthSums'."
+ errorLine1="private fun rememberColumnWidthSums("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, LazyGridSlots> of 'rememberRowHeightSums'."
+ errorLine1="private fun rememberRowHeightSums("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor GridSlotCache has parameter 'calculation' with type Function2<? super Density, ? super Constraints, LazyGridSlots>."
+ errorLine1=" private val calculation: Density.(Constraints) -> LazyGridSlots"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method item has parameter 'span' with type Function1<? super LazyGridItemSpanScope, GridItemSpan>."
errorLine1=" span: (LazyGridItemSpanScope.() -> GridItemSpan)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -534,6 +786,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reverseAware' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun Int.reverseAware() ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/grid/LazyGridMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setPrefetchInfoRetriever$lint_module has parameter '<set-?>' with type Function1<? super Integer, ? extends List<Pair<Integer, Constraints>>>."
errorLine1=" /**"
errorLine2=" ^">
@@ -552,6 +813,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method LazyLayout has parameter 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measurePolicy: LazyLayoutMeasureScope.(Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method LazyLayout has parameter 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measurePolicy: LazyLayoutMeasureScope.(Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/layout/LazyLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<Integer, Object> of 'getKey'."
errorLine1=" val key: ((index: Int) -> Any)? get() = null"
errorLine2=" ~~~">
@@ -597,6 +876,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measurePolicy = rememberPagerMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/pager/LazyLayoutPager.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor PagerLayoutIntervalContent has parameter 'pageContent' with type Function2<? super PagerScope, ? super Integer, Unit>."
errorLine1=" val pageContent: @Composable PagerScope.(page: Int) -> Unit,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -714,6 +1002,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measurePolicy = rememberLazyListMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, MeasureResult> of 'rememberLazyListMeasurePolicy'."
+ errorLine1="private fun rememberLazyListMeasurePolicy("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyList.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor LazyListInterval has parameter 'key' with type Function1<? super Integer, ? extends Object>."
errorLine1=" override val key: ((index: Int) -> Any)?,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -750,6 +1056,60 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reverseAware' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun Int.reverseAware() ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method LazyStaggeredGrid has parameter 'slots' with type Function2<? super Density, ? super Constraints, LazyStaggeredGridSlots>."
+ errorLine1=" slots: Density.(Constraints) -> LazyStaggeredGridSlots,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends LazyStaggeredGridMeasureResult>."
+ errorLine1=" val measurePolicy = rememberStaggeredGridMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, LazyStaggeredGridSlots> of 'rememberColumnSlots'."
+ errorLine1="private fun rememberColumnSlots("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, LazyStaggeredGridSlots> of 'rememberRowSlots'."
+ errorLine1="private fun rememberRowSlots("
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor LazyStaggeredGridSlotCache has parameter 'calculation' with type Function2<? super Density, ? super Constraints, LazyStaggeredGridSlots>."
+ errorLine1=" private val calculation: Density.(Constraints) -> LazyStaggeredGridSlots"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method items has parameter 'key' with type Function1<? super Integer, ? extends Object>."
errorLine1=" key: ((index: Int) -> Any)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -876,6 +1236,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'misalignedStart' with type Function1<? super Integer, ? extends Boolean>."
+ errorLine1=" fun misalignedStart(referenceLane: Int): Boolean {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberStaggeredGridMeasurePolicy has parameter 'slots' with type Function2<? super Density, ? super Constraints, LazyStaggeredGridSlots>."
+ errorLine1=" slots: Density.(Constraints) -> LazyStaggeredGridSlots"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridMeasurePolicy.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, LazyStaggeredGridMeasureResult> of 'rememberStaggeredGridMeasurePolicy'."
+ errorLine1="): LazyLayoutMeasureScope.(Constraints) -> LazyStaggeredGridMeasureResult = remember("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/lazy/staggeredgrid/LazyStaggeredGridMeasurePolicy.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor LazyStaggeredGridScrollPosition has parameter 'fillIndices' with type Function2<? super Integer, ? super Integer, int[]>."
errorLine1=" private val fillIndices: (targetIndex: Int, laneCount: Int) -> IntArray"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -894,6 +1281,114 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type SemanticsPropertyKey<Function0<Offset>> of 'getMagnifierPositionInRoot'."
+ errorLine1="internal val MagnifierPositionInRoot ="
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'sourceCenter' with type Function1<? super Density, Offset>."
+ errorLine1=" sourceCenter: Density.() -> Offset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'magnifierCenter' with type Function1<? super Density, Offset>."
+ errorLine1=" magnifierCenter: Density.() -> Offset = { Offset.Unspecified },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'onSizeChanged' with type Function1<? super DpSize, Unit>."
+ errorLine1=" onSizeChanged: ((DpSize) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'sourceCenter' with type Function1<? super Density, Offset>."
+ errorLine1=" sourceCenter: Density.() -> Offset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'magnifierCenter' with type Function1<? super Density, Offset>."
+ errorLine1=" magnifierCenter: Density.() -> Offset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method magnifier has parameter 'onSizeChanged' with type Function1<? super DpSize, Unit>."
+ errorLine1=" onSizeChanged: ((DpSize) -> Unit)?,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'updatedSourceCenter' with type Function1<? super Density, ? extends Offset>."
+ errorLine1=" val updatedSourceCenter by rememberUpdatedState(sourceCenter)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'updatedMagnifierCenter' with type Function1<? super Density, ? extends Offset>."
+ errorLine1=" val updatedMagnifierCenter by rememberUpdatedState(magnifierCenter)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'updatedOnSizeChanged' with type Function1<? super DpSize, ? extends Unit>."
+ errorLine1=" val updatedOnSizeChanged by rememberUpdatedState(onSizeChanged)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/foundation/Magnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method applyToScroll has parameter 'performScroll' with type Function1<? super Offset, Offset>."
+ errorLine1=" performScroll: (Offset) -> Offset"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method applyToFling has parameter 'performFling' with type Function2<? super Velocity, ? super Continuation<? super Velocity>, ? extends Object>."
+ errorLine1=" suspend fun applyToFling(velocity: Velocity, performFling: suspend (Velocity) -> Velocity)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/Overscroll.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method HorizontalPager has parameter 'key' with type Function1<? super Integer, ? extends Object>."
errorLine1=" key: ((index: Int) -> Any)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -993,6 +1488,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reverseAware' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun Int.reverseAware() ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/pager/PagerMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, MeasureResult> of 'rememberPagerMeasurePolicy'."
+ errorLine1="internal fun rememberPagerMeasurePolicy("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/pager/PagerMeasurePolicy.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberPagerMeasurePolicy has parameter 'pageCount' with type Function0<Integer>."
errorLine1=" pageCount: () -> Int,"
errorLine2=" ~~~~~~~~~">
@@ -1038,6 +1551,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectMoves has parameter 'onMove' with type Function1<? super Offset, Unit>."
+ errorLine1=" onMove: (Offset) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/PointerMoveDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'performScroll' with type Function1<? super Offset, ? extends Offset>."
+ errorLine1=" val performScroll: (Offset) -> Offset = { delta ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'performFling' with type Function2<? super Velocity, ? super Continuation<? super Velocity>, ? extends Object>."
+ errorLine1=" val performFling: suspend (Velocity) -> Velocity = { velocity ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'outerScopeScroll' with type Function1<? super Offset, ? extends Offset>."
+ errorLine1=" val outerScopeScroll: (Offset) -> Offset = { delta ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Scrollable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method ScrollableState has parameter 'consumeScrollDelta' with type Function1<? super Float, Float>."
errorLine1="fun ScrollableState(consumeScrollDelta: (Float) -> Float): ScrollableState {"
errorLine2=" ~~~~~~~~~~~~~~~~">
@@ -1083,6 +1632,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animatedSelectionMagnifier has parameter 'magnifierCenter' with type Function0<Offset>."
+ errorLine1=" magnifierCenter: () -> Offset,"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionMagnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberAnimatedMagnifierPosition has parameter 'targetCalculation' with type Function0<Offset>."
+ errorLine1=" targetCalculation: () -> Offset,"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionMagnifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectNonConsumingTap has parameter 'onTap' with type Function1<? super Offset, Unit>."
+ errorLine1=" private suspend fun PointerInputScope.detectNonConsumingTap(onTap: (Offset) -> Unit) {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'getMagnifierCenter' with type Function2<? super AnchorInfo, ? super Boolean, ? extends Offset>."
+ errorLine1=" fun getMagnifierCenter(anchor: AnchorInfo, isStartHandle: Boolean): Offset {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionManager.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOnPositionChangeCallback$lint_module has parameter '<set-?>' with type Function1<? super Long, Unit>."
errorLine1=" /**"
errorLine2=" ^">
@@ -1101,6 +1686,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOnSelectionUpdateStartCallback$lint_module has parameter '<set-?>' with type Function4<? super Boolean, ? super LayoutCoordinates, ? super Offset, ? super SelectionAdjustment, Unit>."
+ errorLine1=" /**"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionRegistrarImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function4<Boolean, LayoutCoordinates, Offset, SelectionAdjustment, Unit> of 'getOnSelectionUpdateStartCallback$lint_module'."
+ errorLine1=" ((Boolean, LayoutCoordinates, Offset, SelectionAdjustment) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionRegistrarImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOnSelectionUpdateSelectAll$lint_module has parameter '<set-?>' with type Function2<? super Boolean, ? super Long, Unit>."
errorLine1=" /**"
errorLine2=" ^">
@@ -1119,6 +1722,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOnSelectionUpdateCallback$lint_module has parameter '<set-?>' with type Function6<? super Boolean, ? super LayoutCoordinates, ? super Offset, ? super Offset, ? super Boolean, ? super SelectionAdjustment, Boolean>."
+ errorLine1=" /**"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionRegistrarImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function6<Boolean, LayoutCoordinates, Offset, Offset, Boolean, SelectionAdjustment, Boolean> of 'getOnSelectionUpdateCallback$lint_module'."
+ errorLine1=" ((Boolean, LayoutCoordinates, Offset, Offset, Boolean, SelectionAdjustment) -> Boolean)? ="
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/selection/SelectionRegistrarImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setOnSelectableChangeCallback$lint_module has parameter '<set-?>' with type Function1<? super Long, Unit>."
errorLine1=" /**"
errorLine2=" ^">
@@ -1218,6 +1839,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'consumeDelta' with type Function2<? super AnimationScope<Float, AnimationVector1D>, ? super Float, ? extends Unit>."
+ errorLine1=" fun AnimationScope<Float, AnimationVector1D>.consumeDelta(delta: Float) {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/snapping/SnapFlingBehavior.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateSnap has parameter 'onAnimationStep' with type Function1<? super Float, Unit>."
errorLine1=" onAnimationStep: (delta: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -1245,6 +1875,123 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'isValidDistance' with type Function1<? super Float, ? extends Boolean>."
+ errorLine1=" fun Float.isValidDistance(): Boolean {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/snapping/SnapFlingBehavior.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapGestures has parameter 'onDoubleTap' with type Function1<? super Offset, Unit>."
+ errorLine1=" onDoubleTap: ((Offset) -> Unit)? = null,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapGestures has parameter 'onLongPress' with type Function1<? super Offset, Unit>."
+ errorLine1=" onLongPress: ((Offset) -> Unit)? = null,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapGestures has parameter 'onPress' with type Function3<? super PressGestureScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" onPress: suspend PressGestureScope.(Offset) -> Unit = NoPressGesture,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapGestures has parameter 'onTap' with type Function1<? super Offset, Unit>."
+ errorLine1=" onTap: ((Offset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapAndPress has parameter 'onPress' with type Function3<? super PressGestureScope, ? super Offset, ? super Continuation<? super Unit>, ? extends Object>."
+ errorLine1=" onPress: suspend PressGestureScope.(Offset) -> Unit = NoPressGesture,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTapAndPress has parameter 'onTap' with type Function1<? super Offset, Unit>."
+ errorLine1=" onTap: ((Offset) -> Unit)? = null"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/TapGestureDetector.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method platformSpecificTextInputSession has parameter 'onImeAction' with type Function1<? super ImeAction, ? extends Unit>."
+ errorLine1=" onImeAction: ((ImeAction) -> Unit)?"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/TextFieldDecoratorModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method restartInput$lint_module has parameter 'onImeActionPerformed' with type Function1<? super ImeAction, Unit>."
+ errorLine1=" onImeActionPerformed: (ImeAction) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method restartInput$lint_module has parameter 'onImeActionPerformed' with type Function1<? super ImeAction, Unit>."
+ errorLine1=" onImeActionPerformed: (ImeAction) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method onFocus$lint_module has parameter 'onImeActionPerformed' with type Function1<? super ImeAction, Unit>."
+ errorLine1=" onImeActionPerformed: (ImeAction) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method onFocus$lint_module has parameter 'onImeActionPerformed' with type Function1<? super ImeAction, Unit>."
+ errorLine1=" onImeActionPerformed: (ImeAction) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldDelegate.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method tapPressTextFieldModifier has parameter 'onTap' with type Function1<? super Offset, Unit>."
+ errorLine1=" onTap: (Offset) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/text/TextFieldPressGestureFilter.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method detectTransformGestures has parameter 'onGesture' with type Function4<? super Offset, ? super Offset, ? super Float, ? super Float, Unit>."
errorLine1=" onGesture: (centroid: Offset, pan: Offset, zoom: Float, rotation: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -1254,6 +2001,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method transformable has parameter 'canPan' with type Function1<? super Offset, Boolean>."
+ errorLine1=" canPan: (Offset) -> Boolean,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/foundation/gestures/Transformable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method TransformableState has parameter 'onTransformation' with type Function3<? super Float, ? super Offset, ? super Float, Unit>."
errorLine1=" onTransformation: (zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/BasicTextField2Samples.kt b/compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/BasicTextField2Samples.kt
index 507a250..297625e 100644
--- a/compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/BasicTextField2Samples.kt
+++ b/compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/BasicTextField2Samples.kt
@@ -34,7 +34,6 @@
import androidx.compose.foundation.text2.input.forEachTextValue
import androidx.compose.foundation.text2.input.insert
import androidx.compose.foundation.text2.input.rememberTextFieldState
-import androidx.compose.foundation.text2.input.selectCharsIn
import androidx.compose.foundation.text2.input.setTextAndPlaceCursorAtEnd
import androidx.compose.foundation.text2.input.textAsFlow
import androidx.compose.foundation.text2.input.then
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2ImmIntegrationTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2ImmIntegrationTest.kt
index e5d57a0..b0af391 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2ImmIntegrationTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2ImmIntegrationTest.kt
@@ -26,7 +26,7 @@
import androidx.compose.foundation.text2.input.internal.ComposeInputMethodManager
import androidx.compose.foundation.text2.input.internal.setInputConnectionCreatedListenerForTests
import androidx.compose.foundation.text2.input.placeCursorAtEnd
-import androidx.compose.foundation.text2.input.placeCursorBeforeCharAt
+import androidx.compose.foundation.text2.input.selectAll
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2Test.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2Test.kt
index fede0c3..8a919d8 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2Test.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/BasicTextField2Test.kt
@@ -30,8 +30,8 @@
import androidx.compose.foundation.text.TEST_FONT_FAMILY
import androidx.compose.foundation.text.selection.fetchTextLayoutResult
import androidx.compose.foundation.text2.input.TextEditFilter
+import androidx.compose.foundation.text2.input.TextFieldBuffer
import androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
import androidx.compose.foundation.text2.input.TextFieldCharSequence
import androidx.compose.foundation.text2.input.TextFieldState
import androidx.compose.foundation.text2.input.internal.setInputConnectionCreatedListenerForTests
@@ -996,7 +996,7 @@
private object RejectAllTextFilter : TextEditFilter {
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
valueWithChanges.revertAllChanges()
}
@@ -1006,7 +1006,7 @@
TextEditFilter {
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
// Noop
}
diff --git a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/selection/TextFieldCursorHandleTest.kt b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/selection/TextFieldCursorHandleTest.kt
index e5edf63..05c027e 100644
--- a/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/selection/TextFieldCursorHandleTest.kt
+++ b/compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/text2/selection/TextFieldCursorHandleTest.kt
@@ -26,8 +26,6 @@
import androidx.compose.foundation.text2.BasicTextField2
import androidx.compose.foundation.text2.input.TextFieldLineLimits
import androidx.compose.foundation.text2.input.TextFieldState
-import androidx.compose.foundation.text2.input.placeCursorBeforeCharAt
-import androidx.compose.foundation.text2.input.selectCharsIn
import androidx.compose.foundation.text2.input.setTextAndPlaceCursorAtEnd
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.rememberCoroutineScope
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt
index 81e3f041..2ea7e2c 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/BasicSecureTextField.kt
@@ -25,7 +25,7 @@
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.foundation.text2.input.CodepointTransformation
import androidx.compose.foundation.text2.input.TextEditFilter
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
+import androidx.compose.foundation.text2.input.TextFieldBuffer
import androidx.compose.foundation.text2.input.TextFieldCharSequence
import androidx.compose.foundation.text2.input.TextFieldLineLimits
import androidx.compose.foundation.text2.input.TextFieldState
@@ -264,7 +264,7 @@
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
// We only care about a single character insertion changes
val singleCharacterInsertion = valueWithChanges.changes.changeCount == 1 &&
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/AllCapsFilter.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/AllCapsFilter.kt
index ce7b0ad..c087028 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/AllCapsFilter.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/AllCapsFilter.kt
@@ -43,7 +43,7 @@
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
val selection = valueWithChanges.selectionInCodepoints
valueWithChanges.replace(
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/MaxLengthFilter.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/MaxLengthFilter.kt
index f4b8ab3..56d5b9a 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/MaxLengthFilter.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/MaxLengthFilter.kt
@@ -54,7 +54,7 @@
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
val newLength =
if (inCodepoints) valueWithChanges.codepointLength else valueWithChanges.length
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditFilter.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditFilter.kt
index fd6592c..79a4ebd 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditFilter.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditFilter.kt
@@ -52,13 +52,13 @@
* The filter operation. For more information see the documentation on [TextEditFilter].
*
* To reject all changes in [valueWithChanges], call
- * `valueWithChanges.`[revertAllChanges][TextFieldBufferWithSelection.revertAllChanges].
+ * `valueWithChanges.`[revertAllChanges][TextFieldBuffer.revertAllChanges].
*
* @param originalValue The value of the field before the change was performed.
* @param valueWithChanges The value of the field after the change. This value can be changed
* in-place to alter or reject the changes or set the selection.
*/
- fun filter(originalValue: TextFieldCharSequence, valueWithChanges: TextFieldBufferWithSelection)
+ fun filter(originalValue: TextFieldCharSequence, valueWithChanges: TextFieldBuffer)
companion object
}
@@ -89,7 +89,7 @@
override fun filter(
originalValue: TextFieldCharSequence,
- valueWithChanges: TextFieldBufferWithSelection
+ valueWithChanges: TextFieldBuffer
) {
first.filter(originalValue, valueWithChanges)
second.filter(originalValue, valueWithChanges)
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditResult.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditResult.kt
deleted file mode 100644
index 93b0021..0000000
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextEditResult.kt
+++ /dev/null
@@ -1,381 +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.
- */
-
-@file:OptIn(ExperimentalFoundationApi::class)
-
-package androidx.compose.foundation.text2.input
-
-import androidx.compose.foundation.ExperimentalFoundationApi
-import androidx.compose.ui.text.TextRange
-
-/**
- * A value to be returned from [TextFieldState.edit] that specifies where to place the cursor or
- * selection.
- *
- * Predefined results include:
- * - [TextFieldBuffer.placeCursorAtEnd]
- * - [TextFieldBuffer.placeCursorBeforeFirstChange]
- * - [TextFieldBuffer.placeCursorAfterLastChange]
- * - [TextFieldBuffer.placeCursorBeforeCharAt]
- * - [TextFieldBuffer.placeCursorAfterCharAt]
- * - [TextFieldBuffer.placeCursorBeforeCodepointAt]
- * - [TextFieldBuffer.placeCursorAfterCodepointAt]
- * - [TextFieldBuffer.selectAll]
- * - [TextFieldBuffer.selectAllChanges]
- * - [TextFieldBuffer.selectCharsIn]
- * - [TextFieldBuffer.selectCodepointsIn]
- */
-@ExperimentalFoundationApi
-sealed class TextEditResult {
- /**
- * Returns the [TextRange] to set as the new selection. If the selection is collapsed, it will
- * set the cursor instead.
- *
- * @return The new range of the selection, in character offsets.
- */
- internal abstract fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange
-}
-
-/**
- * Returns a [TextEditResult] that places the cursor before the codepoint at the given index.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If [index] is inside an invalid run, the cursor will be placed at the nearest earlier index.
- *
- * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the end
- * of the field, after the last character, pass index [TextFieldBuffer.codepointLength].
- *
- * @param index Codepoint index to place cursor before, should be in range 0 to
- * [TextFieldBuffer.codepointLength], inclusive.
- *
- * @see placeCursorBeforeCharAt
- * @see placeCursorAfterCodepointAt
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorBeforeCodepointAt(index: Int): TextEditResult =
- PlaceCursorResult(this, index, after = false, inCodepoints = true)
-
-/**
- * Returns a [TextEditResult] that places the cursor after the codepoint at the given index.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If [index] is inside an invalid run, the cursor will be placed at the nearest earlier index.
- *
- * To place the cursor at the end of the field, after the last character, pass index
- * [TextFieldBuffer.codepointLength] or call [placeCursorAtEnd].
- *
- * @param index Codepoint index to place cursor after, should be in range 0 (inclusive) to
- * [TextFieldBuffer.codepointLength] (exclusive).
- *
- * @see placeCursorBeforeCharAt
- * @see placeCursorAfterCodepointAt
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorAfterCodepointAt(index: Int): TextEditResult =
- PlaceCursorResult(this, index, after = true, inCodepoints = true)
-
-/**
- * Returns a [TextEditResult] that places the cursor before the character at the given index.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
- * nearest earlier index.
- *
- * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the end
- * of the field, after the last character, pass index [TextFieldBuffer.length] or call
- * [placeCursorAtEnd].
- *
- * @param index Character index to place cursor before, should be in range 0 to
- * [TextFieldBuffer.length], inclusive.
- *
- * @see placeCursorBeforeCodepointAt
- * @see placeCursorAfterCharAt
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorBeforeCharAt(index: Int): TextEditResult =
- PlaceCursorResult(this, index, after = false, inCodepoints = false)
-
-/**
- * Returns a [TextEditResult] that places the cursor after the character at the given index.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
- * nearest earlier index.
- *
- * To place the cursor at the end of the field, after the last character, pass index
- * [TextFieldBuffer.length] or call [placeCursorAtEnd].
- *
- * @param index Character index to place cursor after, should be in range 0 (inclusive) to
- * [TextFieldBuffer.length] (exclusive).
- *
- * @see placeCursorAfterCodepointAt
- * @see placeCursorBeforeCharAt
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorAfterCharAt(index: Int): TextEditResult =
- PlaceCursorResult(this, index, after = true, inCodepoints = false)
-
-/**
- * Returns a [TextEditResult] that places the cursor at the end of the text.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * @see placeCursorAfterLastChange
- * @see TextFieldState.edit
- */
-@Suppress("UnusedReceiverParameter")
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorAtEnd(): TextEditResult = PlaceCursorAtEndResult
-
-/**
- * Returns a [TextEditResult] that places the cursor after the last change made to this
- * [TextFieldBuffer].
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * @see placeCursorAtEnd
- * @see placeCursorBeforeFirstChange
- * @see TextFieldState.edit
- */
-@Suppress("UnusedReceiverParameter")
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorAfterLastChange(): TextEditResult =
- PlaceCursorAfterLastChangeResult
-
-/**
- * Returns a [TextEditResult] that places the cursor before the first change made to this
- * [TextFieldBuffer].
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * @see placeCursorAfterLastChange
- * @see TextFieldState.edit
- */
-@Suppress("UnusedReceiverParameter")
-@ExperimentalFoundationApi
-fun TextFieldBuffer.placeCursorBeforeFirstChange(): TextEditResult =
- PlaceCursorBeforeFirstChangeResult
-
-/**
- * Returns a [TextEditResult] that places the selection around the given [range] in codepoints.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If the start or end of [range] fall inside invalid runs, the values will be adjusted to the
- * nearest earlier and later codepoints, respectively.
- *
- * To place the start of the selection at the beginning of the field, pass index 0. To place the end
- * of the selection at the end of the field, after the last codepoint, pass index
- * [TextFieldBuffer.codepointLength]. Passing a zero-length range is the same as calling
- * [placeCursorBeforeCodepointAt].
- *
- * @param range Codepoint range of the selection, should be in range 0 to
- * [TextFieldBuffer.codepointLength], inclusive.
- *
- * @see selectCharsIn
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.selectCodepointsIn(range: TextRange): TextEditResult =
- SelectRangeResult(this, range, inCodepoints = true)
-
-/**
- * Returns a [TextEditResult] that places the selection around the given [range] in characters.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * If the start or end of [range] fall inside surrogate pairs or other invalid runs, the values will
- * be adjusted to the nearest earlier and later characters, respectively.
- *
- * To place the start of the selection at the beginning of the field, pass index 0. To place the end
- * of the selection at the end of the field, after the last character, pass index
- * [TextFieldBuffer.length]. Passing a zero-length range is the same as calling
- * [placeCursorBeforeCharAt].
- *
- * @param range Codepoint range of the selection, should be in range 0 to
- * [TextFieldBuffer.length], inclusive.
- *
- * @see selectCharsIn
- * @see TextFieldState.edit
- */
-@ExperimentalFoundationApi
-fun TextFieldBuffer.selectCharsIn(range: TextRange): TextEditResult =
- SelectRangeResult(this, range, inCodepoints = false)
-
-/**
- * Returns a [TextEditResult] that places the selection before the first change and after the
- * last change.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * @see selectAll
- * @see TextFieldState.edit
- */
-@Suppress("UnusedReceiverParameter")
-@ExperimentalFoundationApi
-fun TextFieldBuffer.selectAllChanges(): TextEditResult = SelectAllChangesResult
-
-/**
- * Returns a [TextEditResult] that places the selection around all the text.
- *
- * _Note: This method has no side effects – just calling it will not perform the action, its return
- * value must be returned from [TextFieldState.edit]._
- *
- * @see selectAllChanges
- * @see TextFieldState.edit
- */
-@Suppress("UnusedReceiverParameter")
-@ExperimentalFoundationApi
-fun TextFieldBuffer.selectAll(): TextEditResult = SelectAllResult
-
-private object PlaceCursorAtEndResult : TextEditResult() {
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange = TextRange(newValue.length)
-
- override fun toString(): String = "placeCursorAtEnd()"
-}
-
-private object PlaceCursorAfterLastChangeResult : TextEditResult() {
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange {
- return if (newValue.changes.changeCount == 0) {
- oldValue.selectionInChars
- } else {
- TextRange(newValue.changes.getRange(newValue.changes.changeCount).max)
- }
- }
-
- override fun toString(): String = "placeCursorAfterLastChange()"
-}
-
-private object PlaceCursorBeforeFirstChangeResult : TextEditResult() {
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange {
- return if (newValue.changes.changeCount == 0) {
- oldValue.selectionInChars
- } else {
- TextRange(newValue.changes.getRange(0).min)
- }
- }
-
- override fun toString(): String = "placeCursorBeforeFirstChange()"
-}
-
-private object SelectAllChangesResult : TextEditResult() {
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange {
- val changes = newValue.changes
- return if (changes.changeCount == 0) {
- oldValue.selectionInChars
- } else {
- TextRange(
- changes.getRange(0).min,
- changes.getRange(changes.changeCount).max
- )
- }
- }
-
- override fun toString(): String = "selectAllChanges()"
-}
-
-private object SelectAllResult : TextEditResult() {
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange = TextRange(0, newValue.length)
-
- override fun toString(): String = "selectAll()"
-}
-
-private class PlaceCursorResult(
- value: TextFieldBuffer,
- private val rawIndex: Int,
- private val after: Boolean,
- private val inCodepoints: Boolean
-) : TextEditResult() {
-
- init {
- value.requireValidIndex(rawIndex, inCodepoints)
- }
-
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange {
- var index = if (after) rawIndex + 1 else rawIndex
- index = index.coerceAtMost(if (inCodepoints) newValue.codepointLength else newValue.length)
- index = if (inCodepoints) newValue.codepointIndexToCharIndex(index) else index
- return TextRange(index)
- }
-
- override fun toString(): String = buildString {
- append("placeCursor")
- append(if (after) "After" else "Before")
- append(if (inCodepoints) "Codepoint" else "Char")
- append("At(index=$rawIndex)")
- }
-}
-
-private class SelectRangeResult(
- value: TextFieldBuffer,
- private val rawRange: TextRange,
- private val inCodepoints: Boolean
-) : TextEditResult() {
-
- init {
- value.requireValidRange(rawRange, inCodepoints)
- }
-
- override fun calculateSelection(
- oldValue: TextFieldCharSequence,
- newValue: TextFieldBuffer
- ): TextRange = if (inCodepoints) newValue.codepointsToChars(rawRange) else rawRange
-
- override fun toString(): String = buildString {
- append("select")
- append(if (inCodepoints) "Codepoints" else "Chars")
- append("In(range=$rawRange)")
- }
-}
\ No newline at end of file
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBuffer.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBuffer.kt
index 267535c..7c18560 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBuffer.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBuffer.kt
@@ -16,7 +16,6 @@
package androidx.compose.foundation.text2.input
-import androidx.annotation.CallSuper
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.text2.input.TextFieldBuffer.ChangeList
import androidx.compose.foundation.text2.input.internal.ChangeTracker
@@ -25,23 +24,39 @@
/**
* A text buffer that can be edited, similar to [StringBuilder].
*
- * This class provides methods for changing the text, such as [replace], [append], [insert], and
- * [delete].
+ * This class provides methods for changing the text, such as:
+ * - [replace]
+ * - [append]
+ * - [insert]
+ * - [delete]
+ *
+ * This class also stores and tracks the cursor position or selection range. The cursor position is
+ * just a selection range with zero length. The cursor and selection can be changed using methods
+ * such as:
+ * - [placeCursorAfterCodepointAt]
+ * - [placeCursorAfterCharAt]
+ * - [placeCursorBeforeCodepointAt]
+ * - [placeCursorBeforeCharAt]
+ * - [placeCursorAtEnd]
+ * - [selectAll]
*
* To get one of these, and for usage samples, see [TextFieldState.edit]. Every change to the buffer
* is tracked in a [ChangeList] which you can access via the [changes] property.
- *
- * [TextFieldBufferWithSelection] is a special type of buffer that has an associated cursor position
- * or selection range.
*/
@ExperimentalFoundationApi
-open class TextFieldBuffer internal constructor(
- internal val value: TextFieldCharSequence,
- initialChanges: ChangeTracker? = null
+class TextFieldBuffer internal constructor(
+ initialValue: TextFieldCharSequence,
+ initialChanges: ChangeTracker? = null,
+ /**
+ * The value reverted to when [revertAllChanges] is called. This is not necessarily
+ * [initialValue] since the initial value may have already have had some intermediate changes
+ * applied to it.
+ */
+ private val sourceValue: TextFieldCharSequence = initialValue,
) : CharSequence,
Appendable {
- private val buffer = StringBuffer(value)
+ private val buffer = StringBuffer(initialValue)
/**
* Lazily-allocated [ChangeTracker], initialized on the first text change.
@@ -71,6 +86,32 @@
val changes: ChangeList get() = changeTracker ?: EmptyChangeList
/**
+ * True if the selection range has non-zero length. If this is false, then the selection
+ * represents the cursor.
+ *
+ * @see selectionInChars
+ */
+ @get:JvmName("hasSelection")
+ val hasSelection: Boolean
+ get() = !selectionInChars.collapsed
+
+ /**
+ * The selected range of characters.
+ *
+ * @see selectionInCodepoints
+ */
+ var selectionInChars: TextRange = initialValue.selectionInChars
+ private set
+
+ /**
+ * The selected range of codepoints.
+ *
+ * @see selectionInChars
+ */
+ val selectionInCodepoints: TextRange
+ get() = charsToCodepoints(selectionInChars)
+
+ /**
* Replaces the text between [start] (inclusive) and [end] (exclusive) in this value with
* [text], and records the change in [changes].
*
@@ -116,10 +157,48 @@
* @param rangeToBeReplaced The range in the current text that's about to be replaced.
* @param newLength The length of the replacement.
*/
- @CallSuper
- protected open fun onTextWillChange(rangeToBeReplaced: TextRange, newLength: Int) {
+ private fun onTextWillChange(rangeToBeReplaced: TextRange, newLength: Int) {
(changeTracker ?: ChangeTracker().also { changeTracker = it })
.trackChange(rangeToBeReplaced, newLength)
+
+ // Adjust selection.
+ val start = rangeToBeReplaced.min
+ val end = rangeToBeReplaced.max
+ var selStart = selectionInChars.min
+ var selEnd = selectionInChars.max
+
+ if (selEnd < start) {
+ // The entire selection is before the insertion point – we don't have to adjust the
+ // mark at all, so skip the math.
+ return
+ }
+
+ if (selStart <= start && end <= selEnd) {
+ // The insertion is entirely inside the selection, move the end only.
+ val diff = newLength - (end - start)
+ // Preserve "cursorness".
+ if (selStart == selEnd) {
+ selStart += diff
+ }
+ selEnd += diff
+ } else if (selStart > start && selEnd < end) {
+ // Selection is entirely inside replacement, move it to the end.
+ selStart = start + newLength
+ selEnd = start + newLength
+ } else if (selStart >= end) {
+ // The entire selection is after the insertion, so shift everything forward.
+ val diff = newLength - (end - start)
+ selStart += diff
+ selEnd += diff
+ } else if (start < selStart) {
+ // Insertion is around start of selection, truncate start of selection.
+ selStart = start + newLength
+ selEnd += newLength - (end - start)
+ } else {
+ // Insertion is around end of selection, truncate end of selection.
+ selEnd = start
+ }
+ selectionInChars = TextRange(selStart, selEnd)
}
override operator fun get(index: Int): Char = buffer[index]
@@ -129,31 +208,177 @@
override fun toString(): String = buffer.toString()
- internal fun clearChangeList() {
+ private fun clearChangeList() {
changeTracker?.clearChanges()
}
+ /**
+ * Revert all changes made to this value since it was created.
+ *
+ * After calling this method, this object will be in the same state it was when it was initially
+ * created, and [changes] will be empty.
+ */
+ fun revertAllChanges() {
+ replace(0, length, sourceValue.toString())
+ selectionInChars = sourceValue.selectionInChars
+ clearChangeList()
+ }
+
+ /**
+ * Places the cursor before the codepoint at the given index.
+ *
+ * If [index] is inside an invalid run, the cursor will be placed at the nearest earlier index.
+ *
+ * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the
+ * end of the field, after the last character, pass index
+ * [TextFieldBuffer.codepointLength] or call [placeCursorAtEnd].
+ *
+ * @param index Codepoint index to place cursor before, should be in range 0 to
+ * [TextFieldBuffer.codepointLength], inclusive.
+ *
+ * @see placeCursorBeforeCharAt
+ * @see placeCursorAfterCodepointAt
+ */
+ fun placeCursorBeforeCodepointAt(index: Int) {
+ requireValidIndex(index, startExclusive = true, endExclusive = false, inCodepoints = true)
+ val charIndex = codepointIndexToCharIndex(index)
+ selectionInChars = TextRange(charIndex)
+ }
+
+ /**
+ * Places the cursor before the character at the given index.
+ *
+ * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
+ * nearest earlier index.
+ *
+ * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the
+ * end of the field, after the last character, pass index [TextFieldBuffer.length] or call
+ * [placeCursorAtEnd].
+ *
+ * @param index Character index to place cursor before, should be in range 0 to
+ * [TextFieldBuffer.length], inclusive.
+ *
+ * @see placeCursorBeforeCodepointAt
+ * @see placeCursorAfterCharAt
+ */
+ fun placeCursorBeforeCharAt(index: Int) {
+ requireValidIndex(index, startExclusive = true, endExclusive = false, inCodepoints = false)
+ selectionInChars = TextRange(index)
+ }
+
+ /**
+ * Places the cursor after the codepoint at the given index.
+ *
+ * If [index] is inside an invalid run, the cursor will be placed at the nearest later index.
+ *
+ * To place the cursor at the end of the field, after the last character, pass index
+ * [TextFieldBuffer.codepointLength] or call [placeCursorAtEnd].
+ *
+ * @param index Codepoint index to place cursor after, should be in range 0 (inclusive) to
+ * [TextFieldBuffer.codepointLength] (exclusive).
+ *
+ * @see placeCursorAfterCharAt
+ * @see placeCursorBeforeCodepointAt
+ */
+ fun placeCursorAfterCodepointAt(index: Int) {
+ requireValidIndex(index, startExclusive = false, endExclusive = true, inCodepoints = true)
+ val charIndex = codepointIndexToCharIndex((index + 1).coerceAtMost(codepointLength))
+ selectionInChars = TextRange(charIndex)
+ }
+
+ /**
+ * Places the cursor after the character at the given index.
+ *
+ * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
+ * nearest later index.
+ *
+ * To place the cursor at the end of the field, after the last character, pass index
+ * [TextFieldBuffer.length] or call [placeCursorAtEnd].
+ *
+ * @param index Character index to place cursor after, should be in range 0 (inclusive) to
+ * [TextFieldBuffer.length] (exclusive).
+ *
+ * @see placeCursorAfterCodepointAt
+ * @see placeCursorBeforeCharAt
+ */
+ fun placeCursorAfterCharAt(index: Int) {
+ requireValidIndex(index, startExclusive = false, endExclusive = true, inCodepoints = false)
+ selectionInChars = TextRange((index + 1).coerceAtMost(length))
+ }
+
+ /**
+ * Places the selection around the given [range] in codepoints.
+ *
+ * If the start or end of [range] fall inside invalid runs, the values will be adjusted to the
+ * nearest earlier and later codepoints, respectively.
+ *
+ * To place the start of the selection at the beginning of the field, pass index 0. To place the
+ * end of the selection at the end of the field, after the last codepoint, pass index
+ * [TextFieldBuffer.codepointLength]. Passing a zero-length range is the same as calling
+ * [placeCursorBeforeCodepointAt].
+ *
+ * @param range Codepoint range of the selection, should be in range 0 to
+ * [TextFieldBuffer.codepointLength], inclusive.
+ *
+ * @see selectCharsIn
+ */
+ fun selectCodepointsIn(range: TextRange) {
+ requireValidRange(range, inCodepoints = true)
+ selectionInChars = codepointsToChars(range)
+ }
+
+ /**
+ * Places the selection around the given [range] in characters.
+ *
+ * If the start or end of [range] fall inside surrogate pairs or other invalid runs, the values will
+ * be adjusted to the nearest earlier and later characters, respectively.
+ *
+ * To place the start of the selection at the beginning of the field, pass index 0. To place the end
+ * of the selection at the end of the field, after the last character, pass index
+ * [TextFieldBuffer.length]. Passing a zero-length range is the same as calling
+ * [placeCursorBeforeCharAt].
+ *
+ * @param range Codepoint range of the selection, should be in range 0 to
+ * [TextFieldBuffer.length], inclusive.
+ *
+ * @see selectCodepointsIn
+ */
+ fun selectCharsIn(range: TextRange) {
+ requireValidRange(range, inCodepoints = false)
+ selectionInChars = range
+ }
+
internal fun toTextFieldCharSequence(
- selection: TextRange,
composition: TextRange? = null
): TextFieldCharSequence = TextFieldCharSequence(
buffer.toString(),
- selection = selection,
+ selection = selectionInChars,
composition = composition
)
- internal fun requireValidIndex(index: Int, inCodepoints: Boolean) {
+ private fun requireValidIndex(
+ index: Int,
+ startExclusive: Boolean,
+ endExclusive: Boolean,
+ inCodepoints: Boolean
+ ) {
+ var start = if (startExclusive) 0 else -1
+ var end = if (endExclusive) length else length + 1
+
// The "units" of the range in the error message should match the units passed in.
// If the input was in codepoint indices, the output should be in codepoint indices.
- val validRange = TextRange(0, length)
- .let { if (inCodepoints) charsToCodepoints(it) else it }
- require(index in validRange) {
+ if (inCodepoints) {
+ start = charIndexToCodepointIndex(start)
+ end = charIndexToCodepointIndex(end)
+ }
+
+ require(index in start until end) {
val unit = if (inCodepoints) "codepoints" else "chars"
- "Expected $index to be in $validRange ($unit)"
+ "Expected $index to be in [$start, $end) $unit"
}
}
- internal fun requireValidRange(range: TextRange, inCodepoints: Boolean) {
+ private fun requireValidRange(range: TextRange, inCodepoints: Boolean) {
// The "units" of the range in the error message should match the units passed in.
// If the input was in codepoint indices, the output should be in codepoint indices.
val validRange = TextRange(0, length)
@@ -164,21 +389,18 @@
}
}
- internal fun toTextFieldCharSequence(selection: TextRange): TextFieldCharSequence =
- TextFieldCharSequence(buffer.toString(), selection = selection)
-
- internal fun codepointsToChars(range: TextRange): TextRange = TextRange(
+ private fun codepointsToChars(range: TextRange): TextRange = TextRange(
codepointIndexToCharIndex(range.start),
codepointIndexToCharIndex(range.end)
)
- internal fun charsToCodepoints(range: TextRange): TextRange = TextRange(
+ private fun charsToCodepoints(range: TextRange): TextRange = TextRange(
charIndexToCodepointIndex(range.start),
charIndexToCodepointIndex(range.end),
)
// TODO Support actual codepoints.
- internal fun codepointIndexToCharIndex(index: Int): Int = index
+ private fun codepointIndexToCharIndex(index: Int): Int = index
private fun charIndexToCodepointIndex(index: Int): Int = index
/**
@@ -246,6 +468,22 @@
}
/**
+ * Places the cursor at the end of the text.
+ */
+@ExperimentalFoundationApi
+fun TextFieldBuffer.placeCursorAtEnd() {
+ placeCursorBeforeCharAt(length)
+}
+
+/**
+ * Places the selection around all the text.
+ */
+@ExperimentalFoundationApi
+fun TextFieldBuffer.selectAll() {
+ selectCharsIn(TextRange(0, length))
+}
+
+/**
* Iterates over all the changes in this [ChangeList].
*
* Changes are iterated by index, so any changes made by [block] after the current one will be
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelection.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelection.kt
deleted file mode 100644
index 56c698e..0000000
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelection.kt
+++ /dev/null
@@ -1,299 +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.compose.foundation.text2.input
-
-import androidx.compose.foundation.ExperimentalFoundationApi
-import androidx.compose.foundation.text2.input.internal.ChangeTracker
-import androidx.compose.ui.text.TextRange
-
-/**
- * A [TextFieldBuffer] that also provides both read and write access to the current selection,
- * used by [TextEditFilter.filter].
- */
-@ExperimentalFoundationApi
-class TextFieldBufferWithSelection internal constructor(
- value: TextFieldCharSequence,
- /** The value reverted to when [revertAllChanges] is called. */
- private val sourceValue: TextFieldCharSequence = TextFieldCharSequence(),
- initialChanges: ChangeTracker? = null
-) : TextFieldBuffer(value, initialChanges) {
-
- /**
- * True if the selection range has non-zero length. If this is false, then the selection
- * represents the cursor.
- *
- * @see selectionInChars
- */
- val hasSelection: Boolean
- get() = !selectionInChars.collapsed
-
- /**
- * The selected range of characters.
- *
- * @see selectionInCodepoints
- */
- var selectionInChars: TextRange = value.selectionInChars
- private set
-
- /**
- * The selected range of codepoints.
- *
- * @see selectionInChars
- */
- val selectionInCodepoints: TextRange
- get() = charsToCodepoints(selectionInChars)
-
- /**
- * Places the cursor before the codepoint at the given index.
- *
- * If [index] is inside an invalid run, the cursor will be placed at the nearest earlier index.
- *
- * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the
- * end of the field, after the last character, pass index
- * [TextFieldBuffer.codepointLength] or call [placeCursorAtEnd].
- *
- * @param index Codepoint index to place cursor before, should be in range 0 to
- * [TextFieldBuffer.codepointLength], inclusive.
- *
- * @see placeCursorBeforeCharAt
- * @see placeCursorAfterCodepointAt
- */
- fun placeCursorBeforeCodepointAt(index: Int) {
- requireValidIndex(index, inCodepoints = true)
- val charIndex = codepointIndexToCharIndex(index)
- selectionInChars = TextRange(charIndex)
- }
-
- /**
- * Places the cursor before the character at the given index.
- *
- * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
- * nearest earlier index.
- *
- * To place the cursor at the beginning of the field, pass index 0. To place the cursor at the
- * end of the field, after the last character, pass index [TextFieldBuffer.length] or call
- * [placeCursorAtEnd].
- *
- * @param index Character index to place cursor before, should be in range 0 to
- * [TextFieldBuffer.length], inclusive.
- *
- * @see placeCursorBeforeCodepointAt
- * @see placeCursorAfterCharAt
- */
- fun placeCursorBeforeCharAt(index: Int) {
- requireValidIndex(index, inCodepoints = false)
- selectionInChars = TextRange(index)
- }
-
- /**
- * Places the cursor after the codepoint at the given index.
- *
- * If [index] is inside an invalid run, the cursor will be placed at the nearest later index.
- *
- * To place the cursor at the end of the field, after the last character, pass index
- * [TextFieldBuffer.codepointLength] or call [placeCursorAtEnd].
- *
- * @param index Codepoint index to place cursor after, should be in range 0 (inclusive) to
- * [TextFieldBuffer.codepointLength] (exclusive).
- *
- * @see placeCursorAfterCharAt
- * @see placeCursorBeforeCodepointAt
- */
- fun placeCursorAfterCodepointAt(index: Int) {
- requireValidIndex(index, inCodepoints = true)
- val charIndex = codepointIndexToCharIndex((index + 1).coerceAtMost(codepointLength))
- selectionInChars = TextRange(charIndex)
- }
-
- /**
- * Places the cursor after the character at the given index.
- *
- * If [index] is inside a surrogate pair or other invalid run, the cursor will be placed at the
- * nearest later index.
- *
- * To place the cursor at the end of the field, after the last character, pass index
- * [TextFieldBuffer.length] or call [placeCursorAtEnd].
- *
- * @param index Character index to place cursor after, should be in range 0 (inclusive) to
- * [TextFieldBuffer.length] (exclusive).
- *
- * @see placeCursorAfterCodepointAt
- * @see placeCursorBeforeCharAt
- */
- fun placeCursorAfterCharAt(index: Int) {
- requireValidIndex(index, inCodepoints = false)
- selectionInChars = TextRange((index + 1).coerceAtMost(length))
- }
-
- /**
- * Places the cursor at the end of the text.
- *
- * @see placeCursorBeforeFirstChange
- * @see placeCursorAfterLastChange
- */
- fun placeCursorAtEnd() {
- selectionInChars = TextRange(length)
- }
-
- /**
- * Places the cursor after the last change made to this [TextFieldBufferWithSelection].
- *
- * @see placeCursorAtEnd
- * @see placeCursorBeforeFirstChange
- */
- fun placeCursorAfterLastChange() {
- if (changes.changeCount > 0) {
- placeCursorBeforeCharAt(changes.getRange(changes.changeCount).max)
- }
- }
-
- /**
- * Places the cursor before the first change made to this [TextFieldBufferWithSelection].
- *
- * @see placeCursorAfterLastChange
- */
- fun placeCursorBeforeFirstChange() {
- if (changes.changeCount > 0) {
- placeCursorBeforeCharAt(changes.getRange(0).min)
- }
- }
-
- /**
- * Places the selection around the given [range] in codepoints.
- *
- * If the start or end of [range] fall inside invalid runs, the values will be adjusted to the
- * nearest earlier and later codepoints, respectively.
- *
- * To place the start of the selection at the beginning of the field, pass index 0. To place the
- * end of the selection at the end of the field, after the last codepoint, pass index
- * [TextFieldBuffer.codepointLength]. Passing a zero-length range is the same as calling
- * [placeCursorBeforeCodepointAt].
- *
- * @param range Codepoint range of the selection, should be in range 0 to
- * [TextFieldBuffer.codepointLength], inclusive.
- *
- * @see selectCharsIn
- */
- fun selectCodepointsIn(range: TextRange) {
- requireValidRange(range, inCodepoints = true)
- selectionInChars = codepointsToChars(range)
- }
-
- /**
- * Places the selection around the given [range] in characters.
- *
- * If the start or end of [range] fall inside surrogate pairs or other invalid runs, the values will
- * be adjusted to the nearest earlier and later characters, respectively.
- *
- * To place the start of the selection at the beginning of the field, pass index 0. To place the end
- * of the selection at the end of the field, after the last character, pass index
- * [TextFieldBuffer.length]. Passing a zero-length range is the same as calling
- * [placeCursorBeforeCharAt].
- *
- * @param range Codepoint range of the selection, should be in range 0 to
- * [TextFieldBuffer.length], inclusive.
- *
- * @see selectCodepointsIn
- */
- fun selectCharsIn(range: TextRange) {
- requireValidRange(range, inCodepoints = false)
- selectionInChars = range
- }
-
- /**
- * Places the selection around all the text.
- *
- * @see selectAllChanges
- */
- fun selectAll() {
- selectionInChars = TextRange(0, length)
- }
-
- /**
- * Places the selection before the first change and after the last change.
- *
- * @see selectAll
- */
- fun selectAllChanges() {
- if (changes.changeCount > 0) {
- selectCharsIn(
- TextRange(
- changes.getRange(0).min,
- changes.getRange(changes.changeCount).max
- )
- )
- }
- }
-
- /**
- * Revert all changes made to this value since it was created.
- *
- * After calling this method, this object will be in the same state it was when it was initially
- * created, and [changes] will be empty.
- */
- fun revertAllChanges() {
- replace(0, length, sourceValue.toString())
- selectionInChars = sourceValue.selectionInChars
- clearChangeList()
- }
-
- override fun onTextWillChange(rangeToBeReplaced: TextRange, newLength: Int) {
- super.onTextWillChange(rangeToBeReplaced, newLength)
-
- // Adjust selection.
- val start = rangeToBeReplaced.min
- val end = rangeToBeReplaced.max
- var selStart = selectionInChars.min
- var selEnd = selectionInChars.max
-
- if (selEnd < start) {
- // The entire selection is before the insertion point – we don't have to adjust the
- // mark at all, so skip the math.
- return
- }
-
- if (selStart <= start && end <= selEnd) {
- // The insertion is entirely inside the selection, move the end only.
- val diff = newLength - (end - start)
- // Preserve "cursorness".
- if (selStart == selEnd) {
- selStart += diff
- }
- selEnd += diff
- } else if (selStart > start && selEnd < end) {
- // Selection is entirely inside replacement, move it to the end.
- selStart = start + newLength
- selEnd = start + newLength
- } else if (selStart >= end) {
- // The entire selection is after the insertion, so shift everything forward.
- val diff = newLength - (end - start)
- selStart += diff
- selEnd += diff
- } else if (start < selStart) {
- // Insertion is around start of selection, truncate start of selection.
- selStart = start + newLength
- selEnd += newLength - (end - start)
- } else {
- // Insertion is around end of selection, truncate end of selection.
- selEnd = start
- }
- selectionInChars = TextRange(selStart, selEnd)
- }
-
- internal fun toTextFieldCharSequence(composition: TextRange? = null): TextFieldCharSequence =
- toTextFieldCharSequence(selection = selectionInChars, composition = composition)
-}
\ No newline at end of file
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldState.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldState.kt
index 9417a766..5a3ec3b 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldState.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/TextFieldState.kt
@@ -75,19 +75,18 @@
/**
* Runs [block] with a mutable version of the current state. The block can make changes to the
- * text, and must specify the new location of the cursor or selection by returning a
- * [TextEditResult] such as [placeCursorAtEnd] or [selectAll] (see the documentation on
- * [TextEditResult] for the full list of prebuilt results).
+ * text and cursor/selection. See the documentation on [TextFieldBuffer] for a more detailed
+ * description of the available operations.
*
* @sample androidx.compose.foundation.samples.BasicTextField2StateEditSample
*
* @see setTextAndPlaceCursorAtEnd
* @see setTextAndSelectAll
*/
- inline fun edit(block: TextFieldBuffer.() -> TextEditResult) {
+ inline fun edit(block: TextFieldBuffer.() -> Unit) {
val mutableValue = startEdit(text)
- val result = mutableValue.block()
- commitEdit(mutableValue, result)
+ mutableValue.block()
+ commitEdit(mutableValue)
}
override fun toString(): String =
@@ -100,9 +99,8 @@
@Suppress("ShowingMemberInHiddenClass")
@PublishedApi
- internal fun commitEdit(newValue: TextFieldBuffer, result: TextEditResult) {
- val newSelection = result.calculateSelection(text, newValue)
- val finalValue = newValue.toTextFieldCharSequence(newSelection)
+ internal fun commitEdit(newValue: TextFieldBuffer) {
+ val finalValue = newValue.toTextFieldCharSequence()
editProcessor.reset(finalValue)
}
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/EditProcessor.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/EditProcessor.kt
index 259ba86..32835db 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/EditProcessor.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/EditProcessor.kt
@@ -18,15 +18,13 @@
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.text2.input.TextEditFilter
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
+import androidx.compose.foundation.text2.input.TextFieldBuffer
import androidx.compose.foundation.text2.input.TextFieldCharSequence
-import androidx.compose.runtime.State
import androidx.compose.runtime.collection.mutableVectorOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.text.TextRange
-import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.TextInputService
import androidx.compose.ui.util.fastForEach
@@ -53,8 +51,6 @@
var value: TextFieldCharSequence by valueMutableState
private set
- val valueState: State<TextFieldCharSequence> get() = valueMutableState
-
// The editing buffer used for applying editor commands from IME.
internal var mBuffer: EditingBuffer = EditingBuffer(
text = initialValue.toString(),
@@ -177,8 +173,8 @@
return
}
- val mutableValue = TextFieldBufferWithSelection(
- value = proposedValue,
+ val mutableValue = TextFieldBuffer(
+ initialValue = proposedValue,
sourceValue = oldValue,
initialChanges = mBuffer.changeTracker
)
@@ -252,6 +248,4 @@
is BackspaceCommand -> toString()
is MoveCursorCommand -> toString()
is DeleteAllCommand -> toString()
-}
-
-private val EmptyAnnotatedString = buildAnnotatedString { }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/TextFieldKeyEventHandler.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/TextFieldKeyEventHandler.kt
index eacb620..b4e2481 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/TextFieldKeyEventHandler.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/input/internal/TextFieldKeyEventHandler.kt
@@ -26,7 +26,6 @@
import androidx.compose.foundation.text2.input.TextEditFilter
import androidx.compose.foundation.text2.input.TextFieldState
import androidx.compose.foundation.text2.input.internal.TextFieldPreparedSelection.Companion.NoCharacterFound
-import androidx.compose.foundation.text2.input.selectCharsIn
import androidx.compose.ui.input.key.KeyEvent
import androidx.compose.ui.input.key.KeyEventType
import androidx.compose.ui.input.key.type
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/selection/TextFieldSelectionState.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/selection/TextFieldSelectionState.kt
index 9527411..74589cc 100644
--- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/selection/TextFieldSelectionState.kt
+++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text2/selection/TextFieldSelectionState.kt
@@ -26,14 +26,11 @@
import androidx.compose.foundation.text.selection.isPrecisePointer
import androidx.compose.foundation.text.selection.visibleBounds
import androidx.compose.foundation.text2.input.TextEditFilter
-import androidx.compose.foundation.text2.input.TextEditResult
import androidx.compose.foundation.text2.input.TextFieldBuffer
-import androidx.compose.foundation.text2.input.TextFieldBufferWithSelection
import androidx.compose.foundation.text2.input.TextFieldCharSequence
import androidx.compose.foundation.text2.input.TextFieldState
import androidx.compose.foundation.text2.input.internal.TextLayoutState
import androidx.compose.foundation.text2.input.selectAll
-import androidx.compose.foundation.text2.input.selectCharsIn
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
@@ -497,18 +494,15 @@
/**
* Edits the TextFieldState content with a filter applied if available.
*/
- private fun editWithFilter(block: TextFieldBuffer.() -> TextEditResult) {
+ private fun editWithFilter(block: TextFieldBuffer.() -> Unit) {
val filter = textEditFilter
if (filter == null) {
textFieldState.edit(block)
} else {
val originalValue = textFieldState.text
// create a new buffer to pass to TextEditFilter after edit ops
- val buffer = TextFieldBufferWithSelection(originalValue, originalValue)
- val textEditResult = buffer.block()
- // selection is returned as a result, also apply it to buffer
- val newSelection = textEditResult.calculateSelection(originalValue, buffer)
- buffer.selectCharsIn(newSelection)
+ val buffer = TextFieldBuffer(originalValue)
+ buffer.block()
// finally filter the buffer's current status
textEditFilter?.filter(originalValue, buffer)
diff --git a/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelectionTest.kt b/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferTest.kt
similarity index 68%
rename from compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelectionTest.kt
rename to compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferTest.kt
index f511c90..9f7dc54 100644
--- a/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferWithSelectionTest.kt
+++ b/compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text2/input/TextFieldBufferTest.kt
@@ -28,11 +28,11 @@
@OptIn(ExperimentalFoundationApi::class)
@RunWith(JUnit4::class)
-class TextFieldBufferWithSelectionTest {
+class TextFieldBufferTest {
@Test
fun initialSelection() {
- val state = TextFieldBufferWithSelection(TextFieldCharSequence())
+ val state = TextFieldBuffer(TextFieldCharSequence())
assertThat(state.selectionInChars).isEqualTo(TextRange(0))
assertThat(state.hasSelection).isFalse()
}
@@ -155,8 +155,8 @@
@Test
fun resetTo_copiesTextAndSelection() {
val expectedValue = TextFieldCharSequence("world", TextRange(5))
- val state = TextFieldBufferWithSelection(
- value = TextFieldCharSequence("hello", TextRange(2)),
+ val state = TextFieldBuffer(
+ initialValue = TextFieldCharSequence("hello", TextRange(2)),
sourceValue = expectedValue
)
state.revertAllChanges()
@@ -165,6 +165,121 @@
}
@Test
+ fun placeCursorBeforeCharAt_emptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence(""))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorBeforeCharAt(-1)
+ }
+
+ buffer.placeCursorBeforeCharAt(0)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorBeforeCharAt(1)
+ }
+ }
+
+ @Test
+ fun placeCursorBeforeCharAt_nonEmptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence("hello"))
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorBeforeCharAt(-1)
+ }
+
+ buffer.placeCursorBeforeCharAt(0)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ buffer.placeCursorBeforeCharAt(1)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(1))
+
+ buffer.placeCursorBeforeCharAt(5)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(5))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorBeforeCharAt(6)
+ }
+ }
+
+ @Test
+ fun placeCursorAfterCharAt_emptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence(""))
+
+ buffer.placeCursorAfterCharAt(-1)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorAfterCharAt(0)
+ }
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorAfterCharAt(1)
+ }
+ }
+
+ @Test
+ fun placeCursorAfterCharAt_nonEmptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence("hello"))
+
+ buffer.placeCursorAfterCharAt(-1)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ buffer.placeCursorAfterCharAt(0)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(1))
+
+ buffer.placeCursorAfterCharAt(1)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(2))
+
+ buffer.placeCursorAfterCharAt(4)
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(5))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.placeCursorAfterCharAt(5)
+ }
+ }
+
+ @Test
+ fun selectCharsIn_emptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence(""))
+
+ buffer.selectCharsIn(TextRange(0))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.selectCharsIn(TextRange(0, 1))
+ }
+ }
+
+ @Test
+ fun selectCharsIn_nonEmptyBuffer() {
+ val buffer = TextFieldBuffer(TextFieldCharSequence("hello"))
+
+ buffer.selectCharsIn(TextRange(0))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0))
+
+ buffer.selectCharsIn(TextRange(0, 1))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0, 1))
+
+ buffer.selectCharsIn(TextRange(0, 5))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(0, 5))
+
+ buffer.selectCharsIn(TextRange(4, 5))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(4, 5))
+
+ buffer.selectCharsIn(TextRange(5, 5))
+ assertThat(buffer.selectionInChars).isEqualTo(TextRange(5, 5))
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.selectCharsIn(TextRange(5, 6))
+ }
+
+ assertFailsWith<IllegalArgumentException> {
+ buffer.selectCharsIn(TextRange(6, 6))
+ }
+ }
+
+ /** Tests of private testing helper code. */
+ @Test
fun testConvertTextFieldValueToAndFromString() {
assertThat("".parseAsTextEditState()).isEqualTo(TextFieldCharSequence())
assertThat("hello".parseAsTextEditState()).isEqualTo(TextFieldCharSequence("hello"))
@@ -191,10 +306,10 @@
private fun testSelectionAdjustment(
initial: String,
- transform: TextFieldBufferWithSelection.() -> Unit,
+ transform: TextFieldBuffer.() -> Unit,
expected: String
) {
- val state = TextFieldBufferWithSelection(initial.parseAsTextEditState())
+ val state = TextFieldBuffer(initial.parseAsTextEditState())
state.transform()
assertThat(state.toTextFieldCharSequence().toParsableString()).isEqualTo(expected)
}
diff --git a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/PrimitiveInLambdaDetector.kt b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/PrimitiveInLambdaDetector.kt
index c002307..e60cb01 100644
--- a/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/PrimitiveInLambdaDetector.kt
+++ b/compose/lint/internal-lint-checks/src/main/java/androidx/compose/lint/PrimitiveInLambdaDetector.kt
@@ -29,17 +29,17 @@
import com.android.tools.lint.detector.api.SourceCodeScanner
import com.android.tools.lint.detector.api.isKotlin
import com.intellij.lang.jvm.types.JvmType
+import com.intellij.psi.PsiClass
+import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiPrimitiveType
import com.intellij.psi.PsiWildcardType
import com.intellij.psi.impl.source.PsiClassReferenceType
import java.util.EnumSet
-import org.jetbrains.kotlin.asJava.classes.KtUltraLightClass
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.uast.UElement
import org.jetbrains.uast.UField
import org.jetbrains.uast.UMethod
import org.jetbrains.uast.UVariable
-import org.jetbrains.uast.kotlin.KotlinULambdaExpression
/**
* Lambdas with primitives will box the primitives on every call. This lint rule will find
@@ -57,8 +57,7 @@
override fun visitMethod(node: UMethod) {
if (!isKotlin(node) ||
context.evaluator.isOverride(node) ||
- (context.evaluator.isData(node.containingClass) &&
- (node.name.startsWith("copy") || node.name.startsWith("component")))
+ node.isDataClassGeneratedMethod(context)
) {
return
}
@@ -88,15 +87,10 @@
}
if (node.type.hasLambdaWithPrimitive()) {
- val parent = node.uastParent
- if (parent is KotlinULambdaExpression) {
- val sourcePsi = node.sourcePsi
- if (sourcePsi == null ||
- (sourcePsi as? KtParameter)?.isLambdaParameter == true
- ) {
- return // Don't notify for lambda parameters
- }
+ if (node.isLambdaParameter()) {
+ return // Don't notify for lambda parameters
}
+ val parent = node.uastParent
val messageContext = if (parent is UMethod) {
val isInline = context.evaluator.isInline(parent)
val isParameterNoInline = context.evaluator.isNoInline(node)
@@ -130,10 +124,15 @@
}
private fun report(context: JavaContext, node: UElement, target: Any?, messageContext: String) {
+ val location = if (target == null) {
+ context.getLocation(node)
+ } else {
+ context.getLocation(target)
+ }
context.report(
issue = ISSUE,
scope = node,
- location = context.getLocation(target),
+ location = location,
message = "Use a functional interface instead of lambda syntax for lambdas with " +
"primitive values in $messageContext."
)
@@ -164,7 +163,7 @@
// Set of all boxed types that we want to prevent. We don't have to worry
// about Boolean or because the boxed values are kept and reused (and there are only 2).
-private val BoxedPrimitives = setOf(
+val BoxedPrimitives = setOf(
"java.lang.Byte",
"java.lang.Character",
"java.lang.Short",
@@ -178,6 +177,17 @@
"kotlin.ULong",
)
+fun UMethod.isDataClassGeneratedMethod(context: JavaContext): Boolean =
+ context.evaluator.isData(containingClass) &&
+ (name.startsWith("copy") || name.startsWith("component"))
+
+fun UVariable.isLambdaParameter(): Boolean {
+ val sourcePsi = sourcePsi
+ return ((sourcePsi == null && (javaPsi as? PsiParameter)?.name == "it") ||
+ (sourcePsi as? KtParameter)?.isLambdaParameter == true
+ )
+}
+
private fun JvmType.hasLambdaWithPrimitive(): Boolean {
if (isLambda() && hasPrimitiveTypeArgs()) {
return true
@@ -192,10 +202,10 @@
return false
}
-private fun JvmType.isLambda(): Boolean =
+fun JvmType.isLambda(): Boolean =
(this is PsiClassReferenceType && reference.qualifiedName.startsWith(FunctionPrefix))
-private fun JvmType.hasPrimitiveTypeArgs(): Boolean {
+fun JvmType.hasPrimitiveTypeArgs(): Boolean {
if (this !is PsiClassReferenceType) {
return false
}
@@ -225,15 +235,18 @@
return false
}
-private fun PsiClassReferenceType.isBoxedPrimitive(): Boolean {
+fun PsiClassReferenceType.isBoxedPrimitive(): Boolean {
val resolvedType = resolve() ?: return false
- if (resolvedType is KtUltraLightClass && hasJvmInline(resolvedType)) {
+ if (hasJvmInline(resolvedType)) {
val constructorParam =
- resolvedType.constructors.firstOrNull()?.parameters?.firstOrNull()
+ resolvedType.constructors.firstOrNull { it.parameters.size == 1 }?.parameters?.first()
+ ?: resolvedType.methods.firstOrNull {
+ it.parameters.size == 1 && it.name == "constructor-impl"
+ }?.parameters?.first()
if (constructorParam != null) {
val type = constructorParam.type
if (type is PsiPrimitiveType) {
- return true
+ return type.boxedTypeName in BoxedPrimitives
}
if (type is PsiClassReferenceType) {
return type.isBoxedPrimitive()
@@ -243,7 +256,7 @@
return resolvedType.qualifiedName in BoxedPrimitives
}
-private fun hasJvmInline(type: KtUltraLightClass): Boolean {
+private fun hasJvmInline(type: PsiClass): Boolean {
for (annotation in type.annotations) {
if (annotation.qualifiedName == JvmInlineAnnotation) {
return true
diff --git a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/PrimitiveInLambdaDetectorTest.kt b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/PrimitiveInLambdaDetectorTest.kt
index 40d9960..34b19c4 100644
--- a/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/PrimitiveInLambdaDetectorTest.kt
+++ b/compose/lint/internal-lint-checks/src/test/java/androidx/compose/lint/PrimitiveInLambdaDetectorTest.kt
@@ -16,6 +16,7 @@
package androidx.compose.lint
+import androidx.compose.lint.test.kotlinAndBytecodeStub
import com.android.tools.lint.checks.infrastructure.LintDetectorTest
import com.android.tools.lint.detector.api.Detector
import com.android.tools.lint.detector.api.Issue
@@ -45,6 +46,7 @@
fun functionWithLambdaWithParamWithPrimitiveReturnType() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -69,6 +71,7 @@
fun functionWithLambdaWithParamWithPrimitiveParameter() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -93,6 +96,7 @@
fun inlineMethodsNoWarning() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -108,6 +112,7 @@
fun inlineMethodWithNoInline() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -130,6 +135,7 @@
fun functionWithLambdaReturnWithPrimitiveReturnType() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -152,6 +158,7 @@
fun functionWithLambdaReturnWithPrimitiveParameter() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -177,6 +184,7 @@
// be changed to highlighting the type instead of the parameter name.
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -199,6 +207,7 @@
fun fieldWithLambdaWithPrimitives() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -224,6 +233,7 @@
fun overrideNotWarning() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -251,6 +261,7 @@
fun dataClass() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -275,6 +286,7 @@
fun variable() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -300,6 +312,7 @@
fun collectionOfLambdaWithPrimitive() {
lint().files(
ContainsIntClass,
+ SimpleValueClass.bytecode,
kotlin(
"""
package androidx.compose.lint
@@ -336,7 +349,8 @@
Triple("ULong", "1uL", "ULong"),
Triple("Float", "1f", "Float"),
Triple("Double", "1.0", "Double"),
- Triple("ContainsInt", "ContainsInt(0)", "ContainsInt")
+ Triple("ContainsInt", "ContainsInt(0)", "ContainsInt"),
+ Triple("test.SimpleValueClass", "test.SimpleValueClass(0)", "SimpleValueClass")
)
val ContainsIntClass = kotlin(
@@ -346,5 +360,50 @@
@JvmInline value class ContainsInt(val value: Int)
""".trimIndent()
)
+
+ val SimpleValueClass = kotlinAndBytecodeStub(
+ filename = "SimpleValueClass.kt",
+ filepath = "test",
+ checksum = 0xc2548512,
+ source = """
+ package test
+
+ @JvmInline
+ value class SimpleValueClass(val value: Int)
+ """.trimIndent(),
+ """
+ META-INF/main.kotlin_module:
+ H4sIAAAAAAAA/2NgYGBmYGBgBGIOBihQYtBiAABw+ypgGAAAAA==
+ """,
+ """
+ test/SimpleValueClass.class:
+ H4sIAAAAAAAA/31U31MbVRT+7s2vzWaBTaBAFtT+0DbhR5NirVUKUtDapaGt
+ UKMUfVjCTlhINpjdZOob44v+BT74ouOLfeBBZxTQzjhI3/ybHMdzN5uEWTLO
+ ZPbee+75zvnOd87N3//+8SeAm/ic4YJrOm5uzaruVcyiUWmYSxXDcWJgDOqO
+ 0TRyFcMu5x5t7pglN4YQg1Q2Xc+RIZTJ6gyRZuvEdAUxSHFwxBnC7rblMIwU
+ esafZehza2tu3bLL0+KOiGT0bKGbsXVHfiNB22LDqmyZ9RgGGKJ3LNty5z0q
+ RQVJpGSoGCRUMGPGYzkn4QKhjL09095imM6cz3iehJ9wVsEIRkX8NMN4L7Zn
+ HceE47hwXPp/x1eF42uka1sPhqFMDyUUXMJl4XuFxDXq5byCPvTLpPZVEnPb
+ cLaXalumL2aY6FFrkt0ouu2aZaHaBKVqeyuYQlbGJKYVZMSOI8eQML9oGBXH
+ DzWc0QvBQZjNPmWQG/Zm7ZnnpeBNRAX6Jo1Dzd026wyp8yhSvhVadLtXUAU3
+ MCPivNsqoSgjLLqplmq249YbJbdW92lJ7dwMmuhF7zETI3FHBLxL89lkUM6U
+ lieuGV0XpfC9G+IzQ9UWdmtuxbJzO81qbrlZ1W06mMQ82b5YMV1jy3ANsvFq
+ M0TviImPJD6gLLtkf2aJEyXgWxT495P9yzIf5TJXT/Zl+nFVkrkUoTVBa5TW
+ flpD0unXC6Mn+zM8zxZTqajKNZ4PvTxmJ/unP0bDUliNLGuqRMb4jKTKWniU
+ 5dn9l9+GvNuEqiyrap+AkI15tn5CqOoA2dSOLammVpOt0HSWiI4WlqJq7PQb
+ xlu5vuJhYpM+fR4dFAWQKFSW+sCr/nHF+LJcrzXE4xkMqn1916W2ibliGCiQ
+ bA8b1U2z/sTYrJhiHmolo1I06pY4+8a+Ndco7a4Ye/5ZXqs16iXzniUO6dWG
+ 7VpVs2g5Ft3ete2aa7gWjQKNCafJEMRS4j+HdqLTEUTJ8gmdcqITtEYmfoV8
+ QBuOT+kb9YyDWPcAngMStAPi4jH54LfJW9ylX0BdP8JQavgQmnaIV9TsIS4e
+ 4vWfvczdIGm84XFg4on6Qa76DCTB4BjXghipk5geno+50matHeP6QQAQ6SSZ
+ 6pQZSJIPYrpJ6F35mEdUnZhObfIv8O8QCR1MnoAf4q05bfx7cQy39HpK3xh4
+ /B/0t0IOk5FgPg2xu0VSCQK38Y4fXPRFeMUFocljzHYZteBxn5HYeXCViyfq
+ w+d9uDxxhLmJsd8g/9Kzd61YcieW7A0Bo5jzHTEv+tpwLagKb42MmsZ7WPC9
+ r5Em4i7+AnxdO8JisF9xLHmgpPirC/arPWWsx2Sl8T4+CNSX0MZ+QCz8E8Kh
+ rtgREnvhrFYJ3POlTuBDrz6ODc+9iM9o3aXdfVp1gi5vIKTjgY6CjhU8pC0e
+ 6XiMjzbAHKxibQNDDhQHTxzEvO+8g6yDiIOog9ue5Ra9KwczDqYcZBxc8ox9
+ DvodfPwfuO9oETMIAAA=
+ """
+ )
}
}
diff --git a/compose/material/material/integration-tests/material-demos/lint-baseline.xml b/compose/material/material/integration-tests/material-demos/lint-baseline.xml
index a291fce..d63f46c 100644
--- a/compose/material/material/integration-tests/material-demos/lint-baseline.xml
+++ b/compose/material/material/integration-tests/material-demos/lint-baseline.xml
@@ -1,5 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method ColorPicker has parameter 'onColorChange' with type Function1<? super Color, Unit>."
+ errorLine1="private fun ColorPicker(onColorChange: (Color) -> Unit) {"
+ errorLine2=" ~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'updateColorWheel' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" fun updateColorWheel(newPosition: Offset) {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/material/demos/ColorPickerDemo.kt"/>
+ </issue>
<issue
id="PrimitiveInLambda"
diff --git a/compose/material/material/lint-baseline.xml b/compose/material/material/lint-baseline.xml
index d90ca3e..c8e0bc4 100644
--- a/compose/material/material/lint-baseline.xml
+++ b/compose/material/material/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -210,6 +210,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateBackLayerConstraints' with type Function1<? super Constraints, ? extends Constraints>."
+ errorLine1=" val calculateBackLayerConstraints: (Constraints) -> Constraints = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/BackdropScaffold.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BackdropStack has parameter 'calculateBackLayerConstraints' with type Function1<? super Constraints, Constraints>."
+ errorLine1=" calculateBackLayerConstraints: (Constraints) -> Constraints,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/BackdropScaffold.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BackdropStack has parameter 'frontLayer' with type Function2<? super Constraints, ? super Float, Unit>."
errorLine1=" frontLayer: @Composable @UiComposable (Constraints, Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -228,6 +246,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BottomSheet has parameter 'calculateAnchors' with type Function1<? super IntSize, ? extends DraggableAnchors<BottomSheetValue>>."
+ errorLine1=" calculateAnchors: (sheetSize: IntSize) -> DraggableAnchors<BottomSheetValue>,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/BottomSheetScaffold.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BottomSheetScaffoldLayout has parameter 'bottomSheet' with type Function1<? super Integer, Unit>."
errorLine1=" bottomSheet: @Composable (layoutHeight: Int) -> Unit,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -282,6 +309,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method OutlinedTextFieldLayout has parameter 'onLabelMeasured' with type Function1<? super Size, Unit>."
+ errorLine1=" onLabelMeasured: (Size) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor OutlinedTextFieldMeasurePolicy has parameter 'onLabelMeasured' with type Function1<? super Size, Unit>."
+ errorLine1=" private val onLabelMeasured: (Size) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method intrinsicWidth has parameter 'intrinsicMeasurer' with type Function2<? super IntrinsicMeasurable, ? super Integer, Integer>."
errorLine1=" intrinsicMeasurer: (IntrinsicMeasurable, Int) -> Int"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -345,6 +390,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scaleToUserValue' with type Function1<? super Float, ? extends Float>."
+ errorLine1=" fun scaleToUserValue(offset: Float) ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/Slider.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scaleToOffset' with type Function1<? super Float, ? extends Float>."
+ errorLine1=" fun scaleToOffset(userValue: Float) ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/Slider.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scaleToOffset' with type Function1<? super Float, ? extends Float>."
+ errorLine1=" fun scaleToOffset(userValue: Float) ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/Slider.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'postPointerSlop' with type Function2<? super PointerInputChange, ? super Float, ? extends Unit>."
errorLine1=" val postPointerSlop = { pointerInput: PointerInputChange, offset: Float ->"
errorLine2=" ^">
@@ -453,6 +525,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'labelColor' with type Function1<? super InputPhase, ? extends Color>."
+ errorLine1=" val labelColor: @Composable (InputPhase) -> Color = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method Transition has parameter 'contentColor' with type Function1<? super InputPhase, Color>."
+ errorLine1=" contentColor: @Composable (InputPhase) -> Color,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method Transition has parameter 'content' with type Function4<? super Float, ? super Color, ? super Color, ? super Float, Unit>."
errorLine1=" content: @Composable ("
errorLine2=" ^">
diff --git a/compose/material3/material3-adaptive/api/current.txt b/compose/material3/material3-adaptive/api/current.txt
index 5716e1d..2c8f01b 100644
--- a/compose/material3/material3-adaptive/api/current.txt
+++ b/compose/material3/material3-adaptive/api/current.txt
@@ -1,6 +1,16 @@
// Signature format: 4.0
package androidx.compose.material3.adaptive {
+ @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public interface AdaptStrategy {
+ method public String adapt();
+ field public static final androidx.compose.material3.adaptive.AdaptStrategy.Companion Companion;
+ }
+
+ public static final class AdaptStrategy.Companion {
+ method public androidx.compose.material3.adaptive.AdaptStrategy getHide();
+ property public final androidx.compose.material3.adaptive.AdaptStrategy Hide;
+ }
+
@androidx.compose.runtime.Immutable public final class AdaptiveLayoutDirective {
ctor public AdaptiveLayoutDirective(int maxHorizontalPartitions, androidx.compose.material3.adaptive.GutterSizes gutterSizes, optional int maxVerticalPartitions);
method public androidx.compose.material3.adaptive.GutterSizes getGutterSizes();
@@ -66,6 +76,16 @@
property public final boolean isTabletop;
}
+ @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class ThreePaneScaffoldAdaptStrategies {
+ ctor public ThreePaneScaffoldAdaptStrategies(androidx.compose.material3.adaptive.AdaptStrategy primaryPaneAdaptStrategy, androidx.compose.material3.adaptive.AdaptStrategy secondaryPaneAdaptStrategy, androidx.compose.material3.adaptive.AdaptStrategy tertiaryPaneAdaptStrategy);
+ method public androidx.compose.material3.adaptive.AdaptStrategy getPrimaryPaneAdaptStrategy();
+ method public androidx.compose.material3.adaptive.AdaptStrategy getSecondaryPaneAdaptStrategy();
+ method public androidx.compose.material3.adaptive.AdaptStrategy getTertiaryPaneAdaptStrategy();
+ property public final androidx.compose.material3.adaptive.AdaptStrategy primaryPaneAdaptStrategy;
+ property public final androidx.compose.material3.adaptive.AdaptStrategy secondaryPaneAdaptStrategy;
+ property public final androidx.compose.material3.adaptive.AdaptStrategy tertiaryPaneAdaptStrategy;
+ }
+
@androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldArrangement {
ctor public ThreePaneScaffoldArrangement(androidx.compose.material3.adaptive.ThreePaneScaffoldRole firstPane, androidx.compose.material3.adaptive.ThreePaneScaffoldRole secondPane, androidx.compose.material3.adaptive.ThreePaneScaffoldRole thirdPane);
method public androidx.compose.material3.adaptive.ThreePaneScaffoldRole getFirstPane();
diff --git a/compose/material3/material3-adaptive/api/restricted_current.txt b/compose/material3/material3-adaptive/api/restricted_current.txt
index 5716e1d..2c8f01b 100644
--- a/compose/material3/material3-adaptive/api/restricted_current.txt
+++ b/compose/material3/material3-adaptive/api/restricted_current.txt
@@ -1,6 +1,16 @@
// Signature format: 4.0
package androidx.compose.material3.adaptive {
+ @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public interface AdaptStrategy {
+ method public String adapt();
+ field public static final androidx.compose.material3.adaptive.AdaptStrategy.Companion Companion;
+ }
+
+ public static final class AdaptStrategy.Companion {
+ method public androidx.compose.material3.adaptive.AdaptStrategy getHide();
+ property public final androidx.compose.material3.adaptive.AdaptStrategy Hide;
+ }
+
@androidx.compose.runtime.Immutable public final class AdaptiveLayoutDirective {
ctor public AdaptiveLayoutDirective(int maxHorizontalPartitions, androidx.compose.material3.adaptive.GutterSizes gutterSizes, optional int maxVerticalPartitions);
method public androidx.compose.material3.adaptive.GutterSizes getGutterSizes();
@@ -66,6 +76,16 @@
property public final boolean isTabletop;
}
+ @androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi public final class ThreePaneScaffoldAdaptStrategies {
+ ctor public ThreePaneScaffoldAdaptStrategies(androidx.compose.material3.adaptive.AdaptStrategy primaryPaneAdaptStrategy, androidx.compose.material3.adaptive.AdaptStrategy secondaryPaneAdaptStrategy, androidx.compose.material3.adaptive.AdaptStrategy tertiaryPaneAdaptStrategy);
+ method public androidx.compose.material3.adaptive.AdaptStrategy getPrimaryPaneAdaptStrategy();
+ method public androidx.compose.material3.adaptive.AdaptStrategy getSecondaryPaneAdaptStrategy();
+ method public androidx.compose.material3.adaptive.AdaptStrategy getTertiaryPaneAdaptStrategy();
+ property public final androidx.compose.material3.adaptive.AdaptStrategy primaryPaneAdaptStrategy;
+ property public final androidx.compose.material3.adaptive.AdaptStrategy secondaryPaneAdaptStrategy;
+ property public final androidx.compose.material3.adaptive.AdaptStrategy tertiaryPaneAdaptStrategy;
+ }
+
@androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi @androidx.compose.runtime.Immutable public final class ThreePaneScaffoldArrangement {
ctor public ThreePaneScaffoldArrangement(androidx.compose.material3.adaptive.ThreePaneScaffoldRole firstPane, androidx.compose.material3.adaptive.ThreePaneScaffoldRole secondPane, androidx.compose.material3.adaptive.ThreePaneScaffoldRole thirdPane);
method public androidx.compose.material3.adaptive.ThreePaneScaffoldRole getFirstPane();
diff --git a/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/AdaptStrategy.kt b/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/AdaptStrategy.kt
new file mode 100644
index 0000000..550ffda
--- /dev/null
+++ b/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/AdaptStrategy.kt
@@ -0,0 +1,46 @@
+/*
+ * 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.material3.adaptive
+
+/**
+ * Provides the information about how the associated pane should be adapted if it cannot be
+ * displayed in its [PaneAdaptedValue.Expanded] state.
+ */
+@ExperimentalMaterial3AdaptiveApi
+interface AdaptStrategy {
+ /**
+ * Override this function to provide the resulted adapted state.
+ */
+ fun adapt(): PaneAdaptedValue
+
+ private class BaseAdaptStrategy(
+ private val description: String,
+ private val adaptedState: PaneAdaptedValue
+ ) : AdaptStrategy {
+ override fun adapt() = adaptedState
+
+ override fun toString() = "AdaptStrategy[$description]"
+ }
+
+ companion object {
+ /**
+ * The default [AdaptStrategy] that suggests the layout to hide the associated pane when
+ * it has to be adapted, i.e., cannot be displayed in its [PaneAdaptedValue.Expanded] state.
+ */
+ val Hide: AdaptStrategy = BaseAdaptStrategy("Hide", PaneAdaptedValue.Hidden)
+ }
+}
diff --git a/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/ThreePaneScaffoldAdaptStrategies.kt b/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/ThreePaneScaffoldAdaptStrategies.kt
new file mode 100644
index 0000000..2e936e5
--- /dev/null
+++ b/compose/material3/material3-adaptive/src/commonMain/kotlin/androidx/compose/material3/adaptive/ThreePaneScaffoldAdaptStrategies.kt
@@ -0,0 +1,49 @@
+/*
+ * 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.material3.adaptive
+
+/**
+ * The adaptation specs of [ThreePaneScaffold]. This class denotes how each pane of
+ * [ThreePaneScaffold] should be adapted. It should be used as an input parameter of
+ * [calculateThreePaneScaffoldValue] to decide the [ThreePaneScaffoldValue].
+ *
+ * @param primaryPaneAdaptStrategy [AdaptStrategy] of the primary pane of [ThreePaneScaffold]
+ * @param secondaryPaneAdaptStrategy [AdaptStrategy] of the secondary pane of [ThreePaneScaffold]
+ * @param tertiaryPaneAdaptStrategy [AdaptStrategy] of the tertiary pane of [ThreePaneScaffold]
+ */
+@ExperimentalMaterial3AdaptiveApi
+class ThreePaneScaffoldAdaptStrategies(
+ val primaryPaneAdaptStrategy: AdaptStrategy,
+ val secondaryPaneAdaptStrategy: AdaptStrategy,
+ val tertiaryPaneAdaptStrategy: AdaptStrategy
+) {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) return true
+ if (other !is ThreePaneScaffoldAdaptStrategies) return false
+ if (primaryPaneAdaptStrategy != other.primaryPaneAdaptStrategy) return false
+ if (secondaryPaneAdaptStrategy != other.secondaryPaneAdaptStrategy) return false
+ if (tertiaryPaneAdaptStrategy != other.tertiaryPaneAdaptStrategy) return false
+ return true
+ }
+
+ override fun hashCode(): Int {
+ var result = primaryPaneAdaptStrategy.hashCode()
+ result = 31 * result + secondaryPaneAdaptStrategy.hashCode()
+ result = 31 * result + tertiaryPaneAdaptStrategy.hashCode()
+ return result
+ }
+}
diff --git a/compose/material3/material3/lint-baseline.xml b/compose/material3/material3/lint-baseline.xml
index 8409a36..e295f4e 100644
--- a/compose/material3/material3/lint-baseline.xml
+++ b/compose/material3/material3/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -471,6 +471,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method OutlinedTextFieldLayout has parameter 'onLabelMeasured' with type Function1<? super Size, Unit>."
+ errorLine1=" onLabelMeasured: (Size) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor OutlinedTextFieldMeasurePolicy has parameter 'onLabelMeasured' with type Function1<? super Size, Unit>."
+ errorLine1=" private val onLabelMeasured: (Size) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method intrinsicWidth has parameter 'intrinsicMeasurer' with type Function2<? super IntrinsicMeasurable, ? super Integer, Integer>."
errorLine1=" intrinsicMeasurer: (IntrinsicMeasurable, Int) -> Int"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -489,6 +507,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateVerticalPosition' with type Function1<? super Placeable, ? extends Integer>."
+ errorLine1=" // Single line text fields have text components centered vertically."
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/OutlinedTextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method ConsumeSwipeWithinBottomSheetBoundsNestedScrollConnection has parameter 'onFling' with type Function1<? super Float, Unit>."
errorLine1=" onFling: (velocity: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -579,6 +606,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function3<PressGestureScope, Offset, Continuation<? super Unit>, Object> of 'getPress$lint_module'."
+ errorLine1=" internal val press: suspend PressGestureScope.(Offset) -> Unit = { pos ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/Slider.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor RangeSliderState has parameter 'initialOnValueChange' with type Function1<? super FloatRange, Unit>."
errorLine1=" initialOnValueChange: ((FloatRange) -> Unit)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
@@ -615,6 +651,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'isValidDistance' with type Function1<? super Float, ? extends Boolean>."
+ errorLine1=" fun Float.isValidDistance(): Boolean {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/SnapFlingBehavior.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateSnappingOffsetBounds' with type Function0<? extends FloatRange>."
+ errorLine1=" fun calculateSnappingOffsetBounds(): FloatRange {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/SnapFlingBehavior.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'consumeDelta' with type Function2<? super AnimationScope<Float, AnimationVector1D>, ? super Float, ? extends Unit>."
+ errorLine1=" fun AnimationScope<Float, AnimationVector1D>.consumeDelta(delta: Float) {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/SnapFlingBehavior.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor DismissState has parameter 'positionalThreshold' with type Function2<? super Density, ? super Float, Float>."
errorLine1=" positionalThreshold: Density.(totalDistance: Float) -> Float ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -750,6 +813,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor SwipeAnchorsModifier has parameter 'onSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" private val onSizeChanged: (layoutSize: IntSize) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/SwipeableV2.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'valueToOffset' with type Function1<? super Boolean, ? extends Float>."
errorLine1=" val valueToOffset = remember<(Boolean) -> Float>(minBound, maxBound) {"
errorLine2=" ^">
@@ -777,6 +849,33 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'calculateVerticalPosition' with type Function1<? super Placeable, ? extends Integer>."
+ errorLine1=" // Single line text field without label places its text components centered vertically."
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/TextField.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'labelColor' with type Function1<? super InputPhase, ? extends Color>."
+ errorLine1=" val labelColor: @Composable (InputPhase) -> Color = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/TextFieldImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method Transition has parameter 'contentColor' with type Function1<? super InputPhase, Color>."
+ errorLine1=" contentColor: @Composable (InputPhase) -> Color,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/material3/TextFieldImpl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method Transition has parameter 'content' with type Function5<? super Float, ? super Color, ? super Color, ? super Float, ? super Float, Unit>."
errorLine1=" content: @Composable ("
errorLine2=" ^">
diff --git a/compose/runtime/runtime/lint-baseline.xml b/compose/runtime/runtime/lint-baseline.xml
index 6e1428d..60f721c 100644
--- a/compose/runtime/runtime/lint-baseline.xml
+++ b/compose/runtime/runtime/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="ExperimentalPropertyAnnotation"
@@ -66,6 +66,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reportGroup' with type Function3<? super Integer, ? super Boolean, ? super Integer, ? extends Integer>."
+ errorLine1=" fun reportGroup(group: Int, needsNodeDelete: Boolean, nodeIndex: Int): Int {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/runtime/Composer.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method set has parameter 'block' with type Function2<? super T, ? super Integer, Unit>."
errorLine1=" noinline block: T.(value: Int) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -84,6 +93,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'collectFromGroup' with type Function1<? super Integer, ? extends Unit>."
+ errorLine1=" fun collectFromGroup(group: Int) {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/runtime/Composer.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method withFrameNanos has parameter 'onFrame' with type Function1<? super Long, ? extends R>."
errorLine1=" suspend fun <R> withFrameNanos(onFrame: (frameTimeNanos: Long) -> R): R"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -120,9 +138,27 @@
<issue
id="PrimitiveInLambda"
- message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method forEachData$lint_module has parameter 'block' with type Function2<? super Integer, Object, Unit>."
- errorLine1=" internal fun forEachData(group: Int, block: (index: Int, data: Any?) -> Unit) {"
- errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'validateGroup' with type Function2<? super Integer, ? super Integer, ? extends Integer>."
+ errorLine1=" fun validateGroup(parent: Int, parentEnd: Int): Int {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'dataIndex' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun dataIndex(index: Int) ="
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'isStarted' with type Function1<? super Integer, ? extends Boolean>."
+ errorLine1=" fun isStarted(index: Int): Boolean ="
+ errorLine2=" ^">
<location
file="src/commonMain/kotlin/androidx/compose/runtime/SlotTable.kt"/>
</issue>
diff --git a/compose/test-utils/lint-baseline.xml b/compose/test-utils/lint-baseline.xml
index a8d3ffc..4b757ef 100644
--- a/compose/test-utils/lint-baseline.xml
+++ b/compose/test-utils/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PlatformImportInCommonModule"
@@ -37,4 +37,22 @@
file="src/commonMain/kotlin/androidx/compose/testutils/ModifierTestUtils.kt"/>
</issue>
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method assertPixels has parameter 'expectedColorProvider' with type Function1<? super IntOffset, Color>."
+ errorLine1=" expectedColorProvider: (pos: IntOffset) -> Color?"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/testutils/ImageAssertions.android.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method assertPixelColor has parameter 'error' with type Function1<? super Color, String>."
+ errorLine1=" error: (Color) -> String = { color -> "Pixel($x, $y) expected to be $expected, but was $color" }"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/testutils/ImageAssertions.android.kt"/>
+ </issue>
+
</issues>
diff --git a/compose/ui/ui-test/lint-baseline.xml b/compose/ui/ui-test/lint-baseline.xml
index 93403e3..1fa3f35 100644
--- a/compose/ui/ui-test/lint-baseline.xml
+++ b/compose/ui/ui-test/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -12,6 +12,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scrollDelta' with type Function2<? super Float, ? super Float, ? extends Float>."
+ errorLine1=" // Given the desired scroll value to align either side of the target with the"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/test/Actions.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'genState' with type Function2<? super Key, ? super Integer, ? extends Integer>."
+ errorLine1=" fun genState(key: Key, mask: Int) = if (isKeyDown(key)) mask else 0"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/test/AndroidInputDispatcher.android.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method animateAlong has parameter 'curve' with type Function1<? super Long, Offset>."
errorLine1=" curve: (Long) -> Offset,"
errorLine2=" ~~~~~~~~~~~~~~~~">
diff --git a/compose/ui/ui-tooling-data/lint-baseline.xml b/compose/ui/ui-tooling-data/lint-baseline.xml
new file mode 100644
index 0000000..fb91051
--- /dev/null
+++ b/compose/ui/ui-tooling-data/lint-baseline.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'expectNumber' with type Function0<? extends Integer>."
+ errorLine1=" fun expectNumber(): Int {"
+ errorLine2=" ^">
+ <location
+ file="src/jvmMain/kotlin/androidx/compose/ui/tooling/data/SlotTree.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'ensureIndexes' with type Function1<? super Integer, ? extends Unit>."
+ errorLine1=" fun ensureIndexes(index: Int) {"
+ errorLine2=" ^">
+ <location
+ file="src/jvmMain/kotlin/androidx/compose/ui/tooling/data/SlotTree.kt"/>
+ </issue>
+
+</issues>
diff --git a/compose/ui/ui-tooling/lint-baseline.xml b/compose/ui/ui-tooling/lint-baseline.xml
index 433880c..4f98a68 100644
--- a/compose/ui/ui-tooling/lint-baseline.xml
+++ b/compose/ui/ui-tooling/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -28,4 +28,13 @@
file="src/androidMain/kotlin/androidx/compose/ui/tooling/animation/clock/InfiniteTransitionClock.kt"/>
</issue>
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'getDp' with type Function1<? super Object, ? extends Dp>."
+ errorLine1=" fun getDp(par: Any): Dp? {"
+ errorLine2=" ^">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/tooling/animation/clock/Utils.kt"/>
+ </issue>
+
</issues>
diff --git a/compose/ui/ui/integration-tests/ui-demos/lint-baseline.xml b/compose/ui/ui/integration-tests/ui-demos/lint-baseline.xml
index d9b1b51..2e6c0a4 100644
--- a/compose/ui/ui/integration-tests/ui-demos/lint-baseline.xml
+++ b/compose/ui/ui/integration-tests/ui-demos/lint-baseline.xml
@@ -1,5 +1,158 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'trippedModifier' with type Function2<? super Boolean, ? super Color, ? extends Modifier>."
+ errorLine1=" fun trippedModifier(isActive: Boolean, color: Color) ="
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/ButtonMetaStateDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/DoubleTapGestureDetectorDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/DoubleTapInTapDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap: (Offset) -> Unit = { _ ->"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/DoubleTapInTapDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onPress: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/HorizontalScrollersInVerticalScrollerDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/HorizontalScrollersInVerticalScrollerDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/HorizontalScrollersInVerticalScrollerDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/HorizontalScrollersInVerticalScrollerDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/LongPressGestureDetectorDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedLongPressDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedPressDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedPressDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedPressDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onPress: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedScrollingDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedScrollingDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedScrollingDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/NestedScrollingDemo.kt"/>
+ </issue>
<issue
id="PrimitiveInLambda"
@@ -30,6 +183,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/viewinterop/PointerInputInteropAndroidInCompose.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onStart' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onStart: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/PressIndicatorGestureDetectorDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method RecyclingAndroidViewLazyColumn has parameter 'onChangeCheck' with type Function2<? super Integer, ? super Boolean, Unit>."
errorLine1=" onChangeCheck: (Int, Boolean) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
@@ -37,4 +208,49 @@
file="src/main/java/androidx/compose/ui/demos/viewinterop/ScrollingAndroidViewsDemo.kt"/>
</issue>
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/TapGestureDetectorDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onPress: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/VerticalScrollerInDrawerLayoutDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/VerticalScrollerInDrawerLayoutDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onDoubleTap' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onDoubleTap: (Offset) -> Unit = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/VerticalScrollerInDrawerLayoutDemo.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'onLongPress' with type Function1<? super Offset, ? extends Unit>."
+ errorLine1=" val onLongPress = { _: Offset ->"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/compose/ui/demos/gestures/VerticalScrollerInDrawerLayoutDemo.kt"/>
+ </issue>
+
</issues>
diff --git a/compose/ui/ui/lint-baseline.xml b/compose/ui/ui/lint-baseline.xml
index 1bbc5bd..c663909 100644
--- a/compose/ui/ui/lint-baseline.xml
+++ b/compose/ui/ui/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanHideAnnotation"
@@ -120,6 +120,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'canScroll' with type Function2<? super ScrollAxisRange, ? super Float, ? extends Boolean>."
+ errorLine1=" // Will the scrollable scroll when ScrollBy is invoked with the given [amount]?"
+ errorLine2=" ^">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scrollAction' with type AccessibilityAction<Function2<? super Float, ? super Float, ? extends Boolean>>."
errorLine1=" val scrollAction ="
errorLine2=" ^">
@@ -147,6 +156,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scrollDelta' with type Function2<? super Float, ? super Float, ? extends Float>."
+ errorLine1=" // Given the desired scroll value to align either side of the target with the"
+ errorLine2=" ^">
+ <location
+ file="src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<ComposeUiNode, Integer, Unit> of 'getSetCompositeKeyHash'."
errorLine1=" val SetCompositeKeyHash: ComposeUiNode.(Int) -> Unit ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -219,6 +237,186 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor IntermediateLayoutModifierNode has parameter 'measureBlock' with type Function3<? super IntermediateMeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" internal var measureBlock: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/IntermediateLayoutModifierNode.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setMeasureBlock$lint_module has parameter '<set-?>' with type Function3<? super IntermediateMeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" internal var measureBlock: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/IntermediateLayoutModifierNode.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function3<IntermediateMeasureScope, Measurable, Constraints, MeasureResult> of 'getMeasureBlock$lint_module'."
+ errorLine1=" internal var measureBlock: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/IntermediateLayoutModifierNode.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method layout has parameter 'measure' with type Function3<? super MeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measure: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor LayoutElement has parameter 'measure' with type Function3<? super MeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measure: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function3<MeasureScope, Measurable, Constraints, MeasureResult> of 'getMeasure'."
+ errorLine1=" val measure: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor LayoutModifierImpl has parameter 'measureBlock' with type Function3<? super MeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" var measureBlock: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method setMeasureBlock has parameter '<set-?>' with type Function3<? super MeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" var measureBlock: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function3<MeasureScope, Measurable, Constraints, MeasureResult> of 'getMeasureBlock'."
+ errorLine1=" var measureBlock: MeasureScope.(Measurable, Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LayoutModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'printSubTree' with type Function2<? super LayoutNode, ? super Integer, ? extends Unit>."
+ errorLine1=" fun printSubTree(node: LayoutNode, depth: Int) {"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/node/LayoutTreeConsistencyChecker.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method intermediateLayout has parameter 'measure' with type Function3<? super IntermediateMeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measure: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LookaheadScope.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor IntermediateLayoutElement has parameter 'measure' with type Function3<? super IntermediateMeasureScope, ? super Measurable, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measure: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LookaheadScope.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function3<IntermediateMeasureScope, Measurable, Constraints, MeasureResult> of 'getMeasure'."
+ errorLine1=" val measure: IntermediateMeasureScope.("
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/LookaheadScope.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method onSizeChanged has parameter 'onSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" onSizeChanged: (IntSize) -> Unit"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor OnSizeChangedModifier has parameter 'onSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" val onSizeChanged: (IntSize) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function1<IntSize, Unit> of 'getOnSizeChanged'."
+ errorLine1=" val onSizeChanged: (IntSize) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/OnRemeasuredModifier.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method invokeOverAllPasses has parameter '$this$invokeOverAllPasses' with type Function3<? super PointerEvent, ? super PointerEventPass, ? super IntSize, Unit>."
+ errorLine1="internal fun PointerInputHandler.invokeOverAllPasses("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method invokeOverPass has parameter '$this$invokeOverPass' with type Function3<? super PointerEvent, ? super PointerEventPass, ? super IntSize, Unit>."
+ errorLine1="internal fun PointerInputHandler.invokeOverPass("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method invokeOverPasses has parameter '$this$invokeOverPasses' with type Function3<? super PointerEvent, ? super PointerEventPass, ? super IntSize, Unit>."
+ errorLine1="internal fun PointerInputHandler.invokeOverPasses("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method invokeOverPasses has parameter '$this$invokeOverPasses' with type Function3<? super PointerEvent, ? super PointerEventPass, ? super IntSize, Unit>."
+ errorLine1="internal fun PointerInputHandler.invokeOverPasses("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/input/pointer/PointerInputTestUtil.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type SemanticsPropertyKey<Function1<Object, Integer>> of 'getIndexForKey'."
errorLine1=" val IndexForKey = SemanticsPropertyKey<(Any) -> Int>("IndexForKey")"
errorLine2=" ~~~~~~~~~~~">
@@ -345,6 +543,87 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method SubcomposeLayout has parameter 'measurePolicy' with type Function2<? super SubcomposeMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measurePolicy: SubcomposeMeasureScope.(Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method SubcomposeLayout has parameter 'measurePolicy' with type Function2<? super SubcomposeMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" measurePolicy: SubcomposeMeasureScope.(Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LayoutNode, Function2<? super SubcomposeMeasureScope, ? super Constraints, ? extends MeasureResult>, Unit> of 'getSetMeasurePolicy$lint_module'."
+ errorLine1=" LayoutNode.((SubcomposeMeasureScope.(Constraints) -> MeasureResult)) -> Unit ="
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method createMeasurePolicy has parameter 'block' with type Function2<? super SubcomposeMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" block: SubcomposeMeasureScope.(Constraints) -> MeasureResult"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/layout/SubcomposeLayout.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'majorAxisDistance' with type Function1<? super Rect, ? extends Float>."
+ errorLine1=" // The distance from the edge furthest in the given direction of source to the edge nearest"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/focus/TwoDimensionalFocusSearch.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'minorAxisDistance' with type Function1<? super Rect, ? extends Float>."
+ errorLine1=" // Find the distance on the minor axis w.r.t the direction to the nearest edge of the"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/focus/TwoDimensionalFocusSearch.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'weightedDistance' with type Function1<? super Rect, ? extends Long>."
+ errorLine1=" // Fudge-factor opportunity: how to calculate distance given major and minor axis distances."
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/focus/TwoDimensionalFocusSearch.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'majorAxisDistance' with type Function1<? super Rect, ? extends Float>."
+ errorLine1=" // The distance from the edge furthest in the given direction of source to the edge nearest"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/focus/TwoDimensionalFocusSearch.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'majorAxisDistanceToFarEdge' with type Function1<? super Rect, ? extends Float>."
+ errorLine1=" // The distance along the major axis w.r.t the direction from the edge of source to the far"
+ errorLine2=" ^">
+ <location
+ file="src/commonMain/kotlin/androidx/compose/ui/focus/TwoDimensionalFocusSearch.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberVectorPainter has parameter 'content' with type Function2<? super Float, ? super Float, Unit>."
errorLine1=" content: @Composable @VectorComposable (viewportWidth: Float, viewportHeight: Float) -> Unit"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlsTest.kt b/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlsTest.kt
index af87916..af294a3 100644
--- a/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlsTest.kt
+++ b/core/core-telecom/src/androidTest/java/androidx/core/telecom/BasicCallControlsTest.kt
@@ -21,11 +21,13 @@
import androidx.annotation.RequiresApi
import androidx.core.telecom.internal.utils.Utils
import androidx.core.telecom.utils.BaseTelecomTest
+import androidx.core.telecom.utils.MockInCallService
import androidx.core.telecom.utils.TestUtils
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.filters.SdkSuppress
import kotlinx.coroutines.CompletableDeferred
+import kotlinx.coroutines.cancel
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
@@ -134,6 +136,31 @@
runBlocking_RequestEndpointChangeAsserts()
}
+ /**
+ * assert [CallsManager.addCall] can successfully add a call and verifies that requests to
+ * mute/unmute the call are reflected in [CallControlScope.isMuted]. The call should use the
+ * *V2 platform APIs* under the hood.
+ */
+ @SdkSuppress(minSdkVersion = VERSION_CODES.UPSIDE_DOWN_CAKE)
+ @LargeTest
+ @Test
+ fun testIsMuted() {
+ setUpV2Test()
+ verifyMuteStateChange()
+ }
+
+ /**
+ * assert that an exception is thrown in the call flow when CallControlScope#setCallbacks isn't
+ * the first function to be invoked. The call should use the *V2 platform APIs* under the hood.
+ */
+ @SdkSuppress(minSdkVersion = VERSION_CODES.UPSIDE_DOWN_CAKE)
+ @LargeTest
+ @Test
+ fun testBasicCallControlCallbackOperations_CallbackNotSet() {
+ setUpV2Test()
+ verifyAnswerCallFails_CallbackNotSet()
+ }
+
/***********************************************************************************************
* Backwards Compatibility Layer tests
*********************************************************************************************/
@@ -209,6 +236,32 @@
// not actually verify the request was successful. Need to change the impl. details.
}
+ /**
+ * assert [CallsManager.addCall] can successfully add a call and verifies that requests to
+ * mute/unmute the call are reflected in [CallControlScope.isMuted]. The call should use the
+ * *[android.telecom.ConnectionService] and [android.telecom.Connection] APIs* under the hood.
+ */
+ @SdkSuppress(minSdkVersion = VERSION_CODES.O)
+ @LargeTest
+ @Test
+ fun testIsMuted_BackwardsCompat() {
+ setUpBackwardsCompatTest()
+ verifyMuteStateChange()
+ }
+
+ /**
+ * assert that an exception is thrown in the call flow when CallControlScope#setCallbacks isn't
+ * the first function to be invoked. The call should use the
+ * *[android.telecom.ConnectionService] and [android.telecom.Connection] APIs* under the hood.
+ */
+ @SdkSuppress(minSdkVersion = VERSION_CODES.O)
+ @LargeTest
+ @Test
+ fun testBasicCallControlCallbackOperations_BackwardsCompat_CallbackNotSet() {
+ setUpBackwardsCompatTest()
+ verifyAnswerCallFails_CallbackNotSet()
+ }
+
/***********************************************************************************************
* Helpers
*********************************************************************************************/
@@ -301,6 +354,78 @@
}
}
+ /**
+ * This helper verifies that [CallControlScope.isMuted] properly collects updates to the mute
+ * state via [MockInCallService.setMuted].
+ *
+ * Note: Due to the possibility that the channel can receive stale updates, it's necessary to
+ * keep receiving those updates until the state does change. To prevent the test execution from
+ * blocking on additional updates, the coroutine scope needs to be cancelled.
+ */
+ @Suppress("deprecation")
+ private fun verifyMuteStateChange() {
+ runBlocking {
+ val deferred = CompletableDeferred<Unit>()
+ assertWithinTimeout_addCall(deferred, TestUtils.OUTGOING_CALL_ATTRIBUTES) {
+ launch {
+ assertTrue(setActive())
+ // Grab initial mute state
+ val initialMuteState = isMuted.first()
+ // Toggle to other state
+ val setMuteStateTo = !initialMuteState
+ var muteStateChanged = false
+ // Toggle mute via ICS
+ MockInCallService.setMute(setMuteStateTo)
+ runBlocking {
+ launch {
+ isMuted.collect {
+ if (it != initialMuteState) {
+ muteStateChanged = true
+ // Cancel the coroutine to ensure we don't block on waiting for
+ // updates and force a timeout.
+ cancel()
+ }
+ }
+ }
+ }
+
+ // Ensure that the updated mute state was collected
+ assertTrue(muteStateChanged)
+ assertTrue(disconnect(DisconnectCause(DisconnectCause.LOCAL)))
+ deferred.complete(Unit) // completed all asserts. cancel timeout!
+ }
+ }
+ }
+ }
+
+ @Suppress("deprecation")
+ private fun verifyAnswerCallFails_CallbackNotSet() {
+ try {
+ runBlocking {
+ val deferred = CompletableDeferred<Unit>()
+ // Skip setting callback
+ assertWithinTimeout_addCall(deferred, TestUtils.INCOMING_CALL_ATTRIBUTES, false) {
+ launch {
+ val call = TestUtils.waitOnInCallServiceToReachXCalls(1)
+ assertNotNull("The returned Call object is <NULL>", call)
+ // Send answer request
+ answer(CallAttributesCompat.CALL_TYPE_AUDIO_CALL)
+ // Always send the disconnect signal if possible:
+ disconnect(DisconnectCause(DisconnectCause.LOCAL))
+ // CallException should be thrown at this point. Add failing assertion to
+ // ensure that the exception is always thrown.
+ assertTrue("Call was set to active without setting callbacks", false)
+ }
+ }
+ }
+ } catch (e: CallException) {
+ // Exception should be thrown from not setting the callback.
+ assertTrue(e.code == CallException.ERROR_CALLBACKS_CODE)
+ // Assert that the callback wasn't invoked
+ assertFalse(TestUtils.mOnAnswerCallbackCalled)
+ }
+ }
+
private fun getAnotherEndpoint(
currentEndpoint: CallEndpointCompat,
availableEndpoints: List<CallEndpointCompat>
diff --git a/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/BaseTelecomTest.kt b/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/BaseTelecomTest.kt
index 157928b..eb9a8a1 100644
--- a/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/BaseTelecomTest.kt
+++ b/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/BaseTelecomTest.kt
@@ -140,12 +140,15 @@
suspend fun assertWithinTimeout_addCall(
deferred: CompletableDeferred<Unit>,
attributes: CallAttributesCompat,
+ setCallback: Boolean = true,
assertBlock: CallControlScope.() -> (Unit)
) {
try {
withTimeout(TestUtils.WAIT_ON_ASSERTS_TO_FINISH_TIMEOUT) {
mCallsManager.addCall(attributes) {
- setCallback(TestUtils.mCallControlCallbacksImpl)
+ if (setCallback) {
+ setCallback(TestUtils.mCallControlCallbacksImpl)
+ }
assertBlock()
}
Log.i(TestUtils.LOG_TAG, "assertWithinTimeout: execution <PAUSED>")
diff --git a/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/MockInCallService.kt b/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/MockInCallService.kt
index 3efd8c0..d620ca7 100644
--- a/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/MockInCallService.kt
+++ b/core/core-telecom/src/androidTest/java/androidx/core/telecom/utils/MockInCallService.kt
@@ -31,6 +31,7 @@
val LOG_TAG = "MockInCallService"
val mCalls = Collections.synchronizedList(ArrayList<Call>())
var mIsServiceBound = false
+ var mService: MockInCallService? = null
@Suppress("deprecation")
fun destroyAllCalls() {
@@ -58,17 +59,25 @@
fun getCallCount(): Int {
return mCalls.size
}
+
+ fun setMute(muted: Boolean) {
+ mService?.setMuted(muted)
+ }
}
override fun onBind(intent: Intent?): IBinder? {
Log.i(LOG_TAG, "Service bounded")
mIsServiceBound = true
+ if (mService == null) {
+ mService = this
+ }
return super.onBind(intent)
}
override fun onUnbind(intent: Intent?): Boolean {
Log.i(LOG_TAG, "Service has been unbound")
mIsServiceBound = false
+ mService = null
return super.onUnbind(intent)
}
diff --git a/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSession.kt b/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSession.kt
index a0e2cae..d464886 100644
--- a/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSession.kt
+++ b/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSession.kt
@@ -230,7 +230,9 @@
// handle requests that originate from the client and propagate into platform
// return the platforms response which indicates success of the request.
override fun getCallId(): ParcelUuid {
- verifySessionCallbacks()
+ CoroutineScope(session.mCoroutineContext).launch {
+ verifySessionCallbacks()
+ }
return session.getCallId()
}
@@ -272,10 +274,15 @@
override val isMuted: Flow<Boolean> =
callChannels.isMutedChannel.receiveAsFlow()
- private fun verifySessionCallbacks() {
- if (!session.hasClientSetCallbacks()) {
- throw androidx.core.telecom.CallException(
- androidx.core.telecom.CallException.ERROR_CALLBACKS_CODE)
+ private suspend fun verifySessionCallbacks() {
+ CoroutineScope(session.mCoroutineContext).launch {
+ if (!session.hasClientSetCallbacks()) {
+ // Always send disconnect signal so that we don't end up with stuck calls.
+ session.disconnect(DisconnectCause(DisconnectCause.LOCAL))
+ throw androidx.core.telecom.CallException(
+ androidx.core.telecom.CallException.ERROR_CALLBACKS_CODE
+ )
+ }
}
}
}
diff --git a/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSessionLegacy.kt b/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSessionLegacy.kt
index e5a6d35..5f3d00d 100644
--- a/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSessionLegacy.kt
+++ b/core/core-telecom/src/main/java/androidx/core/telecom/internal/CallSessionLegacy.kt
@@ -361,6 +361,8 @@
private fun verifySessionCallbacks() {
if (!session.hasClientSetCallbacks()) {
+ // Always send disconnect signal so that we don't end up with stuck calls.
+ session.setDisconnected(DisconnectCause(DisconnectCause.LOCAL))
throw CallException(CallException.ERROR_CALLBACKS_CODE)
}
}
diff --git a/credentials/credentials-play-services-auth/api/1.2.0-beta01.txt b/credentials/credentials-play-services-auth/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/credentials/credentials-play-services-auth/api/1.2.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/credentials/credentials-play-services-auth/api/res-1.2.0-beta01.txt b/credentials/credentials-play-services-auth/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/credentials/credentials-play-services-auth/api/res-1.2.0-beta01.txt
diff --git a/credentials/credentials-play-services-auth/api/restricted_1.2.0-beta01.txt b/credentials/credentials-play-services-auth/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..e6f50d0
--- /dev/null
+++ b/credentials/credentials-play-services-auth/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1 @@
+// Signature format: 4.0
diff --git a/credentials/credentials/api/1.2.0-beta01.txt b/credentials/credentials/api/1.2.0-beta01.txt
new file mode 100644
index 0000000..3a1d7df
--- /dev/null
+++ b/credentials/credentials/api/1.2.0-beta01.txt
@@ -0,0 +1,900 @@
+// Signature format: 4.0
+package androidx.credentials {
+
+ public final class ClearCredentialStateRequest {
+ ctor public ClearCredentialStateRequest();
+ }
+
+ public abstract class CreateCredentialRequest {
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final android.os.Bundle getCredentialData();
+ method public final androidx.credentials.CreateCredentialRequest.DisplayInfo getDisplayInfo();
+ method public final String? getOrigin();
+ method public final boolean getPreferImmediatelyAvailableCredentials();
+ method public final String getType();
+ method public final boolean isAutoSelectAllowed();
+ method public final boolean isSystemProviderRequired();
+ property public final android.os.Bundle candidateQueryData;
+ property public final android.os.Bundle credentialData;
+ property public final androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo;
+ property public final boolean isAutoSelectAllowed;
+ property public final boolean isSystemProviderRequired;
+ property public final String? origin;
+ property public final boolean preferImmediatelyAvailableCredentials;
+ property public final String type;
+ }
+
+ public static final class CreateCredentialRequest.DisplayInfo {
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId);
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId, optional CharSequence? userDisplayName);
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId, CharSequence? userDisplayName, String? preferDefaultProvider);
+ method public CharSequence? getUserDisplayName();
+ method public CharSequence getUserId();
+ property public final CharSequence? userDisplayName;
+ property public final CharSequence userId;
+ }
+
+ public abstract class CreateCredentialResponse {
+ method public final android.os.Bundle getData();
+ method public final String getType();
+ property public final android.os.Bundle data;
+ property public final String type;
+ }
+
+ public class CreateCustomCredentialRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed, optional String? origin);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed, optional String? origin, optional boolean preferImmediatelyAvailableCredentials);
+ }
+
+ public class CreateCustomCredentialResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreateCustomCredentialResponse(String type, android.os.Bundle data);
+ }
+
+ public final class CreatePasswordRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreatePasswordRequest(String id, String password);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin, optional boolean preferImmediatelyAvailableCredentials);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin, optional boolean preferImmediatelyAvailableCredentials, optional boolean isAutoSelectAllowed);
+ ctor public CreatePasswordRequest(String id, String password, String? origin, String? preferDefaultProvider, boolean preferImmediatelyAvailableCredentials, boolean isAutoSelectAllowed);
+ method public String getId();
+ method public String getPassword();
+ property public final String id;
+ property public final String password;
+ }
+
+ public final class CreatePasswordResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreatePasswordResponse();
+ }
+
+ public final class CreatePublicKeyCredentialRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreatePublicKeyCredentialRequest(String requestJson);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials, optional String? origin);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials, optional String? origin, optional boolean isAutoSelectAllowed);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, byte[]? clientDataHash, boolean preferImmediatelyAvailableCredentials, String? origin, String? preferDefaultProvider, boolean isAutoSelectAllowed);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class CreatePublicKeyCredentialResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreatePublicKeyCredentialResponse(String registrationResponseJson);
+ method public String getRegistrationResponseJson();
+ property public final String registrationResponseJson;
+ }
+
+ public abstract class Credential {
+ method public final android.os.Bundle getData();
+ method public final String getType();
+ property public final android.os.Bundle data;
+ property public final String type;
+ }
+
+ @RequiresApi(16) public interface CredentialManager {
+ method public default suspend Object? clearCredentialState(androidx.credentials.ClearCredentialStateRequest request, kotlin.coroutines.Continuation<? super kotlin.Unit>);
+ method public void clearCredentialStateAsync(androidx.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ method public static androidx.credentials.CredentialManager create(android.content.Context context);
+ method public default suspend Object? createCredential(android.content.Context context, androidx.credentials.CreateCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.CreateCredentialResponse>);
+ method public void createCredentialAsync(android.content.Context context, androidx.credentials.CreateCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.CreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method @RequiresApi(34) public android.app.PendingIntent createSettingsPendingIntent();
+ method public default suspend Object? getCredential(android.content.Context context, androidx.credentials.GetCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.GetCredentialResponse>);
+ method @RequiresApi(34) public default suspend Object? getCredential(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, kotlin.coroutines.Continuation<? super androidx.credentials.GetCredentialResponse>);
+ method public void getCredentialAsync(android.content.Context context, androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public void getCredentialAsync(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default suspend Object? prepareGetCredential(androidx.credentials.GetCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.PrepareGetCredentialResponse>);
+ method @RequiresApi(34) public void prepareGetCredentialAsync(androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.PrepareGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ field public static final androidx.credentials.CredentialManager.Companion Companion;
+ }
+
+ public static final class CredentialManager.Companion {
+ method public androidx.credentials.CredentialManager create(android.content.Context context);
+ }
+
+ public interface CredentialManagerCallback<R, E> {
+ method public void onError(E e);
+ method public void onResult(R result);
+ }
+
+ public abstract class CredentialOption {
+ method public final java.util.Set<android.content.ComponentName> getAllowedProviders();
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final android.os.Bundle getRequestData();
+ method public final String getType();
+ method public final boolean isAutoSelectAllowed();
+ method public final boolean isSystemProviderRequired();
+ property public final java.util.Set<android.content.ComponentName> allowedProviders;
+ property public final android.os.Bundle candidateQueryData;
+ property public final boolean isAutoSelectAllowed;
+ property public final boolean isSystemProviderRequired;
+ property public final android.os.Bundle requestData;
+ property public final String type;
+ }
+
+ public interface CredentialProvider {
+ method public boolean isAvailableOnDevice();
+ method public void onClearCredential(androidx.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ method public void onCreateCredential(android.content.Context context, androidx.credentials.CreateCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.CreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method public void onGetCredential(android.content.Context context, androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default void onGetCredential(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default void onPrepareCredential(androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.PrepareGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ }
+
+ public class CustomCredential extends androidx.credentials.Credential {
+ ctor public CustomCredential(String type, android.os.Bundle data);
+ }
+
+ public final class GetCredentialRequest {
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi, optional android.content.ComponentName? preferUiBrandingComponentName);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi, optional android.content.ComponentName? preferUiBrandingComponentName, optional boolean preferImmediatelyAvailableCredentials);
+ method public java.util.List<androidx.credentials.CredentialOption> getCredentialOptions();
+ method public String? getOrigin();
+ method public boolean getPreferIdentityDocUi();
+ method public boolean getPreferImmediatelyAvailableCredentials();
+ method public android.content.ComponentName? getPreferUiBrandingComponentName();
+ property public final java.util.List<androidx.credentials.CredentialOption> credentialOptions;
+ property public final String? origin;
+ property public final boolean preferIdentityDocUi;
+ property public final boolean preferImmediatelyAvailableCredentials;
+ property public final android.content.ComponentName? preferUiBrandingComponentName;
+ }
+
+ public static final class GetCredentialRequest.Builder {
+ ctor public GetCredentialRequest.Builder();
+ method public androidx.credentials.GetCredentialRequest.Builder addCredentialOption(androidx.credentials.CredentialOption credentialOption);
+ method public androidx.credentials.GetCredentialRequest build();
+ method public androidx.credentials.GetCredentialRequest.Builder setCredentialOptions(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions);
+ method public androidx.credentials.GetCredentialRequest.Builder setOrigin(String origin);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferIdentityDocUi(boolean preferIdentityDocUi);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferImmediatelyAvailableCredentials(boolean preferImmediatelyAvailableCredentials);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferUiBrandingComponentName(android.content.ComponentName? component);
+ }
+
+ public final class GetCredentialResponse {
+ ctor public GetCredentialResponse(androidx.credentials.Credential credential);
+ method public androidx.credentials.Credential getCredential();
+ property public final androidx.credentials.Credential credential;
+ }
+
+ public class GetCustomCredentialOption extends androidx.credentials.CredentialOption {
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired);
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, optional boolean isAutoSelectAllowed);
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, optional boolean isAutoSelectAllowed, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ }
+
+ public final class GetPasswordOption extends androidx.credentials.CredentialOption {
+ ctor public GetPasswordOption();
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds);
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds, optional boolean isAutoSelectAllowed);
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds, optional boolean isAutoSelectAllowed, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ method public java.util.Set<java.lang.String> getAllowedUserIds();
+ property public final java.util.Set<java.lang.String> allowedUserIds;
+ }
+
+ public final class GetPublicKeyCredentialOption extends androidx.credentials.CredentialOption {
+ ctor public GetPublicKeyCredentialOption(String requestJson);
+ ctor public GetPublicKeyCredentialOption(String requestJson, optional byte[]? clientDataHash);
+ ctor public GetPublicKeyCredentialOption(String requestJson, optional byte[]? clientDataHash, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class PasswordCredential extends androidx.credentials.Credential {
+ ctor public PasswordCredential(String id, String password);
+ method public String getId();
+ method public String getPassword();
+ property public final String id;
+ property public final String password;
+ field public static final androidx.credentials.PasswordCredential.Companion Companion;
+ field public static final String TYPE_PASSWORD_CREDENTIAL = "android.credentials.TYPE_PASSWORD_CREDENTIAL";
+ }
+
+ public static final class PasswordCredential.Companion {
+ }
+
+ @RequiresApi(34) public final class PrepareGetCredentialResponse {
+ method public kotlin.jvm.functions.Function1<java.lang.String,java.lang.Boolean>? getCredentialTypeDelegate();
+ method public kotlin.jvm.functions.Function0<java.lang.Boolean>? getHasAuthResultsDelegate();
+ method public kotlin.jvm.functions.Function0<java.lang.Boolean>? getHasRemoteResultsDelegate();
+ method public androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? getPendingGetCredentialHandle();
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasAuthenticationResults();
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasCredentialResults(String credentialType);
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasRemoteResults();
+ method public boolean isNullHandlesForTest();
+ property public final kotlin.jvm.functions.Function1<java.lang.String,java.lang.Boolean>? credentialTypeDelegate;
+ property public final kotlin.jvm.functions.Function0<java.lang.Boolean>? hasAuthResultsDelegate;
+ property public final kotlin.jvm.functions.Function0<java.lang.Boolean>? hasRemoteResultsDelegate;
+ property public final boolean isNullHandlesForTest;
+ property public final androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? pendingGetCredentialHandle;
+ }
+
+ @RequiresApi(34) public static final class PrepareGetCredentialResponse.PendingGetCredentialHandle {
+ ctor public PrepareGetCredentialResponse.PendingGetCredentialHandle(android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? frameworkHandle);
+ }
+
+ @VisibleForTesting public static final class PrepareGetCredentialResponse.TestBuilder {
+ ctor public PrepareGetCredentialResponse.TestBuilder();
+ method public androidx.credentials.PrepareGetCredentialResponse build();
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setCredentialTypeDelegate(kotlin.jvm.functions.Function1<? super java.lang.String,java.lang.Boolean> handler);
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setHasAuthResultsDelegate(kotlin.jvm.functions.Function0<java.lang.Boolean> handler);
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setHasRemoteResultsDelegate(kotlin.jvm.functions.Function0<java.lang.Boolean> handler);
+ }
+
+ public final class PublicKeyCredential extends androidx.credentials.Credential {
+ ctor public PublicKeyCredential(String authenticationResponseJson);
+ method public String getAuthenticationResponseJson();
+ property public final String authenticationResponseJson;
+ field public static final androidx.credentials.PublicKeyCredential.Companion Companion;
+ field public static final String TYPE_PUBLIC_KEY_CREDENTIAL = "androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL";
+ }
+
+ public static final class PublicKeyCredential.Companion {
+ }
+
+}
+
+package androidx.credentials.exceptions {
+
+ public abstract class ClearCredentialException extends java.lang.Exception {
+ }
+
+ public final class ClearCredentialInterruptedException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialInterruptedException();
+ ctor public ClearCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialProviderConfigurationException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialProviderConfigurationException();
+ ctor public ClearCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialUnknownException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialUnknownException();
+ ctor public ClearCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialUnsupportedException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialUnsupportedException();
+ ctor public ClearCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCustomCredentialException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCustomCredentialException(String type);
+ ctor public ClearCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class CreateCredentialCancellationException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialCancellationException();
+ ctor public CreateCredentialCancellationException(optional CharSequence? errorMessage);
+ }
+
+ public abstract class CreateCredentialException extends java.lang.Exception {
+ }
+
+ public final class CreateCredentialInterruptedException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialInterruptedException();
+ ctor public CreateCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialNoCreateOptionException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialNoCreateOptionException();
+ ctor public CreateCredentialNoCreateOptionException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialProviderConfigurationException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialProviderConfigurationException();
+ ctor public CreateCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialUnknownException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialUnknownException();
+ ctor public CreateCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialUnsupportedException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialUnsupportedException();
+ ctor public CreateCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCustomCredentialException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCustomCredentialException(String type);
+ ctor public CreateCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class GetCredentialCancellationException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialCancellationException();
+ ctor public GetCredentialCancellationException(optional CharSequence? errorMessage);
+ }
+
+ public abstract class GetCredentialException extends java.lang.Exception {
+ }
+
+ public final class GetCredentialInterruptedException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialInterruptedException();
+ ctor public GetCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialProviderConfigurationException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialProviderConfigurationException();
+ ctor public GetCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialUnknownException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialUnknownException();
+ ctor public GetCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialUnsupportedException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialUnsupportedException();
+ ctor public GetCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCustomCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCustomCredentialException(String type);
+ ctor public GetCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class NoCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public NoCredentialException();
+ ctor public NoCredentialException(optional CharSequence? errorMessage);
+ }
+
+}
+
+package androidx.credentials.exceptions.domerrors {
+
+ public final class AbortError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public AbortError();
+ }
+
+ public final class ConstraintError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public ConstraintError();
+ }
+
+ public final class DataCloneError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public DataCloneError();
+ }
+
+ public final class DataError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public DataError();
+ }
+
+ public abstract class DomError {
+ ctor public DomError(String type);
+ }
+
+ public final class EncodingError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public EncodingError();
+ }
+
+ public final class HierarchyRequestError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public HierarchyRequestError();
+ }
+
+ public final class InUseAttributeError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InUseAttributeError();
+ }
+
+ public final class InvalidCharacterError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidCharacterError();
+ }
+
+ public final class InvalidModificationError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidModificationError();
+ }
+
+ public final class InvalidNodeTypeError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidNodeTypeError();
+ }
+
+ public final class InvalidStateError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidStateError();
+ }
+
+ public final class NamespaceError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NamespaceError();
+ }
+
+ public final class NetworkError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NetworkError();
+ }
+
+ public final class NoModificationAllowedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NoModificationAllowedError();
+ }
+
+ public final class NotAllowedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotAllowedError();
+ }
+
+ public final class NotFoundError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotFoundError();
+ }
+
+ public final class NotReadableError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotReadableError();
+ }
+
+ public final class NotSupportedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotSupportedError();
+ }
+
+ public final class OperationError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public OperationError();
+ }
+
+ public final class OptOutError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public OptOutError();
+ }
+
+ public final class QuotaExceededError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public QuotaExceededError();
+ }
+
+ public final class ReadOnlyError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public ReadOnlyError();
+ }
+
+ public final class SecurityError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public SecurityError();
+ }
+
+ public final class SyntaxError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public SyntaxError();
+ }
+
+ public final class TimeoutError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public TimeoutError();
+ }
+
+ public final class TransactionInactiveError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public TransactionInactiveError();
+ }
+
+ public final class UnknownError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public UnknownError();
+ }
+
+ public final class VersionError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public VersionError();
+ }
+
+ public final class WrongDocumentError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public WrongDocumentError();
+ }
+
+}
+
+package androidx.credentials.exceptions.publickeycredential {
+
+ public final class CreatePublicKeyCredentialDomException extends androidx.credentials.exceptions.publickeycredential.CreatePublicKeyCredentialException {
+ ctor public CreatePublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError);
+ ctor public CreatePublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError, optional CharSequence? errorMessage);
+ method public androidx.credentials.exceptions.domerrors.DomError getDomError();
+ property public final androidx.credentials.exceptions.domerrors.DomError domError;
+ }
+
+ public class CreatePublicKeyCredentialException extends androidx.credentials.exceptions.CreateCredentialException {
+ }
+
+ public final class GetPublicKeyCredentialDomException extends androidx.credentials.exceptions.publickeycredential.GetPublicKeyCredentialException {
+ ctor public GetPublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError);
+ ctor public GetPublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError, optional CharSequence? errorMessage);
+ method public androidx.credentials.exceptions.domerrors.DomError getDomError();
+ property public final androidx.credentials.exceptions.domerrors.DomError domError;
+ }
+
+ public class GetPublicKeyCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ }
+
+}
+
+package androidx.credentials.provider {
+
+ public final class Action {
+ ctor public Action(CharSequence title, android.app.PendingIntent pendingIntent, optional CharSequence? subtitle);
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence? getSubtitle();
+ method public CharSequence getTitle();
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence? subtitle;
+ property public final CharSequence title;
+ }
+
+ public static final class Action.Builder {
+ ctor public Action.Builder(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.Action build();
+ method public androidx.credentials.provider.Action.Builder setSubtitle(CharSequence? subtitle);
+ }
+
+ public final class AuthenticationAction {
+ ctor public AuthenticationAction(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTitle();
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence title;
+ }
+
+ public static final class AuthenticationAction.Builder {
+ ctor public AuthenticationAction.Builder(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.AuthenticationAction build();
+ }
+
+ public abstract class BeginCreateCredentialRequest {
+ ctor public BeginCreateCredentialRequest(String type, android.os.Bundle candidateQueryData, androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ method public static final android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialRequest request);
+ method public static final androidx.credentials.provider.BeginCreateCredentialRequest? fromBundle(android.os.Bundle bundle);
+ method public final androidx.credentials.provider.CallingAppInfo? getCallingAppInfo();
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final String getType();
+ property public final androidx.credentials.provider.CallingAppInfo? callingAppInfo;
+ property public final android.os.Bundle candidateQueryData;
+ property public final String type;
+ field public static final androidx.credentials.provider.BeginCreateCredentialRequest.Companion Companion;
+ }
+
+ public static final class BeginCreateCredentialRequest.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialRequest request);
+ method public androidx.credentials.provider.BeginCreateCredentialRequest? fromBundle(android.os.Bundle bundle);
+ }
+
+ public final class BeginCreateCredentialResponse {
+ ctor public BeginCreateCredentialResponse(optional java.util.List<androidx.credentials.provider.CreateEntry> createEntries, optional androidx.credentials.provider.RemoteEntry? remoteEntry);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialResponse response);
+ method public static androidx.credentials.provider.BeginCreateCredentialResponse? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.CreateEntry> getCreateEntries();
+ method public androidx.credentials.provider.RemoteEntry? getRemoteEntry();
+ property public final java.util.List<androidx.credentials.provider.CreateEntry> createEntries;
+ property public final androidx.credentials.provider.RemoteEntry? remoteEntry;
+ field public static final androidx.credentials.provider.BeginCreateCredentialResponse.Companion Companion;
+ }
+
+ public static final class BeginCreateCredentialResponse.Builder {
+ ctor public BeginCreateCredentialResponse.Builder();
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder addCreateEntry(androidx.credentials.provider.CreateEntry createEntry);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse build();
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder setCreateEntries(java.util.List<androidx.credentials.provider.CreateEntry> createEntries);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder setRemoteEntry(androidx.credentials.provider.RemoteEntry? remoteEntry);
+ }
+
+ public static final class BeginCreateCredentialResponse.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialResponse response);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse? fromBundle(android.os.Bundle bundle);
+ }
+
+ public class BeginCreateCustomCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreateCustomCredentialRequest(String type, android.os.Bundle candidateQueryData, androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ }
+
+ public final class BeginCreatePasswordCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreatePasswordCredentialRequest(androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData);
+ }
+
+ public final class BeginCreatePublicKeyCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreatePublicKeyCredentialRequest(String requestJson, androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData);
+ ctor public BeginCreatePublicKeyCredentialRequest(String requestJson, androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData, optional byte[]? clientDataHash);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public abstract class BeginGetCredentialOption {
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final String getId();
+ method public final String getType();
+ property public final android.os.Bundle candidateQueryData;
+ property public final String id;
+ property public final String type;
+ }
+
+ public final class BeginGetCredentialRequest {
+ ctor public BeginGetCredentialRequest(java.util.List<? extends androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions);
+ ctor public BeginGetCredentialRequest(java.util.List<? extends androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions, optional androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialRequest request);
+ method public static androidx.credentials.provider.BeginGetCredentialRequest? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.BeginGetCredentialOption> getBeginGetCredentialOptions();
+ method public androidx.credentials.provider.CallingAppInfo? getCallingAppInfo();
+ property public final java.util.List<androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions;
+ property public final androidx.credentials.provider.CallingAppInfo? callingAppInfo;
+ field public static final androidx.credentials.provider.BeginGetCredentialRequest.Companion Companion;
+ }
+
+ public static final class BeginGetCredentialRequest.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialRequest request);
+ method public androidx.credentials.provider.BeginGetCredentialRequest? fromBundle(android.os.Bundle bundle);
+ }
+
+ public final class BeginGetCredentialResponse {
+ ctor public BeginGetCredentialResponse(optional java.util.List<? extends androidx.credentials.provider.CredentialEntry> credentialEntries, optional java.util.List<androidx.credentials.provider.Action> actions, optional java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationActions, optional androidx.credentials.provider.RemoteEntry? remoteEntry);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public static androidx.credentials.provider.BeginGetCredentialResponse? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.Action> getActions();
+ method public java.util.List<androidx.credentials.provider.AuthenticationAction> getAuthenticationActions();
+ method public java.util.List<androidx.credentials.provider.CredentialEntry> getCredentialEntries();
+ method public androidx.credentials.provider.RemoteEntry? getRemoteEntry();
+ property public final java.util.List<androidx.credentials.provider.Action> actions;
+ property public final java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationActions;
+ property public final java.util.List<androidx.credentials.provider.CredentialEntry> credentialEntries;
+ property public final androidx.credentials.provider.RemoteEntry? remoteEntry;
+ field public static final androidx.credentials.provider.BeginGetCredentialResponse.Companion Companion;
+ }
+
+ public static final class BeginGetCredentialResponse.Builder {
+ ctor public BeginGetCredentialResponse.Builder();
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addAction(androidx.credentials.provider.Action action);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addAuthenticationAction(androidx.credentials.provider.AuthenticationAction authenticationAction);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addCredentialEntry(androidx.credentials.provider.CredentialEntry entry);
+ method public androidx.credentials.provider.BeginGetCredentialResponse build();
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setActions(java.util.List<androidx.credentials.provider.Action> actions);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setAuthenticationActions(java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationEntries);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setCredentialEntries(java.util.List<? extends androidx.credentials.provider.CredentialEntry> entries);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setRemoteEntry(androidx.credentials.provider.RemoteEntry? remoteEntry);
+ }
+
+ public static final class BeginGetCredentialResponse.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public androidx.credentials.provider.BeginGetCredentialResponse? fromBundle(android.os.Bundle bundle);
+ }
+
+ public class BeginGetCustomCredentialOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetCustomCredentialOption(String id, String type, android.os.Bundle candidateQueryData);
+ }
+
+ public final class BeginGetPasswordOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetPasswordOption(java.util.Set<java.lang.String> allowedUserIds, android.os.Bundle candidateQueryData, String id);
+ method public java.util.Set<java.lang.String> getAllowedUserIds();
+ property public final java.util.Set<java.lang.String> allowedUserIds;
+ }
+
+ public final class BeginGetPublicKeyCredentialOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetPublicKeyCredentialOption(android.os.Bundle candidateQueryData, String id, String requestJson);
+ ctor public BeginGetPublicKeyCredentialOption(android.os.Bundle candidateQueryData, String id, String requestJson, optional byte[]? clientDataHash);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class CallingAppInfo {
+ ctor public CallingAppInfo(String packageName, android.content.pm.SigningInfo signingInfo);
+ ctor public CallingAppInfo(String packageName, android.content.pm.SigningInfo signingInfo, optional String? origin);
+ method public String? getOrigin();
+ method public String getPackageName();
+ method public android.content.pm.SigningInfo getSigningInfo();
+ property public final String? origin;
+ property public final String packageName;
+ property public final android.content.pm.SigningInfo signingInfo;
+ }
+
+ @RequiresApi(26) public final class CreateEntry {
+ ctor public CreateEntry(CharSequence accountName, android.app.PendingIntent pendingIntent, optional CharSequence? description, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon? icon, optional Integer? passwordCredentialCount, optional Integer? publicKeyCredentialCount, optional Integer? totalCredentialCount, optional boolean isAutoSelectAllowed);
+ method public CharSequence getAccountName();
+ method public CharSequence? getDescription();
+ method public android.graphics.drawable.Icon? getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public Integer? getPasswordCredentialCount();
+ method public android.app.PendingIntent getPendingIntent();
+ method public Integer? getPublicKeyCredentialCount();
+ method public Integer? getTotalCredentialCount();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence accountName;
+ property public final CharSequence? description;
+ property public final android.graphics.drawable.Icon? icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ }
+
+ public static final class CreateEntry.Builder {
+ ctor public CreateEntry.Builder(CharSequence accountName, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.CreateEntry build();
+ method public androidx.credentials.provider.CreateEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.CreateEntry.Builder setDescription(CharSequence? description);
+ method public androidx.credentials.provider.CreateEntry.Builder setIcon(android.graphics.drawable.Icon? icon);
+ method public androidx.credentials.provider.CreateEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ method public androidx.credentials.provider.CreateEntry.Builder setPasswordCredentialCount(int count);
+ method public androidx.credentials.provider.CreateEntry.Builder setPublicKeyCredentialCount(int count);
+ method public androidx.credentials.provider.CreateEntry.Builder setTotalCredentialCount(int count);
+ }
+
+ public abstract class CredentialEntry {
+ method public final androidx.credentials.provider.BeginGetCredentialOption getBeginGetCredentialOption();
+ property public final androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption;
+ }
+
+ @RequiresApi(34) public abstract class CredentialProviderService extends android.service.credentials.CredentialProviderService {
+ ctor public CredentialProviderService();
+ method public final void onBeginCreateCredential(android.service.credentials.BeginCreateCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<android.service.credentials.BeginCreateCredentialResponse,android.credentials.CreateCredentialException> callback);
+ method public abstract void onBeginCreateCredentialRequest(androidx.credentials.provider.BeginCreateCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<androidx.credentials.provider.BeginCreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method public final void onBeginGetCredential(android.service.credentials.BeginGetCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<android.service.credentials.BeginGetCredentialResponse,android.credentials.GetCredentialException> callback);
+ method public abstract void onBeginGetCredentialRequest(androidx.credentials.provider.BeginGetCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<androidx.credentials.provider.BeginGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method public final void onClearCredentialState(android.service.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<java.lang.Void,android.credentials.ClearCredentialStateException> callback);
+ method public abstract void onClearCredentialStateRequest(androidx.credentials.provider.ProviderClearCredentialStateRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ }
+
+ @RequiresApi(26) public final class CustomCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public CustomCredentialEntry(android.content.Context context, CharSequence title, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption, optional CharSequence? subtitle, optional CharSequence? typeDisplayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence? getSubtitle();
+ method public CharSequence getTitle();
+ method public String getType();
+ method public CharSequence? getTypeDisplayName();
+ method public boolean isAutoSelectAllowed();
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence? subtitle;
+ property public final CharSequence title;
+ property public String type;
+ property public final CharSequence? typeDisplayName;
+ }
+
+ public static final class CustomCredentialEntry.Builder {
+ ctor public CustomCredentialEntry.Builder(android.content.Context context, String type, CharSequence title, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption);
+ method public androidx.credentials.provider.CustomCredentialEntry build();
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setSubtitle(CharSequence? subtitle);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setTypeDisplayName(CharSequence? typeDisplayName);
+ }
+
+ public final class IntentHandlerConverters {
+ method @RequiresApi(34) public static androidx.credentials.provider.BeginGetCredentialResponse? getBeginGetResponse(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.CreateCredentialResponse? getCreateCredentialCredentialResponse(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.CreateCredentialException? getCreateCredentialException(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.GetCredentialException? getGetCredentialException(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.GetCredentialResponse? getGetCredentialResponse(android.content.Intent);
+ }
+
+ @RequiresApi(26) public final class PasswordCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public PasswordCredentialEntry(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPasswordOption beginGetPasswordOption, optional CharSequence? displayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public CharSequence? getDisplayName();
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTypeDisplayName();
+ method public CharSequence getUsername();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence? displayName;
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence typeDisplayName;
+ property public final CharSequence username;
+ }
+
+ public static final class PasswordCredentialEntry.Builder {
+ ctor public PasswordCredentialEntry.Builder(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPasswordOption beginGetPasswordOption);
+ method public androidx.credentials.provider.PasswordCredentialEntry build();
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setDisplayName(CharSequence? displayName);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ }
+
+ @RequiresApi(34) public final class PendingIntentHandler {
+ ctor public PendingIntentHandler();
+ method public static androidx.credentials.provider.BeginGetCredentialRequest? retrieveBeginGetCredentialRequest(android.content.Intent intent);
+ method public static androidx.credentials.provider.ProviderCreateCredentialRequest? retrieveProviderCreateCredentialRequest(android.content.Intent intent);
+ method public static androidx.credentials.provider.ProviderGetCredentialRequest? retrieveProviderGetCredentialRequest(android.content.Intent intent);
+ method public static void setBeginGetCredentialResponse(android.content.Intent intent, androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public static void setCreateCredentialException(android.content.Intent intent, androidx.credentials.exceptions.CreateCredentialException exception);
+ method public static void setCreateCredentialResponse(android.content.Intent intent, androidx.credentials.CreateCredentialResponse response);
+ method public static void setGetCredentialException(android.content.Intent intent, androidx.credentials.exceptions.GetCredentialException exception);
+ method public static void setGetCredentialResponse(android.content.Intent intent, androidx.credentials.GetCredentialResponse response);
+ field public static final androidx.credentials.provider.PendingIntentHandler.Companion Companion;
+ }
+
+ public static final class PendingIntentHandler.Companion {
+ method public androidx.credentials.provider.BeginGetCredentialRequest? retrieveBeginGetCredentialRequest(android.content.Intent intent);
+ method public androidx.credentials.provider.ProviderCreateCredentialRequest? retrieveProviderCreateCredentialRequest(android.content.Intent intent);
+ method public androidx.credentials.provider.ProviderGetCredentialRequest? retrieveProviderGetCredentialRequest(android.content.Intent intent);
+ method public void setBeginGetCredentialResponse(android.content.Intent intent, androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public void setCreateCredentialException(android.content.Intent intent, androidx.credentials.exceptions.CreateCredentialException exception);
+ method public void setCreateCredentialResponse(android.content.Intent intent, androidx.credentials.CreateCredentialResponse response);
+ method public void setGetCredentialException(android.content.Intent intent, androidx.credentials.exceptions.GetCredentialException exception);
+ method public void setGetCredentialResponse(android.content.Intent intent, androidx.credentials.GetCredentialResponse response);
+ }
+
+ public final class ProviderClearCredentialStateRequest {
+ ctor public ProviderClearCredentialStateRequest(androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ }
+
+ public final class ProviderCreateCredentialRequest {
+ ctor public ProviderCreateCredentialRequest(androidx.credentials.CreateCredentialRequest callingRequest, androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ method public androidx.credentials.CreateCredentialRequest getCallingRequest();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ property public final androidx.credentials.CreateCredentialRequest callingRequest;
+ }
+
+ public final class ProviderGetCredentialRequest {
+ ctor public ProviderGetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ method public java.util.List<androidx.credentials.CredentialOption> getCredentialOptions();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ property public final java.util.List<androidx.credentials.CredentialOption> credentialOptions;
+ }
+
+ @RequiresApi(26) public final class PublicKeyCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public PublicKeyCredentialEntry(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption, optional CharSequence? displayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public CharSequence? getDisplayName();
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTypeDisplayName();
+ method public CharSequence getUsername();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence? displayName;
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence typeDisplayName;
+ property public final CharSequence username;
+ }
+
+ public static final class PublicKeyCredentialEntry.Builder {
+ ctor public PublicKeyCredentialEntry.Builder(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry build();
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setDisplayName(CharSequence? displayName);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ }
+
+ public final class RemoteEntry {
+ ctor public RemoteEntry(android.app.PendingIntent pendingIntent);
+ method public android.app.PendingIntent getPendingIntent();
+ property public final android.app.PendingIntent pendingIntent;
+ }
+
+ public static final class RemoteEntry.Builder {
+ ctor public RemoteEntry.Builder(android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.RemoteEntry build();
+ }
+
+}
+
diff --git a/credentials/credentials/api/res-1.2.0-beta01.txt b/credentials/credentials/api/res-1.2.0-beta01.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/credentials/credentials/api/res-1.2.0-beta01.txt
diff --git a/credentials/credentials/api/restricted_1.2.0-beta01.txt b/credentials/credentials/api/restricted_1.2.0-beta01.txt
new file mode 100644
index 0000000..3a1d7df
--- /dev/null
+++ b/credentials/credentials/api/restricted_1.2.0-beta01.txt
@@ -0,0 +1,900 @@
+// Signature format: 4.0
+package androidx.credentials {
+
+ public final class ClearCredentialStateRequest {
+ ctor public ClearCredentialStateRequest();
+ }
+
+ public abstract class CreateCredentialRequest {
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final android.os.Bundle getCredentialData();
+ method public final androidx.credentials.CreateCredentialRequest.DisplayInfo getDisplayInfo();
+ method public final String? getOrigin();
+ method public final boolean getPreferImmediatelyAvailableCredentials();
+ method public final String getType();
+ method public final boolean isAutoSelectAllowed();
+ method public final boolean isSystemProviderRequired();
+ property public final android.os.Bundle candidateQueryData;
+ property public final android.os.Bundle credentialData;
+ property public final androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo;
+ property public final boolean isAutoSelectAllowed;
+ property public final boolean isSystemProviderRequired;
+ property public final String? origin;
+ property public final boolean preferImmediatelyAvailableCredentials;
+ property public final String type;
+ }
+
+ public static final class CreateCredentialRequest.DisplayInfo {
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId);
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId, optional CharSequence? userDisplayName);
+ ctor public CreateCredentialRequest.DisplayInfo(CharSequence userId, CharSequence? userDisplayName, String? preferDefaultProvider);
+ method public CharSequence? getUserDisplayName();
+ method public CharSequence getUserId();
+ property public final CharSequence? userDisplayName;
+ property public final CharSequence userId;
+ }
+
+ public abstract class CreateCredentialResponse {
+ method public final android.os.Bundle getData();
+ method public final String getType();
+ property public final android.os.Bundle data;
+ property public final String type;
+ }
+
+ public class CreateCustomCredentialRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed, optional String? origin);
+ ctor public CreateCustomCredentialRequest(String type, android.os.Bundle credentialData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, androidx.credentials.CreateCredentialRequest.DisplayInfo displayInfo, optional boolean isAutoSelectAllowed, optional String? origin, optional boolean preferImmediatelyAvailableCredentials);
+ }
+
+ public class CreateCustomCredentialResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreateCustomCredentialResponse(String type, android.os.Bundle data);
+ }
+
+ public final class CreatePasswordRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreatePasswordRequest(String id, String password);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin, optional boolean preferImmediatelyAvailableCredentials);
+ ctor public CreatePasswordRequest(String id, String password, optional String? origin, optional boolean preferImmediatelyAvailableCredentials, optional boolean isAutoSelectAllowed);
+ ctor public CreatePasswordRequest(String id, String password, String? origin, String? preferDefaultProvider, boolean preferImmediatelyAvailableCredentials, boolean isAutoSelectAllowed);
+ method public String getId();
+ method public String getPassword();
+ property public final String id;
+ property public final String password;
+ }
+
+ public final class CreatePasswordResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreatePasswordResponse();
+ }
+
+ public final class CreatePublicKeyCredentialRequest extends androidx.credentials.CreateCredentialRequest {
+ ctor public CreatePublicKeyCredentialRequest(String requestJson);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials, optional String? origin);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, optional byte[]? clientDataHash, optional boolean preferImmediatelyAvailableCredentials, optional String? origin, optional boolean isAutoSelectAllowed);
+ ctor public CreatePublicKeyCredentialRequest(String requestJson, byte[]? clientDataHash, boolean preferImmediatelyAvailableCredentials, String? origin, String? preferDefaultProvider, boolean isAutoSelectAllowed);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class CreatePublicKeyCredentialResponse extends androidx.credentials.CreateCredentialResponse {
+ ctor public CreatePublicKeyCredentialResponse(String registrationResponseJson);
+ method public String getRegistrationResponseJson();
+ property public final String registrationResponseJson;
+ }
+
+ public abstract class Credential {
+ method public final android.os.Bundle getData();
+ method public final String getType();
+ property public final android.os.Bundle data;
+ property public final String type;
+ }
+
+ @RequiresApi(16) public interface CredentialManager {
+ method public default suspend Object? clearCredentialState(androidx.credentials.ClearCredentialStateRequest request, kotlin.coroutines.Continuation<? super kotlin.Unit>);
+ method public void clearCredentialStateAsync(androidx.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ method public static androidx.credentials.CredentialManager create(android.content.Context context);
+ method public default suspend Object? createCredential(android.content.Context context, androidx.credentials.CreateCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.CreateCredentialResponse>);
+ method public void createCredentialAsync(android.content.Context context, androidx.credentials.CreateCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.CreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method @RequiresApi(34) public android.app.PendingIntent createSettingsPendingIntent();
+ method public default suspend Object? getCredential(android.content.Context context, androidx.credentials.GetCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.GetCredentialResponse>);
+ method @RequiresApi(34) public default suspend Object? getCredential(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, kotlin.coroutines.Continuation<? super androidx.credentials.GetCredentialResponse>);
+ method public void getCredentialAsync(android.content.Context context, androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public void getCredentialAsync(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default suspend Object? prepareGetCredential(androidx.credentials.GetCredentialRequest request, kotlin.coroutines.Continuation<? super androidx.credentials.PrepareGetCredentialResponse>);
+ method @RequiresApi(34) public void prepareGetCredentialAsync(androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.PrepareGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ field public static final androidx.credentials.CredentialManager.Companion Companion;
+ }
+
+ public static final class CredentialManager.Companion {
+ method public androidx.credentials.CredentialManager create(android.content.Context context);
+ }
+
+ public interface CredentialManagerCallback<R, E> {
+ method public void onError(E e);
+ method public void onResult(R result);
+ }
+
+ public abstract class CredentialOption {
+ method public final java.util.Set<android.content.ComponentName> getAllowedProviders();
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final android.os.Bundle getRequestData();
+ method public final String getType();
+ method public final boolean isAutoSelectAllowed();
+ method public final boolean isSystemProviderRequired();
+ property public final java.util.Set<android.content.ComponentName> allowedProviders;
+ property public final android.os.Bundle candidateQueryData;
+ property public final boolean isAutoSelectAllowed;
+ property public final boolean isSystemProviderRequired;
+ property public final android.os.Bundle requestData;
+ property public final String type;
+ }
+
+ public interface CredentialProvider {
+ method public boolean isAvailableOnDevice();
+ method public void onClearCredential(androidx.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ method public void onCreateCredential(android.content.Context context, androidx.credentials.CreateCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.CreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method public void onGetCredential(android.content.Context context, androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default void onGetCredential(android.content.Context context, androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.GetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method @RequiresApi(34) public default void onPrepareCredential(androidx.credentials.GetCredentialRequest request, android.os.CancellationSignal? cancellationSignal, java.util.concurrent.Executor executor, androidx.credentials.CredentialManagerCallback<androidx.credentials.PrepareGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ }
+
+ public class CustomCredential extends androidx.credentials.Credential {
+ ctor public CustomCredential(String type, android.os.Bundle data);
+ }
+
+ public final class GetCredentialRequest {
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi, optional android.content.ComponentName? preferUiBrandingComponentName);
+ ctor public GetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, optional String? origin, optional boolean preferIdentityDocUi, optional android.content.ComponentName? preferUiBrandingComponentName, optional boolean preferImmediatelyAvailableCredentials);
+ method public java.util.List<androidx.credentials.CredentialOption> getCredentialOptions();
+ method public String? getOrigin();
+ method public boolean getPreferIdentityDocUi();
+ method public boolean getPreferImmediatelyAvailableCredentials();
+ method public android.content.ComponentName? getPreferUiBrandingComponentName();
+ property public final java.util.List<androidx.credentials.CredentialOption> credentialOptions;
+ property public final String? origin;
+ property public final boolean preferIdentityDocUi;
+ property public final boolean preferImmediatelyAvailableCredentials;
+ property public final android.content.ComponentName? preferUiBrandingComponentName;
+ }
+
+ public static final class GetCredentialRequest.Builder {
+ ctor public GetCredentialRequest.Builder();
+ method public androidx.credentials.GetCredentialRequest.Builder addCredentialOption(androidx.credentials.CredentialOption credentialOption);
+ method public androidx.credentials.GetCredentialRequest build();
+ method public androidx.credentials.GetCredentialRequest.Builder setCredentialOptions(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions);
+ method public androidx.credentials.GetCredentialRequest.Builder setOrigin(String origin);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferIdentityDocUi(boolean preferIdentityDocUi);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferImmediatelyAvailableCredentials(boolean preferImmediatelyAvailableCredentials);
+ method public androidx.credentials.GetCredentialRequest.Builder setPreferUiBrandingComponentName(android.content.ComponentName? component);
+ }
+
+ public final class GetCredentialResponse {
+ ctor public GetCredentialResponse(androidx.credentials.Credential credential);
+ method public androidx.credentials.Credential getCredential();
+ property public final androidx.credentials.Credential credential;
+ }
+
+ public class GetCustomCredentialOption extends androidx.credentials.CredentialOption {
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired);
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, optional boolean isAutoSelectAllowed);
+ ctor public GetCustomCredentialOption(String type, android.os.Bundle requestData, android.os.Bundle candidateQueryData, boolean isSystemProviderRequired, optional boolean isAutoSelectAllowed, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ }
+
+ public final class GetPasswordOption extends androidx.credentials.CredentialOption {
+ ctor public GetPasswordOption();
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds);
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds, optional boolean isAutoSelectAllowed);
+ ctor public GetPasswordOption(optional java.util.Set<java.lang.String> allowedUserIds, optional boolean isAutoSelectAllowed, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ method public java.util.Set<java.lang.String> getAllowedUserIds();
+ property public final java.util.Set<java.lang.String> allowedUserIds;
+ }
+
+ public final class GetPublicKeyCredentialOption extends androidx.credentials.CredentialOption {
+ ctor public GetPublicKeyCredentialOption(String requestJson);
+ ctor public GetPublicKeyCredentialOption(String requestJson, optional byte[]? clientDataHash);
+ ctor public GetPublicKeyCredentialOption(String requestJson, optional byte[]? clientDataHash, optional java.util.Set<android.content.ComponentName> allowedProviders);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class PasswordCredential extends androidx.credentials.Credential {
+ ctor public PasswordCredential(String id, String password);
+ method public String getId();
+ method public String getPassword();
+ property public final String id;
+ property public final String password;
+ field public static final androidx.credentials.PasswordCredential.Companion Companion;
+ field public static final String TYPE_PASSWORD_CREDENTIAL = "android.credentials.TYPE_PASSWORD_CREDENTIAL";
+ }
+
+ public static final class PasswordCredential.Companion {
+ }
+
+ @RequiresApi(34) public final class PrepareGetCredentialResponse {
+ method public kotlin.jvm.functions.Function1<java.lang.String,java.lang.Boolean>? getCredentialTypeDelegate();
+ method public kotlin.jvm.functions.Function0<java.lang.Boolean>? getHasAuthResultsDelegate();
+ method public kotlin.jvm.functions.Function0<java.lang.Boolean>? getHasRemoteResultsDelegate();
+ method public androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? getPendingGetCredentialHandle();
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasAuthenticationResults();
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasCredentialResults(String credentialType);
+ method @RequiresPermission(android.Manifest.permission.CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS) public boolean hasRemoteResults();
+ method public boolean isNullHandlesForTest();
+ property public final kotlin.jvm.functions.Function1<java.lang.String,java.lang.Boolean>? credentialTypeDelegate;
+ property public final kotlin.jvm.functions.Function0<java.lang.Boolean>? hasAuthResultsDelegate;
+ property public final kotlin.jvm.functions.Function0<java.lang.Boolean>? hasRemoteResultsDelegate;
+ property public final boolean isNullHandlesForTest;
+ property public final androidx.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? pendingGetCredentialHandle;
+ }
+
+ @RequiresApi(34) public static final class PrepareGetCredentialResponse.PendingGetCredentialHandle {
+ ctor public PrepareGetCredentialResponse.PendingGetCredentialHandle(android.credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle? frameworkHandle);
+ }
+
+ @VisibleForTesting public static final class PrepareGetCredentialResponse.TestBuilder {
+ ctor public PrepareGetCredentialResponse.TestBuilder();
+ method public androidx.credentials.PrepareGetCredentialResponse build();
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setCredentialTypeDelegate(kotlin.jvm.functions.Function1<? super java.lang.String,java.lang.Boolean> handler);
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setHasAuthResultsDelegate(kotlin.jvm.functions.Function0<java.lang.Boolean> handler);
+ method public androidx.credentials.PrepareGetCredentialResponse.TestBuilder setHasRemoteResultsDelegate(kotlin.jvm.functions.Function0<java.lang.Boolean> handler);
+ }
+
+ public final class PublicKeyCredential extends androidx.credentials.Credential {
+ ctor public PublicKeyCredential(String authenticationResponseJson);
+ method public String getAuthenticationResponseJson();
+ property public final String authenticationResponseJson;
+ field public static final androidx.credentials.PublicKeyCredential.Companion Companion;
+ field public static final String TYPE_PUBLIC_KEY_CREDENTIAL = "androidx.credentials.TYPE_PUBLIC_KEY_CREDENTIAL";
+ }
+
+ public static final class PublicKeyCredential.Companion {
+ }
+
+}
+
+package androidx.credentials.exceptions {
+
+ public abstract class ClearCredentialException extends java.lang.Exception {
+ }
+
+ public final class ClearCredentialInterruptedException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialInterruptedException();
+ ctor public ClearCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialProviderConfigurationException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialProviderConfigurationException();
+ ctor public ClearCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialUnknownException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialUnknownException();
+ ctor public ClearCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCredentialUnsupportedException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCredentialUnsupportedException();
+ ctor public ClearCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class ClearCustomCredentialException extends androidx.credentials.exceptions.ClearCredentialException {
+ ctor public ClearCustomCredentialException(String type);
+ ctor public ClearCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class CreateCredentialCancellationException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialCancellationException();
+ ctor public CreateCredentialCancellationException(optional CharSequence? errorMessage);
+ }
+
+ public abstract class CreateCredentialException extends java.lang.Exception {
+ }
+
+ public final class CreateCredentialInterruptedException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialInterruptedException();
+ ctor public CreateCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialNoCreateOptionException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialNoCreateOptionException();
+ ctor public CreateCredentialNoCreateOptionException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialProviderConfigurationException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialProviderConfigurationException();
+ ctor public CreateCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialUnknownException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialUnknownException();
+ ctor public CreateCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCredentialUnsupportedException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCredentialUnsupportedException();
+ ctor public CreateCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class CreateCustomCredentialException extends androidx.credentials.exceptions.CreateCredentialException {
+ ctor public CreateCustomCredentialException(String type);
+ ctor public CreateCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class GetCredentialCancellationException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialCancellationException();
+ ctor public GetCredentialCancellationException(optional CharSequence? errorMessage);
+ }
+
+ public abstract class GetCredentialException extends java.lang.Exception {
+ }
+
+ public final class GetCredentialInterruptedException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialInterruptedException();
+ ctor public GetCredentialInterruptedException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialProviderConfigurationException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialProviderConfigurationException();
+ ctor public GetCredentialProviderConfigurationException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialUnknownException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialUnknownException();
+ ctor public GetCredentialUnknownException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCredentialUnsupportedException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCredentialUnsupportedException();
+ ctor public GetCredentialUnsupportedException(optional CharSequence? errorMessage);
+ }
+
+ public final class GetCustomCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public GetCustomCredentialException(String type);
+ ctor public GetCustomCredentialException(String type, optional CharSequence? errorMessage);
+ method public String getType();
+ property public String type;
+ }
+
+ public final class NoCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ ctor public NoCredentialException();
+ ctor public NoCredentialException(optional CharSequence? errorMessage);
+ }
+
+}
+
+package androidx.credentials.exceptions.domerrors {
+
+ public final class AbortError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public AbortError();
+ }
+
+ public final class ConstraintError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public ConstraintError();
+ }
+
+ public final class DataCloneError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public DataCloneError();
+ }
+
+ public final class DataError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public DataError();
+ }
+
+ public abstract class DomError {
+ ctor public DomError(String type);
+ }
+
+ public final class EncodingError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public EncodingError();
+ }
+
+ public final class HierarchyRequestError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public HierarchyRequestError();
+ }
+
+ public final class InUseAttributeError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InUseAttributeError();
+ }
+
+ public final class InvalidCharacterError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidCharacterError();
+ }
+
+ public final class InvalidModificationError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidModificationError();
+ }
+
+ public final class InvalidNodeTypeError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidNodeTypeError();
+ }
+
+ public final class InvalidStateError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public InvalidStateError();
+ }
+
+ public final class NamespaceError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NamespaceError();
+ }
+
+ public final class NetworkError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NetworkError();
+ }
+
+ public final class NoModificationAllowedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NoModificationAllowedError();
+ }
+
+ public final class NotAllowedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotAllowedError();
+ }
+
+ public final class NotFoundError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotFoundError();
+ }
+
+ public final class NotReadableError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotReadableError();
+ }
+
+ public final class NotSupportedError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public NotSupportedError();
+ }
+
+ public final class OperationError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public OperationError();
+ }
+
+ public final class OptOutError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public OptOutError();
+ }
+
+ public final class QuotaExceededError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public QuotaExceededError();
+ }
+
+ public final class ReadOnlyError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public ReadOnlyError();
+ }
+
+ public final class SecurityError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public SecurityError();
+ }
+
+ public final class SyntaxError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public SyntaxError();
+ }
+
+ public final class TimeoutError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public TimeoutError();
+ }
+
+ public final class TransactionInactiveError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public TransactionInactiveError();
+ }
+
+ public final class UnknownError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public UnknownError();
+ }
+
+ public final class VersionError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public VersionError();
+ }
+
+ public final class WrongDocumentError extends androidx.credentials.exceptions.domerrors.DomError {
+ ctor public WrongDocumentError();
+ }
+
+}
+
+package androidx.credentials.exceptions.publickeycredential {
+
+ public final class CreatePublicKeyCredentialDomException extends androidx.credentials.exceptions.publickeycredential.CreatePublicKeyCredentialException {
+ ctor public CreatePublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError);
+ ctor public CreatePublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError, optional CharSequence? errorMessage);
+ method public androidx.credentials.exceptions.domerrors.DomError getDomError();
+ property public final androidx.credentials.exceptions.domerrors.DomError domError;
+ }
+
+ public class CreatePublicKeyCredentialException extends androidx.credentials.exceptions.CreateCredentialException {
+ }
+
+ public final class GetPublicKeyCredentialDomException extends androidx.credentials.exceptions.publickeycredential.GetPublicKeyCredentialException {
+ ctor public GetPublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError);
+ ctor public GetPublicKeyCredentialDomException(androidx.credentials.exceptions.domerrors.DomError domError, optional CharSequence? errorMessage);
+ method public androidx.credentials.exceptions.domerrors.DomError getDomError();
+ property public final androidx.credentials.exceptions.domerrors.DomError domError;
+ }
+
+ public class GetPublicKeyCredentialException extends androidx.credentials.exceptions.GetCredentialException {
+ }
+
+}
+
+package androidx.credentials.provider {
+
+ public final class Action {
+ ctor public Action(CharSequence title, android.app.PendingIntent pendingIntent, optional CharSequence? subtitle);
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence? getSubtitle();
+ method public CharSequence getTitle();
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence? subtitle;
+ property public final CharSequence title;
+ }
+
+ public static final class Action.Builder {
+ ctor public Action.Builder(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.Action build();
+ method public androidx.credentials.provider.Action.Builder setSubtitle(CharSequence? subtitle);
+ }
+
+ public final class AuthenticationAction {
+ ctor public AuthenticationAction(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTitle();
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence title;
+ }
+
+ public static final class AuthenticationAction.Builder {
+ ctor public AuthenticationAction.Builder(CharSequence title, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.AuthenticationAction build();
+ }
+
+ public abstract class BeginCreateCredentialRequest {
+ ctor public BeginCreateCredentialRequest(String type, android.os.Bundle candidateQueryData, androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ method public static final android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialRequest request);
+ method public static final androidx.credentials.provider.BeginCreateCredentialRequest? fromBundle(android.os.Bundle bundle);
+ method public final androidx.credentials.provider.CallingAppInfo? getCallingAppInfo();
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final String getType();
+ property public final androidx.credentials.provider.CallingAppInfo? callingAppInfo;
+ property public final android.os.Bundle candidateQueryData;
+ property public final String type;
+ field public static final androidx.credentials.provider.BeginCreateCredentialRequest.Companion Companion;
+ }
+
+ public static final class BeginCreateCredentialRequest.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialRequest request);
+ method public androidx.credentials.provider.BeginCreateCredentialRequest? fromBundle(android.os.Bundle bundle);
+ }
+
+ public final class BeginCreateCredentialResponse {
+ ctor public BeginCreateCredentialResponse(optional java.util.List<androidx.credentials.provider.CreateEntry> createEntries, optional androidx.credentials.provider.RemoteEntry? remoteEntry);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialResponse response);
+ method public static androidx.credentials.provider.BeginCreateCredentialResponse? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.CreateEntry> getCreateEntries();
+ method public androidx.credentials.provider.RemoteEntry? getRemoteEntry();
+ property public final java.util.List<androidx.credentials.provider.CreateEntry> createEntries;
+ property public final androidx.credentials.provider.RemoteEntry? remoteEntry;
+ field public static final androidx.credentials.provider.BeginCreateCredentialResponse.Companion Companion;
+ }
+
+ public static final class BeginCreateCredentialResponse.Builder {
+ ctor public BeginCreateCredentialResponse.Builder();
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder addCreateEntry(androidx.credentials.provider.CreateEntry createEntry);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse build();
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder setCreateEntries(java.util.List<androidx.credentials.provider.CreateEntry> createEntries);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse.Builder setRemoteEntry(androidx.credentials.provider.RemoteEntry? remoteEntry);
+ }
+
+ public static final class BeginCreateCredentialResponse.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginCreateCredentialResponse response);
+ method public androidx.credentials.provider.BeginCreateCredentialResponse? fromBundle(android.os.Bundle bundle);
+ }
+
+ public class BeginCreateCustomCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreateCustomCredentialRequest(String type, android.os.Bundle candidateQueryData, androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ }
+
+ public final class BeginCreatePasswordCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreatePasswordCredentialRequest(androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData);
+ }
+
+ public final class BeginCreatePublicKeyCredentialRequest extends androidx.credentials.provider.BeginCreateCredentialRequest {
+ ctor public BeginCreatePublicKeyCredentialRequest(String requestJson, androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData);
+ ctor public BeginCreatePublicKeyCredentialRequest(String requestJson, androidx.credentials.provider.CallingAppInfo? callingAppInfo, android.os.Bundle candidateQueryData, optional byte[]? clientDataHash);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public abstract class BeginGetCredentialOption {
+ method public final android.os.Bundle getCandidateQueryData();
+ method public final String getId();
+ method public final String getType();
+ property public final android.os.Bundle candidateQueryData;
+ property public final String id;
+ property public final String type;
+ }
+
+ public final class BeginGetCredentialRequest {
+ ctor public BeginGetCredentialRequest(java.util.List<? extends androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions);
+ ctor public BeginGetCredentialRequest(java.util.List<? extends androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions, optional androidx.credentials.provider.CallingAppInfo? callingAppInfo);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialRequest request);
+ method public static androidx.credentials.provider.BeginGetCredentialRequest? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.BeginGetCredentialOption> getBeginGetCredentialOptions();
+ method public androidx.credentials.provider.CallingAppInfo? getCallingAppInfo();
+ property public final java.util.List<androidx.credentials.provider.BeginGetCredentialOption> beginGetCredentialOptions;
+ property public final androidx.credentials.provider.CallingAppInfo? callingAppInfo;
+ field public static final androidx.credentials.provider.BeginGetCredentialRequest.Companion Companion;
+ }
+
+ public static final class BeginGetCredentialRequest.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialRequest request);
+ method public androidx.credentials.provider.BeginGetCredentialRequest? fromBundle(android.os.Bundle bundle);
+ }
+
+ public final class BeginGetCredentialResponse {
+ ctor public BeginGetCredentialResponse(optional java.util.List<? extends androidx.credentials.provider.CredentialEntry> credentialEntries, optional java.util.List<androidx.credentials.provider.Action> actions, optional java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationActions, optional androidx.credentials.provider.RemoteEntry? remoteEntry);
+ method public static android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public static androidx.credentials.provider.BeginGetCredentialResponse? fromBundle(android.os.Bundle bundle);
+ method public java.util.List<androidx.credentials.provider.Action> getActions();
+ method public java.util.List<androidx.credentials.provider.AuthenticationAction> getAuthenticationActions();
+ method public java.util.List<androidx.credentials.provider.CredentialEntry> getCredentialEntries();
+ method public androidx.credentials.provider.RemoteEntry? getRemoteEntry();
+ property public final java.util.List<androidx.credentials.provider.Action> actions;
+ property public final java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationActions;
+ property public final java.util.List<androidx.credentials.provider.CredentialEntry> credentialEntries;
+ property public final androidx.credentials.provider.RemoteEntry? remoteEntry;
+ field public static final androidx.credentials.provider.BeginGetCredentialResponse.Companion Companion;
+ }
+
+ public static final class BeginGetCredentialResponse.Builder {
+ ctor public BeginGetCredentialResponse.Builder();
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addAction(androidx.credentials.provider.Action action);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addAuthenticationAction(androidx.credentials.provider.AuthenticationAction authenticationAction);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder addCredentialEntry(androidx.credentials.provider.CredentialEntry entry);
+ method public androidx.credentials.provider.BeginGetCredentialResponse build();
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setActions(java.util.List<androidx.credentials.provider.Action> actions);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setAuthenticationActions(java.util.List<androidx.credentials.provider.AuthenticationAction> authenticationEntries);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setCredentialEntries(java.util.List<? extends androidx.credentials.provider.CredentialEntry> entries);
+ method public androidx.credentials.provider.BeginGetCredentialResponse.Builder setRemoteEntry(androidx.credentials.provider.RemoteEntry? remoteEntry);
+ }
+
+ public static final class BeginGetCredentialResponse.Companion {
+ method public android.os.Bundle asBundle(androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public androidx.credentials.provider.BeginGetCredentialResponse? fromBundle(android.os.Bundle bundle);
+ }
+
+ public class BeginGetCustomCredentialOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetCustomCredentialOption(String id, String type, android.os.Bundle candidateQueryData);
+ }
+
+ public final class BeginGetPasswordOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetPasswordOption(java.util.Set<java.lang.String> allowedUserIds, android.os.Bundle candidateQueryData, String id);
+ method public java.util.Set<java.lang.String> getAllowedUserIds();
+ property public final java.util.Set<java.lang.String> allowedUserIds;
+ }
+
+ public final class BeginGetPublicKeyCredentialOption extends androidx.credentials.provider.BeginGetCredentialOption {
+ ctor public BeginGetPublicKeyCredentialOption(android.os.Bundle candidateQueryData, String id, String requestJson);
+ ctor public BeginGetPublicKeyCredentialOption(android.os.Bundle candidateQueryData, String id, String requestJson, optional byte[]? clientDataHash);
+ method public byte[]? getClientDataHash();
+ method public String getRequestJson();
+ property public final byte[]? clientDataHash;
+ property public final String requestJson;
+ }
+
+ public final class CallingAppInfo {
+ ctor public CallingAppInfo(String packageName, android.content.pm.SigningInfo signingInfo);
+ ctor public CallingAppInfo(String packageName, android.content.pm.SigningInfo signingInfo, optional String? origin);
+ method public String? getOrigin();
+ method public String getPackageName();
+ method public android.content.pm.SigningInfo getSigningInfo();
+ property public final String? origin;
+ property public final String packageName;
+ property public final android.content.pm.SigningInfo signingInfo;
+ }
+
+ @RequiresApi(26) public final class CreateEntry {
+ ctor public CreateEntry(CharSequence accountName, android.app.PendingIntent pendingIntent, optional CharSequence? description, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon? icon, optional Integer? passwordCredentialCount, optional Integer? publicKeyCredentialCount, optional Integer? totalCredentialCount, optional boolean isAutoSelectAllowed);
+ method public CharSequence getAccountName();
+ method public CharSequence? getDescription();
+ method public android.graphics.drawable.Icon? getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public Integer? getPasswordCredentialCount();
+ method public android.app.PendingIntent getPendingIntent();
+ method public Integer? getPublicKeyCredentialCount();
+ method public Integer? getTotalCredentialCount();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence accountName;
+ property public final CharSequence? description;
+ property public final android.graphics.drawable.Icon? icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ }
+
+ public static final class CreateEntry.Builder {
+ ctor public CreateEntry.Builder(CharSequence accountName, android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.CreateEntry build();
+ method public androidx.credentials.provider.CreateEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.CreateEntry.Builder setDescription(CharSequence? description);
+ method public androidx.credentials.provider.CreateEntry.Builder setIcon(android.graphics.drawable.Icon? icon);
+ method public androidx.credentials.provider.CreateEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ method public androidx.credentials.provider.CreateEntry.Builder setPasswordCredentialCount(int count);
+ method public androidx.credentials.provider.CreateEntry.Builder setPublicKeyCredentialCount(int count);
+ method public androidx.credentials.provider.CreateEntry.Builder setTotalCredentialCount(int count);
+ }
+
+ public abstract class CredentialEntry {
+ method public final androidx.credentials.provider.BeginGetCredentialOption getBeginGetCredentialOption();
+ property public final androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption;
+ }
+
+ @RequiresApi(34) public abstract class CredentialProviderService extends android.service.credentials.CredentialProviderService {
+ ctor public CredentialProviderService();
+ method public final void onBeginCreateCredential(android.service.credentials.BeginCreateCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<android.service.credentials.BeginCreateCredentialResponse,android.credentials.CreateCredentialException> callback);
+ method public abstract void onBeginCreateCredentialRequest(androidx.credentials.provider.BeginCreateCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<androidx.credentials.provider.BeginCreateCredentialResponse,androidx.credentials.exceptions.CreateCredentialException> callback);
+ method public final void onBeginGetCredential(android.service.credentials.BeginGetCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<android.service.credentials.BeginGetCredentialResponse,android.credentials.GetCredentialException> callback);
+ method public abstract void onBeginGetCredentialRequest(androidx.credentials.provider.BeginGetCredentialRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<androidx.credentials.provider.BeginGetCredentialResponse,androidx.credentials.exceptions.GetCredentialException> callback);
+ method public final void onClearCredentialState(android.service.credentials.ClearCredentialStateRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<java.lang.Void,android.credentials.ClearCredentialStateException> callback);
+ method public abstract void onClearCredentialStateRequest(androidx.credentials.provider.ProviderClearCredentialStateRequest request, android.os.CancellationSignal cancellationSignal, android.os.OutcomeReceiver<java.lang.Void,androidx.credentials.exceptions.ClearCredentialException> callback);
+ }
+
+ @RequiresApi(26) public final class CustomCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public CustomCredentialEntry(android.content.Context context, CharSequence title, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption, optional CharSequence? subtitle, optional CharSequence? typeDisplayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence? getSubtitle();
+ method public CharSequence getTitle();
+ method public String getType();
+ method public CharSequence? getTypeDisplayName();
+ method public boolean isAutoSelectAllowed();
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence? subtitle;
+ property public final CharSequence title;
+ property public String type;
+ property public final CharSequence? typeDisplayName;
+ }
+
+ public static final class CustomCredentialEntry.Builder {
+ ctor public CustomCredentialEntry.Builder(android.content.Context context, String type, CharSequence title, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetCredentialOption beginGetCredentialOption);
+ method public androidx.credentials.provider.CustomCredentialEntry build();
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setSubtitle(CharSequence? subtitle);
+ method public androidx.credentials.provider.CustomCredentialEntry.Builder setTypeDisplayName(CharSequence? typeDisplayName);
+ }
+
+ public final class IntentHandlerConverters {
+ method @RequiresApi(34) public static androidx.credentials.provider.BeginGetCredentialResponse? getBeginGetResponse(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.CreateCredentialResponse? getCreateCredentialCredentialResponse(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.CreateCredentialException? getCreateCredentialException(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.GetCredentialException? getGetCredentialException(android.content.Intent);
+ method @RequiresApi(34) public static android.credentials.GetCredentialResponse? getGetCredentialResponse(android.content.Intent);
+ }
+
+ @RequiresApi(26) public final class PasswordCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public PasswordCredentialEntry(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPasswordOption beginGetPasswordOption, optional CharSequence? displayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public CharSequence? getDisplayName();
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTypeDisplayName();
+ method public CharSequence getUsername();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence? displayName;
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence typeDisplayName;
+ property public final CharSequence username;
+ }
+
+ public static final class PasswordCredentialEntry.Builder {
+ ctor public PasswordCredentialEntry.Builder(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPasswordOption beginGetPasswordOption);
+ method public androidx.credentials.provider.PasswordCredentialEntry build();
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setDisplayName(CharSequence? displayName);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.PasswordCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ }
+
+ @RequiresApi(34) public final class PendingIntentHandler {
+ ctor public PendingIntentHandler();
+ method public static androidx.credentials.provider.BeginGetCredentialRequest? retrieveBeginGetCredentialRequest(android.content.Intent intent);
+ method public static androidx.credentials.provider.ProviderCreateCredentialRequest? retrieveProviderCreateCredentialRequest(android.content.Intent intent);
+ method public static androidx.credentials.provider.ProviderGetCredentialRequest? retrieveProviderGetCredentialRequest(android.content.Intent intent);
+ method public static void setBeginGetCredentialResponse(android.content.Intent intent, androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public static void setCreateCredentialException(android.content.Intent intent, androidx.credentials.exceptions.CreateCredentialException exception);
+ method public static void setCreateCredentialResponse(android.content.Intent intent, androidx.credentials.CreateCredentialResponse response);
+ method public static void setGetCredentialException(android.content.Intent intent, androidx.credentials.exceptions.GetCredentialException exception);
+ method public static void setGetCredentialResponse(android.content.Intent intent, androidx.credentials.GetCredentialResponse response);
+ field public static final androidx.credentials.provider.PendingIntentHandler.Companion Companion;
+ }
+
+ public static final class PendingIntentHandler.Companion {
+ method public androidx.credentials.provider.BeginGetCredentialRequest? retrieveBeginGetCredentialRequest(android.content.Intent intent);
+ method public androidx.credentials.provider.ProviderCreateCredentialRequest? retrieveProviderCreateCredentialRequest(android.content.Intent intent);
+ method public androidx.credentials.provider.ProviderGetCredentialRequest? retrieveProviderGetCredentialRequest(android.content.Intent intent);
+ method public void setBeginGetCredentialResponse(android.content.Intent intent, androidx.credentials.provider.BeginGetCredentialResponse response);
+ method public void setCreateCredentialException(android.content.Intent intent, androidx.credentials.exceptions.CreateCredentialException exception);
+ method public void setCreateCredentialResponse(android.content.Intent intent, androidx.credentials.CreateCredentialResponse response);
+ method public void setGetCredentialException(android.content.Intent intent, androidx.credentials.exceptions.GetCredentialException exception);
+ method public void setGetCredentialResponse(android.content.Intent intent, androidx.credentials.GetCredentialResponse response);
+ }
+
+ public final class ProviderClearCredentialStateRequest {
+ ctor public ProviderClearCredentialStateRequest(androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ }
+
+ public final class ProviderCreateCredentialRequest {
+ ctor public ProviderCreateCredentialRequest(androidx.credentials.CreateCredentialRequest callingRequest, androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ method public androidx.credentials.CreateCredentialRequest getCallingRequest();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ property public final androidx.credentials.CreateCredentialRequest callingRequest;
+ }
+
+ public final class ProviderGetCredentialRequest {
+ ctor public ProviderGetCredentialRequest(java.util.List<? extends androidx.credentials.CredentialOption> credentialOptions, androidx.credentials.provider.CallingAppInfo callingAppInfo);
+ method public androidx.credentials.provider.CallingAppInfo getCallingAppInfo();
+ method public java.util.List<androidx.credentials.CredentialOption> getCredentialOptions();
+ property public final androidx.credentials.provider.CallingAppInfo callingAppInfo;
+ property public final java.util.List<androidx.credentials.CredentialOption> credentialOptions;
+ }
+
+ @RequiresApi(26) public final class PublicKeyCredentialEntry extends androidx.credentials.provider.CredentialEntry {
+ ctor public PublicKeyCredentialEntry(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption, optional CharSequence? displayName, optional java.time.Instant? lastUsedTime, optional android.graphics.drawable.Icon icon, optional boolean isAutoSelectAllowed);
+ method public CharSequence? getDisplayName();
+ method public android.graphics.drawable.Icon getIcon();
+ method public java.time.Instant? getLastUsedTime();
+ method public android.app.PendingIntent getPendingIntent();
+ method public CharSequence getTypeDisplayName();
+ method public CharSequence getUsername();
+ method public boolean isAutoSelectAllowed();
+ property public final CharSequence? displayName;
+ property public final android.graphics.drawable.Icon icon;
+ property public final boolean isAutoSelectAllowed;
+ property public final java.time.Instant? lastUsedTime;
+ property public final android.app.PendingIntent pendingIntent;
+ property public final CharSequence typeDisplayName;
+ property public final CharSequence username;
+ }
+
+ public static final class PublicKeyCredentialEntry.Builder {
+ ctor public PublicKeyCredentialEntry.Builder(android.content.Context context, CharSequence username, android.app.PendingIntent pendingIntent, androidx.credentials.provider.BeginGetPublicKeyCredentialOption beginGetPublicKeyCredentialOption);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry build();
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setAutoSelectAllowed(boolean autoSelectAllowed);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setDisplayName(CharSequence? displayName);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setIcon(android.graphics.drawable.Icon icon);
+ method public androidx.credentials.provider.PublicKeyCredentialEntry.Builder setLastUsedTime(java.time.Instant? lastUsedTime);
+ }
+
+ public final class RemoteEntry {
+ ctor public RemoteEntry(android.app.PendingIntent pendingIntent);
+ method public android.app.PendingIntent getPendingIntent();
+ property public final android.app.PendingIntent pendingIntent;
+ }
+
+ public static final class RemoteEntry.Builder {
+ ctor public RemoteEntry.Builder(android.app.PendingIntent pendingIntent);
+ method public androidx.credentials.provider.RemoteEntry build();
+ }
+
+}
+
diff --git a/credentials/credentials/build.gradle b/credentials/credentials/build.gradle
index 5143f0d..76d78db 100644
--- a/credentials/credentials/build.gradle
+++ b/credentials/credentials/build.gradle
@@ -26,7 +26,7 @@
api("androidx.annotation:annotation:1.5.0")
api(libs.kotlinStdlib)
implementation(libs.kotlinCoroutinesCore)
- api(project(":core:core"))
+ api("androidx.core:core:1.11.0-beta02")
samples(project(":credentials:credentials-samples"))
androidTestImplementation("androidx.activity:activity:1.2.0")
diff --git a/credentials/credentials/samples/src/main/java/androidx/credentials/samples/CredentialManagerSample.kt b/credentials/credentials/samples/src/main/java/androidx/credentials/samples/CredentialManagerSample.kt
index aaba76c..57232c9 100644
--- a/credentials/credentials/samples/src/main/java/androidx/credentials/samples/CredentialManagerSample.kt
+++ b/credentials/credentials/samples/src/main/java/androidx/credentials/samples/CredentialManagerSample.kt
@@ -21,6 +21,10 @@
import android.os.Bundle
import android.util.Log
import androidx.annotation.Sampled
+import androidx.credentials.CreateCredentialResponse
+import androidx.credentials.CreateCustomCredentialResponse
+import androidx.credentials.CreatePasswordResponse
+import androidx.credentials.CreatePublicKeyCredentialResponse
import androidx.credentials.Credential
import androidx.credentials.CredentialManager
import androidx.credentials.CustomCredential
@@ -83,9 +87,55 @@
const val TAG: String = "TAG"
+/**
+ * Sample showing how to use a [CreateCredentialResponse] object.
+ */
+@Sampled
+fun processCreateCredentialResponse(
+ response: CreateCredentialResponse,
+ loginWithPasskey: (String) -> Unit,
+ loginWithPassword: () -> Unit,
+ loginWithExampleCustomCredential: (CreateExampleCustomCredentialResponse) -> Unit
+) {
+ when (response) {
+ is CreatePasswordResponse ->
+ // Password saved successfully, proceed to signed in experience.
+ loginWithPassword()
+ is CreatePublicKeyCredentialResponse ->
+ // Validate and register the registration json from your server, and if successful
+ // proceed to signed in experience.
+ loginWithPasskey(response.registrationResponseJson)
+ is CreateCustomCredentialResponse -> {
+ // If you are also using any external sign-in libraries, parse them here with the
+ // utility functions provided they provided.
+ if (response.type == ExampleCustomCredential.TYPE) {
+ try {
+ val createExampleCustomCredentialResponse =
+ CreateExampleCustomCredentialResponse.createFrom(response)
+ loginWithExampleCustomCredential(createExampleCustomCredentialResponse)
+ } catch (e: CreateExampleCustomCredentialResponse.ParsingException) {
+ // Unlikely to happen. If it does, you likely need to update the dependency
+ // version of your external sign-in library.
+ Log.e(TAG, "Failed to parse a CreateExampleCustomCredentialResponse", e)
+ }
+ } else {
+ Log.w(
+ TAG,
+ "Received unrecognized response type ${response.type}. " +
+ "This shouldn't happen")
+ }
+ }
+ else -> {
+ Log.w(
+ TAG,
+ "Received unrecognized response type ${response.type}. This shouldn't happen")
+ }
+ }
+}
+
@Sampled
/**
- * Sample showing how to use a Credential object - as a passkey credential, a password credential,
+ * Sample showing how to use a [Credential] object - as a passkey credential, a password credential,
* or any custom credential.
*/
fun processCredential(
@@ -149,3 +199,20 @@
class ExampleCustomCredentialParsingException(e: Throwable? = null) : Exception(e)
}
+
+class CreateExampleCustomCredentialResponse(
+ data: Bundle
+) : CreateCustomCredentialResponse(
+ type = ExampleCustomCredential.TYPE,
+ data = data
+) {
+ companion object {
+ @JvmStatic
+ fun createFrom(
+ response: CreateCredentialResponse
+ ): CreateExampleCustomCredentialResponse =
+ CreateExampleCustomCredentialResponse(response.data)
+ }
+
+ class ParsingException(e: Throwable? = null) : Exception(e)
+}
diff --git a/credentials/credentials/src/main/java/androidx/credentials/CreateCredentialResponse.kt b/credentials/credentials/src/main/java/androidx/credentials/CreateCredentialResponse.kt
index 50cad1b..55eaf4c 100644
--- a/credentials/credentials/src/main/java/androidx/credentials/CreateCredentialResponse.kt
+++ b/credentials/credentials/src/main/java/androidx/credentials/CreateCredentialResponse.kt
@@ -24,6 +24,8 @@
* Base response class for the credential creation operation made with the
* [CreateCredentialRequest].
*
+ * @sample androidx.credentials.samples.processCreateCredentialResponse
+ *
* @property type the credential type determined by the credential-type-specific subclass (e.g.
* the type for [CreatePasswordResponse] is [PasswordCredential.TYPE_PASSWORD_CREDENTIAL] and for
* [CreatePublicKeyCredentialResponse] is [PublicKeyCredential.TYPE_PUBLIC_KEY_CREDENTIAL])
diff --git a/glance/glance-appwidget/lint-baseline.xml b/glance/glance-appwidget/lint-baseline.xml
index 7487854..006d6ff 100644
--- a/glance/glance-appwidget/lint-baseline.xml
+++ b/glance/glance-appwidget/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="BanThreadSleep"
@@ -39,6 +39,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method extractAllSizes has parameter 'minSize' with type Function0<DpSize>."
+ errorLine1="internal fun Bundle.extractAllSizes(minSize: () -> DpSize): List<DpSize> {"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/glance/appwidget/AppWidgetUtils.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method estimateSizes has parameter 'minSize' with type Function0<DpSize>."
+ errorLine1="private fun Bundle.estimateSizes(minSize: () -> DpSize): List<DpSize> {"
+ errorLine2=" ~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/glance/appwidget/AppWidgetUtils.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'toPixels' with type Function1<? super Dp, ? extends Integer>."
+ errorLine1=" fun Dimension.Dp.toPixels() = dp.toPixels(context)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/glance/appwidget/ApplyModifiers.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'toPixels' with type Function1<? super Resource, ? extends Integer>."
+ errorLine1=" fun Dimension.Resource.toPixels() = context.resources.getDimensionPixelSize(res)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/glance/appwidget/ApplyModifiers.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method items has parameter 'itemId' with type Function1<? super Integer, Long>."
errorLine1=" itemId: ((index: Int) -> Long) = { UnspecifiedItemId },"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/libraryversions.toml b/libraryversions.toml
index 044e4a5..535b338 100644
--- a/libraryversions.toml
+++ b/libraryversions.toml
@@ -43,7 +43,7 @@
CORE_SPLASHSCREEN = "1.1.0-alpha01"
CORE_TELECOM = "1.0.0-alpha01"
CORE_UWB = "1.0.0-alpha06"
-CREDENTIALS = "1.2.0-alpha05"
+CREDENTIALS = "1.2.0-beta01"
CURSORADAPTER = "1.1.0-alpha01"
CUSTOMVIEW = "1.2.0-alpha03"
CUSTOMVIEW_POOLINGCONTAINER = "1.1.0-alpha01"
diff --git a/settings.gradle b/settings.gradle
index c447e34..c284fc6 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -395,6 +395,7 @@
}
projectReferences[name] = links
}
+ // Remove file existence checking when https://github.com/gradle/gradle/issues/25531 is fixed.
if (!file.exists()) {
// This option is supported so that development/simplify_build_failure.sh can try
// deleting entire projects at once to identify the cause of a build failure
diff --git a/tv/tv-foundation/lint-baseline.xml b/tv/tv-foundation/lint-baseline.xml
index 1347079..84c2667 100644
--- a/tv/tv-foundation/lint-baseline.xml
+++ b/tv/tv-foundation/lint-baseline.xml
@@ -93,6 +93,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method LazyGrid has parameter 'slotSizesSums' with type Function2<? super Density, ? super Constraints, ? extends List<Integer>>."
+ errorLine1=" slotSizesSums: Density.(Constraints) -> List<Int>,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measurePolicy = rememberLazyGridMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, MeasureResult> of 'rememberLazyGridMeasurePolicy'."
+ errorLine1="private fun rememberLazyGridMeasurePolicy("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rememberLazyGridMeasurePolicy has parameter 'slotSizesSums' with type Function2<? super Density, ? super Constraints, ? extends List<Integer>>."
+ errorLine1=" slotSizesSums: Density.(Constraints) -> List<Int>,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGrid.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'lineOf' with type Function1<? super Integer, ? extends Integer>."
errorLine1=" val lineOf: (Int) -> Int = {"
errorLine2=" ~~~~~~~~~~~~">
@@ -102,6 +138,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'slotSizesSums' with type Function2<? super Density, ? super Constraints, ? extends List<? extends Integer>>."
+ errorLine1=" val slotSizesSums = rememberColumnWidthSums(columns, horizontalArrangement, contentPadding)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'slotSizesSums' with type Function2<? super Density, ? super Constraints, ? extends List<? extends Integer>>."
+ errorLine1=" val slotSizesSums = rememberRowHeightSums(rows, verticalArrangement, contentPadding)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, List<Integer>> of 'rememberColumnWidthSums'."
+ errorLine1="private fun rememberColumnWidthSums("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<Density, Constraints, List<Integer>> of 'rememberRowHeightSums'."
+ errorLine1="private fun rememberRowHeightSums("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGridDsl.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method item has parameter 'span' with type Function1<? super TvLazyGridItemSpanScope, TvGridItemSpan>."
errorLine1=" span: (TvLazyGridItemSpanScope.() -> TvGridItemSpan)? = null,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -210,6 +282,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reverseAware' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun Int.reverseAware() ="
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/grid/LazyGridMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor NearestRangeKeyIndexMapState has parameter 'firstVisibleItemIndex' with type Function0<Integer>."
errorLine1=" firstVisibleItemIndex: () -> Int,"
errorLine2=" ~~~~~~~~~">
@@ -273,6 +354,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'measurePolicy' with type Function2<? super LazyLayoutMeasureScope, ? super Constraints, ? extends MeasureResult>."
+ errorLine1=" val measurePolicy = rememberLazyListMeasurePolicy("
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyList.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in return type Function2<LazyLayoutMeasureScope, Constraints, MeasureResult> of 'rememberLazyListMeasurePolicy'."
+ errorLine1="private fun rememberLazyListMeasurePolicy("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyList.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method measureLazyList has parameter 'layout' with type Function3<? super Integer, ? super Integer, ? super Function1<? super PlacementScope, Unit>, ? extends MeasureResult>."
errorLine1=" layout: (Int, Int, Placeable.PlacementScope.() -> Unit) -> MeasureResult"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -282,6 +381,51 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'endIndex' with type Function1<? super LazyListBeyondBoundsInfo, ? extends Integer>."
+ errorLine1=" fun LazyListBeyondBoundsInfo.endIndex() = min(end, itemsCount - 1)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'addItem' with type Function1<? super Integer, ? extends Unit>."
+ errorLine1=" fun addItem(index: Int) {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'startIndex' with type Function1<? super LazyListBeyondBoundsInfo, ? extends Integer>."
+ errorLine1=" fun LazyListBeyondBoundsInfo.startIndex() = min(start, itemsCount - 1)"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'addItem' with type Function1<? super Integer, ? extends Unit>."
+ errorLine1=" fun addItem(index: Int) {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'reverseAware' with type Function1<? super Integer, ? extends Integer>."
+ errorLine1=" fun Int.reverseAware() ="
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/foundation/lazy/list/LazyListMeasure.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'var9cfa9825' with type Function2<? super TvLazyGridItemSpanScope, ? super Integer, ? extends TvGridItemSpan>."
errorLine1=" span = span?.let { { span() } } ?: DefaultSpan,"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
diff --git a/tv/tv-material/lint-baseline.xml b/tv/tv-material/lint-baseline.xml
index 8818459..68659db 100644
--- a/tv/tv-material/lint-baseline.xml
+++ b/tv/tv-material/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PrimitiveInLambda"
@@ -12,6 +12,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'updateItemBasedOnLayout' with type Function2<? super FocusDirection, ? super Boolean, ? extends Unit>."
+ errorLine1=" fun updateItemBasedOnLayout(direction: FocusDirection, isLtr: Boolean) {"
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/material3/Carousel.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'handledHorizontalFocusMove' with type Function1<? super FocusDirection, ? extends Boolean>."
+ errorLine1=" fun handledHorizontalFocusMove(direction: FocusDirection): Boolean ="
+ errorLine2=" ^">
+ <location
+ file="src/main/java/androidx/tv/material3/Carousel.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'scrollByAction' with type Function2<? super Float, ? super Float, ? extends Boolean>."
errorLine1=" val scrollByAction: ((x: Float, y: Float) -> Boolean) ="
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -48,6 +66,15 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method DrawerSheet has parameter 'sizeAnimationFinishedListener' with type Function2<? super IntSize, ? super IntSize, Unit>."
+ errorLine1=" sizeAnimationFinishedListener: ((initialValue: IntSize, targetValue: IntSize) -> Unit)? = null,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/tv/material3/NavigationDrawer.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'valueToOffset' with type Function1<? super Boolean, ? extends Float>."
errorLine1=" val valueToOffset = remember<(Boolean) -> Float>(minBound, maxBound) {"
errorLine2=" ^">
diff --git a/wear/compose/compose-foundation/lint-baseline.xml b/wear/compose/compose-foundation/lint-baseline.xml
index 0ce8821..83c5cbf 100644
--- a/wear/compose/compose-foundation/lint-baseline.xml
+++ b/wear/compose/compose-foundation/lint-baseline.xml
@@ -217,4 +217,13 @@
file="src/main/java/androidx/wear/compose/foundation/SwipeableV2.kt"/>
</issue>
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor SwipeAnchorsModifier has parameter 'onSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" private val onSizeChanged: (layoutSize: IntSize) -> Unit,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/foundation/SwipeableV2.kt"/>
+ </issue>
+
</issues>
diff --git a/wear/compose/compose-material/lint-baseline.xml b/wear/compose/compose-material/lint-baseline.xml
index 77e29cb..c490fad 100644
--- a/wear/compose/compose-material/lint-baseline.xml
+++ b/wear/compose/compose-material/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.1.0-beta02" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta02)" variant="all" version="8.1.0-beta02">
+<issues format="6" by="lint 8.1.0-beta05" type="baseline" client="gradle" dependencies="false" name="AGP (8.1.0-beta05)" variant="all" version="8.1.0-beta05">
<issue
id="PrimitiveInLambda"
@@ -129,6 +129,24 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'boundsSize' with type Function1<? super Density, ? extends IntSize>."
+ errorLine1=" val boundsSize: Density.() -> IntSize = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in variable 'boundsOffset' with type Function1<? super Density, ? extends IntOffset>."
+ errorLine1=" val boundsOffset: Density.() -> IntOffset = {"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in constructor FractionPositionIndicatorState has parameter 'fraction' with type Function0<Float>."
errorLine1=" private val fraction: () -> Float"
errorLine2=" ~~~~~~~~~~~">
@@ -138,6 +156,42 @@
<issue
id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BoundsLimiter has parameter 'offset' with type Function1<? super Density, IntOffset>."
+ errorLine1=" offset: Density.() -> IntOffset,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BoundsLimiter has parameter 'size' with type Function1<? super Density, IntSize>."
+ errorLine1=" size: Density.() -> IntSize,"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method BoundsLimiter has parameter 'onSizeChanged' with type Function1<? super IntSize, Unit>."
+ errorLine1=" onSizeChanged: (IntSize) -> Unit = { },"
+ errorLine2=" ~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
+ message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method transparentSizeModifier has parameter 'size' with type Function1<? super Density, IntSize>."
+ errorLine1="private fun Modifier.transparentSizeModifier(size: Density.() -> IntSize): Modifier = this.then("
+ errorLine2=" ~~~~~~~~~~~~~~~~~~~~~">
+ <location
+ file="src/main/java/androidx/wear/compose/material/PositionIndicator.kt"/>
+ </issue>
+
+ <issue
+ id="PrimitiveInLambda"
message="Use a functional interface instead of lambda syntax for lambdas with primitive values in method rangeSemantics has parameter 'onValueChange' with type Function1<? super Float, Unit>."
errorLine1=" onValueChange: (Float) -> Unit,"
errorLine2=" ~~~~~~~~~~~~~~~">