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

Send button disabled style and check if the camera exists to prevent crash #18

Merged
merged 2 commits into from
Jul 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ApptentiveConnect/source/Custom Views/ATCustomButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ - (id)initWithButtonStyle:(ATCustomButtonStyle)style {
button.titleLabel.font = [UIFont boldSystemFontOfSize:12.0];
button.titleLabel.shadowOffset = CGSizeMake(0.0, -1.0);

[button setTitleShadowColor:[UIColor colorWithRed:63./256. green:63./256. blue:63./256. alpha:1.0] forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[button setTitleShadowColor:[UIColor colorWithWhite:0 alpha:0.8] forState:UIControlStateNormal];
[button setTitleColor:[UIColor colorWithRed: 0.79 green: 0.86 blue: 0.99 alpha: 1] forState:UIControlStateDisabled];
[button setTitleShadowColor:[UIColor colorWithWhite:0 alpha:0.5] forState:UIControlStateDisabled];

[button setBackgroundImage:[ATBackend imageNamed:@"at_send_bg"] forState:UIControlStateNormal];
[button setBackgroundImage:[ATBackend imageNamed:@"at_send_highlighted_bg"] forState:UIControlStateHighlighted];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ - (IBAction)takePhoto:(id)sender {
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
[self chooseImage];
} else if (buttonIndex == 1) {
} else if (buttonIndex == 1 && [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
[self takePhoto];
}
}
Expand Down