Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jwoo/ios custom styling #1474

Merged
merged 11 commits into from
Jun 15, 2018
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
30184A9720D1B298001C5A68 /* InputsFormWithHeightStretch.json in Resources */ = {isa = PBXBuildFile; fileRef = 30184A9620D1B298001C5A68 /* InputsFormWithHeightStretch.json */; };
30860BC220C9B5C9009F9D99 /* (null) in Resources */ = {isa = PBXBuildFile; };
30860BC320C9B5C9009F9D99 /* ColumnSet.Input.ChoiceSet.VerticalStretch.json in Resources */ = {isa = PBXBuildFile; fileRef = 30860BB720C9B5C8009F9D99 /* ColumnSet.Input.ChoiceSet.VerticalStretch.json */; };
30860BC420C9B5C9009F9D99 /* (null) in Resources */ = {isa = PBXBuildFile; };
Expand Down Expand Up @@ -127,7 +126,6 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
30184A9620D1B298001C5A68 /* InputsFormWithHeightStretch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = InputsFormWithHeightStretch.json; path = ../../../../samples/Tests/InputsFormWithHeightStretch.json; sourceTree = "<group>"; };
30860BB720C9B5C8009F9D99 /* ColumnSet.Input.ChoiceSet.VerticalStretch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = ColumnSet.Input.ChoiceSet.VerticalStretch.json; path = ../../../../samples/Tests/ColumnSet.Input.ChoiceSet.VerticalStretch.json; sourceTree = "<group>"; };
30860BB920C9B5C8009F9D99 /* ColumnSet.VerticalStretch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = ColumnSet.VerticalStretch.json; path = ../../../../samples/Tests/ColumnSet.VerticalStretch.json; sourceTree = "<group>"; };
30860BBA20C9B5C8009F9D99 /* ColumnSet.Input.Number.VerticalStretch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = ColumnSet.Input.Number.VerticalStretch.json; path = ../../../../samples/Tests/ColumnSet.Input.Number.VerticalStretch.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -346,7 +344,6 @@
F4D33E341F045B6E00941E44 /* Jsons */ = {
isa = PBXGroup;
children = (
30184A9620D1B298001C5A68 /* InputsFormWithHeightStretch.json */,
30860BC020C9B5C9009F9D99 /* ColumnSet_Container.VerticalStretch.json */,
30860BBE20C9B5C8009F9D99 /* ColumnSet.FactSet.VerticalStretch.json */,
30860BBB20C9B5C8009F9D99 /* ColumnSet.ImageSet.VerticalStretch.json */,
Expand Down Expand Up @@ -526,7 +523,6 @@
F4933CDE1F79852C00F6EBFD /* Input.Number.json in Resources */,
F4933CE41F79852C00F6EBFD /* TextBlock.Color.json in Resources */,
F4933CD41F79852C00F6EBFD /* Image.HorizontalAlignment.json in Resources */,
30184A9720D1B298001C5A68 /* InputsFormWithHeightStretch.json in Resources */,
F4933CC51F79852C00F6EBFD /* Action.Submit.json in Resources */,
6B268FE520CEF89100D99C1B /* (null) in Resources */,
F4933CED1F79852C00F6EBFD /* TextBlock.Weight.json in Resources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@
F448732A1EE2261F00FCAFAE /* ToggleInput.h in Headers */ = {isa = PBXBuildFile; fileRef = F44872F21EE2261F00FCAFAE /* ToggleInput.h */; settings = {ATTRIBUTES = (Public, ); }; };
F452CD581F68CD6F005394B2 /* HostConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F452CD571F68CD6F005394B2 /* HostConfig.cpp */; };
F45A071F1EF4BD67007C6503 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F45A071E1EF4BD67007C6503 /* UIKit.framework */; };
F4603238207575C7006C5358 /* ACRLabelView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F4603237207575A3006C5358 /* ACRLabelView.xib */; };
F460323F20757C57006C5358 /* ACRButton.xib in Resources */ = {isa = PBXBuildFile; fileRef = F460323E20757C57006C5358 /* ACRButton.xib */; };
F460324120757F38006C5358 /* ACRTextField.xib in Resources */ = {isa = PBXBuildFile; fileRef = F460324020757F38006C5358 /* ACRTextField.xib */; };
F460324520758583006C5358 /* ACRDatePicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = F460324420758583006C5358 /* ACRDatePicker.xib */; };
F460324720759519006C5358 /* ACRDateTextField.xib in Resources */ = {isa = PBXBuildFile; fileRef = F460324620759519006C5358 /* ACRDateTextField.xib */; };
F46032492075997D006C5358 /* ACRInputTableView.xib in Resources */ = {isa = PBXBuildFile; fileRef = F46032482075997D006C5358 /* ACRInputTableView.xib */; };
F495FC0A2022A18F0093D4DE /* ACRChoiceSetViewDataSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = F495FC082022A18F0093D4DE /* ACRChoiceSetViewDataSource.mm */; };
F495FC0B2022A18F0093D4DE /* ACRChoiceSetViewDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = F495FC092022A18F0093D4DE /* ACRChoiceSetViewDataSource.h */; settings = {ATTRIBUTES = (Public, ); }; };
F495FC0E2022AC920093D4DE /* ACRChoiceSetViewDataSourceCompactStyle.mm in Sources */ = {isa = PBXBuildFile; fileRef = F495FC0C2022AC920093D4DE /* ACRChoiceSetViewDataSourceCompactStyle.mm */; };
Expand Down Expand Up @@ -391,6 +397,12 @@
F45A071A1EF4BC44007C6503 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
F45A071C1EF4BCC3007C6503 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
F45A071E1EF4BD67007C6503 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
F4603237207575A3006C5358 /* ACRLabelView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRLabelView.xib; sourceTree = "<group>"; };
F460323E20757C57006C5358 /* ACRButton.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRButton.xib; sourceTree = "<group>"; };
F460324020757F38006C5358 /* ACRTextField.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRTextField.xib; sourceTree = "<group>"; };
F460324420758583006C5358 /* ACRDatePicker.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRDatePicker.xib; sourceTree = "<group>"; };
F460324620759519006C5358 /* ACRDateTextField.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRDateTextField.xib; sourceTree = "<group>"; };
F46032482075997D006C5358 /* ACRInputTableView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ACRInputTableView.xib; sourceTree = "<group>"; };
F495FC082022A18F0093D4DE /* ACRChoiceSetViewDataSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ACRChoiceSetViewDataSource.mm; sourceTree = "<group>"; };
F495FC092022A18F0093D4DE /* ACRChoiceSetViewDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ACRChoiceSetViewDataSource.h; sourceTree = "<group>"; };
F495FC0C2022AC920093D4DE /* ACRChoiceSetViewDataSourceCompactStyle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ACRChoiceSetViewDataSourceCompactStyle.mm; sourceTree = "<group>"; };
Expand Down Expand Up @@ -530,6 +542,7 @@
F42979321F30074900E89914 /* Inputs */,
F42979341F3007C500E89914 /* ReadOnlyObjects */,
F42979351F3007DF00E89914 /* Layouts */,
F460323D20757AE6006C5358 /* XIB */,
F423C0B81EE1FBAA00905679 /* ACFramework.h */,
F4F2556B1F98246000A80D39 /* ACOBaseActionElement.h */,
F4F44B8A2048F83F00A2F24C /* ACOBaseCardElement.h */,
Expand Down Expand Up @@ -793,6 +806,19 @@
name = Frameworks;
sourceTree = "<group>";
};
F460323D20757AE6006C5358 /* XIB */ = {
isa = PBXGroup;
children = (
F4603237207575A3006C5358 /* ACRLabelView.xib */,
F460323E20757C57006C5358 /* ACRButton.xib */,
F460324020757F38006C5358 /* ACRTextField.xib */,
F460324420758583006C5358 /* ACRDatePicker.xib */,
F460324620759519006C5358 /* ACRDateTextField.xib */,
F46032482075997D006C5358 /* ACRInputTableView.xib */,
);
name = XIB;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
Expand Down Expand Up @@ -984,6 +1010,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
global,
);
mainGroup = F423C0AB1EE1FBA900905679;
productRefGroup = F423C0B61EE1FBA900905679 /* Products */;
Expand All @@ -1002,6 +1029,12 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F460324520758583006C5358 /* ACRDatePicker.xib in Resources */,
F46032492075997D006C5358 /* ACRInputTableView.xib in Resources */,
F460323F20757C57006C5358 /* ACRButton.xib in Resources */,
F4603238207575C7006C5358 /* ACRLabelView.xib in Resources */,
F460324720759519006C5358 /* ACRDateTextField.xib in Resources */,
F460324120757F38006C5358 /* ACRTextField.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,19 @@
#import "ACRView.h"

@implementation UIButton(ACRButton)

Copy link

@bviglietta bviglietta Jun 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this method, since it's just repeating the superclass's implementation. #Resolved

+ (UIButton* )rootView:(ACRView *)rootView
baseActionElement:(ACOBaseActionElement *)acoAction
title:(NSString *)title
iconUrl:(NSString *)iconUrl
andHostConfig:(ACOHostConfig *)config;
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
NSBundle* bundle = [NSBundle bundleWithIdentifier:@"MSFT.AdaptiveCards"];
UIButton *button = [bundle loadNibNamed:@"ACRButton" owner:rootView options:nil][0];
[button setTitle:title forState:UIControlStateNormal];
[button setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
[button setBackgroundColor:[UIColor colorWithRed:0.0
green:122.0/255.0
blue:1.0
alpha:1.0]];

CGSize contentSize = [button.titleLabel intrinsicContentSize];
[button setFrame:CGRectMake(0, 0, contentSize.width, contentSize.height)];
[button setContentEdgeInsets:UIEdgeInsetsMake(5,5,5,5)];

std::shared_ptr<AdaptiveCards::BaseActionElement> action = [acoAction element];
if([iconUrl length] != 0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14109" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="cellForCompactMode" textLabel="Zi9-4G-d2d" style="IBUITableViewCellStyleDefault" id="BWp-lV-bvH">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="BWp-lV-bvH" id="QDz-wL-Cn5">
<rect key="frame" x="0.0" y="0.0" width="341" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Make Choice" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" highlighted="YES" adjustsFontSizeToFit="NO" id="Zi9-4G-d2d">
<rect key="frame" x="16" y="0.0" width="324" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<point key="canvasLocation" x="71.5" y="59"/>
</tableViewCell>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,15 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
// creates top view that hides selection table
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"tabCellId";
static NSString *identifier = @"cellForCompactMode";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if(!cell)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:identifier];
NSBundle *bundle = [NSBundle bundleWithIdentifier:@"MSFT.AdaptiveCards"];
[tableView registerNib:[UINib nibWithNibName:@"ACRCellForCompactMode" bundle:bundle] forCellReuseIdentifier:identifier];
cell = [tableView dequeueReusableCellWithIdentifier:identifier];
}
NSString *title = @"Make Choice";
cell.textLabel.text = title;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.selectionStyle = UITableViewCellSelectionStyleBlue;

return cell;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<datePicker contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" datePickerMode="dateAndTime" minuteInterval="1" id="j3j-us-bMu">
<rect key="frame" x="0.0" y="0.0" width="375" height="215"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<date key="date" timeIntervalSinceReferenceDate="544572879.81824601">
<!--2018-04-04 22:14:39 +0000-->
</date>
<point key="canvasLocation" x="-406.5" y="40.5"/>
</datePicker>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ - (instancetype)initWithFrame:(CGRect)frame
- (instancetype)initWithTimeDateInput:(std::shared_ptr<BaseInputElement> const &)elem
dateStyle:(NSDateFormatterStyle)dateStyle
{
self = [self initWithFrame:CGRectMake(0,0,0,0)];

NSBundle *bundle = [NSBundle bundleWithIdentifier:@"MSFT.AdaptiveCards"];
self = [bundle loadNibNamed:@"ACRDateTextField" owner:self options:nil][0];
if(self)
{
NSString *valueStr = nil;
Expand All @@ -33,8 +33,7 @@ - (instancetype)initWithTimeDateInput:(std::shared_ptr<BaseInputElement> const &
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateStyle = dateStyle;
formatter.locale = [NSLocale currentLocale];

UIDatePicker *picker = [[UIDatePicker alloc] init];
UIDatePicker *picker = [bundle loadNibNamed:@"ACRDatePicker" owner:self options:nil][0];

self.id = [NSString stringWithCString:elem->GetId().c_str()
encoding:NSUTF8StringEncoding];
Expand Down Expand Up @@ -112,7 +111,7 @@ - (instancetype)initWithTimeDateInput:(std::shared_ptr<BaseInputElement> const &
}

- (IBAction)dismiss
{
{
[self endEditing:YES];
self.text = [self.formatter stringFromDate:((UIDatePicker *)self.inputView).date];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" clearsOnBeginEditing="YES" minimumFontSize="17" clearButtonMode="whileEditing" id="ir7-Oe-3OW" customClass="ACRDateTextField">
<rect key="frame" x="0.0" y="0.0" width="97" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.93725490570000003" green="0.93725490570000003" blue="0.95686274770000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
<point key="canvasLocation" x="-110" y="-87"/>
</textField>
</objects>
</document>
Loading