Merge "Semantics no-op cleanups" into androidx-master-dev
diff --git a/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
index 073e41f..065bace 100644
--- a/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
+++ b/ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
@@ -78,7 +78,7 @@
Modifier.drawBehind { },
Modifier.drawLayer(),
Modifier.keyInputFilter { _ -> true },
- Modifier.semantics(),
+ Modifier.semantics { },
Modifier.pressIndicatorGestureFilter(),
Modifier.layoutId("Hello"),
Modifier.padding(10.dp),
diff --git a/ui/ui-core/api/0.1.0-dev15.txt b/ui/ui-core/api/0.1.0-dev15.txt
index dba437b..a90510a 100644
--- a/ui/ui-core/api/0.1.0-dev15.txt
+++ b/ui/ui-core/api/0.1.0-dev15.txt
@@ -1929,17 +1929,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -1948,7 +1937,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -1963,22 +1952,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2310,14 +2294,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2326,64 +2310,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/api/current.txt b/ui/ui-core/api/current.txt
index dba437b..a90510a 100644
--- a/ui/ui-core/api/current.txt
+++ b/ui/ui-core/api/current.txt
@@ -1929,17 +1929,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -1948,7 +1937,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -1963,22 +1952,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2310,14 +2294,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2326,64 +2310,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
index dba437b..a90510a 100644
--- a/ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
@@ -1929,17 +1929,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -1948,7 +1937,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -1963,22 +1952,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2310,14 +2294,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2326,64 +2310,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/api/public_plus_experimental_current.txt b/ui/ui-core/api/public_plus_experimental_current.txt
index dba437b..a90510a 100644
--- a/ui/ui-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-core/api/public_plus_experimental_current.txt
@@ -1929,17 +1929,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -1948,7 +1937,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -1963,22 +1952,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2310,14 +2294,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2326,64 +2310,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/api/restricted_0.1.0-dev15.txt b/ui/ui-core/api/restricted_0.1.0-dev15.txt
index f1e9bc8..afa5b10 100644
--- a/ui/ui-core/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-core/api/restricted_0.1.0-dev15.txt
@@ -1981,17 +1981,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -2000,7 +1989,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -2015,22 +2004,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2371,14 +2355,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2387,64 +2371,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/api/restricted_current.txt b/ui/ui-core/api/restricted_current.txt
index f1e9bc8..afa5b10 100644
--- a/ui/ui-core/api/restricted_current.txt
+++ b/ui/ui-core/api/restricted_current.txt
@@ -1981,17 +1981,6 @@
method public static <T> T? getOrNull(androidx.ui.core.semantics.SemanticsConfiguration, androidx.ui.semantics.SemanticsPropertyKey<T> key);
}
- public final class SemanticsHintOverrides {
- ctor public SemanticsHintOverrides(String? onTapHint, String? onLongPressHint);
- method public String? component1();
- method public String? component2();
- method public androidx.ui.core.semantics.SemanticsHintOverrides copy(String? onTapHint, String? onLongPressHint);
- method public String? getOnLongPressHint();
- method public String? getOnTapHint();
- method public boolean isNotEmpty();
- property public final boolean isNotEmpty;
- }
-
public interface SemanticsModifier extends androidx.ui.core.Modifier.Element {
method public int getId();
method public androidx.ui.core.semantics.SemanticsConfiguration getSemanticsConfiguration();
@@ -2000,7 +1989,7 @@
}
public final class SemanticsModifierKt {
- method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit>? properties = null);
+ method public static androidx.ui.core.Modifier semantics(androidx.ui.core.Modifier, boolean mergeAllDescendants = false, kotlin.jvm.functions.Function1<? super androidx.ui.semantics.SemanticsPropertyReceiver,kotlin.Unit> properties);
}
public final class SemanticsNode {
@@ -2015,22 +2004,17 @@
method public boolean getMergingEnabled();
method public androidx.ui.core.semantics.SemanticsNode? getParent();
method public androidx.ui.unit.IntSize getSize();
- method public androidx.ui.core.semantics.SemanticsConfiguration getUnmergedConfig();
method public boolean isRoot();
- method public void setComponentNode(androidx.ui.core.LayoutNode p);
property public final androidx.ui.unit.PxBounds boundsInRoot;
property public final java.util.List<androidx.ui.core.semantics.SemanticsNode> children;
+ property public final androidx.ui.core.LayoutNode componentNode;
property public final androidx.ui.core.semantics.SemanticsConfiguration config;
property public final androidx.ui.unit.PxBounds globalBounds;
property public final androidx.ui.geometry.Offset globalPosition;
+ property public final int id;
property public final boolean isRoot;
property public final androidx.ui.core.semantics.SemanticsNode? parent;
property public final androidx.ui.unit.IntSize size;
- field public static final androidx.ui.core.semantics.SemanticsNode.Companion Companion;
- }
-
- public static final class SemanticsNode.Companion {
- method public int generateNewId();
}
public final class SemanticsNodeKt {
@@ -2371,14 +2355,14 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> getCustomActions();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollBackward();
+ method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy();
method @Deprecated public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getScrollForward();
- method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollTo();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> getSetProgress();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.util.List<androidx.ui.semantics.CustomAccessibilityAction>> CustomActions;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollBackward;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy;
property @Deprecated public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> ScrollForward;
- property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollTo;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>>> SetProgress;
field public static final androidx.ui.semantics.SemanticsActions INSTANCE;
}
@@ -2387,64 +2371,50 @@
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityLabel();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> getAccessibilityRangeInfo();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getAccessibilityValue();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getEnabled();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getHidden();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsPopup();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getDisabled();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getHidden();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsPopup();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> getTestTag();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> getText();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityLabel;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityRangeInfo> AccessibilityRangeInfo;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> AccessibilityValue;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Enabled;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Hidden;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsPopup;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Disabled;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> Hidden;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsPopup;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.String> TestTag;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.text.AnnotatedString> Text;
field public static final androidx.ui.semantics.SemanticsProperties INSTANCE;
}
public final class SemanticsPropertiesKt {
- method public static void ScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
+ method public static void disabled(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.semantics.AccessibilityRangeInfo getAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static java.util.List<androidx.ui.semantics.CustomAccessibilityAction> getCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getEnabled(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getHidden(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getOnClick(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getPopup(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method @Deprecated public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> getScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> getScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> getSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static String getTestTag(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.text.AnnotatedString getText(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void hidden(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void onClick(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void popup(androidx.ui.semantics.SemanticsPropertyReceiver);
method @Deprecated public static void scrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
+ method public static void scrollBy(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean> action);
method @Deprecated public static void scrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function0<java.lang.Boolean> action);
method public static void setAccessibilityLabel(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValue(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setAccessibilityValueRange(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityRangeInfo p);
method public static void setCustomActions(androidx.ui.semantics.SemanticsPropertyReceiver, java.util.List<androidx.ui.semantics.CustomAccessibilityAction> p);
- method public static void setEnabled(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setHidden(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
- method public static void setOnClick(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setPopup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setProgress(androidx.ui.semantics.SemanticsPropertyReceiver, String? label = null, kotlin.jvm.functions.Function1<? super java.lang.Float,java.lang.Boolean> action);
- method @Deprecated public static void setScrollBackward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method @Deprecated public static void setScrollForward(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>> p);
- method public static void setScrollTo(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>> p);
- method public static void setSetProgress(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Float,java.lang.Boolean>> p);
method public static void setTestTag(androidx.ui.semantics.SemanticsPropertyReceiver, String p);
method public static void setText(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.text.AnnotatedString p);
}
- public class SemanticsPropertyKey<T> implements kotlin.properties.ReadWriteProperty<androidx.ui.semantics.SemanticsPropertyReceiver,T> {
+ public final class SemanticsPropertyKey<T> {
ctor public SemanticsPropertyKey(String name);
- method public final String getName();
- method public final T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
- method public T! merge(T? existingValue, T? newValue);
- method public final void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
+ method public String getName();
+ method public operator T! getValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property);
+ method public operator void setValue(androidx.ui.semantics.SemanticsPropertyReceiver thisRef, kotlin.reflect.KProperty<?> property, T? value);
}
public interface SemanticsPropertyReceiver {
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
index 0480a00..6feea64 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
@@ -70,9 +70,9 @@
val label1 = "foo"
val label2 = "bar"
composeTestRule.setContent {
- SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true).testTag(tag1)) {
+ SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true) {}.testTag(tag1)) {
SimpleTestLayout(Modifier.semantics { accessibilityLabel = label1 }) { }
- SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true).testTag(tag2)) {
+ SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true) {}.testTag(tag2)) {
SimpleTestLayout(Modifier.semantics { accessibilityLabel = label2 }) { }
}
}
@@ -87,7 +87,7 @@
val label = "foo"
val showSubtree = mutableStateOf(true)
composeTestRule.setContent {
- SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true).testTag(TestTag)) {
+ SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TestTag)) {
if (showSubtree.value) {
SimpleTestLayout(Modifier.semantics { accessibilityLabel = label }) { }
}
@@ -109,7 +109,7 @@
val value = "bar"
val showNewNode = mutableStateOf(false)
composeTestRule.setContent {
- SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true).testTag(TestTag)) {
+ SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TestTag)) {
SimpleTestLayout(Modifier.semantics { accessibilityLabel = label }) { }
if (showNewNode.value) {
SimpleTestLayout(Modifier.semantics { accessibilityValue = value }) { }
@@ -218,7 +218,7 @@
val isAfter = mutableStateOf(false)
composeTestRule.setContent {
- SimpleTestLayout(Modifier.testTag(TestTag).semantics(mergeAllDescendants = true)) {
+ SimpleTestLayout(Modifier.testTag(TestTag).semantics(mergeAllDescendants = true) {}) {
SimpleTestLayout(Modifier.semantics {
accessibilityLabel = if (isAfter.value) afterLabel else beforeLabel }
) {}
@@ -237,7 +237,7 @@
val label = "label"
composeTestRule.setContent {
SimpleTestLayout(Modifier.testTag(TestTag)) {
- SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true)) {
+ SimpleTestLayout(Modifier.semantics(mergeAllDescendants = true) {}) {
SimpleTestLayout(Modifier.semantics { accessibilityLabel = label }) { }
}
}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
index 07f5af7..468ab05 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
@@ -16,8 +16,10 @@
package androidx.ui.core
-actual typealias NativeRectF = android.graphics.RectF
-actual typealias NativeMatrix = android.graphics.Matrix
+internal actual typealias AtomicInt = java.util.concurrent.atomic.AtomicInteger
+
+internal actual typealias NativeRectF = android.graphics.RectF
+internal actual typealias NativeMatrix = android.graphics.Matrix
internal actual fun simpleIdentityToString(obj: Any, name: String?): String {
val className = name ?: if (obj::class.java.isAnonymousClass) {
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
index a06492c..8e091ba4 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
@@ -70,7 +70,6 @@
import androidx.ui.core.pointerinput.PointerInputEventProcessor
import androidx.ui.core.pointerinput.ProcessResult
import androidx.ui.core.semantics.SemanticsModifierCore
-import androidx.ui.core.semantics.SemanticsNode
import androidx.ui.core.semantics.SemanticsOwner
import androidx.ui.core.text.AndroidFontResourceLoader
import androidx.ui.core.texttoolbar.AndroidTextToolbar
@@ -124,9 +123,9 @@
private set
private val semanticsModifier = SemanticsModifierCore(
- id = SemanticsNode.generateNewId(),
+ id = SemanticsModifierCore.generateSemanticsId(),
mergeAllDescendants = false,
- properties = null
+ properties = {}
)
private val focusModifier = FocusModifierImpl(Inactive)
private val keyInputModifier = KeyInputModifier(null, null)
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
index 6640ab1..0c61f80 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
@@ -201,9 +201,8 @@
semanticsNode.config.getOrNull(SemanticsProperties.AccessibilityValue)
info.contentDescription =
semanticsNode.config.getOrNull(SemanticsProperties.AccessibilityLabel)
- info.isEnabled = semanticsNode.config.getOrElse(SemanticsProperties.Enabled) { true }
- info.isVisibleToUser = !(semanticsNode.config.getOrElse(
- SemanticsProperties.Hidden) { false })
+ info.isEnabled = (semanticsNode.config.getOrNull(SemanticsProperties.Disabled) == null)
+ info.isVisibleToUser = (semanticsNode.config.getOrNull(SemanticsProperties.Hidden) == null)
info.isClickable = semanticsNode.config.contains(SemanticsActions.OnClick)
if (info.isClickable) {
info.addAction(
@@ -458,7 +457,7 @@
AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS ->
return clearAccessibilityFocus(virtualViewId)
AccessibilityNodeInfoCompat.ACTION_CLICK -> {
- return if (node.canPerformAction(SemanticsActions.OnClick)) {
+ return if (node.config.contains(SemanticsActions.OnClick)) {
node.config[SemanticsActions.OnClick].action()
} else {
false
@@ -468,7 +467,7 @@
// TODO(b/157692376): remove scroll forward/backward api together with slider
// scroll action.
@Suppress("DEPRECATION")
- return if (node.canPerformAction(SemanticsActions.ScrollForward)) {
+ return if (node.config.contains(SemanticsActions.ScrollForward)) {
node.config[SemanticsActions.ScrollForward].action()
} else {
false
@@ -476,7 +475,7 @@
}
AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD -> {
@Suppress("DEPRECATION")
- return if (node.canPerformAction(SemanticsActions.ScrollBackward)) {
+ return if (node.config.contains(SemanticsActions.ScrollBackward)) {
node.config[SemanticsActions.ScrollBackward].action()
} else {
false
@@ -489,7 +488,7 @@
) {
return false
}
- return if (node.canPerformAction(SemanticsActions.SetProgress)) {
+ return if (node.config.contains(SemanticsActions.SetProgress)) {
node.config[SemanticsActions.SetProgress].action(
arguments.getFloat(
AccessibilityNodeInfoCompat.ACTION_ARGUMENT_PROGRESS_VALUE
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
index 1dd7771..543a5ed 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
@@ -104,7 +104,7 @@
val parentComposition = compositionReference()
onCommit {
composition = popupLayout.setContent(recomposer, parentComposition) {
- SimpleStack(Modifier.semantics { this.popup = true }.onPositioned {
+ SimpleStack(Modifier.semantics { this.popup() }.onPositioned {
// Get the size of the content
popupLayout.popupPositionProperties.childrenSize = it.size
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
index ca38393..5c8a0bf 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
@@ -16,6 +16,14 @@
package androidx.ui.core
+// TODO(aelias): Mark the typealiases internal when https://youtrack.jetbrains.com/issue/KT-36695 is fixed.
+// Currently, they behave as internal because the actual is internal, even though the expect is public.
+
+expect class AtomicInt(value_: Int) {
+ fun addAndGet(delta: Int): Int
+ fun compareAndSet(expected: Int, new: Int): Boolean
+}
+
// TODO(b/160140398): rewrite depending code using androidx.ui.geometry.Rect and androidx.ui.vectormath64.Matrix3.
expect class NativeRectF() {
var left: Float
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
index 97af431..a89739eb 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
@@ -96,23 +96,14 @@
*
* The [other] configuration must not contain any properties that cannot be
* merged into this configuration.
- *
- * @param ignoreAlreadySet if true, ignore properties that are already set instead of merging
*/
- internal fun absorb(other: SemanticsConfiguration, ignoreAlreadySet: Boolean = false) {
+ internal fun absorb(other: SemanticsConfiguration) {
if (other.isMergingSemanticsOfDescendants) {
isMergingSemanticsOfDescendants = true
}
-
for (entry in other.props) {
val key = entry.key
- if (props.containsKey(key)) {
- if (!ignoreAlreadySet) {
- @Suppress("UNCHECKED_CAST")
- key as SemanticsPropertyKey<Any?>
- props[key] = key.merge(props[key], entry.value)
- }
- } else {
+ if (!props.containsKey(key)) {
props[key] = entry.value
}
}
@@ -142,7 +133,6 @@
return result
}
- private val CommaSeparator = ", "
override fun toString(): String {
val propsString = StringBuilder()
var nextSeparator = ""
@@ -150,7 +140,7 @@
if (isMergingSemanticsOfDescendants) {
propsString.append(nextSeparator)
propsString.append("mergeDescendants=true")
- nextSeparator = CommaSeparator
+ nextSeparator = ", "
}
for ((key, value) in props) {
@@ -158,7 +148,7 @@
propsString.append(key.name)
propsString.append(" : ")
propsString.append(value)
- nextSeparator = CommaSeparator
+ nextSeparator = ", "
}
return "${simpleIdentityToString(this@SemanticsConfiguration, null)}{ $propsString }"
}
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
deleted file mode 100644
index a49173d..0000000
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2019 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.ui.core.semantics
-
-/**
- * Provides hint values which override the default hints on supported
- * platforms.
- *
- * On iOS, these values are always ignored.
- */
-// @immutable
-data class SemanticsHintOverrides(
- /**
- * The hint text for a tap action.
- *
- * If null, the standard hint is used instead.
- *
- * The hint should describe what happens when a tap occurs, not the
- * manner in which a tap is accomplished.
- *
- * Bad: 'Double tap to show movies'.
- * Good: 'show movies'.
- */
- val onTapHint: String?,
- /**
- * The hint text for a long press action.
- *
- * If null, the standard hint is used instead.
- *
- * The hint should describe what happens when a long press occurs, not
- * the manner in which the long press is accomplished.
- *
- * Bad: 'Double tap and hold to show tooltip'.
- * Good: 'show tooltip'.
- */
- val onLongPressHint: String?
-) {
-
- // TODO: b/150777826 - fix and re-enable assertion
- /*
- init {
- check(onTapHint != "")
- check(onLongPressHint != "")
- }
- */
-
- /** Whether there are any non-null hint values. */
- val isNotEmpty
- get() = onTapHint != null || onLongPressHint != null
-}
\ No newline at end of file
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
index 00e458f..07a0cb5 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
@@ -17,6 +17,7 @@
package androidx.ui.core.semantics
import androidx.compose.remember
+import androidx.ui.core.AtomicInt
import androidx.ui.core.Modifier
import androidx.ui.core.composed
import androidx.ui.semantics.SemanticsPropertyReceiver
@@ -27,7 +28,9 @@
*/
interface SemanticsModifier : Modifier.Element {
/**
- * The unique id of this semantics. Should be generated from SemanticsNode.generateNewId().
+ * The unique id of this semantics.
+ *
+ * Should be generated from SemanticsModifierCore.generateSemanticsId().
*/
val id: Int
@@ -41,14 +44,18 @@
internal class SemanticsModifierCore(
override val id: Int,
mergeAllDescendants: Boolean,
- properties: (SemanticsPropertyReceiver.() -> Unit)?
+ properties: (SemanticsPropertyReceiver.() -> Unit)
) : SemanticsModifier {
override val semanticsConfiguration: SemanticsConfiguration =
SemanticsConfiguration().also {
it.isMergingSemanticsOfDescendants = mergeAllDescendants
- properties?.invoke(it)
+ it.properties()
}
+ companion object {
+ private var lastIdentifier = AtomicInt(0)
+ fun generateSemanticsId() = lastIdentifier.addAndGet(1)
+ }
}
/**
@@ -61,8 +68,8 @@
*/
fun Modifier.semantics(
mergeAllDescendants: Boolean = false,
- properties: (SemanticsPropertyReceiver.() -> Unit)? = null
+ properties: (SemanticsPropertyReceiver.() -> Unit)
): Modifier = composed {
- val id = remember { SemanticsNode.generateNewId() }
+ val id = remember { SemanticsModifierCore.generateSemanticsId() }
SemanticsModifierCore(id, mergeAllDescendants, properties)
}
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
index 68a359a..3bed72e 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
@@ -24,8 +24,6 @@
import androidx.ui.core.findClosestParentNode
import androidx.ui.core.globalBounds
import androidx.ui.core.globalPosition
-import androidx.ui.semantics.AccessibilityAction
-import androidx.ui.semantics.SemanticsPropertyKey
import androidx.ui.unit.IntSize
import androidx.ui.unit.PxBounds
import androidx.ui.geometry.Offset
@@ -41,17 +39,19 @@
internal typealias SemanticsNodeVisitor = (node: SemanticsNode) -> Boolean
/**
- * A node that represents some semantic data.
+ * A list of key/value pairs associated with a layout node or its subtree.
+ *
+ * Each SemanticsNode takes its id and initial key/value list from the
+ * outermost modifier on one layout node. It also contains the "collapsed" configuration
+ * of any other semantics modifiers on the same layout node, and if "mergeDescendants" is
+ * specified and enabled, also the "merged" configuration of its subtree.
*/
@OptIn(ExperimentalLayoutNodeApi::class)
class SemanticsNode internal constructor(
- /**
- * The unique identifier for this node.
- *
- * The first root node has an id of 1. Other nodes are given a unique id when
- * they are created.
+ /*
+ * This is expected to be the outermost semantics modifier on a layout node.
*/
- val id: Int,
+ internal val layoutNodeWrapper: SemanticsWrapper,
/**
* mergingEnabled specifies whether mergeAllDescendants config has any effect.
*
@@ -62,40 +62,12 @@
*
* mergingEnabled is typically true or false consistently on every node of a SemanticsNode tree.
*/
- val mergingEnabled: Boolean,
- val unmergedConfig: SemanticsConfiguration,
- var componentNode: LayoutNode
+ val mergingEnabled: Boolean
) {
- companion object {
- // TODO(b/145955412) maybe randomize? don't want this to be a contract
- // TODO: Might need to be atomic for multi-threaded composition
- private var lastIdentifier: Int = 0
-
- fun generateNewId(): Int {
- lastIdentifier += 1
- return lastIdentifier
- }
-
- /**
- * In tests use this function to reset the counter used to generate
- * [SemanticsNode.id].
- */
- internal fun debugResetSemanticsIdCounter() {
- lastIdentifier = 0
- }
- }
-
- /**
- * Creates a semantic node.
- *
- * Each semantic node has a unique identifier that is assigned when the node
- * is created.
- */
- internal constructor(
- mergingEnabled: Boolean,
- unmergedConfig: SemanticsConfiguration,
- layoutNode: LayoutNode
- ) : this(generateNewId(), mergingEnabled, unmergedConfig, layoutNode)
+ internal val unmergedConfig = layoutNodeWrapper.collapsedSemanticsConfiguration()
+ val id: Int = layoutNodeWrapper.semanticsModifier.id
+ // TODO(aelias): Make this internal and expose the Owner instead
+ val componentNode: LayoutNode = layoutNodeWrapper.layoutNode
// GEOMETRY
@@ -152,7 +124,7 @@
private fun buildMergedConfig(
mergedConfig: SemanticsConfiguration
): SemanticsConfiguration {
- mergedConfig.absorb(unmergedConfig, ignoreAlreadySet = true)
+ mergedConfig.absorb(unmergedConfig)
unmergedChildren().fastForEach { child ->
if (child.isMergingSemanticsOfDescendants == false) {
@@ -253,11 +225,6 @@
return SemanticsNode(outerSemantics, mergingEnabled)
}
- internal fun <T : Function<Boolean>> canPerformAction(
- action: SemanticsPropertyKey<AccessibilityAction<T>>
- ) =
- this.config.contains(action)
-
private fun findOneLayerOfMergingSemanticsNodes(
list: MutableList<SemanticsNode> = mutableListOf<SemanticsNode>()
): List<SemanticsNode> {
@@ -272,26 +239,13 @@
}
}
-@OptIn(ExperimentalLayoutNodeApi::class)
-internal fun SemanticsNode(
- outerSemantics: SemanticsWrapper,
- mergingEnabled: Boolean
-): SemanticsNode {
- with (outerSemantics) {
- return SemanticsNode(modifier.id,
- mergingEnabled,
- collapsedSemanticsConfiguration(),
- layoutNode)
- }
-}
-
/**
* Returns the outermost semantics node on a LayoutNode.
*/
@OptIn(ExperimentalLayoutNodeApi::class)
internal val LayoutNode.outerSemantics: SemanticsWrapper?
get() {
- return (this as? LayoutNode)?.outerLayoutNodeWrapper?.nearestSemantics
+ return outerLayoutNodeWrapper.nearestSemantics
}
/**
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
index ed64320..80178c3 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
@@ -18,12 +18,8 @@
import androidx.ui.core.ExperimentalLayoutNodeApi
import androidx.ui.core.LayoutNode
-import androidx.ui.semantics.AccessibilityAction
-import androidx.ui.semantics.SemanticsPropertyKey
import androidx.ui.util.fastForEach
-// TODO(b/142821673): Clean up and integrate this (probably with AndroidComposeView)
-
/**
* Owns [SemanticsNode] objects and notifies listeners of changes to the
* semantics tree
@@ -43,26 +39,6 @@
get() {
return SemanticsNode(rootNode.outerSemantics!!, mergingEnabled = false)
}
-
- private fun <T : Function<Boolean>> getSemanticsActionHandlerForId(
- id: Int,
- action: SemanticsPropertyKey<AccessibilityAction<T>>
- ): AccessibilityAction<*>? {
- var result: SemanticsNode? = rootSemanticsNode.findChildById(id)
- if (result != null && !result.canPerformAction(action)) {
- result.visitDescendants { node: SemanticsNode ->
- if (node.canPerformAction(action)) {
- result = node
- return@visitDescendants false // found node, abort walk
- }
- return@visitDescendants true // continue walk
- }
- }
- if (result?.canPerformAction(action) != true) {
- return null
- }
- return result!!.unmergedConfig.getOrNull(action)
- }
}
/**
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
index 5b6a304..8dc5f75 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
@@ -27,11 +27,11 @@
) : DelegatingLayoutNodeWrapper<SemanticsModifier>(wrapped, semanticsModifier) {
fun collapsedSemanticsConfiguration(): SemanticsConfiguration {
var config = SemanticsConfiguration()
- config.absorb(modifier.semanticsConfiguration, ignoreAlreadySet = true)
+ config.absorb(modifier.semanticsConfiguration)
val innerConfig = wrapped.nearestSemantics?.collapsedSemanticsConfiguration()
if (innerConfig != null) {
- config.absorb(innerConfig, ignoreAlreadySet = true)
+ config.absorb(innerConfig)
}
return config
}
@@ -46,6 +46,6 @@
}
override fun toString(): String {
- return "${super.toString()} localConfig: ${modifier.semanticsConfiguration}"
+ return "${super.toString()} id: ${modifier.id} config: ${modifier.semanticsConfiguration}"
}
}
diff --git a/ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
index f79ae99..8307e97 100644
--- a/ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
@@ -17,8 +17,6 @@
package androidx.ui.semantics
import androidx.ui.text.AnnotatedString
-import androidx.ui.text.annotatedString
-import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty
/**
@@ -31,13 +29,7 @@
*
* @see SemanticsPropertyReceiver.accessibilityLabel
*/
- val AccessibilityLabel = object : SemanticsPropertyKey<String>("AccessibilityLabel") {
- override fun merge(existingValue: String, newValue: String): String {
- // TODO(b/138173613): Needs TextDirection, probably needs to pass both nodes
- // to retrieve it
- return existingValue + "\n" + newValue
- }
- }
+ val AccessibilityLabel = SemanticsPropertyKey<String>("AccessibilityLabel")
/**
* Developer-set state description of the semantics node. For example: on/off. If this not
@@ -58,18 +50,18 @@
SemanticsPropertyKey<AccessibilityRangeInfo>("AccessibilityRangeInfo")
/**
- * Whether this semantics node is enabled.
+ * Whether this semantics node is disabled.
*
- * @see SemanticsPropertyReceiver.enabled
+ * @see SemanticsPropertyReceiver.disabled
*/
- val Enabled = SemanticsPropertyKey<Boolean>("Enabled")
+ val Disabled = SemanticsPropertyKey<Unit>("Disabled")
/**
* Whether this semantics node is hidden.
*
* @see SemanticsPropertyReceiver.hidden
*/
- val Hidden = SemanticsPropertyKey<Boolean>("Hidden")
+ val Hidden = SemanticsPropertyKey<Unit>("Hidden")
/**
* Whether this semantics node represents a Popup. Not to be confused with if this node is
@@ -77,7 +69,7 @@
*
* @see SemanticsPropertyReceiver.popup
*/
- val IsPopup = SemanticsPropertyKey<Boolean>("IsPopup")
+ val IsPopup = SemanticsPropertyKey<Unit>("IsPopup")
// TODO(b/138172781): Move to FoundationSemanticsProperties
/**
@@ -93,23 +85,7 @@
*
* @see SemanticsPropertyReceiver.text
*/
- val Text = object : SemanticsPropertyKey<AnnotatedString>("Text") {
- override fun merge(
- existingValue: AnnotatedString,
- newValue: AnnotatedString
- ): AnnotatedString {
- // TODO(b/138173613): Needs TextDirection, probably needs to pass both nodes
- // to retrieve it
- return annotatedString {
- append(existingValue)
- append("\n")
- append(newValue)
- }
- }
- }
-
- // TODO(b/151228491): TextDirection needs to be in core for platform use
- // val TextDirection = SemanticsPropertyKey<TextDirection>("TextDirection")
+ val Text = SemanticsPropertyKey<AnnotatedString>("Text")
}
/**
@@ -127,10 +103,10 @@
/**
* Action to scroll to a specified position.
*
- * @see SemanticsPropertyReceiver.ScrollTo
+ * @see SemanticsPropertyReceiver.ScrollBy
*/
- val ScrollTo =
- SemanticsPropertyKey<AccessibilityAction<(x: Float, y: Float) -> Boolean>>("ScrollTo")
+ val ScrollBy =
+ SemanticsPropertyKey<AccessibilityAction<(x: Float, y: Float) -> Boolean>>("ScrollBy")
/**
* Action to scroll the content forward.
@@ -169,46 +145,25 @@
SemanticsPropertyKey<List<CustomAccessibilityAction>>("CustomActions")
}
-open class SemanticsPropertyKey<T>(
+class SemanticsPropertyKey<T>(
/**
* The name of the property. Should be the same as the constant from which it is accessed.
*/
val name: String
-) :
- ReadWriteProperty<SemanticsPropertyReceiver, T> {
- /**
- * Subclasses that wish to implement merging should override this to output the merged value
- *
- * This implementation always throws IllegalStateException. It should be overridden for
- * properties that can be merged.
- */
- open fun merge(existingValue: T, newValue: T): T {
- throw IllegalStateException(
- "merge function called on unmergeable property $name. " +
- "Existing value: $existingValue, new value: $newValue. " +
- "You may need to add a semantic boundary."
- )
- }
-
+) {
/**
* Throws [UnsupportedOperationException]. Should not be called.
*/
- // noinspection DeprecatedCallableAddReplaceWith
- // TODO(KT-32770): Re-deprecate this
- // @Deprecated(
- // message = "You cannot retrieve a semantics property directly - " +
- // "use one of the SemanticsConfiguration.getOr* methods instead",
- // level = DeprecationLevel.ERROR
- // )
- // TODO(KT-6519): Remove this getter entirely
- final override fun getValue(thisRef: SemanticsPropertyReceiver, property: KProperty<*>): T {
+ // TODO(KT-6519): Remove this getter
+ // TODO(KT-32770): Cannot deprecate this either as the getter is considered called by "by"
+ final operator fun getValue(thisRef: SemanticsPropertyReceiver, property: KProperty<*>): T {
throw UnsupportedOperationException(
"You cannot retrieve a semantics property directly - " +
"use one of the SemanticsConfiguration.getOr* methods instead"
)
}
- final override fun setValue(
+ final operator fun setValue(
thisRef: SemanticsPropertyReceiver,
property: KProperty<*>,
value: T
@@ -230,15 +185,7 @@
* forward action should return false if the widget is not enabled or has reached the end of the
* list.
*/
-data class AccessibilityAction<T : Function<Boolean>>(val label: CharSequence?, val action: T) {
- // TODO(b/145951226): Workaround for a bytecode issue, remove this
- override fun hashCode(): Int {
- var result = label?.hashCode() ?: 0
- // (action as Any) is the workaround
- result = 31 * result + (action as Any).hashCode()
- return result
- }
-}
+data class AccessibilityAction<T : Function<Boolean>>(val label: CharSequence?, val action: T)
/**
* Data class for custom accessibility action.
@@ -247,15 +194,7 @@
* @param action The function to invoke when this action is performed. The function should have no
* arguments and return a boolean result indicating whether the action is successfully handled.
*/
-data class CustomAccessibilityAction(val label: CharSequence, val action: () -> Boolean) {
- // TODO(b/145951226): Workaround for a bytecode issue, remove this
- override fun hashCode(): Int {
- var result = label.hashCode()
- // (action as Any) is the workaround
- result = 31 * result + (action as Any).hashCode()
- return result
- }
-}
+data class CustomAccessibilityAction(val label: CharSequence, val action: () -> Boolean)
data class AccessibilityRangeInfo(
val current: Float,
@@ -292,18 +231,22 @@
var SemanticsPropertyReceiver.accessibilityValueRange by SemanticsProperties.AccessibilityRangeInfo
/**
- * Whether this semantics node is enabled.
+ * Whether this semantics node is disabled.
*
- * @see SemanticsProperties.Enabled
+ * @see SemanticsProperties.Disabled
*/
-var SemanticsPropertyReceiver.enabled by SemanticsProperties.Enabled
+fun SemanticsPropertyReceiver.disabled() {
+ this[SemanticsProperties.Disabled] = Unit
+}
/**
* Whether this semantics node is hidden.
*
* @See SemanticsProperties.Hidden
*/
-var SemanticsPropertyReceiver.hidden by SemanticsProperties.Hidden
+fun SemanticsPropertyReceiver.hidden() {
+ this[SemanticsProperties.Hidden] = Unit
+}
/**
* Whether this semantics node represents a Popup. Not to be confused with if this node is
@@ -311,7 +254,9 @@
*
* @See SemanticsProperties.IsPopup
*/
-var SemanticsPropertyReceiver.popup by SemanticsProperties.IsPopup
+fun SemanticsPropertyReceiver.popup() {
+ this[SemanticsProperties.IsPopup] = Unit
+}
// TODO(b/138172781): Move to FoundationSemanticsProperties.kt
/**
@@ -328,8 +273,6 @@
*/
var SemanticsPropertyReceiver.text by SemanticsProperties.Text
-// var SemanticsPropertyReceiver.textDirection by SemanticsProperties.TextDirection
-
/**
* Custom actions which are defined by app developers.
*
@@ -338,45 +281,6 @@
var SemanticsPropertyReceiver.customActions by SemanticsActions.CustomActions
/**
- * Action to be performed when the node is clicked.
- *
- * @see SemanticsActions.OnClick
- */
-var SemanticsPropertyReceiver.onClick by SemanticsActions.OnClick
-
-/**
- * Action to scroll to a specified position.
- *
- * @see SemanticsActions.ScrollTo
- */
-var SemanticsPropertyReceiver.ScrollTo by SemanticsActions.ScrollTo
-
-/**
- * Action to scroll the content forward.
- *
- * @see SemanticsActions.ScrollForward
- */
-@Deprecated("Use scroll up/down/left/right instead")
-@Suppress("DEPRECATION")
-var SemanticsPropertyReceiver.scrollForward by SemanticsActions.ScrollForward
-
-/**
- * Action to scroll the content backward.
- *
- * @see SemanticsActions.ScrollBackward
- */
-@Deprecated("Use scroll up/down/left/right instead")
-@Suppress("DEPRECATION")
-var SemanticsPropertyReceiver.scrollBackward by SemanticsActions.ScrollBackward
-
-/**
- * Action to set slider progress.
- *
- * @see SemanticsActions.SetProgress
- */
-var SemanticsPropertyReceiver.setProgress by SemanticsActions.SetProgress
-
-/**
* This function adds the [SemanticsActions.OnClick] to the [SemanticsPropertyReceiver].
*
* @param label Optional label for this action.
@@ -387,16 +291,16 @@
}
/**
- * This function adds the [SemanticsActions.ScrollTo] to the [SemanticsPropertyReceiver].
+ * This function adds the [SemanticsActions.ScrollBy] to the [SemanticsPropertyReceiver].
*
* @param label Optional label for this action.
- * @param action Action to be performed when the [SemanticsActions.ScrollTo] is called.
+ * @param action Action to be performed when the [SemanticsActions.ScrollBy] is called.
*/
-fun SemanticsPropertyReceiver.ScrollTo(
+fun SemanticsPropertyReceiver.scrollBy(
label: String? = null,
action: (x: Float, y: Float) -> Boolean
) {
- this[SemanticsActions.ScrollTo] = AccessibilityAction(label, action)
+ this[SemanticsActions.ScrollBy] = AccessibilityAction(label, action)
}
/**
@@ -437,52 +341,3 @@
) {
this[SemanticsActions.SetProgress] = AccessibilityAction(label, action)
}
-
-// TODO(b/138173613): Use this for merging labels
-/*
-
- /**
- * U+202A LEFT-TO-RIGHT EMBEDDING
- *
- * Treat the following text as embedded left-to-right.
- *
- * Use [PDF] to end the embedding.
- */
- private const val LRE = "\u202A"
-
- /**
- * U+202B RIGHT-TO-LEFT EMBEDDING
- *
- * Treat the following text as embedded right-to-left.
- *
- * Use [PDF] to end the embedding.
- */
- private const val RLE = "\u202B"
-
- /**
- * U+202C POP DIRECTIONAL FORMATTING
- *
- * End the scope of the last [LRE], [RLE], [RLO], or [LRO].
- */
- private const val PDF = "\u202C"
-
-private fun concatStrings(
- thisString: String?,
- otherString: String?,
- thisTextDirection: TextDirection?,
- otherTextDirection: TextDirection?
-): String? {
- if (otherString.isNullOrEmpty())
- return thisString
- var nestedLabel = otherString
- if (thisTextDirection != otherTextDirection && otherTextDirection != null) {
- nestedLabel = when (otherTextDirection) {
- TextDirection.Rtl -> "${RLE}$nestedLabel${PDF}"
- TextDirection.Ltr -> "${LRE}$nestedLabel${PDF}"
- }
- }
- if (thisString.isNullOrEmpty())
- return nestedLabel
- return "$thisString\n$nestedLabel"
-}
-*/
diff --git a/ui/ui-foundation/api/0.1.0-dev15.txt b/ui/ui-foundation/api/0.1.0-dev15.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/0.1.0-dev15.txt
+++ b/ui/ui-foundation/api/0.1.0-dev15.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/api/current.txt b/ui/ui-foundation/api/current.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/current.txt
+++ b/ui/ui-foundation/api/current.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/api/public_plus_experimental_current.txt b/ui/ui-foundation/api/public_plus_experimental_current.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/public_plus_experimental_current.txt
+++ b/ui/ui-foundation/api/public_plus_experimental_current.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/api/restricted_0.1.0-dev15.txt b/ui/ui-foundation/api/restricted_0.1.0-dev15.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-foundation/api/restricted_0.1.0-dev15.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/api/restricted_current.txt b/ui/ui-foundation/api/restricted_current.txt
index 8814c9a..ec9a8bd 100644
--- a/ui/ui-foundation/api/restricted_current.txt
+++ b/ui/ui-foundation/api/restricted_current.txt
@@ -359,22 +359,21 @@
public final class FoundationSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getInMutuallyExclusiveGroup();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getIsDialog();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getIsDialog();
method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSelected();
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> getToggleableState();
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> InMutuallyExclusiveGroup;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> IsDialog;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> IsDialog;
property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> Selected;
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.foundation.selection.ToggleableState> ToggleableState;
field public static final androidx.ui.foundation.semantics.FoundationSemanticsProperties INSTANCE;
}
public final class FoundationSemanticsPropertiesKt {
- method public static boolean getDialog(androidx.ui.semantics.SemanticsPropertyReceiver);
+ method public static void dialog(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static boolean getSelected(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static androidx.ui.foundation.selection.ToggleableState getToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static void setDialog(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setInMutuallyExclusiveGroup(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setSelected(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
method public static void setToggleableState(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.foundation.selection.ToggleableState p);
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
index dacfdbe..95a2c2a 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
@@ -26,7 +26,7 @@
import androidx.ui.core.gesture.pressIndicatorGestureFilter
import androidx.ui.core.gesture.tapGestureFilter
import androidx.ui.core.semantics.semantics
-import androidx.ui.semantics.enabled
+import androidx.ui.semantics.disabled
import androidx.ui.semantics.onClick
/**
@@ -58,16 +58,14 @@
onDoubleClick: (() -> Unit)? = null,
onClick: () -> Unit
) = composed {
- val semanticModifier = Modifier.semantics(
- mergeAllDescendants = true,
- properties = {
- this.enabled = enabled
- if (enabled) {
- // b/156468846: add long click semantics and double click if needed
- onClick(action = { onClick(); return@onClick true }, label = onClickLabel)
- }
+ val semanticModifier = Modifier.semantics(mergeAllDescendants = true) {
+ if (enabled) {
+ // b/156468846: add long click semantics and double click if needed
+ onClick(action = { onClick(); return@onClick true }, label = onClickLabel)
+ } else {
+ disabled()
}
- )
+ }
val interactionUpdate =
if (enabled) {
Modifier.pressIndicatorGestureFilter(
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
index bbd548f..9763ec6 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
@@ -77,7 +77,7 @@
dialog.setContent(composition) {
// TODO(b/159900354): draw a scrim and add margins around the Compose Dialog, and
// consume clicks so they can't pass through to the underlying UI
- Box(Modifier.semantics { this.dialog = true }, children = children)
+ Box(Modifier.semantics { this.dialog() }, children = children)
}
}
}
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
index a4d59e0..2f50b6a 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
@@ -44,7 +44,7 @@
import androidx.ui.layout.RowScope
import androidx.ui.savedinstancestate.Saver
import androidx.ui.savedinstancestate.rememberSavedInstanceState
-import androidx.ui.semantics.ScrollTo
+import androidx.ui.semantics.scrollBy
import kotlin.math.roundToInt
/**
@@ -289,13 +289,13 @@
.semantics {
if (isScrollable) {
// when b/156389287 is fixed, this should be proper scrollTo with reverse handling
- ScrollTo(action = { x, y ->
+ scrollBy(action = { x, y ->
if (isVertical) {
scrollerPosition.scrollBy(y)
} else {
scrollerPosition.scrollBy(x)
}
- return@ScrollTo true
+ return@scrollBy true
})
}
}
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
index cac46d7..25d8ca6 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
@@ -67,9 +67,9 @@
interactionState = interactionState,
indication = indication,
onClick = onClick
- ).semantics(properties = {
+ ).semantics {
this.inMutuallyExclusiveGroup = inMutuallyExclusiveGroup
this.selected = selected
this.accessibilityValue = if (selected) Strings.Selected else Strings.NotSelected
- })
+ }
}
\ No newline at end of file
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
index 407f163..1511a42 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
@@ -35,7 +35,7 @@
import androidx.ui.foundation.selection.ToggleableState.On
import androidx.ui.foundation.semantics.toggleableState
import androidx.ui.semantics.accessibilityValue
-import androidx.ui.semantics.enabled
+import androidx.ui.semantics.disabled
import androidx.ui.semantics.onClick
/**
@@ -99,23 +99,21 @@
onClick: () -> Unit
) = composed {
// TODO(pavlis): Handle multiple states for Semantics
- val semantics = Modifier.semantics(
- mergeAllDescendants = true,
- properties = {
- this.accessibilityValue = when (state) {
- // TODO(ryanmentley): These should be set by Checkbox, Switch, etc.
- On -> Strings.Checked
- Off -> Strings.Unchecked
- Indeterminate -> Strings.Indeterminate
- }
- this.toggleableState = state
- this.enabled = enabled
-
- if (enabled) {
- onClick(action = { onClick(); return@onClick true }, label = "Toggle")
- }
+ val semantics = Modifier.semantics(mergeAllDescendants = true) {
+ this.accessibilityValue = when (state) {
+ // TODO(ryanmentley): These should be set by Checkbox, Switch, etc.
+ On -> Strings.Checked
+ Off -> Strings.Unchecked
+ Indeterminate -> Strings.Indeterminate
}
- )
+ this.toggleableState = state
+
+ if (enabled) {
+ onClick(action = { onClick(); return@onClick true }, label = "Toggle")
+ } else {
+ disabled()
+ }
+ }
val interactionUpdate =
if (enabled) {
Modifier.pressIndicatorGestureFilter(
diff --git a/ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt b/ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
index 0cb421f..e65cd13 100644
--- a/ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
+++ b/ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
@@ -26,14 +26,6 @@
*/
object FoundationSemanticsProperties {
/**
- * Whether this element is in a group from which only a single item can be selected at any given
- * time (such as a radio group)
- *
- * @see SemanticsPropertyReceiver.inMutuallyExclusiveGroup
- */
- val InMutuallyExclusiveGroup = SemanticsPropertyKey<Boolean>("InMutuallyExclusiveGroup")
-
- /**
* Whether this element is selected (out of a list of possible selections).
* The presence of this property indicates that the element is selectable.
*
@@ -42,6 +34,17 @@
val Selected = SemanticsPropertyKey<Boolean>("Selected")
/**
+ * Whether this element is in a group from which only a single item can be selected at any given
+ * time (such as a radio group)
+ *
+ * The presence of this property indicates that the element is a member of
+ * a selectable group (exclusive or not).
+ *
+ * @see SemanticsPropertyReceiver.inMutuallyExclusiveGroup
+ */
+ val InMutuallyExclusiveGroup = SemanticsPropertyKey<Boolean>("InMutuallyExclusiveGroup")
+
+ /**
* The state of a toggleable component.
* The presence of this property indicates that the element is toggleable.
*
@@ -53,7 +56,7 @@
* Whether this element is a Dialog. Not to be confused with if this element is _part of_ a
* Dialog.
*/
- val IsDialog = SemanticsPropertyKey<Boolean>("IsDialog")
+ val IsDialog = SemanticsPropertyKey<Unit>("IsDialog")
}
/**
@@ -85,4 +88,6 @@
/**
* Whether this element is a Dialog. Not to be confused with if this element is _part of_ a Dialog.
*/
-var SemanticsPropertyReceiver.dialog by FoundationSemanticsProperties.IsDialog
+fun SemanticsPropertyReceiver.dialog() {
+ this[FoundationSemanticsProperties.IsDialog] = Unit
+}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
index b45304d..d4572b5 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
@@ -558,7 +558,7 @@
fun zOrderingBasedOnElevationIsApplied() {
composeTestRule.setMaterialContent {
Stack(
- Modifier.semantics(mergeAllDescendants = true)
+ Modifier.semantics(mergeAllDescendants = true) {}
.testTag("stack")
.preferredSize(10.dp, 10.dp)
) {
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
index f3fcca5..5f17c0a 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
@@ -57,7 +57,7 @@
cardColor = MaterialTheme.colors.surface
Providers(ShapesAmbient provides Shapes(medium = shape)) {
Card(modifier = Modifier
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("card"),
elevation = 0.dp
) {
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
index 7fe300b..2cda410 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
@@ -23,7 +23,6 @@
import androidx.test.screenshot.assertAgainstGolden
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
-import androidx.ui.core.semantics.semantics
import androidx.ui.core.testTag
import androidx.ui.foundation.Box
import androidx.ui.foundation.selection.ToggleableState
@@ -63,7 +62,7 @@
@Test
fun checkBoxTest_checked() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(checked = true, onCheckedChange = { })
}
}
@@ -73,7 +72,7 @@
@Test
fun checkBoxTest_unchecked() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(modifier = wrap, checked = false, onCheckedChange = { })
}
}
@@ -83,7 +82,7 @@
@Test
fun checkBoxTest_pressed() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(modifier = wrap, checked = false, onCheckedChange = { })
}
}
@@ -96,7 +95,7 @@
@Test
fun checkBoxTest_indeterminate() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
TriStateCheckbox(
state = ToggleableState.Indeterminate,
modifier = wrap,
@@ -109,7 +108,7 @@
@Test
fun checkBoxTest_disabled_checked() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(modifier = wrap, checked = true, enabled = false, onCheckedChange = { })
}
}
@@ -119,7 +118,7 @@
@Test
fun checkBoxTest_disabled_unchecked() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(modifier = wrap, checked = false, enabled = false, onCheckedChange = { })
}
}
@@ -129,7 +128,7 @@
@Test
fun checkBoxTest_disabled_indeterminate() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
TriStateCheckbox(
state = ToggleableState.Indeterminate,
enabled = false,
@@ -144,7 +143,7 @@
fun checkBoxTest_unchecked_animateToChecked() {
composeTestRule.setMaterialContent {
val isChecked = state { false }
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(
modifier = wrap,
checked = isChecked.value,
@@ -169,7 +168,7 @@
fun checkBoxTest_checked_animateToUnchecked() {
composeTestRule.setMaterialContent {
val isChecked = state { true }
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
Checkbox(
modifier = wrap,
checked = isChecked.value,
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
index f3be708..d774c3f 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
@@ -24,7 +24,6 @@
import androidx.test.screenshot.assertAgainstGolden
import androidx.ui.core.Alignment
import androidx.ui.core.Modifier
-import androidx.ui.core.semantics.semantics
import androidx.ui.core.testTag
import androidx.ui.foundation.Box
import androidx.ui.layout.wrapContentSize
@@ -63,7 +62,7 @@
@Test
fun radioButtonTest_selected() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(selected = true, onClick = {})
}
}
@@ -73,7 +72,7 @@
@Test
fun radioButtonTest_notSelected() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(selected = false, onClick = {})
}
}
@@ -83,7 +82,7 @@
@Test
fun radioButtonTest_pressed() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(selected = false, onClick = {})
}
}
@@ -96,7 +95,7 @@
@Test
fun radioButtonTest_disabled_selected() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(selected = true, onClick = {}, enabled = false)
}
}
@@ -106,7 +105,7 @@
@Test
fun radioButtonTest_disabled_notSelected() {
composeTestRule.setMaterialContent {
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(selected = false, onClick = {}, enabled = false)
}
}
@@ -117,7 +116,7 @@
fun radioButton_notSelected_animateToSelected() {
composeTestRule.setMaterialContent {
val isSelected = state { false }
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(
selected = isSelected.value,
onClick = { isSelected.value = !isSelected.value }
@@ -141,7 +140,7 @@
fun radioButton_selected_animateToNotSelected() {
composeTestRule.setMaterialContent {
val isSelected = state { true }
- Box(wrap.semantics().testTag(wrapperTestTag)) {
+ Box(wrap.testTag(wrapperTestTag)) {
RadioButton(
selected = isSelected.value,
onClick = { isSelected.value = !isSelected.value }
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
index f18e253..764f4f7 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
@@ -347,7 +347,7 @@
Stack(
Modifier
.size(10.dp, 20.dp)
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("Scaffold")
) {
Scaffold(
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
index 13cadce..3d17c81 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
@@ -341,7 +341,7 @@
.compositeOver(background)
Providers(ShapesAmbient provides Shapes(medium = shape)) {
Snackbar(modifier = Modifier
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("snackbar"),
text = { Text("") }
)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
index 538796d..f10e94b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
@@ -53,7 +53,7 @@
composeTestRule.setMaterialContent {
Stack(Modifier
.preferredSize(10.dp, 10.dp)
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("stack")) {
Surface(color = Color.Yellow, elevation = 2.dp) {
Box(Modifier.fillMaxSize())
@@ -80,7 +80,7 @@
composeTestRule.setMaterialContent {
Stack(Modifier
.preferredSize(10.dp, 10.dp)
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("stack")) {
Surface(color = Color.Yellow) {
Box(Modifier.fillMaxSize())
@@ -107,7 +107,7 @@
composeTestRule.setMaterialContent {
Stack(Modifier
.preferredSize(10.dp, 10.dp)
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("stack")) {
Box(Modifier.fillMaxSize().drawBackground(Color.Green).zIndex(3f))
Surface(color = Color.Yellow, elevation = 2.dp) {
@@ -132,7 +132,7 @@
composeTestRule.setMaterialContent {
Stack(Modifier
.preferredSize(10.dp, 10.dp)
- .semantics(mergeAllDescendants = true)
+ .semantics(mergeAllDescendants = true) {}
.testTag("stack")) {
Box(Modifier.fillMaxSize().drawBackground(Color.Green).zIndex(1f))
Surface(color = Color.Yellow, elevation = 2.dp) {
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
index 8b8ed07..770953b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
@@ -623,7 +623,7 @@
*/
@Composable
private fun RippleBox(interactionState: InteractionState, rippleIndication: RippleIndication) {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(Tag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(Tag)) {
Surface(
Modifier.padding(25.dp),
color = RippleBoxBackgroundColor, shape = RoundedCornerShape(20)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
index c8aafd2..7389518 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
@@ -56,7 +56,7 @@
@Test
fun outlinedTextField_withInput() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
OutlinedTextField(
value = "Text",
onValueChange = {},
@@ -71,7 +71,7 @@
@Test
fun outlinedTextField_notFocused() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
OutlinedTextField(
value = "",
onValueChange = {},
@@ -86,7 +86,7 @@
@Test
fun outlinedTextField_focused() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
OutlinedTextField(
value = "",
onValueChange = {},
@@ -104,7 +104,7 @@
@Test
fun outlinedTextField_focused_rtl() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag).rtl) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag).rtl) {
OutlinedTextField(
value = "",
onValueChange = {},
@@ -122,7 +122,7 @@
@Test
fun filledTextField_withInput() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
FilledTextField(
value = "Text",
onValueChange = {},
@@ -137,7 +137,7 @@
@Test
fun filledTextField_notFocused() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
FilledTextField(
value = "",
onValueChange = {},
@@ -152,7 +152,7 @@
@Test
fun filledTextField_focused() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag)) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag)) {
FilledTextField(
value = "",
onValueChange = {},
@@ -170,7 +170,7 @@
@Test
fun filledTextField_focused_rtl() {
composeTestRule.setMaterialContent {
- Box(Modifier.semantics(mergeAllDescendants = true).testTag(TextFieldTag).rtl) {
+ Box(Modifier.semantics(mergeAllDescendants = true) {}.testTag(TextFieldTag).rtl) {
FilledTextField(
value = "",
onValueChange = {},
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt b/ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
index 7d8312c..5fd57c9 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
@@ -17,7 +17,6 @@
import androidx.compose.Composable
import androidx.ui.core.Modifier
-import androidx.ui.core.semantics.semantics
import androidx.ui.foundation.ContentGravity
import androidx.ui.foundation.ProvideTextStyle
import androidx.ui.foundation.shape.corner.CircleShape
@@ -93,7 +92,7 @@
}
Row(
- Modifier.fillMaxHeight().weight(1f).semantics(),
+ Modifier.fillMaxHeight().weight(1f),
verticalGravity = ContentGravity.CenterVertically
) {
ProvideTextStyle(value = MaterialTheme.typography.h6) {
diff --git a/ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt b/ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
index c4de0f0..ec83e8e 100644
--- a/ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
+++ b/ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
@@ -48,7 +48,6 @@
import androidx.ui.core.focus.FocusState
import androidx.ui.core.focus.focusState
import androidx.ui.core.offset
-import androidx.ui.core.semantics.semantics
import androidx.ui.foundation.ContentColorAmbient
import androidx.ui.foundation.ProvideTextStyle
import androidx.ui.foundation.TextField
@@ -166,7 +165,6 @@
}
val textFieldModifier = modifier
- .semantics(mergeAllDescendants = true)
.clickable(indication = RippleIndication(bounded = false)) {
focusModifier.requestFocus()
keyboardController.value?.showSoftwareKeyboard()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
index 8bde3ad..d035cc5 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
@@ -38,7 +38,7 @@
@Test
fun assertIsNotHidden_forVisibleElement_isOk() {
composeTestRule.setContent {
- BoundaryNode { testTag = "test"; hidden = false }
+ BoundaryNode { testTag = "test" }
}
onNodeWithTag("test")
@@ -48,7 +48,7 @@
@Test(expected = AssertionError::class)
fun assertIsNotHidden_forHiddenElement_throwsError() {
composeTestRule.setContent {
- BoundaryNode { testTag = "test"; hidden = true }
+ BoundaryNode { testTag = "test"; hidden() }
}
onNodeWithTag("test")
@@ -58,7 +58,7 @@
@Test
fun assertIsHidden_forHiddenElement_isOk() {
composeTestRule.setContent {
- BoundaryNode { testTag = "test"; hidden = true }
+ BoundaryNode { testTag = "test"; hidden() }
}
onNodeWithTag("test")
@@ -68,7 +68,7 @@
@Test(expected = AssertionError::class)
fun assertIsHidden_forNotHiddenElement_throwsError() {
composeTestRule.setContent {
- BoundaryNode { testTag = "test"; hidden = false }
+ BoundaryNode { testTag = "test" }
}
onNodeWithTag("test")
@@ -194,7 +194,6 @@
onNodeWithTag("test")
.assertIsUnselected()
}
-
@Test(expected = AssertionError::class)
fun assertItemInExclusiveGroup_forItemNotInGroup_throwsError() {
composeTestRule.setContent {
@@ -208,7 +207,7 @@
@Test(expected = AssertionError::class)
fun assertItemInExclusiveGroup_forItemWithoutProperty_throwsError() {
composeTestRule.setContent {
- BoundaryNode { testTag = "test"; }
+ BoundaryNode { testTag = "test" }
}
onNodeWithTag("test")
@@ -226,7 +225,7 @@
}
@Composable
- fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)? = null) {
+ fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)) {
Column(Modifier.semantics(properties = props)) {}
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
index 301adaf..e58171a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
@@ -68,7 +68,7 @@
}
@Composable
- fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)? = null) {
+ fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)) {
Column(Modifier.semantics(properties = props)) {}
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
index 60afce4..4036a2a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
@@ -20,7 +20,6 @@
import androidx.compose.state
import androidx.test.filters.MediumTest
import androidx.ui.core.Modifier
-import androidx.ui.core.semantics.semantics
import androidx.ui.core.testTag
import androidx.ui.foundation.Box
import androidx.ui.foundation.Text
@@ -53,7 +52,7 @@
"Failed to assert the following: (OnClick is defined)\n" +
"Semantics of the node:\n" +
"Node #X at (X, X, X, X)px, Tag: 'MyButton'\n" +
- "Enabled = 'false'\n" +
+ "Disabled = 'kotlin.Unit'\n" +
"Text = 'Toggle'\n" +
"MergeDescendants = 'true'\n" +
"Has 1 sibling\n" +
@@ -325,11 +324,8 @@
onClick: (() -> Unit)? = null,
children: @Composable () -> Unit
) {
- // Since we're adding layouts in between the clickable layer and the content, we need to
- // merge all descendants, or we'll get multiple nodes
Surface {
- Box(modifier.semantics(mergeAllDescendants = true)
- .clickable(onClick = onClick ?: {}, enabled = onClick != null)) {
+ Box(modifier.clickable(onClick = onClick ?: {}, enabled = onClick != null)) {
Box(children = children)
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
index 94af34e..0084446 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
@@ -126,7 +126,7 @@
}
@Composable
- fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)? = null) {
+ fun BoundaryNode(props: (SemanticsPropertyReceiver.() -> Unit)) {
Column(Modifier.semantics(properties = props)) {}
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
index fead412..afd122c 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
@@ -25,7 +25,7 @@
import androidx.ui.layout.Column
import androidx.ui.material.Button
import androidx.ui.material.MaterialTheme
-import androidx.ui.semantics.enabled
+import androidx.ui.semantics.disabled
import androidx.ui.semantics.testTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -94,8 +94,8 @@
@Test
fun printHierarchy() {
composeTestRule.setContent {
- Column(Modifier.semantics { this.enabled = true; this.testTag = "column" }) {
- Box(Modifier.semantics { this.enabled = true; this.testTag = "box" }) {
+ Column(Modifier.semantics { this.disabled(); this.testTag = "column" }) {
+ Box(Modifier.semantics { this.disabled(); this.testTag = "box" }) {
Button(onClick = {}) {
Text("Button")
}
@@ -110,11 +110,10 @@
assertThat(obfuscateNodesInfo(result)).isEqualTo("" +
"Node #X at (X, X, X, X)px\n" +
" |-Node #X at (X, X, X, X)px, Tag: 'column'\n" +
- " Enabled = 'true'\n" +
+ " Disabled = 'kotlin.Unit'\n" +
" |-Node #X at (X, X, X, X)px, Tag: 'box'\n" +
- " | Enabled = 'true'\n" +
+ " | Disabled = 'kotlin.Unit'\n" +
" | |-Node #X at (X, X, X, X)px\n" +
- " | Enabled = 'true'\n" +
" | OnClick = 'AccessibilityAction(label=null, action=Function0" +
"<java.lang.Boolean>)'\n" +
" | Text = 'Button'\n" +
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
index 2d198e6..ad45a26 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
@@ -25,7 +25,7 @@
import androidx.ui.graphics.Color
import androidx.ui.layout.Column
import androidx.ui.layout.preferredSize
-import androidx.ui.semantics.ScrollTo
+import androidx.ui.semantics.scrollBy
import androidx.ui.unit.dp
import com.google.common.truth.Truth
import org.junit.Assert
@@ -43,9 +43,9 @@
composeTestRule.setContent {
Box(Modifier.semantics {
- ScrollTo(action = { _, _ ->
+ scrollBy(action = { _, _ ->
wasScrollToCalled = true
- return@ScrollTo true
+ return@scrollBy true
})
}) {
Box(Modifier.testTag(tag))
@@ -85,10 +85,10 @@
val green = Color(alpha = 0xFF, red = 0, green = 0xFF, blue = 0)
Box(Modifier.semantics {
- ScrollTo(action = { x, y ->
- currentScrollPositionY = y
- currentScrollPositionX = x
- return@ScrollTo true
+ scrollBy(action = { x, y ->
+ currentScrollPositionY += y
+ currentScrollPositionX += x
+ return@scrollBy true
})
}) {
Column {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
index e507eeca..c1ac5d8 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
@@ -207,7 +207,7 @@
expectErrorMessageStartsWith("" +
"Failed to perform IME action.\n" +
- "Failed to assert the following: (SupportsInputMethods = 'true')\n" +
+ "Failed to assert the following: (SupportsInputMethods is defined)\n" +
"Semantics of the node:"
) {
onNodeWithTag("node")
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
index 96b92f0..a3f01d1 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
@@ -42,12 +42,12 @@
/**
* Scrolls to a node using SemanticsActions. It first identifies a parent semantics node with a
- * Semantics ScrollTo action, then it retrieves the location of the current element and computes
+ * Semantics ScrollBy action, then it retrieves the location of the current element and computes
* the relative coordinates that will be used by the scroller.
*
- * Throws [AssertionError] if there is no parent node with ScrollTo SemanticsAction, the
+ * Throws [AssertionError] if there is no parent node with ScrollBy SemanticsAction, the
* current semantics node doesn't have a bounding rectangle set or if a layout node used to
- * compute the relative coordinates to be fed to the ScrollTo action can't be found.
+ * compute the relative coordinates to be fed to the ScrollBy action can't be found.
*/
fun SemanticsNodeInteraction.performScrollTo(): SemanticsNodeInteraction {
// find containing node with scroll action
@@ -68,7 +68,7 @@
val position = layoutNode.coordinates.localToGlobal(Offset(0.0f, 0.0f))
runOnUiThread {
- scrollableSemanticsNode.config[SemanticsActions.ScrollTo].action(
+ scrollableSemanticsNode.config[SemanticsActions.ScrollBy].action(
(globalPosition.x - position.x),
(globalPosition.y - position.y)
)
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
index fb073fa..4f8fad7 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
@@ -30,18 +30,18 @@
/**
* Returns whether the node is enabled.
*
- * @see SemanticsProperties.Enabled
+ * @see SemanticsProperties.Disabled
*/
fun isEnabled(): SemanticsMatcher =
- SemanticsMatcher.expectValue(SemanticsProperties.Enabled, true)
+ !SemanticsMatcher.keyIsDefined(SemanticsProperties.Disabled)
/**
* Returns whether the node is not enabled.
*
- * @see SemanticsProperties.Enabled
+ * @see SemanticsProperties.Disabled
*/
fun isNotEnabled(): SemanticsMatcher =
- SemanticsMatcher.expectValue(SemanticsProperties.Enabled, false)
+ SemanticsMatcher.keyIsDefined(SemanticsProperties.Disabled)
/**
* Return whether the node is checkable.
@@ -110,18 +110,18 @@
/**
* Return whether the node has a semantics scrollable action defined.
*
- * @see SemanticsActions.ScrollTo
+ * @see SemanticsActions.ScrollBy
*/
fun hasScrollAction(): SemanticsMatcher =
- SemanticsMatcher.keyIsDefined(SemanticsActions.ScrollTo)
+ SemanticsMatcher.keyIsDefined(SemanticsActions.ScrollBy)
/**
* Return whether the node has no semantics scrollable action defined.
*
- * @see SemanticsActions.ScrollTo
+ * @see SemanticsActions.ScrollBy
*/
fun hasNoScrollAction(): SemanticsMatcher =
- SemanticsMatcher.keyNotDefined(SemanticsActions.ScrollTo)
+ SemanticsMatcher.keyNotDefined(SemanticsActions.ScrollBy)
/**
* Returns whether the node's label matches exactly to the given text.
@@ -205,7 +205,6 @@
fun hasTestTag(testTag: String): SemanticsMatcher =
SemanticsMatcher.expectValue(SemanticsProperties.TestTag, testTag)
-// TODO(ryanmentley/pavlis): Do we want these convenience functions?
/**
* Verifies that the node is in a mutually exclusive group - that is,
* that [FoundationSemanticsProperties.InMutuallyExclusiveGroup] is set to true
@@ -222,7 +221,7 @@
* @see SemanticsProperties.Hidden
*/
fun isHidden(): SemanticsMatcher =
- SemanticsMatcher.expectValue(SemanticsProperties.Hidden, true)
+ SemanticsMatcher.keyIsDefined(SemanticsProperties.Hidden)
/**
* Returns whether the node is not hidden.
@@ -232,7 +231,7 @@
* @see SemanticsProperties.Hidden
*/
fun isNotHidden(): SemanticsMatcher =
- SemanticsMatcher.expectValue(SemanticsProperties.Hidden, false)
+ !SemanticsMatcher.keyIsDefined(SemanticsProperties.Hidden)
/**
* Returns whether the node is a dialog.
@@ -272,7 +271,7 @@
* gestures input but only to IME. This can be used to for instance filter out all text fields.
*/
fun hasInputMethodsSupport() =
- SemanticsMatcher.expectValue(TextSemanticsProperties.SupportsInputMethods, true)
+ SemanticsMatcher.keyIsDefined(TextSemanticsProperties.SupportsInputMethods)
/**
* Return whether the node is the root semantics node.
diff --git a/ui/ui-text/api/0.1.0-dev15.txt b/ui/ui-text/api/0.1.0-dev15.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/0.1.0-dev15.txt
+++ b/ui/ui-text/api/0.1.0-dev15.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/api/current.txt b/ui/ui-text/api/current.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/current.txt
+++ b/ui/ui-text/api/current.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/api/public_plus_experimental_current.txt b/ui/ui-text/api/public_plus_experimental_current.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/public_plus_experimental_current.txt
+++ b/ui/ui-text/api/public_plus_experimental_current.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/api/restricted_0.1.0-dev15.txt b/ui/ui-text/api/restricted_0.1.0-dev15.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-text/api/restricted_0.1.0-dev15.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/api/restricted_current.txt b/ui/ui-text/api/restricted_current.txt
index 14e11078..f84b79f 100644
--- a/ui/ui-text/api/restricted_current.txt
+++ b/ui/ui-text/api/restricted_current.txt
@@ -30,17 +30,16 @@
public final class TextSemanticsProperties {
method public androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> getImeAction();
- method public androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> getSupportsInputMethods();
+ method public androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> getSupportsInputMethods();
property public final androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.input.ImeAction> ImeAction;
- property public final androidx.ui.semantics.SemanticsPropertyKey<java.lang.Boolean> SupportsInputMethods;
+ property public final androidx.ui.semantics.SemanticsPropertyKey<kotlin.Unit> SupportsInputMethods;
field public static final androidx.ui.text.TextSemanticsProperties INSTANCE;
}
public final class TextSemanticsPropertiesKt {
method public static androidx.ui.input.ImeAction getImeAction(androidx.ui.semantics.SemanticsPropertyReceiver);
- method public static boolean getSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
method public static void setImeAction(androidx.ui.semantics.SemanticsPropertyReceiver, androidx.ui.input.ImeAction p);
- method public static void setSupportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver, boolean p);
+ method public static void supportsInputMethods(androidx.ui.semantics.SemanticsPropertyReceiver);
}
}
diff --git a/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt b/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
index 4c66d38..e50e07a 100644
--- a/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
+++ b/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
@@ -471,12 +471,11 @@
onBlur(false)
}
- val semantics = Modifier.semantics(
- properties = {
- this.imeAction = imeAction
- this.supportsInputMethods = true
- onClick(action = { doFocusIn(); return@onClick true })
- })
+ val semantics = Modifier.semantics {
+ this.imeAction = imeAction
+ this.supportsInputMethods()
+ onClick(action = { doFocusIn(); return@onClick true })
+ }
val drag = Modifier.dragPositionGestureFilter(
onPress = {
state.selectionIsOn = false
diff --git a/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt b/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
index 6cab41f..d53c8d1 100644
--- a/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
+++ b/ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
@@ -32,14 +32,14 @@
val ImeAction = SemanticsPropertyKey<ImeAction>("ImeAction")
/**
- * Return whether the node supports input methods.
+ * Whether the node supports input methods.
*
* Supporting input methods means that the node provides a connection to IME (keyboard) and
* is able to accept input from it. This is typically a text field for instance.
*
* @see SemanticsPropertyReceiver.supportsInputMethods
*/
- val SupportsInputMethods = SemanticsPropertyKey<Boolean>("SupportsInputMethods")
+ val SupportsInputMethods = SemanticsPropertyKey<Unit>("SupportsInputMethods")
}
/**
@@ -50,11 +50,13 @@
var SemanticsPropertyReceiver.imeAction by TextSemanticsProperties.ImeAction
/**
- * Return whether the component supports input methods.
+ * Whether the component supports input methods.
*
* Supporting input methods means that the component provides a connection to IME (keyboard) and
* is able to accept input from it. This is typically a text field for instance.
*
* @see TextSemanticsProperties.SupportsInputMethods
*/
-var SemanticsPropertyReceiver.supportsInputMethods by TextSemanticsProperties.SupportsInputMethods
\ No newline at end of file
+fun SemanticsPropertyReceiver.supportsInputMethods() {
+ this[TextSemanticsProperties.SupportsInputMethods] = Unit
+}
\ No newline at end of file