Add label to the “load embed” button
This commit is contained in:
parent
c67e6ce45e
commit
e46c25892d
|
@ -132,6 +132,7 @@
|
|||
"sensitive_content": "Sensitive Content",
|
||||
"media_content_warning": "Tap anywhere to reveal",
|
||||
"tap_to_reveal": "Tap to reveal",
|
||||
"load_embed": "Load Embed",
|
||||
"poll": {
|
||||
"vote": "Vote",
|
||||
"closed": "Closed"
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
"sensitive_content": "Sensitive Content",
|
||||
"media_content_warning": "Tap anywhere to reveal",
|
||||
"tap_to_reveal": "Tap to reveal",
|
||||
"load_embed": "Load Embed",
|
||||
"poll": {
|
||||
"vote": "Vote",
|
||||
"closed": "Closed"
|
||||
|
|
|
@ -272,6 +272,8 @@ public enum L10n {
|
|||
public enum Status {
|
||||
/// Content Warning
|
||||
public static let contentWarning = L10n.tr("Localizable", "Common.Controls.Status.ContentWarning", fallback: "Content Warning")
|
||||
/// Load Embed
|
||||
public static let loadEmbed = L10n.tr("Localizable", "Common.Controls.Status.LoadEmbed", fallback: "Load Embed")
|
||||
/// Tap anywhere to reveal
|
||||
public static let mediaContentWarning = L10n.tr("Localizable", "Common.Controls.Status.MediaContentWarning", fallback: "Tap anywhere to reveal")
|
||||
/// Sensitive Content
|
||||
|
|
|
@ -107,6 +107,7 @@ Please check your internet connection.";
|
|||
"Common.Controls.Status.Actions.Unfavorite" = "Unfavorite";
|
||||
"Common.Controls.Status.Actions.Unreblog" = "Undo reblog";
|
||||
"Common.Controls.Status.ContentWarning" = "Content Warning";
|
||||
"Common.Controls.Status.LoadEmbed" = "Load Embed";
|
||||
"Common.Controls.Status.MediaContentWarning" = "Tap anywhere to reveal";
|
||||
"Common.Controls.Status.MetaEntity.Email" = "Email address: %@";
|
||||
"Common.Controls.Status.MetaEntity.Hashtag" = "Hashtag: %@";
|
||||
|
|
|
@ -9,6 +9,7 @@ import AlamofireImage
|
|||
import Combine
|
||||
import MastodonAsset
|
||||
import MastodonCore
|
||||
import MastodonLocalization
|
||||
import CoreDataStack
|
||||
import UIKit
|
||||
import WebKit
|
||||
|
@ -33,6 +34,9 @@ public final class StatusCardControl: UIControl {
|
|||
configuration.baseBackgroundColor = .clear
|
||||
configuration.cornerStyle = .capsule
|
||||
configuration.buttonSize = .large
|
||||
configuration.title = L10n.Common.Controls.Status.loadEmbed
|
||||
configuration.image = UIImage(systemName: "play.fill")
|
||||
configuration.imagePadding = 12
|
||||
return UIButton(configuration: configuration, primaryAction: UIAction { [weak self] _ in
|
||||
self?.showWebView()
|
||||
})
|
||||
|
@ -112,8 +116,6 @@ public final class StatusCardControl: UIControl {
|
|||
containerStackView.isUserInteractionEnabled = false
|
||||
containerStackView.distribution = .fill
|
||||
|
||||
showEmbedButton.setImage(UIImage(systemName: "play.fill"), for: .normal)
|
||||
|
||||
addSubview(containerStackView)
|
||||
addSubview(highlightView)
|
||||
addSubview(showEmbedButton)
|
||||
|
@ -125,7 +127,6 @@ public final class StatusCardControl: UIControl {
|
|||
containerStackView.pinToParent()
|
||||
highlightView.pinToParent()
|
||||
NSLayoutConstraint.activate([
|
||||
showEmbedButton.widthAnchor.constraint(equalTo: showEmbedButton.heightAnchor),
|
||||
showEmbedButton.centerXAnchor.constraint(equalTo: imageView.centerXAnchor),
|
||||
showEmbedButton.centerYAnchor.constraint(equalTo: imageView.centerYAnchor),
|
||||
])
|
||||
|
|
Loading…
Reference in New Issue