Skip to content

Commit

Permalink
Merge branch 'sovation-labelcolor'
Browse files Browse the repository at this point in the history
  • Loading branch information
shiv19 committed Apr 3, 2019
2 parents 69a309c + c30ce78 commit c637768
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Color } from "tns-core-modules/color";

export declare class ModalDatetimepicker {
constructor();
pickDate(options?: PickerOptions): Promise<DateResponse>;
Expand Down Expand Up @@ -28,6 +30,8 @@ export interface PickerOptions {
};
cancelLabel?: string;
doneLabel?: string;
cancelLabelColor?: Color;
doneLabelColor?: Color;
datePickerMode?: string;
}

Expand Down
7 changes: 5 additions & 2 deletions src/modal-datetimepicker.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as application from "tns-core-modules/application";
import * as frame from "tns-core-modules/ui/frame";
import { Label } from "tns-core-modules/ui/label/";
import { Page } from "tns-core-modules/ui/page";
import { Color } from "tns-core-modules/ui/frame";

class ButtonHandler extends NSObject {
public close(nativeButton: UIButton, nativeEvent: _UIEvent) {
Expand Down Expand Up @@ -199,7 +200,7 @@ export class ModalDatetimepicker {
40
);
cancelButton.setTitleColorForState(
UIColor.whiteColor,
(options.cancelLabelColor && options.cancelLabelColor.ios) || UIColor.whiteColor,
UIControlState.Normal
);
cancelButton.titleLabel.font = UIFont.systemFontOfSize(18);
Expand Down Expand Up @@ -233,7 +234,7 @@ export class ModalDatetimepicker {
40
);
doneButton.setTitleColorForState(
UIColor.colorWithRedGreenBlueAlpha(0, 0.6, 1, 1),
(options.doneLabelColor && options.doneLabelColor.ios) || UIColor.colorWithRedGreenBlueAlpha(0, 0.6, 1, 1),
UIControlState.Normal
);
doneButton.titleLabel.font = UIFont.boldSystemFontOfSize(18);
Expand Down Expand Up @@ -391,6 +392,8 @@ export interface PickerOptions {
startingMinute?: number;
cancelLabel?: string;
doneLabel?: string;
cancelLabelColor?: Color;
doneLabelColor?: Color;
}

export interface TimeResponse {
Expand Down

0 comments on commit c637768

Please sign in to comment.