feat: #259 编辑页面 FAB 支持随输入法上下移动

This commit is contained in:
Super12138 2025-05-31 17:57:35 +08:00
parent 47abaa12cc
commit 2fe9c9df6c
2 changed files with 10 additions and 6 deletions

View file

@ -34,7 +34,7 @@ android {
applicationId = "cn.super12138.todo"
minSdk = 24
targetSdk = 36
versionCode = 690
versionCode = 701
versionName = "2.1.2"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

View file

@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.sizeIn
@ -126,7 +127,8 @@ fun TodoEditorPage(
text = stringResource(R.string.action_delete),
expanded = true,
containerColor = MaterialTheme.colorScheme.errorContainer,
onClick = { showDeleteConfirmDialog = true }
onClick = { showDeleteConfirmDialog = true },
modifier = Modifier.imePadding()
)
}
AnimatedExtendedFloatingActionButton(
@ -152,10 +154,12 @@ fun TodoEditorPage(
)
)
},
modifier = Modifier.sharedElement(
sharedContentState = rememberSharedContentState(key = Constants.KEY_TODO_FAB_TRANSITION),
animatedVisibilityScope = animatedVisibilityScope
)
modifier = Modifier
.imePadding()
.sharedElement(
sharedContentState = rememberSharedContentState(key = Constants.KEY_TODO_FAB_TRANSITION),
animatedVisibilityScope = animatedVisibilityScope
)
)
}
}