mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
UI tests updated
This commit is contained in:
@@ -119,11 +119,14 @@ struct MessageText: UIViewRepresentable {
|
||||
let string = attributedText.string as NSString
|
||||
guard string.length > 0 else { return true }
|
||||
|
||||
// Isolate the last paragraph because its direction is what decides
|
||||
// which side the trailing attachment ends up on.
|
||||
let lastParagraphRange = string.paragraphRange(for: NSRange(location: string.length - 1, length: 0))
|
||||
let lastParagraph = string.substring(with: lastParagraphRange)
|
||||
|
||||
let textIsRTL = lastParagraph.firstStrongCharacterIsRTL
|
||||
return textIsRTL == (layoutDirection == .rightToLeft)
|
||||
let layoutIsRTL = layoutDirection == .rightToLeft
|
||||
return textIsRTL == layoutIsRTL
|
||||
}
|
||||
|
||||
func makeUIView(context: Context) -> MessageTextView {
|
||||
|
||||
Reference in New Issue
Block a user