feat: set status content direction if possible. resolve #295
This commit is contained in:
parent
b5052cca5e
commit
58daa930cb
|
@ -720,6 +720,15 @@ extension StatusSection {
|
||||||
statusItemAttribute: Item.StatusAttribute
|
statusItemAttribute: Item.StatusAttribute
|
||||||
) {
|
) {
|
||||||
// set content
|
// set content
|
||||||
|
let paragraphStyle = cell.statusView.contentMetaText.paragraphStyle
|
||||||
|
if let language = (status.reblog ?? status).language {
|
||||||
|
let direction = Locale.characterDirection(forLanguage: language)
|
||||||
|
paragraphStyle.alignment = direction == .rightToLeft ? .right : .left
|
||||||
|
} else {
|
||||||
|
paragraphStyle.alignment = .natural
|
||||||
|
}
|
||||||
|
cell.statusView.contentMetaText.paragraphStyle = paragraphStyle
|
||||||
|
|
||||||
if let content = content {
|
if let content = content {
|
||||||
cell.statusView.contentMetaText.configure(content: content)
|
cell.statusView.contentMetaText.configure(content: content)
|
||||||
cell.statusView.contentMetaText.textView.accessibilityLabel = content.trimmed
|
cell.statusView.contentMetaText.textView.accessibilityLabel = content.trimmed
|
||||||
|
|
|
@ -217,6 +217,7 @@ final class StatusView: UIView {
|
||||||
let style = NSMutableParagraphStyle()
|
let style = NSMutableParagraphStyle()
|
||||||
style.lineSpacing = 5
|
style.lineSpacing = 5
|
||||||
style.paragraphSpacing = 8
|
style.paragraphSpacing = 8
|
||||||
|
style.alignment = .natural
|
||||||
return style
|
return style
|
||||||
}()
|
}()
|
||||||
metaText.textAttributes = [
|
metaText.textAttributes = [
|
||||||
|
|
Loading…
Reference in New Issue