Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated APIs in TooltipArea and PointerEvent. #1029

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions compose/foundation/foundation/api/desktop/foundation.api
Original file line number Diff line number Diff line change
Expand Up @@ -401,22 +401,20 @@ public final class androidx/compose/foundation/TooltipArea_desktopKt {
}

public abstract interface class androidx/compose/foundation/TooltipPlacement {
public abstract fun positionProvider (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
public fun positionProvider-9KIMszo (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
public abstract fun positionProvider-9KIMszo (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
}

public final class androidx/compose/foundation/TooltipPlacement$ComponentRect : androidx/compose/foundation/TooltipPlacement {
public static final field $stable I
public synthetic fun <init> (Landroidx/compose/ui/Alignment;Landroidx/compose/ui/Alignment;JILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Landroidx/compose/ui/Alignment;Landroidx/compose/ui/Alignment;JLkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun positionProvider (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
public fun positionProvider-9KIMszo (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
}

public final class androidx/compose/foundation/TooltipPlacement$CursorPoint : androidx/compose/foundation/TooltipPlacement {
public static final field $stable I
public synthetic fun <init> (JLandroidx/compose/ui/Alignment;FILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (JLandroidx/compose/ui/Alignment;FLkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun positionProvider (Landroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
public fun positionProvider-9KIMszo (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/ui/window/PopupPositionProvider;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,25 +208,13 @@ private suspend fun PointerInputScope.detectDown(onDown: (Offset) -> Unit) {
*/
@ExperimentalFoundationApi
interface TooltipPlacement {
/**
* Returns [PopupPositionProvider] implementation.
*/
@Deprecated(
message = "Use the overload that takes a cursor position; will be removed in Compose 1.5"
)
@Composable
fun positionProvider(): PopupPositionProvider

/**
* Returns [PopupPositionProvider] implementation.
*
* @param cursorPosition The position of the mouse cursor relative to the tooltip area.
*/
@Suppress("DEPRECATION")
@Composable
fun positionProvider(cursorPosition: Offset): PopupPositionProvider {
return positionProvider()
}
fun positionProvider(cursorPosition: Offset): PopupPositionProvider

/**
* [TooltipPlacement] implementation for providing a [PopupPositionProvider] that calculates
Expand All @@ -242,15 +230,6 @@ interface TooltipPlacement {
private val alignment: Alignment = Alignment.BottomEnd,
private val windowMargin: Dp = 4.dp
) : TooltipPlacement {

@Suppress("OVERRIDE_DEPRECATION")
@Composable
override fun positionProvider(): PopupPositionProvider = rememberCursorPositionProvider(
offset = offset,
alignment = alignment,
windowMargin = windowMargin
)

@OptIn(ExperimentalComposeUiApi::class)
@Composable
override fun positionProvider(cursorPosition: Offset) =
Expand All @@ -276,12 +255,12 @@ interface TooltipPlacement {
private val alignment: Alignment = Alignment.BottomCenter,
private val offset: DpOffset = DpOffset.Zero
) : TooltipPlacement {
@Suppress("OVERRIDE_DEPRECATION")
@Composable
override fun positionProvider() = rememberComponentRectPositionProvider(
anchor,
alignment,
offset
)
override fun positionProvider(cursorPosition: Offset) =
rememberComponentRectPositionProvider(
anchor = anchor,
alignment = alignment,
offset = offset
)
}
}
2 changes: 1 addition & 1 deletion compose/ui/ui/api/desktop/ui.api
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ public final class androidx/compose/ui/input/pointer/PointerEvent {
public final fun component2-ry648PA ()I
public final fun component3-k7X9c1A ()I
public final fun component5 ()Ljava/lang/Object;
public final fun copy-jTTBaPM (Ljava/util/List;IIILjava/lang/Object;Landroidx/compose/ui/input/pointer/PointerButton;)Landroidx/compose/ui/input/pointer/PointerEvent;
public final synthetic fun copy-jTTBaPM (Ljava/util/List;IIILjava/lang/Object;Landroidx/compose/ui/input/pointer/PointerButton;)Landroidx/compose/ui/input/pointer/PointerEvent;
public static synthetic fun copy-jTTBaPM$default (Landroidx/compose/ui/input/pointer/PointerEvent;Ljava/util/List;IIILjava/lang/Object;Landroidx/compose/ui/input/pointer/PointerButton;ILjava/lang/Object;)Landroidx/compose/ui/input/pointer/PointerEvent;
public fun equals (Ljava/lang/Object;)Z
public final fun getButton-RaE_XpY ()Landroidx/compose/ui/input/pointer/PointerButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ actual class PointerEvent internal constructor(

// _button was internal, so no need for a component6

@Deprecated("Will be removed in 1.5")
@Deprecated(
message = "Removed in 1.6",
level = DeprecationLevel.HIDDEN
)
@Suppress("LocalVariableName")
fun copy(
changes: List<PointerInputChange> = this.changes,
Expand Down