From 5e0b42084404cf45ab9c7fd84dd26b7110777b24 Mon Sep 17 00:00:00 2001 From: junkfood <69683722+JunkFood02@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:01:33 +0800 Subject: [PATCH] fix(ui): RTL walkaround --- .../java/me/ash/reader/ui/component/menu/DropdownMenuImpl.kt | 5 +++-- .../main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/ash/reader/ui/component/menu/DropdownMenuImpl.kt b/app/src/main/java/me/ash/reader/ui/component/menu/DropdownMenuImpl.kt index 885facd42..4e355378c 100644 --- a/app/src/main/java/me/ash/reader/ui/component/menu/DropdownMenuImpl.kt +++ b/app/src/main/java/me/ash/reader/ui/component/menu/DropdownMenuImpl.kt @@ -2,6 +2,7 @@ package me.ash.reader.ui.component.menu import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.EnterTransition +import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.MutableTransitionState import androidx.compose.animation.core.tween import androidx.compose.animation.expandVertically @@ -427,7 +428,7 @@ fun DropdownMenuContent( animationSpec = tween( delayMillis = ExitDuration - FadeOutDuration, durationMillis = FadeOutDuration, - easing = EmphasizedAccelerate + easing = LinearEasing ) ), modifier = Modifier ) { @@ -456,7 +457,7 @@ fun DropdownMenuContent( ), exit = fadeOut( animationSpec = tween( // Why ??? - durationMillis = ExitDuration - 40, + durationMillis = ExitDuration - 20, easing = EmphasizedAccelerate ) ) + shrinkVertically( diff --git a/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt b/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt index 403065791..74795634e 100644 --- a/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt +++ b/app/src/main/java/me/ash/reader/ui/page/home/flow/ArticleItem.kt @@ -376,7 +376,9 @@ fun SwipeableArticleItem( expanded = expanded, onDismissRequest = { expanded = false }, offset = density.run { - DpOffset(menuOffset.x.toDp(), 0.dp) + if (LocalLayoutDirection.current == LayoutDirection.Ltr) + DpOffset(menuOffset.x.toDp(), 0.dp) + else DpOffset(0.dp, 0.dp) }, ) { ArticleItemMenuContent(