Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/split/MagneticDividerUtils.kt +10 −3 Original line number Diff line number Diff line Loading @@ -59,6 +59,13 @@ class MagneticDividerUtils { */ @JvmStatic val SNAP_POSITION_KEY = SemanticKey<Int?>() /** * Key used for identity regions which don't have drop zones associated with them. * Need to keep this key separate for the SemanticKeys we create with null values as it * seems like this overwrites the semantics created with real snapTarget values */ @JvmStatic private val SNAP_POSITION_KEY_IDENTITY = SemanticKey<Int?>() /** * Create a MotionSpec that has "snap zones" for each of the SnapTargets provided. */ Loading @@ -84,7 +91,7 @@ class MagneticDividerUtils { // opposed to "effects" movement). spatialDirectionalMotionSpec( initialMapping = Mapping.Fixed(topLeftDismissPosition), semantics = listOf(SNAP_POSITION_KEY with null), semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null), defaultSpring = MagneticSpring ) { // NOTE: This block is a trailing lambda passed in as the "init" parameter. Loading Loading @@ -140,7 +147,7 @@ class MagneticDividerUtils { // Create another identity zone. identity( breakpoint = targetPosition + snapThreshold, semantics = listOf(SNAP_POSITION_KEY with null) semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null) ) } Loading @@ -151,7 +158,7 @@ class MagneticDividerUtils { fixedValue( breakpoint = bottomRightDismissPosition, value = bottomRightDismissPosition, semantics = listOf(SNAP_POSITION_KEY with null) semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null) ) } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/split/MagneticDividerUtils.kt +10 −3 Original line number Diff line number Diff line Loading @@ -59,6 +59,13 @@ class MagneticDividerUtils { */ @JvmStatic val SNAP_POSITION_KEY = SemanticKey<Int?>() /** * Key used for identity regions which don't have drop zones associated with them. * Need to keep this key separate for the SemanticKeys we create with null values as it * seems like this overwrites the semantics created with real snapTarget values */ @JvmStatic private val SNAP_POSITION_KEY_IDENTITY = SemanticKey<Int?>() /** * Create a MotionSpec that has "snap zones" for each of the SnapTargets provided. */ Loading @@ -84,7 +91,7 @@ class MagneticDividerUtils { // opposed to "effects" movement). spatialDirectionalMotionSpec( initialMapping = Mapping.Fixed(topLeftDismissPosition), semantics = listOf(SNAP_POSITION_KEY with null), semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null), defaultSpring = MagneticSpring ) { // NOTE: This block is a trailing lambda passed in as the "init" parameter. Loading Loading @@ -140,7 +147,7 @@ class MagneticDividerUtils { // Create another identity zone. identity( breakpoint = targetPosition + snapThreshold, semantics = listOf(SNAP_POSITION_KEY with null) semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null) ) } Loading @@ -151,7 +158,7 @@ class MagneticDividerUtils { fixedValue( breakpoint = bottomRightDismissPosition, value = bottomRightDismissPosition, semantics = listOf(SNAP_POSITION_KEY with null) semantics = listOf(SNAP_POSITION_KEY_IDENTITY with null) ) } } Loading