Few misc foundation API changes
As API council finished reviewing foundation, few low hanging fruits that are easy to fix has been fixed there.
Relnote: "Modifier.deternimateProgress has beed renamed to Modifier.progressSemantics"
Bug: 150706555
Bug: 148542949
Fixes: 154875304
Test: added for new APIs
Change-Id: I9c0b48e0b7969a842a114b50c86d8c37799ede1d
diff --git a/ui/ui-foundation/api/0.1.0-dev16.txt b/ui/ui-foundation/api/0.1.0-dev16.txt
index 8ccb51d..768fa50 100644
--- a/ui/ui-foundation/api/0.1.0-dev16.txt
+++ b/ui/ui-foundation/api/0.1.0-dev16.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.Composable public static void Box-DoyBz0g(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192b49: androidx.compose.ui.unit.Dp = border?.size
- if (var41192b49 != null) var41192b49 else 0.dp
+ var var411927ec: androidx.compose.ui.unit.Dp = border?.size
+ if (var411927ec != null) var411927ec else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.Stable public static androidx.ui.core.Modifier determinateProgressIndicator(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.ui.core.DrawModifier {
method public void draw(androidx.ui.core.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.ui.core.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.Composable public static void ScrollableColumn(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.ui.core.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/api/current.txt b/ui/ui-foundation/api/current.txt
index 115ec61..6d3e4b5 100644
--- a/ui/ui-foundation/api/current.txt
+++ b/ui/ui-foundation/api/current.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.runtime.Composable public static void Box-qeZOqCs(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192ecf: androidx.compose.ui.unit.Dp = border?.size
- if (var41192ecf != null) var41192ecf else 0.dp
+ var var41192b72: androidx.compose.ui.unit.Dp = border?.size
+ if (var41192b72 != null) var41192b72 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.compose.ui.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.runtime.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier determinateProgressIndicator(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.compose.ui.DrawModifier {
method public void draw(androidx.compose.ui.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.runtime.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.compose.ui.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.runtime.Composable public static void ScrollableColumn(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.compose.ui.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev16.txt b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev16.txt
index 8ccb51d..768fa50 100644
--- a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev16.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev16.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.Composable public static void Box-DoyBz0g(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192b49: androidx.compose.ui.unit.Dp = border?.size
- if (var41192b49 != null) var41192b49 else 0.dp
+ var var411927ec: androidx.compose.ui.unit.Dp = border?.size
+ if (var411927ec != null) var411927ec else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.Stable public static androidx.ui.core.Modifier determinateProgressIndicator(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.ui.core.DrawModifier {
method public void draw(androidx.ui.core.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.ui.core.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.Composable public static void ScrollableColumn(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.ui.core.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/api/public_plus_experimental_current.txt b/ui/ui-foundation/api/public_plus_experimental_current.txt
index 115ec61..6d3e4b5 100644
--- a/ui/ui-foundation/api/public_plus_experimental_current.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_current.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.runtime.Composable public static void Box-qeZOqCs(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192ecf: androidx.compose.ui.unit.Dp = border?.size
- if (var41192ecf != null) var41192ecf else 0.dp
+ var var41192b72: androidx.compose.ui.unit.Dp = border?.size
+ if (var41192b72 != null) var41192b72 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.compose.ui.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.runtime.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier determinateProgressIndicator(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.compose.ui.DrawModifier {
method public void draw(androidx.compose.ui.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.runtime.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.compose.ui.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.runtime.Composable public static void ScrollableColumn(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.compose.ui.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/api/restricted_0.1.0-dev16.txt b/ui/ui-foundation/api/restricted_0.1.0-dev16.txt
index 8ccb51d..768fa50 100644
--- a/ui/ui-foundation/api/restricted_0.1.0-dev16.txt
+++ b/ui/ui-foundation/api/restricted_0.1.0-dev16.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.Composable public static void Box-DoyBz0g(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192b49: androidx.compose.ui.unit.Dp = border?.size
- if (var41192b49 != null) var41192b49 else 0.dp
+ var var411927ec: androidx.compose.ui.unit.Dp = border?.size
+ if (var411927ec != null) var411927ec else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.ui.core.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.Composable public static void Canvas(androidx.ui.core.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.Stable public static androidx.ui.core.Modifier determinateProgressIndicator(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.ui.core.DrawModifier {
method public void draw(androidx.ui.core.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.Stable public static androidx.ui.core.Modifier progressSemantics(androidx.ui.core.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.ui.core.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.Composable public static void ScrollableColumn(androidx.ui.core.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.ui.core.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/api/restricted_current.txt b/ui/ui-foundation/api/restricted_current.txt
index 115ec61..6d3e4b5 100644
--- a/ui/ui-foundation/api/restricted_current.txt
+++ b/ui/ui-foundation/api/restricted_current.txt
@@ -30,13 +30,13 @@
public final class BoxKt {
method @androidx.compose.runtime.Composable public static void Box-qeZOqCs(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.ui.graphics.Shape shape = androidx.compose.ui.graphics.RectangleShapeKt.RectangleShape, long backgroundColor = Color.Transparent, androidx.compose.foundation.Border? border = null, float padding = elvis {
- var var41192ecf: androidx.compose.ui.unit.Dp = border?.size
- if (var41192ecf != null) var41192ecf else 0.dp
+ var var41192b72: androidx.compose.ui.unit.Dp = border?.size
+ if (var41192b72 != null) var41192b72 else 0.dp
}, float paddingStart = Dp.Unspecified, float paddingTop = Dp.Unspecified, float paddingEnd = Dp.Unspecified, float paddingBottom = Dp.Unspecified, androidx.compose.ui.Alignment gravity = ContentGravity.TopStart, kotlin.jvm.functions.Function0<kotlin.Unit> children = emptyContent());
}
public final class CanvasKt {
- method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onCanvas);
+ method @androidx.compose.runtime.Composable public static void Canvas(androidx.compose.ui.Modifier modifier, kotlin.jvm.functions.Function1<? super androidx.compose.ui.graphics.drawscope.DrawScope,kotlin.Unit> onDraw);
}
public final class ClickableKt {
@@ -58,10 +58,6 @@
method @androidx.compose.runtime.Composable public static boolean isSystemInDarkTheme();
}
- public final class DeterminateProgressIndicatorKt {
- method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier determinateProgressIndicator(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
- }
-
public final class DrawBorder implements androidx.compose.ui.DrawModifier {
method public void draw(androidx.compose.ui.ContentDrawScope);
}
@@ -128,6 +124,11 @@
@kotlin.RequiresOptIn(message="This API is internal to library.") @kotlin.annotation.Target(allowedTargets={AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER}) public @interface InternalFoundationApi {
}
+ public final class ProgressSemanticsKt {
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier, @FloatRange(from=0.0, to=1.0) float progress);
+ method @androidx.compose.runtime.Stable public static androidx.compose.ui.Modifier progressSemantics(androidx.compose.ui.Modifier);
+ }
+
public final class ScrollKt {
method @Deprecated @androidx.compose.runtime.Composable public static void HorizontalScroller(androidx.compose.foundation.ScrollerPosition scrollerPosition = ScrollerPosition(), androidx.compose.ui.Modifier modifier = Modifier, boolean isScrollable = true, kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.RowScope,kotlin.Unit> children);
method @androidx.compose.runtime.Composable public static void ScrollableColumn(androidx.compose.ui.Modifier modifier = Modifier, androidx.compose.foundation.ScrollState scrollState = rememberScrollState(0.0), androidx.compose.foundation.layout.Arrangement.Vertical verticalArrangement = Arrangement.Top, androidx.compose.ui.Alignment.Horizontal horizontalGravity = Alignment.Start, boolean reverseScrollDirection = false, boolean isScrollEnabled = true, androidx.compose.foundation.layout.InnerPadding contentPadding = androidx.compose.foundation.layout.InnerPadding(0.dp), kotlin.jvm.functions.Function1<? super androidx.compose.foundation.layout.ColumnScope,kotlin.Unit> children);
diff --git a/ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/DeterminateProgressSamples.kt b/ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/ProgressSemanticsSamples.kt
similarity index 69%
rename from ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/DeterminateProgressSamples.kt
rename to ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/ProgressSemanticsSamples.kt
index 10222c9..7d76282 100644
--- a/ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/DeterminateProgressSamples.kt
+++ b/ui/ui-foundation/samples/src/main/java/androidx/compose/foundation/samples/ProgressSemanticsSamples.kt
@@ -20,18 +20,29 @@
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.foundation.Box
+import androidx.compose.foundation.Text
import androidx.compose.foundation.background
-import androidx.compose.foundation.determinateProgressIndicator
-import androidx.compose.ui.graphics.Color
import androidx.compose.foundation.layout.preferredSize
+import androidx.compose.foundation.progressSemantics
+import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
@Sampled
@Composable
-fun DeterminateProgressSample() {
+fun DeterminateProgressSemanticsSample() {
val progress = 0.5f // emulate progress from some state
Box(
- Modifier.determinateProgressIndicator(progress)
- .preferredSize((progress * 100).dp, 4.dp).background(color = Color.Cyan)
+ Modifier
+ .progressSemantics(progress)
+ .preferredSize((progress * 100).dp, 4.dp)
+ .background(color = Color.Cyan)
)
+}
+
+@Sampled
+@Composable
+fun IndeterminateProgressSemanticsSample() {
+ Box(Modifier.progressSemantics().background(color = Color.Cyan)) {
+ Text("Operation is on progress")
+ }
}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/DeterminateProgressTest.kt b/ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ProgressSemanticsTest.kt
similarity index 80%
rename from ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/DeterminateProgressTest.kt
rename to ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ProgressSemanticsTest.kt
index a1174e2..44323a4 100644
--- a/ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/DeterminateProgressTest.kt
+++ b/ui/ui-foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/ProgressSemanticsTest.kt
@@ -36,7 +36,7 @@
@MediumTest
@RunWith(JUnit4::class)
-class DeterminateProgressTest {
+class ProgressSemanticsTest {
@get:Rule
val composeTestRule = createComposeRule()
@@ -51,7 +51,7 @@
Box(
Modifier
.testTag(tag)
- .determinateProgressIndicator(progress.value)
+ .progressSemantics(progress.value)
.preferredSize(50.dp)
.background(color = Color.Cyan)
)
@@ -77,4 +77,23 @@
.assertValueEquals("50 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0.5f, 0f..1f))
}
+
+ @Test
+ fun indeterminateProgress_testSemantics() {
+ val tag = "linear"
+
+ composeTestRule
+ .setContent {
+ Box(
+ Modifier
+ .testTag(tag)
+ .progressSemantics()
+ .preferredSize(50.dp)
+ .background(color = Color.Cyan)
+ )
+ }
+
+ onNodeWithTag(tag)
+ .assertValueEquals(Strings.InProgress)
+ }
}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Box.kt b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Box.kt
index 1076e1a..c734c52 100644
--- a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Box.kt
+++ b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Box.kt
@@ -35,14 +35,15 @@
/**
* A convenience composable that combines common layout and draw logic.
*
- * In order to define the size of the [Box], the [androidx.compose.foundation.layout.LayoutWidth],
- * [androidx.compose.foundation.layout.LayoutHeight] and [androidx.compose.foundation.layout.LayoutSize] modifiers can be used.
+ * In order to define the size of the [Box], the [androidx.compose.foundation.layout.width],
+ * [androidx.compose.foundation.layout.height] and [androidx.compose.foundation.layout.size]
+ * modifiers can be used.
* The [Box] will try to be only as small as its content. However, if it is constrained
* otherwise, [Box] will allow its content to be smaller and will position the content inside,
* according to [gravity].
*
* The specified [padding] will be applied inside the [Box]. In order to apply padding outside
- * the [Box], the [androidx.compose.foundation.layout.LayoutPadding] modifier should be used.
+ * the [Box], the [androidx.compose.foundation.layout.padding] modifier should be used.
*
* @sample androidx.compose.foundation.samples.SimpleCircleBox
*
diff --git a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Canvas.kt b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Canvas.kt
index 5d4454f..3814608 100644
--- a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Canvas.kt
+++ b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/Canvas.kt
@@ -25,17 +25,17 @@
/**
* Component that allow you to specify an area on the screen and perform canvas drawing on this
- * area. You MUST specify size with modifier, whether with exact sizes via [LayoutSize] modifier,
- * or relative to parent, via [LayoutSize.Fill], [ColumnScope.LayoutWeight], etc. If parent
+ * area. You MUST specify size with modifier, whether with exact sizes via [Modifier.size]
+ * modifier, or relative to parent, via [Modifier.fillMaxSize], [ColumnScope.weight], etc. If parent
* wraps this child, only exact sizes must be specified.
*
* @sample androidx.compose.foundation.samples.CanvasSample
*
* @param modifier mandatory modifier to specify size strategy for this composable
- * @param onCanvas lambda that will be called to perform drawing. Note that this lambda will be
+ * @param onDraw lambda that will be called to perform drawing. Note that this lambda will be
* called during draw stage, you have no access to composition scope, meaning that [Composable]
* function invocation inside it will result to runtime exception
*/
@Composable
-fun Canvas(modifier: Modifier, onCanvas: DrawScope.() -> Unit) =
- Spacer(modifier.drawBehind(onCanvas))
\ No newline at end of file
+fun Canvas(modifier: Modifier, onDraw: DrawScope.() -> Unit) =
+ Spacer(modifier.drawBehind(onDraw))
\ No newline at end of file
diff --git a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/DeterminateProgressIndicator.kt b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/ProgressSemantics.kt
similarity index 77%
rename from ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/DeterminateProgressIndicator.kt
rename to ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/ProgressSemantics.kt
index d615d1a..0ca624e 100644
--- a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/DeterminateProgressIndicator.kt
+++ b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/ProgressSemantics.kt
@@ -27,17 +27,17 @@
import kotlin.math.roundToInt
/**
- * Contains the [Semantics] required for a determinate progress indicator, that represents progress
+ * Contains the [semantics] required for a determinate progress indicator, that represents progress
* ranging from 0.0 to 1.0.
*
- * @sample androidx.compose.foundation.samples.DeterminateProgressSample
+ * @sample androidx.compose.foundation.samples.DeterminateProgressSemanticsSample
*
* @param progress The progress of this progress indicator, where 0.0 represents no progress and 1.0
* represents full progress
* @throws IllegalArgumentException when the progress is not within range
*/
@Stable
-fun Modifier.determinateProgressIndicator(
+fun Modifier.progressSemantics(
@FloatRange(from = 0.0, to = 1.0) progress: Float
): Modifier {
if (progress !in 0f..1f) {
@@ -56,3 +56,18 @@
accessibilityValueRange = AccessibilityRangeInfo(progress, 0f..1f)
}
}
+
+/**
+ * Contains the [semantics] required for an indeterminate progress indicator, that represents the
+ * fact of the in-progress operation.
+ *
+ * If you need determinate progress 0.0 to 1.0, consider using overload with the progress
+ * parameter.
+ *
+ * @sample androidx.compose.foundation.samples.IndeterminateProgressSemanticsSample
+ *
+ */
+@Stable
+fun Modifier.progressSemantics(): Modifier {
+ return semantics { accessibilityValue = Strings.InProgress }
+}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Selectable.kt b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Selectable.kt
index e691767..ad667159 100644
--- a/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Selectable.kt
+++ b/ui/ui-foundation/src/commonMain/kotlin/androidx/compose/foundation/selection/Selectable.kt
@@ -34,7 +34,7 @@
/**
* Configure component to be selectable, usually as a part of a mutually exclusive group, where
* only one item can be selected at any point in time. A typical example of mutually exclusive set
- * is [androidx.compose.material.RadioGroup]
+ * is a RadioGroup or a row of Tabs.
*
* If you want to make an item support on/off capabilities without being part of a set, consider
* using [Modifier.toggleable]
diff --git a/ui/ui-material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt b/ui/ui-material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt
index 0503bf0..adab73b 100644
--- a/ui/ui-material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt
+++ b/ui/ui-material/src/commonMain/kotlin/androidx/compose/material/ProgressIndicator.kt
@@ -25,15 +25,13 @@
import androidx.compose.animation.core.repeatable
import androidx.compose.animation.core.transitionDefinition
import androidx.compose.animation.core.tween
-import androidx.compose.runtime.Composable
import androidx.compose.animation.transition
-import androidx.compose.ui.platform.DensityAmbient
-import androidx.compose.ui.unit.LayoutDirection
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.semantics.semantics
import androidx.compose.foundation.Canvas
-import androidx.compose.foundation.Strings
-import androidx.compose.foundation.determinateProgressIndicator
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.preferredSize
+import androidx.compose.foundation.progressSemantics
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
@@ -41,10 +39,9 @@
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.vectormath.degrees
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.preferredSize
-import androidx.compose.ui.semantics.accessibilityValue
+import androidx.compose.ui.platform.DensityAmbient
import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.annotation.FloatRange
import kotlin.math.abs
@@ -65,7 +62,8 @@
) {
val backgroundColor = color.copy(alpha = BackgroundOpacity)
Canvas(
- modifier.determinateProgressIndicator(progress)
+ modifier
+ .progressSemantics(progress)
.preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)
) {
val strokeWidth = ProgressIndicatorConstants.DefaultStrokeWidth.toPx()
@@ -95,11 +93,11 @@
val secondLineHead = state[SecondLineHeadProp]
val secondLineTail = state[SecondLineTailProp]
val backgroundColor = color.copy(alpha = BackgroundOpacity)
- Canvas(modifier
- // TODO(b/154875304) create IndeterminateProgressIndicator in foundation and move the
- // semantics there
- .semantics { accessibilityValue = Strings.InProgress }
- .preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)) {
+ Canvas(
+ modifier
+ .progressSemantics()
+ .preferredSize(LinearIndicatorWidth, LinearIndicatorHeight)
+ ) {
val strokeWidth = ProgressIndicatorConstants.DefaultStrokeWidth.toPx()
drawLinearIndicatorBackground(backgroundColor, strokeWidth)
if (firstLineHead - firstLineTail > 0) {
@@ -166,7 +164,7 @@
}
Canvas(
modifier
- .determinateProgressIndicator(progress)
+ .progressSemantics(progress)
.padding(CircularIndicatorPadding)
.preferredSize(CircularIndicatorDiameter)
) {
@@ -214,9 +212,7 @@
Canvas(
modifier
- // TODO(b/154875304) create IndeterminateProgressIndicator in foundation and move the
- // semantics there
- .semantics { accessibilityValue = Strings.InProgress }
+ .progressSemantics()
.padding(CircularIndicatorPadding)
.preferredSize(CircularIndicatorDiameter)
) {