Skip to content

Commit

Permalink
adjusted showcard location and button width (microsoft#1602)
Browse files Browse the repository at this point in the history
updated button's selected state
  • Loading branch information
jwoo-msft authored Jun 13, 2018
1 parent 10da978 commit d9dabae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ - (instancetype)initWithActionElement:(ACOBaseActionElement *)actionElement root

- (IBAction)send:(UIButton *)sender
{
[sender setSelected:YES];
[_view.acrActionDelegate didFetchUserResponses:[_view card] action:_actionElement];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ + (UIView *)renderWithAdaptiveCards:(std::shared_ptr<AdaptiveCard> const &)adapt
ACRRegistration *reg = [ACRRegistration getInstance];
UIView<ACRIContentHoldingView> *childview = nil;
NSDictionary<NSString *, NSNumber*> *attributes =
@{@"spacing":[NSNumber numberWithInt:[config getHostConfig]->actions.buttonSpacing],
@"distribution":[NSNumber numberWithInt:UIStackViewDistributionFillEqually]};
@{@"spacing":[NSNumber numberWithInt:[config getHostConfig]->actions.buttonSpacing]};

if(ActionsOrientation::Horizontal == [config getHostConfig]->actions.actionsOrientation){
childview = [[ACRColumnSetView alloc] initWithFrame:CGRectMake(0, 0, superview.frame.size.width, superview.frame.size.height) attributes:attributes];
Expand All @@ -111,6 +110,8 @@ + (UIView *)renderWithAdaptiveCards:(std::shared_ptr<AdaptiveCard> const &)adapt
}

ACOBaseActionElement *acoElem = [[ACOBaseActionElement alloc] init];
ACRContentHoldingUIScrollView *containingView = [[ACRContentHoldingUIScrollView alloc] init];
[superview addArrangedSubview:containingView];
float accumulatedWidth = 0, accumulatedHeight = 0, spacing = [config getHostConfig]->actions.buttonSpacing, maxWidth = 0, maxHeight = 0;
for(const auto &elem:elems){
ACRBaseActionElementRenderer *actionRenderer =
Expand Down Expand Up @@ -143,9 +144,8 @@ + (UIView *)renderWithAdaptiveCards:(std::shared_ptr<AdaptiveCard> const &)adapt
}
childview.frame = CGRectMake(0, 0, contentWidth, contentHeight);

ACRContentHoldingUIScrollView *containingView = [[ACRContentHoldingUIScrollView alloc] initWithFrame:CGRectMake(0, 0, superview.frame.size.width, contentHeight)];
containingView.frame = CGRectMake(0, 0, superview.frame.size.width, contentHeight);
containingView.translatesAutoresizingMaskIntoConstraints = NO;
[superview addArrangedSubview:containingView];
[containingView addSubview:childview];
[NSLayoutConstraint constraintWithItem:containingView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:childview attribute:NSLayoutAttributeTop multiplier:1.0 constant:0].active = YES;
[NSLayoutConstraint constraintWithItem:containingView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:childview attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0].active = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@

- (NSMutableDictionary *)getTextMap;

- (dispatch_queue_t)getSerialTextQueue;

- (ACOAdaptiveCard *)card;

- (UIView *)render;

+ (void)setImageView:(UIImageView*)imageView inButton:(UIButton*)button withConfig:(ACOHostConfig *)config;

- (void)waitForAsyncTasksToFinish;
@end

0 comments on commit d9dabae

Please sign in to comment.