mirror of
https://github.com/tooot-app/app
synced 2025-04-23 14:47:21 +02:00
Fix Android expand
This commit is contained in:
parent
41bfeed56f
commit
6c6d563aae
@ -10,7 +10,7 @@ import { useTheme } from '@utils/styles/ThemeManager'
|
|||||||
import { LinearGradient } from 'expo-linear-gradient'
|
import { LinearGradient } from 'expo-linear-gradient'
|
||||||
import React, { useCallback, useState } from 'react'
|
import React, { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { Pressable, Text, View } from 'react-native'
|
import { Platform, Pressable, Text, View } from 'react-native'
|
||||||
import HTMLView from 'react-native-htmlview'
|
import HTMLView from 'react-native-htmlview'
|
||||||
|
|
||||||
// Prevent going to the same hashtag multiple times
|
// Prevent going to the same hashtag multiple times
|
||||||
@ -214,12 +214,18 @@ const ParseHTML: React.FC<Props> = ({
|
|||||||
const [expanded, setExpanded] = useState(false)
|
const [expanded, setExpanded] = useState(false)
|
||||||
|
|
||||||
const onTextLayout = useCallback(({ nativeEvent }) => {
|
const onTextLayout = useCallback(({ nativeEvent }) => {
|
||||||
if (
|
switch (Platform.OS) {
|
||||||
nativeEvent.lines &&
|
case 'ios':
|
||||||
nativeEvent.lines.length === numberOfLines + 1
|
if (nativeEvent.lines.length === numberOfLines + 1) {
|
||||||
) {
|
|
||||||
setExpandAllow(true)
|
setExpandAllow(true)
|
||||||
}
|
}
|
||||||
|
break
|
||||||
|
case 'android':
|
||||||
|
if (nativeEvent.lines.length > numberOfLines + 1) {
|
||||||
|
setExpandAllow(true)
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user