Skip to content

Commit d2ace2f

Browse files
Hristo HristovHristo Hristov
Hristo Hristov
authored and
Hristo Hristov
committed
Resolving comments
1 parent 5a2efb6 commit d2ace2f

File tree

5 files changed

+17
-42
lines changed

5 files changed

+17
-42
lines changed

tns-core-modules/ui/core/view-base/view-base.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,6 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
660660
} else {
661661
// TODO: Implement _createNativeView for iOS
662662
this.createNativeView();
663-
if (!currentNativeView) {
664-
console.log(`${this.typeName} doesnt have NativeView !!!!! =================`);
665-
}
666663
// this.nativeView = this._iosView = (<any>this)._nativeView;
667664
}
668665

tns-core-modules/ui/date-picker/date-picker.android.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,19 +119,19 @@ export class DatePicker extends DatePickerBase {
119119
}
120120
}
121121

122-
[maxDateProperty.getDefault](): Date {
122+
[maxDateProperty.getDefault](): number {
123123
return this.nativeView.getMaxDate();
124124
}
125-
[maxDateProperty.setNative](value: Date) {
125+
[maxDateProperty.setNative](value: Date | number) {
126126
const newValue = value instanceof Date ? value.getTime() : value;
127127
this.nativeView.setMaxDate(newValue);
128128
}
129129

130-
[minDateProperty.getDefault](): Date {
130+
[minDateProperty.getDefault](): number {
131131
return this.nativeView.getMinDate();
132132
}
133-
[minDateProperty.setNative](value: Date) {
133+
[minDateProperty.setNative](value: Date | number) {
134134
const newValue = value instanceof Date ? value.getTime() : value;
135135
this.nativeView.setMinDate(newValue);
136136
}
137-
}
137+
}

tns-core-modules/ui/editable-text-base/editable-text-base.android.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -159,23 +159,6 @@ export abstract class EditableTextBase extends EditableTextBaseCommon {
159159
(<any>this.nativeView).listener.owner = null;
160160
}
161161

162-
// public _resetNativeView(force?: boolean) {
163-
// if (this._android) {
164-
// this._android.setOnFocusChangeListener(null);
165-
// this._android.setOnEditorActionListener(null);
166-
167-
// if (this._editTextListeners) {
168-
// this._android.removeTextChangedListener(this._editTextListeners);
169-
// }
170-
// }
171-
// super.resetNativeView();
172-
// }
173-
174-
// public _disposeNativeView(force?: boolean) {
175-
// this._android = undefined;
176-
// super.disposeNativeView();
177-
// }
178-
179162
public dismissSoftInput() {
180163
ad.dismissSoftInput(this.nativeView);
181164
}

tns-core-modules/ui/html-view/html-view.ios.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,26 @@
55
export * from "./html-view-common";
66

77
export class HtmlView extends HtmlViewBase {
8-
private _ios: UITextView;
8+
nativeView: UITextView;
99

1010
constructor() {
1111
super();
12-
this.nativeView = this._ios = UITextView.new();
13-
14-
this._ios.scrollEnabled = false;
15-
this._ios.editable = false;
16-
this._ios.selectable = true;
17-
this._ios.userInteractionEnabled = true;
18-
this._ios.dataDetectorTypes = UIDataDetectorTypes.All;
12+
const nativeView = UITextView.new()
13+
nativeView.scrollEnabled = false;
14+
nativeView.editable = false;
15+
nativeView.selectable = true;
16+
nativeView.userInteractionEnabled = true;
17+
nativeView.dataDetectorTypes = UIDataDetectorTypes.All;
18+
19+
this.nativeView = nativeView;
1920
}
2021

2122
get ios(): UITextView {
22-
return this._ios;
23+
return this.nativeView;
2324
}
2425

25-
// get nativeView(): UITextView {
26-
// return this._ios;
27-
// }
28-
2926
public onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void {
30-
var nativeView = this._ios;
27+
const nativeView = this.nativeView;
3128
if (nativeView) {
3229
const width = layout.getMeasureSpecSize(widthMeasureSpec);
3330
const widthMode = layout.getMeasureSpecMode(widthMeasureSpec);
@@ -54,6 +51,6 @@ export class HtmlView extends HtmlViewBase {
5451
[htmlProperty.setNative](value: string) {
5552
const htmlString = NSString.stringWithString(value + "");
5653
const nsData = htmlString.dataUsingEncoding(NSUnicodeStringEncoding);
57-
this._ios.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
54+
this.nativeView.attributedText = NSAttributedString.alloc().initWithDataOptionsDocumentAttributesError(nsData, <any>{ [NSDocumentTypeDocumentAttribute]: NSHTMLTextDocumentType }, null);
5855
}
5956
}

tns-core-modules/ui/time-picker/time-picker.android.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ function initializeTimeChangedListener(): void {
2929
}
3030

3131
const validTime = getValidTime(timePicker, hour, minute);
32-
hourProperty.nativeValueChange(timePicker, validTime.hour);
33-
minuteProperty.nativeValueChange(timePicker, validTime.minute);
3432
timeProperty.nativeValueChange(timePicker, new Date(0, 0, 0, validTime.hour, validTime.minute));
3533
}
3634
}

0 commit comments

Comments
 (0)