ui-core to MPP (part 3)
Test: ./gradlew :ui:ui-core:assemble
Change-Id: Iac2f7ae73015d29677020e9cb63565869f7029c6
Relnote: API refactor
diff --git a/ui/ui-core/api/0.1.0-dev15.txt b/ui/ui-core/api/0.1.0-dev15.txt
index e4e17ba..3357ccd 100644
--- a/ui/ui-core/api/0.1.0-dev15.txt
+++ b/ui/ui-core/api/0.1.0-dev15.txt
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -300,7 +303,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -312,7 +315,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
diff --git a/ui/ui-core/api/current.txt b/ui/ui-core/api/current.txt
index e4e17ba..3357ccd 100644
--- a/ui/ui-core/api/current.txt
+++ b/ui/ui-core/api/current.txt
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -300,7 +303,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -312,7 +315,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
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 fed983d..3357ccd 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
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -281,7 +284,6 @@
}
public final class DebugUtilsKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static String simpleIdentityToString(Object obj, String? name = null);
}
public enum Direction {
@@ -301,7 +303,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -313,7 +315,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
diff --git a/ui/ui-core/api/public_plus_experimental_current.txt b/ui/ui-core/api/public_plus_experimental_current.txt
index fed983d..3357ccd 100644
--- a/ui/ui-core/api/public_plus_experimental_current.txt
+++ b/ui/ui-core/api/public_plus_experimental_current.txt
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -281,7 +284,6 @@
}
public final class DebugUtilsKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static String simpleIdentityToString(Object obj, String? name = null);
}
public enum Direction {
@@ -301,7 +303,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -313,7 +315,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
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 0be8134..a9e2861 100644
--- a/ui/ui-core/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-core/api/restricted_0.1.0-dev15.txt
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -287,7 +290,6 @@
}
public final class DebugUtilsKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static String simpleIdentityToString(Object obj, String? name = null);
}
@kotlin.PublishedApi internal final class DefaultIntrinsicMeasurable implements androidx.ui.core.Measurable {
@@ -321,7 +323,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -333,7 +335,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
diff --git a/ui/ui-core/api/restricted_current.txt b/ui/ui-core/api/restricted_current.txt
index 0be8134..a9e2861 100644
--- a/ui/ui-core/api/restricted_current.txt
+++ b/ui/ui-core/api/restricted_current.txt
@@ -183,6 +183,9 @@
method public static androidx.compose.ProvidableAmbient<androidx.ui.platform.UriHandler> getUriHandlerAmbient();
}
+ public final class AndroidActualsKt {
+ }
+
public final class AndroidAmbientsKt {
method public static androidx.compose.ProvidableAmbient<android.content.res.Configuration> getConfigurationAmbient();
method public static androidx.compose.ProvidableAmbient<android.content.Context> getContextAmbient();
@@ -287,7 +290,6 @@
}
public final class DebugUtilsKt {
- method @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP) public static String simpleIdentityToString(Object obj, String? name = null);
}
@kotlin.PublishedApi internal final class DefaultIntrinsicMeasurable implements androidx.ui.core.Measurable {
@@ -321,7 +323,7 @@
method @FloatRange(from=0.0, to=360.0) public default float getRotationZ();
method public default float getScaleX();
method public default float getScaleY();
- method @FloatRange(from=0.0) public default float getShadowElevation();
+ method @FloatRange(from=0.0, to=3.4E38) public default float getShadowElevation();
method public default androidx.ui.graphics.Shape getShape();
method public default long getTransformOrigin();
method public default float getTranslationX();
@@ -333,7 +335,7 @@
property @FloatRange(from=0.0, to=360.0) public default float rotationZ;
property public default float scaleX;
property public default float scaleY;
- property @FloatRange(from=0.0) public default float shadowElevation;
+ property @FloatRange(from=0.0, to=3.4E38) public default float shadowElevation;
property public default androidx.ui.graphics.Shape shape;
property public default long transformOrigin;
property public default float translationX;
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
similarity index 72%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt
rename to ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
index 4867ad4..07f5af7 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
@@ -13,18 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package androidx.ui.core
-import androidx.annotation.RestrictTo
+actual typealias NativeRectF = android.graphics.RectF
+actual typealias NativeMatrix = android.graphics.Matrix
-internal inline fun ifDebug(block: () -> Unit) {
- // Right now, we always run these. At a later point, we may revisit this
- block()
-}
-
-// TODO(MPP): this should use expect/actual
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-fun simpleIdentityToString(obj: Any, name: String? = null): String {
+internal actual fun simpleIdentityToString(obj: Any, name: String?): String {
val className = name ?: if (obj::class.java.isAnonymousClass) {
obj::class.java.name
} else {
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Layout.kt b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Layout.kt
index 8b54ee5..a0bf2c3 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Layout.kt
+++ b/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Layout.kt
@@ -237,7 +237,7 @@
}
@Deprecated(
- """Use Layout() function with
+ """Use Layout() function with
'MeasureScope.(List<Measurable>, Constraints) -> MeasureScope.MeasureResult'
measure block instead.""",
ReplaceWith("Layout(children, modifier, {measurables, constraints -> measureBlock})")
@@ -447,7 +447,7 @@
return simpleIdentityToString(
this,
"MeasuringIntrinsicsMeasureBlocks"
- ) + "{ measureBlock=${simpleIdentityToString(measureBlock)} }"
+ ) + "{ measureBlock=${simpleIdentityToString(measureBlock, null)} }"
}
}
@@ -513,7 +513,7 @@
return simpleIdentityToString(
this,
"MeasuringIntrinsicsMeasureBlocks"
- ) + "{ measureBlock=${simpleIdentityToString(measureBlock)} }"
+ ) + "{ measureBlock=${simpleIdentityToString(measureBlock, null)} }"
}
}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AlignmentLine.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/AlignmentLine.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AlignmentLine.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/AlignmentLine.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ComposedModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ComposedModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ComposedModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ComposedModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ContentDrawScope.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ContentDrawScope.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ContentDrawScope.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ContentDrawScope.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DebugUtils.kt
similarity index 64%
copy from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt
copy to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DebugUtils.kt
index 4867ad4..a4a8d00 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DebugUtils.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DebugUtils.kt
@@ -15,21 +15,9 @@
*/
package androidx.ui.core
-import androidx.annotation.RestrictTo
-
internal inline fun ifDebug(block: () -> Unit) {
// Right now, we always run these. At a later point, we may revisit this
block()
}
-// TODO(MPP): this should use expect/actual
-@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
-fun simpleIdentityToString(obj: Any, name: String? = null): String {
- val className = name ?: if (obj::class.java.isAnonymousClass) {
- obj::class.java.name
- } else {
- obj::class.java.simpleName
- }
-
- return className + "@" + String.format("%07x", System.identityHashCode(obj))
-}
\ No newline at end of file
+internal expect fun simpleIdentityToString(obj: Any, name: String?): String
\ No newline at end of file
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
similarity index 97%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
index dcfdb52e..77acc72 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DelegatingLayoutNodeWrapper.kt
@@ -22,6 +22,7 @@
import androidx.ui.geometry.Offset
import androidx.ui.graphics.Canvas
import androidx.ui.unit.IntOffset
+import androidx.ui.util.nativeClass
/**
* [LayoutNodeWrapper] with default implementations for methods.
@@ -55,7 +56,7 @@
*/
fun setModifierTo(modifier: Modifier.Element) {
if (modifier !== this.modifier) {
- require(modifier.javaClass == this.modifier.javaClass)
+ require(modifier.nativeClass() == this.modifier.nativeClass())
@Suppress("UNCHECKED_CAST")
this.modifier = modifier as T
}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DrawLayerModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DrawLayerModifier.kt
similarity index 98%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DrawLayerModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DrawLayerModifier.kt
index 032934e..9f3983e 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DrawLayerModifier.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DrawLayerModifier.kt
@@ -16,11 +16,11 @@
package androidx.ui.core
-import androidx.annotation.FloatRange
import androidx.compose.Immutable
import androidx.compose.Stable
import androidx.ui.graphics.RectangleShape
import androidx.ui.graphics.Shape
+import androidx.ui.util.annotation.FloatRange
import androidx.ui.util.packFloats
import androidx.ui.util.unpackFloat1
import androidx.ui.util.unpackFloat2
@@ -116,7 +116,7 @@
* Sets the elevation for the shadow in pixels. With the [shadowElevation] > 0f and
* [shape] set, a shadow is produced.
*/
- @get:FloatRange(from = 0.0)
+ @get:FloatRange(from = 0.0, to = 3.4e38 /* POSITIVE_INFINITY */)
val shadowElevation: Float get() = 0f
/**
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DrawModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DrawModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/DrawModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/DrawModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ErrorMessages.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ErrorMessages.kt
similarity index 98%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ErrorMessages.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ErrorMessages.kt
index 7329f79..a5169fc 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ErrorMessages.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ErrorMessages.kt
@@ -17,6 +17,8 @@
package androidx.ui.core
+import androidx.ui.util.format
+
internal enum class ErrorMessages(val message: String) {
ComponentNodeHasParent("Inserting an instance that already has a parent"),
SizeAlreadyExists("Layout can only be used once within a MeasureBox"),
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
new file mode 100644
index 0000000..5e80623
--- /dev/null
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package androidx.ui.core
+
+// TODO(b/160140398): rewrite depending code using androidx.ui.geometry.Rect and androidx.ui.vectormath64.Matrix3.
+expect class NativeRectF() {
+ var left: Float
+ var right: Float
+ var top: Float
+ var bottom: Float
+
+ fun set(left: Float, right: Float, top: Float, bottom: Float)
+
+ fun intersect(left: Float, right: Float, top: Float, bottom: Float): Boolean
+
+ fun setEmpty()
+}
+
+expect class NativeMatrix() {
+ fun isIdentity(): Boolean
+
+ fun invert(inverted: NativeMatrix): Boolean
+
+ fun mapPoints(points: FloatArray)
+ fun mapRect(rect: NativeRectF): Boolean
+}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ExperimentalLayoutNodeApi.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ExperimentalLayoutNodeApi.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ExperimentalLayoutNodeApi.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ExperimentalLayoutNodeApi.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/InnerPlaceable.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/InnerPlaceable.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/InnerPlaceable.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/InnerPlaceable.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/IntrinsicMeasurable.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/IntrinsicMeasurable.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/IntrinsicMeasurable.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/IntrinsicMeasurable.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/IntrinsicMeasureScope.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/IntrinsicMeasureScope.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/IntrinsicMeasureScope.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/IntrinsicMeasureScope.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayerWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayerWrapper.kt
similarity index 92%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayerWrapper.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayerWrapper.kt
index 9bd3871..710e471 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayerWrapper.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayerWrapper.kt
@@ -16,8 +16,6 @@
package androidx.ui.core
-import android.graphics.Matrix
-import android.graphics.RectF
import androidx.ui.core.pointerinput.PointerInputFilter
import androidx.ui.geometry.Rect
import androidx.ui.geometry.Offset
@@ -60,7 +58,7 @@
// TODO(mount): This cache isn't thread safe at all.
private var positionCache: FloatArray? = null
// TODO (njawad): This cache matrix is not thread safe
- private var inverseMatrixCache: Matrix? = null
+ private var inverseMatrixCache: NativeMatrix? = null
override fun performMeasure(
constraints: Constraints,
@@ -92,8 +90,8 @@
override fun fromParentPosition(position: Offset): Offset {
val matrix = layer.getMatrix()
val targetPosition =
- if (!matrix.isIdentity) {
- val inverse = inverseMatrixCache ?: Matrix().also { inverseMatrixCache = it }
+ if (!matrix.isIdentity()) {
+ val inverse = inverseMatrixCache ?: NativeMatrix().also { inverseMatrixCache = it }
matrix.invert(inverse)
mapPointsFromMatrix(inverse, position)
} else {
@@ -105,7 +103,7 @@
override fun toParentPosition(position: Offset): Offset {
val matrix = layer.getMatrix()
val targetPosition =
- if (!matrix.isIdentity) {
+ if (!matrix.isIdentity()) {
mapPointsFromMatrix(matrix, position)
} else {
position
@@ -117,7 +115,7 @@
* Return a transformed [Offset] based off of the provided matrix transformation
* and untransformed position.
*/
- private fun mapPointsFromMatrix(matrix: Matrix, position: Offset): Offset {
+ private fun mapPointsFromMatrix(matrix: NativeMatrix, position: Offset): Offset {
val x = position.x
val y = position.y
val cache = positionCache
@@ -132,7 +130,7 @@
return Offset(point[0], point[1])
}
- override fun rectInParent(bounds: RectF) {
+ override fun rectInParent(bounds: NativeRectF) {
if (modifier.clip &&
!bounds.intersect(0f, 0f, size.width.toFloat(), size.height.toFloat())
) {
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutCoordinates.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutCoordinates.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutCoordinates.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutCoordinates.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
similarity index 97%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
index 21b033c..180c98d 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNode.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNode.kt
@@ -35,7 +35,9 @@
import androidx.ui.graphics.drawscope.DrawScope
import androidx.ui.graphics.drawscope.drawCanvas
import androidx.ui.unit.Density
+import androidx.ui.util.deleteAt
import androidx.ui.util.fastForEach
+import androidx.ui.util.nativeClass
import kotlin.math.roundToInt
import kotlin.math.sign
@@ -232,7 +234,7 @@
}
override fun toString(): String {
- return "${simpleIdentityToString(this)} children: ${_children.size} " +
+ return "${simpleIdentityToString(this, null)} children: ${_children.size} " +
"measureBlocks: $measureBlocks"
}
@@ -254,7 +256,7 @@
if (depth == 0) {
// Delete trailing newline
- tree.deleteCharAt(tree.length - 1)
+ tree.deleteAt(tree.length - 1)
}
return tree.toString()
}
@@ -960,7 +962,7 @@
while (index >= 0) {
val wrapper = wrapperCache[index]
if (wrapper != null && (wrapper.modifier === modifier ||
- wrapper.modifier.javaClass == modifier.javaClass)) {
+ wrapper.modifier.nativeClass() == modifier.nativeClass())) {
return index
}
index--
@@ -1037,15 +1039,16 @@
}
internal companion object {
- private val ErrorMeasureBlocks = object : NoIntrinsicsMeasureBlocks(
- error = "Undefined intrinsics block and it is required"
- ) {
- override fun measure(
- measureScope: MeasureScope,
- measurables: List<Measurable>,
- constraints: Constraints,
- layoutDirection: LayoutDirection
- ) = error("Undefined measure and it is required")
+ private val ErrorMeasureBlocks: NoIntrinsicsMeasureBlocks =
+ object : NoIntrinsicsMeasureBlocks(
+ error = "Undefined intrinsics block and it is required"
+ ) {
+ override fun measure(
+ measureScope: MeasureScope,
+ measurables: List<Measurable>,
+ constraints: Constraints,
+ layoutDirection: LayoutDirection
+ ) = error("Undefined measure and it is required")
}
}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
similarity index 98%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
index cdf54d4..d0bab09 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/LayoutNodeWrapper.kt
@@ -18,7 +18,6 @@
package androidx.ui.core
-import android.graphics.RectF
import androidx.ui.core.focus.ModifiedFocusNode
import androidx.ui.core.keyinput.ModifiedKeyInputNode
import androidx.ui.core.pointerinput.PointerInputFilter
@@ -87,7 +86,7 @@
var isShallowPlacing = false
// TODO(mount): This is not thread safe.
- private var rectCache: RectF? = null
+ private var rectCache: NativeRectF? = null
/**
* Whether a pointer that is relative to the device screen is in the bounds of this
@@ -246,7 +245,7 @@
* Modifies bounds to be in the parent LayoutNodeWrapper's coordinates, including clipping,
* scaling, etc.
*/
- protected open fun rectInParent(bounds: RectF) {
+ protected open fun rectInParent(bounds: NativeRectF) {
val x = position.x
bounds.left += x
bounds.right += x
@@ -259,7 +258,7 @@
override fun childBoundingBox(child: LayoutCoordinates): PxBounds {
check(isAttached) { ExpectAttachedLayoutCoordinates }
check(child.isAttached) { "Child $child is not attached!" }
- val bounds = rectCache ?: RectF().also { rectCache = it }
+ val bounds = rectCache ?: NativeRectF().also { rectCache = it }
bounds.set(
0f,
0f,
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Measurable.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Measurable.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Measurable.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Measurable.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/MeasureScope.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/MeasureScope.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/MeasureScope.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/MeasureScope.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedDrawNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedDrawNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedDrawNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedDrawNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedLayoutNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedLayoutNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedLayoutNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedLayoutNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedParentDataNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedParentDataNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ModifiedParentDataNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ModifiedParentDataNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Modifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Modifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Modifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Modifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OnPositionedModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OnPositionedModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OnPositionedModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OnPositionedModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OuterMeasurablePlaceable.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OuterMeasurablePlaceable.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OuterMeasurablePlaceable.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OuterMeasurablePlaceable.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OwnedLayer.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OwnedLayer.kt
similarity index 96%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OwnedLayer.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OwnedLayer.kt
index 2001b81..dfa9f45 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/OwnedLayer.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/OwnedLayer.kt
@@ -16,7 +16,6 @@
package androidx.ui.core
-import android.graphics.Matrix
import androidx.ui.graphics.Canvas
import androidx.ui.unit.IntOffset
import androidx.ui.unit.IntSize
@@ -76,5 +75,5 @@
* Returns a matrix that this layer will use to transform the contents.
* The caller must not modify the returned Matrix.
*/
- fun getMatrix(): Matrix
+ fun getMatrix(): NativeMatrix
}
\ No newline at end of file
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Owner.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Owner.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Owner.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Owner.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ParentDataModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ParentDataModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ParentDataModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ParentDataModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Placeable.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Placeable.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Placeable.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Placeable.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/PointerInput.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/PointerInput.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/PointerInput.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/PointerInput.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/PointerInputDelegatingWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/PointerInputDelegatingWrapper.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/PointerInputDelegatingWrapper.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/PointerInputDelegatingWrapper.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Ref.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Ref.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/Ref.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Ref.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ZIndexModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ZIndexModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/ZIndexModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/ZIndexModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusModifierImpl.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifierImpl.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusModifierImpl.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusModifierImpl.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusNodeUtils.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusState.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusState.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/FocusState.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/FocusState.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/focus/ModifiedFocusNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/KeyEvent.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/KeyEvent.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/KeyEvent.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/KeyEvent.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/KeyInputModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/KeyInputModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/KeyInputModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/KeyInputModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/ModifiedKeyInputNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/ModifiedKeyInputNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/keyinput/ModifiedKeyInputNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/keyinput/ModifiedKeyInputNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt
similarity index 98%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt
index 1033533..380629e 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/HitPathTracker.kt
@@ -16,7 +16,6 @@
package androidx.ui.core.pointerinput
-import androidx.annotation.VisibleForTesting
import androidx.ui.core.CustomEvent
import androidx.ui.core.CustomEventDispatcher
import androidx.ui.core.InternalPointerEvent
@@ -27,6 +26,7 @@
import androidx.ui.unit.IntOffset
import androidx.ui.unit.IntSize
import androidx.ui.unit.plus
+import androidx.ui.util.annotation.VisibleForTesting
/**
* Organizes pointers and the [PointerInputFilter]s that they hit into a hierarchy such that
@@ -40,17 +40,19 @@
private val hitPathsToRetain: MutableMap<PointerId, Int> = mutableMapOf()
private val retainedHitPaths: MutableSet<PointerId> = mutableSetOf()
- private val dispatchChangesRetVal = object : DispatchChangesRetVal {
+ internal interface DispatchChangesRetVal {
+ operator fun component1(): InternalPointerEvent
+ operator fun component2(): Boolean
+ }
+ private class DispatchChangesRetValImpl : DispatchChangesRetVal {
lateinit var internalPointerEvent: InternalPointerEvent
var wasDispatchedToSomething: Boolean = false
override operator fun component1() = internalPointerEvent
override operator fun component2() = wasDispatchedToSomething
}
- internal interface DispatchChangesRetVal {
- operator fun component1(): InternalPointerEvent
- operator fun component2(): Boolean
- }
+ // See https://youtrack.jetbrains.com/issue/KT-39905.
+ private val dispatchChangesRetVal = DispatchChangesRetValImpl()
/**
* Associates a [pointerId] to a list of hit [pointerInputFilters] and keeps track of them.
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInput.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInput.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInput.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInput.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInputEvent.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInputEvent.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInputEvent.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInputEvent.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInputEventProcessor.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInputEventProcessor.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/pointerinput/PointerInputEventProcessor.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/pointerinput/PointerInputEventProcessor.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
similarity index 97%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
index df87e43..97af431 100644
--- a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
+++ b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
@@ -128,9 +128,7 @@
override fun equals(other: Any?): Boolean {
if (this === other) return true
- if (javaClass != other?.javaClass) return false
-
- other as SemanticsConfiguration
+ if (other !is SemanticsConfiguration) return false
if (isMergingSemanticsOfDescendants != other.isMergingSemanticsOfDescendants) return false
if (props != other.props) return false
@@ -162,7 +160,7 @@
propsString.append(value)
nextSeparator = CommaSeparator
}
- return "${simpleIdentityToString(this@SemanticsConfiguration)}{ $propsString }"
+ return "${simpleIdentityToString(this@SemanticsConfiguration, null)}{ $propsString }"
}
}
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
diff --git a/ui/ui-core/src/androidMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt b/ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
similarity index 100%
rename from ui/ui-core/src/androidMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
rename to ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
diff --git a/ui/ui-util/api/0.1.0-dev15.txt b/ui/ui-util/api/0.1.0-dev15.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/0.1.0-dev15.txt
+++ b/ui/ui-util/api/0.1.0-dev15.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/api/current.txt b/ui/ui-util/api/current.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/current.txt
+++ b/ui/ui-util/api/current.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-util/api/public_plus_experimental_0.1.0-dev15.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-util/api/public_plus_experimental_0.1.0-dev15.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/api/public_plus_experimental_current.txt b/ui/ui-util/api/public_plus_experimental_current.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/public_plus_experimental_current.txt
+++ b/ui/ui-util/api/public_plus_experimental_current.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/api/restricted_0.1.0-dev15.txt b/ui/ui-util/api/restricted_0.1.0-dev15.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-util/api/restricted_0.1.0-dev15.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/api/restricted_current.txt b/ui/ui-util/api/restricted_current.txt
index 11414d6..ca4dd93 100644
--- a/ui/ui-util/api/restricted_current.txt
+++ b/ui/ui-util/api/restricted_current.txt
@@ -31,6 +31,7 @@
method public static StringBuilder deleteAt(StringBuilder, int index);
method public static String format(String, java.lang.Object?... args);
method public static int identityHashCode(Object?);
+ method public static Object nativeClass(Object);
}
public final class JvmSynchronizationHelperKt {
diff --git a/ui/ui-util/src/commonMain/kotlin/androidx/ui/util/MiscHelpers.kt b/ui/ui-util/src/commonMain/kotlin/androidx/ui/util/MiscHelpers.kt
index 802ad61..fcf72d9 100644
--- a/ui/ui-util/src/commonMain/kotlin/androidx/ui/util/MiscHelpers.kt
+++ b/ui/ui-util/src/commonMain/kotlin/androidx/ui/util/MiscHelpers.kt
@@ -20,4 +20,7 @@
expect fun String.format(vararg args: Any?): String
-expect fun StringBuilder.deleteAt(index: Int): StringBuilder
\ No newline at end of file
+expect fun StringBuilder.deleteAt(index: Int): StringBuilder
+
+// For performance optimizations of type.
+expect fun Any.nativeClass(): Any
\ No newline at end of file
diff --git a/ui/ui-util/src/jvmMain/kotlin/androidx/ui/util/JvmMiscHelpers.kt b/ui/ui-util/src/jvmMain/kotlin/androidx/ui/util/JvmMiscHelpers.kt
index b93d83f..1d9a1b2 100644
--- a/ui/ui-util/src/jvmMain/kotlin/androidx/ui/util/JvmMiscHelpers.kt
+++ b/ui/ui-util/src/jvmMain/kotlin/androidx/ui/util/JvmMiscHelpers.kt
@@ -23,4 +23,6 @@
actual fun StringBuilder.deleteAt(index: Int): StringBuilder {
this.deleteCharAt(index)
return this
-}
\ No newline at end of file
+}
+
+actual fun Any.nativeClass(): Any = this.javaClass
\ No newline at end of file