Accessibility label changes for heart.
This commit is contained in:
parent
d43cf7dfa0
commit
1bf75c9929
@ -79,7 +79,6 @@ import UIKit
|
|||||||
heightConstraint = heightAnchor.constraint(equalTo: widthAnchor, multiplier: 1)
|
heightConstraint = heightAnchor.constraint(equalTo: widthAnchor, multiplier: 1)
|
||||||
heightConstraint?.isActive = true
|
heightConstraint?.isActive = true
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "heart_action_hint")
|
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
updateAccessibilityLabel()
|
updateAccessibilityLabel()
|
||||||
}
|
}
|
||||||
@ -97,10 +96,8 @@ import UIKit
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
/// Adjust accessibility label based on selection of Heart.
|
/// Adjust accessibility label based on selection of Heart.
|
||||||
func updateAccessibilityLabel() {
|
func updateAccessibilityLabel() {
|
||||||
if let message = MVMCoreUIUtility.hardcodedString(withKey: "heart"),
|
accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "heart_unfavorite_action_hint" : "heart_favorite_action_hint")
|
||||||
let selectedState = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "heart_selected_state" : "heart_not_selected_state") {
|
accessibilityLabel = MVMCoreUIUtility.hardcodedString(withKey: isSelected ? "heart_selected_state" : "heart_not_selected_state")
|
||||||
accessibilityLabel = message + selectedState
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func tapAction() {
|
func tapAction() {
|
||||||
|
|||||||
@ -60,6 +60,6 @@ open class HeartModel: MoleculeModelProtocol {
|
|||||||
try container.encode(isActive, forKey: .isActive)
|
try container.encode(isActive, forKey: .isActive)
|
||||||
try container.encode(activeColor, forKey: .activeColor)
|
try container.encode(activeColor, forKey: .activeColor)
|
||||||
try container.encode(inActiveColor, forKey: .inActiveColor)
|
try container.encode(inActiveColor, forKey: .inActiveColor)
|
||||||
try container.encodeModelIfPresent(action, forKey: .action)
|
try container.encodeModel(action, forKey: .action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,8 +68,8 @@
|
|||||||
"AccToggleHint" = "double tap to toggle";
|
"AccToggleHint" = "double tap to toggle";
|
||||||
|
|
||||||
// MARK: Heart
|
// MARK: Heart
|
||||||
"heart" = "Favorite";
|
"heart_favorite_action_hint" = "Double tap to favorite";
|
||||||
"heart_action_hint" = "Double tap to favorite";
|
"heart_unfavorite_action_hint" = "Double tap to unfavorite";
|
||||||
"heart_selected_state" = "Favorited";
|
"heart_selected_state" = "Favorited";
|
||||||
"heart_not_selected_state" = "Unfavorited";
|
"heart_not_selected_state" = "Unfavorited";
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,8 @@
|
|||||||
"AccOff" = "apagado";
|
"AccOff" = "apagado";
|
||||||
"AccToggleHint" = "toca dos veces para alternar";
|
"AccToggleHint" = "toca dos veces para alternar";
|
||||||
// Heart
|
// Heart
|
||||||
"heart_action_hint" = "Toca dos veces en favorito";
|
"heart_favorite_action_hint" = "Toca dos veces en favorito";
|
||||||
|
"heart_unfavorite_action_hint" = "Toca dos veces para dejar de marcar como favorito";
|
||||||
"heart_selected_state" = "Favoritos";
|
"heart_selected_state" = "Favoritos";
|
||||||
"heart_not_selected_state" = "No favorito";
|
"heart_not_selected_state" = "No favorito";
|
||||||
// Carousel
|
// Carousel
|
||||||
|
|||||||
@ -53,7 +53,8 @@
|
|||||||
"AccToggleHint" = "toca dos veces para alternar";
|
"AccToggleHint" = "toca dos veces para alternar";
|
||||||
|
|
||||||
// Heart
|
// Heart
|
||||||
"heart_action_hint" = "Toca dos veces en favorito";
|
"heart_favorite_action_hint" = "Toca dos veces en favorito";
|
||||||
|
"heart_unfavorite_action_hint" = "Toca dos veces para dejar de marcar como favorito";
|
||||||
"heart_selected_state" = "Favoritos";
|
"heart_selected_state" = "Favoritos";
|
||||||
"heart_not_selected_state" = "No favorito";
|
"heart_not_selected_state" = "No favorito";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user