-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcalendar-weekview.android.js
211 lines (211 loc) · 8.74 KB
/
calendar-weekview.android.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var common = require("./calendar-weekview.common");
var application = require("application");
var color_1 = require("color");
function eventTextColorPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setEventTextColor(new color_1.Color(data.newValue).android);
}
function textSizePropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setTextSize(new color_1.Color(data.newValue).android);
}
function hourHeightPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHourHeight(data.newValue);
}
function headerColumnPaddingPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHeaderColumnPadding(data.newValue);
}
function headerColumnTextColorPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHeaderColumnTextColor(new color_1.Color(data.newValue).android);
}
function headerRowPaddingPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHeaderRowPadding(data.newValue);
}
function columnGapPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setColumnGap(data.newValue);
}
function noOfVisibleDaysPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setNumberOfVisibleDays(data.newValue);
}
function headerRowBackgroundColorPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHeaderRowBackgroundColor(new color_1.Color(data.newValue).android);
}
function dayBackgroundColorPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setDayBackgroundColor(new color_1.Color(data.newValue).android);
}
function todayBackgroundColorPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setTodayBackgroundColor(new color_1.Color(data.newValue).android);
}
function headerColumnBackgroundPropertyChanged(data) {
var wView = data.object;
if (!wView.android) {
return;
}
wView.android.setHeaderColumnBackgroundColor(new color_1.Color(data.newValue).android);
}
common.CalendarWeekView.eventTextColorProperty.metadata.onSetNativeValue = eventTextColorPropertyChanged;
common.CalendarWeekView.textSizeProperty.metadata.onSetNativeValue = textSizePropertyChanged;
common.CalendarWeekView.hourHeightProperty.metadata.onSetNativeValue = hourHeightPropertyChanged;
common.CalendarWeekView.headerColumnPaddingProperty.metadata.onSetNativeValue = headerColumnPaddingPropertyChanged;
common.CalendarWeekView.headerColumnTextColorProperty.metadata.onSetNativeValue = headerColumnTextColorPropertyChanged;
common.CalendarWeekView.headerRowPaddingProperty.metadata.onSetNativeValue = headerRowPaddingPropertyChanged;
common.CalendarWeekView.columnGapProperty.metadata.onSetNativeValue = columnGapPropertyChanged;
common.CalendarWeekView.noOfVisibleDaysProperty.metadata.onSetNativeValue = noOfVisibleDaysPropertyChanged;
common.CalendarWeekView.headerRowBackgroundColorProperty.metadata.onSetNativeValue = headerRowBackgroundColorPropertyChanged;
common.CalendarWeekView.dayBackgroundColorProperty.metadata.onSetNativeValue = dayBackgroundColorPropertyChanged;
common.CalendarWeekView.todayBackgroundColorProperty.metadata.onSetNativeValue = todayBackgroundColorPropertyChanged;
common.CalendarWeekView.headerColumnBackgroundProperty.metadata.onSetNativeValue = headerColumnBackgroundPropertyChanged;
global.moduleMerge(common, exports);
var WeekView = com.alamkanak.weekview.WeekView;
var CalendarWeekView = (function (_super) {
__extends(CalendarWeekView, _super);
function CalendarWeekView() {
var _this = _super.call(this) || this;
_this.eventsList = new java.util.ArrayList();
var context = application.android.context;
return _this;
}
Object.defineProperty(CalendarWeekView.prototype, "android", {
get: function () {
return this._android;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CalendarWeekView.prototype, "_nativeView", {
get: function () {
return this._android;
},
enumerable: true,
configurable: true
});
CalendarWeekView.prototype._createUI = function () {
var that = this;
this._android = new WeekView(this._context);
this._android.setOnEventClickListener(new com.alamkanak.weekview.WeekView.EventClickListener({
onEventClick: function (event, eventRect) {
console.log("in set on EventClickListener");
}
}));
this._android.setMonthChangeListener(new com.alamkanak.weekview.MonthLoader.MonthChangeListener({
onMonthChange: function (newYear, newMonth) {
return that.getEvents(newYear, newMonth);
}
}));
this._android.setEventLongPressListener(new com.alamkanak.weekview.WeekView.EventLongPressListener({
onEventLongPress: function (event, eventRect) {
console.log("in set on EventLongPressListener");
}
}));
this._android.setEmptyViewLongPressListener(new com.alamkanak.weekview.WeekView.EmptyViewLongPressListener({
onEmptyViewLongPress: function (time) {
console.log("in set on setEmptyViewLongPressListener");
}
}));
if (this.eventTextColor) {
this._android.setEventTextColor(new color_1.Color(this.eventTextColor).android);
}
if (this.textSize) {
this._android.setTextSize(this.textSize);
}
if (this.hourHeight) {
this._android.setHourHeight(this.hourHeight);
}
if (this.headerColumnPadding) {
this._android.setHeaderColumnPadding(this.headerColumnPadding);
}
if (this.headerColumnTextColor) {
this._android.setHeaderColumnTextColor(new color_1.Color(this.headerColumnTextColor).android);
}
if (this.headerRowPadding) {
this._android.setHeaderRowPadding(this.headerRowPadding);
}
if (this.columnGap) {
this._android.setColumnGap(this.columnGap);
}
if (this.noOfVisibleDays) {
this._android.setNumberOfVisibleDays(this.noOfVisibleDays);
}
if (this.headerRowBackgroundColor) {
this._android.setHeaderRowBackgroundColor(new color_1.Color(this.headerRowBackgroundColor).android);
}
if (this.dayBackgroundColor) {
this._android.setDayBackgroundColor(new color_1.Color(this.dayBackgroundColor).android);
}
if (this.todayBackgroundColor) {
this._android.setTodayBackgroundColor(new color_1.Color(this.todayBackgroundColor).android);
}
if (this.headerColumnBackground) {
this._android.setHeaderColumnBackgroundColor(new color_1.Color(this.headerColumnBackground).android);
}
};
CalendarWeekView.prototype.addEvent = function (id, name, startYear, startMonth, startDay, startHour, startMinute, endYear, endMonth, endDay, endHour, endMinute, eventColor) {
var event1 = new com.alamkanak.weekview.WeekViewEvent(id, name, startYear, startMonth, startDay, startHour, startMinute, endYear, endMonth, endDay, endHour, endMinute);
event1.setColor(new color_1.Color(eventColor).android);
this.eventsList.add(event1);
this._android.notifyDatasetChanged();
};
CalendarWeekView.prototype.getEvents = function (newYear, newMonth) {
var date = new Date();
this.events = new java.util.ArrayList();
if (this.eventsList.size() > 0) {
if (date.getFullYear() == newYear && date.getMonth() == newMonth) {
for (var i = 0; i < this.eventsList.size(); i++) {
this.events.add(this.eventsList.get(i));
}
}
}
return this.events;
};
return CalendarWeekView;
}(common.CalendarWeekView));
CalendarWeekView = __decorate([
Interfaces([com.alamkanak.weekview.MonthLoader.MonthChangeListener, com.alamkanak.weekview.WeekView.EventClickListener, com.alamkanak.weekview.WeekView.EventLongPressListener, com.alamkanak.weekview.WeekView.EmptyViewLongPressListener]),
__metadata("design:paramtypes", [])
], CalendarWeekView);
exports.CalendarWeekView = CalendarWeekView;
//# sourceMappingURL=calendar-weekview.android.js.map