animate text in both directions
This commit is contained in:
@@ -862,15 +862,20 @@ function ExpandableRichTextView({
|
|||||||
}) {
|
}) {
|
||||||
const {height: screenHeight} = useSafeAreaFrame()
|
const {height: screenHeight} = useSafeAreaFrame()
|
||||||
const [expanded, setExpanded] = useState(false)
|
const [expanded, setExpanded] = useState(false)
|
||||||
|
const [hasBeenExpanded, setHasBeenExpanded] = useState(false)
|
||||||
const [constrained, setConstrained] = useState(false)
|
const [constrained, setConstrained] = useState(false)
|
||||||
const [contentHeight, setContentHeight] = useState(0)
|
const [contentHeight, setContentHeight] = useState(0)
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|
||||||
|
if (expanded && !hasBeenExpanded) {
|
||||||
|
setHasBeenExpanded(true)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView
|
<ScrollView
|
||||||
scrollEnabled={expanded}
|
scrollEnabled={expanded}
|
||||||
onContentSizeChange={(_w, h) => {
|
onContentSizeChange={(_w, h) => {
|
||||||
if (expanded) {
|
if (hasBeenExpanded) {
|
||||||
LayoutAnimation.configureNext({
|
LayoutAnimation.configureNext({
|
||||||
duration: 500,
|
duration: 500,
|
||||||
update: {type: 'spring', springDamping: 0.6},
|
update: {type: 'spring', springDamping: 0.6},
|
||||||
|
|||||||
Reference in New Issue
Block a user