Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoo-msft authored Aug 17, 2021
1 parent 36cb670 commit a2b8e29
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup

// Obtain text color to apply to the attributed string
ACRContainerStyle style = lab.style;
auto textColor = textRun->GetTextColor().value_or(ForegroundColor::Default);
auto foregroundColor = [acoConfig getTextBlockColor:style
textColor:textRun->GetTextColor().value_or(ForegroundColor::Default)
textColor:textColor
subtleOption:textRun->GetIsSubtle().value_or(false)];

// Config and add Select Action
Expand All @@ -122,19 +123,20 @@ - (UIView *)render:(UIView<ACRIContentHoldingView> *)viewGroup
[textRunContent addAttribute:@"SelectAction"
value:target
range:selectActionRange];

[ACRLongPressGestureRecognizerFactory
addTapGestureRecognizerToUITextView:lab
target:(NSObject<ACRSelectActionDelegate>
*)target
rootView:rootView
hostConfig:acoConfig];

[textRunContent addAttribute:NSUnderlineStyleAttributeName
value:[NSNumber numberWithInt:NSUnderlineStyleSingle]
range:selectActionRange];
[textRunContent addAttribute:NSUnderlineColorAttributeName
value:foregroundColor
range:selectActionRange];
if (@available(iOS 13.0, *)) {
foregroundColor = UIColor.linkColor;
} else {
// Fallback on earlier versions
foregroundColor = [ACOHostConfig convertHexColorCodeToUIColor:"#007affff"];
}
}
}

Expand Down

0 comments on commit a2b8e29

Please sign in to comment.