summaryrefslogtreecommitdiff
path: root/alarm-app/res/alert/edje/alert-layout.edc
blob: a1a33ed192bba495ca0ab86f87699e0f995f9b0c (plain)
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
/*
 * Copyright 2017 Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://floralicense.org/license/
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "AlertLayout.h"

#define TRANSITION_GLIDE(duration) CUBIC_BEZIER (duration) 0.25 0.46 0.45 1.0

#define ARROW_WH     24

#define ARROW1_LR    68
#define ARROW1_T     57
#define ARROW1_TIME  0.23

#define ARROW2_LR    49
#define ARROW2_T     75
#define ARROW2_TIME  0.26

#define ARROW3_LR    35
#define ARROW3_T     96
#define ARROW3_TIME  0.30

#define ARROW4_LR    25
#define ARROW4_T     119
#define ARROW4_TIME  0.16

#define BTN_LR       6
#define BTN_WH       50
#define BTN_FULL_WH  480
#define BTN_TIME     0.2

#define ICON_T       106
#define ICON_WH      80

#define TEXT_LR      70

#define TIME_T       9
#define TIME_H       52

#define ORIG_TIME_T  4
#define ORIG_TIME_H  37

#define ARROW_PART(NAME, SIDE, ICON_PATH, MIRRORED_ICON_PATH, POS_X, POS_Y, ALIGN_X) \
	spacer { "spacer."NAME"."SIDE"_top"; scale; \
		desc { "default"; \
			fixed: 1 1; \
			min: POS_X POS_Y; \
			align: ALIGN_X 0.0; \
			rel1 { relative: ALIGN_X 0.0; to_x: "spacer."SIDE; } \
			rel2 { relative: ALIGN_X 0.0; to_x: "spacer."SIDE; } \
		} \
	} \
	image { "image."NAME"_"SIDE; scale; \
		images { \
			image: ICON_PATH COMP; \
			image: MIRRORED_ICON_PATH COMP; \
		} \
		clip: "clipper."NAME"_"SIDE; \
		desc { "default"; \
			fixed: 1 1; \
			min: ARROW_WH ARROW_WH; \
			align: ALIGN_X 0.0; \
			rel1 { relative: (1.0-ALIGN_X) 1.0; to: "spacer."NAME"."SIDE"_top"; } \
			rel2 { relative: (1.0-ALIGN_X) 1.0; to: "spacer."NAME"."SIDE"_top"; } \
			image.normal: ICON_PATH; \
		} \
		desc { "mirrored"; inherit; \
			image.normal: MIRRORED_ICON_PATH; \
		} \
	} \
	rect { "clipper."NAME"_"SIDE; \
		clip: "clipper.arrows_"SIDE; \
		desc { "default"; \
			rel.to: "image."NAME"_"SIDE; \
			color: 255 255 255 64; \
		} \
		desc { "active"; \
			rel.to: "image."NAME"_"SIDE; \
			color: 255 255 255 255; \
		} \
	}

#define ARROW_PROGRAM(ARROW_NAME, NEXT_ARROW_NAME, DURATION_IN, DURATION_OUT) \
	program { \
		name: "activate_"ARROW_NAME; \
		action: STATE_SET "active"; \
		targets: "clipper."ARROW_NAME"_left" "clipper."ARROW_NAME"_right"; \
		transition: LINEAR DURATION_IN; \
		after: "deactivate_"ARROW_NAME; \
		after: "activate_"NEXT_ARROW_NAME; \
	} \
	program { \
		name: "deactivate_"ARROW_NAME; \
		action: STATE_SET "default"; \
		targets: "clipper."ARROW_NAME"_left" "clipper."ARROW_NAME"_right"; \
		transition: LINEAR DURATION_OUT; \
	} \
	program { \
		signal: "edje,state,rtl"; \
		source: "edje"; \
		action: STATE_SET "mirrored"; \
		targets: "image."ARROW_NAME"_left" "image."ARROW_NAME"_right"; \
	} \
	program { \
		signal: "edje,state,ltr"; \
		source: "edje"; \
		action: STATE_SET "default"; \
		targets: "image."ARROW_NAME"_left" "image."ARROW_NAME"_right"; \
	}

styles {
	style {
		name: "time";
		base: "font=Tizen:style=Regular font_size=40 align=center color=#ccc";
	}
	style {
		name: "orig_time";
		base: "font=Tizen:style=Regular font_size=28 align=center color=#ccc";
	}
}

collections {
	base_scale: 1.3;

	group { LAYOUT_ALERT;
		parts {
			ARROW_PART("arrow1", "left", PATH_ICON_ARROW1_L, PATH_ICON_ARROW1_R, ARROW1_LR, ARROW1_T, 0.0)
			ARROW_PART("arrow2", "left", PATH_ICON_ARROW2_L, PATH_ICON_ARROW2_R, ARROW2_LR, ARROW2_T, 0.0)
			ARROW_PART("arrow3", "left", PATH_ICON_ARROW3_L, PATH_ICON_ARROW3_R, ARROW3_LR, ARROW3_T, 0.0)
			ARROW_PART("arrow4", "left", PATH_ICON_ARROW4_L, PATH_ICON_ARROW4_R, ARROW4_LR, ARROW4_T, 0.0)

			ARROW_PART("arrow1", "right", PATH_ICON_ARROW1_R, PATH_ICON_ARROW1_L, ARROW1_LR, ARROW1_T, 1.0)
			ARROW_PART("arrow2", "right", PATH_ICON_ARROW2_R, PATH_ICON_ARROW2_L, ARROW2_LR, ARROW2_T, 1.0)
			ARROW_PART("arrow3", "right", PATH_ICON_ARROW3_R, PATH_ICON_ARROW3_L, ARROW3_LR, ARROW3_T, 1.0)
			ARROW_PART("arrow4", "right", PATH_ICON_ARROW4_R, PATH_ICON_ARROW4_L, ARROW4_LR, ARROW4_T, 1.0)

			rect { "clipper.arrows_left";
				desc { "default";
					rel1 { to_x: "image.arrow4_left"; to_y: "image.arrow1_left"; }
					rel2 { to_x: "image.arrow1_left"; to_y: "image.arrow4_left"; }
					color_class: "layout/"LAYOUT_ALERT"/"COLOR_CLASS_DISMISS_VISIBLE;
				}
				desc { "hidden";
					inherit: "default";
					color_class: "layout/"LAYOUT_ALERT"/"COLOR_CLASS_DISMISS_HIDDEN;
				}
			}
			rect { "clipper.arrows_right";
				desc { "default";
					rel1.to: "image.arrow1_right";
					rel2.to: "image.arrow4_right";
					color_class: "layout/"LAYOUT_ALERT"/"COLOR_CLASS_SNOOZE_VISIBLE;
				}
				desc { "hidden";
					inherit: "default";
					color_class: "layout/"LAYOUT_ALERT"/"COLOR_CLASS_SNOOZE_HIDDEN;
				}
			}
			spacer { "spacer.left"; scale;
				desc { "default";
					fixed: 1 0;
					align: 1.0 0.5;
					rel2.relative: 0.0 1.0;
				}
				desc { "hidden";
					inherit: "default";
					min: (BTN_LR+BTN_WH) 0;
				}
			}
			spacer { "spacer.right"; scale;
				desc { "default";
					fixed: 1 0;
					align: 0.0 0.5;
					rel1.relative: 1.0 0.0;
				}
				desc { "hidden";
					inherit: "default";
					min: (BTN_LR+BTN_WH) 0;
				}
			}
			spacer { "spacer.icon.top"; scale;
				desc { "default";
					fixed: 0 1;
					min: 0 ICON_T;
					align: 0.5 0.0;
					rel2.relative: 1.0 0.0;
				}
			}
			image { "image.icon"; scale;
				images.image: PATH_ICON_ALERT COMP;
				desc { "default";
					fixed: 1 1;
					min: ICON_WH ICON_WH;
					align: 0.5 0.0;
					rel1 { relative: 0.5 1.0; to_y: "spacer.icon.top"; }
					rel2 { relative: 0.5 1.0; to_y: "spacer.icon.top"; }
					image.normal: PATH_ICON_ALERT;
				}
			}
			spacer { "spacer.text.left"; scale;
				desc { "default";
					fixed: 1 0;
					min: TEXT_LR 0;
					align: 0.0 0.5;
					rel2.relative: 0.0 1.0;
				}
			}
			spacer { "spacer.text.right"; scale;
				desc { "default";
					fixed: 1 0;
					min: TEXT_LR 0;
					align: 1.0 0.5;
					rel1.relative: 1.0 0.0;
				}
			}
			spacer { "spacer.time.top"; scale;
				desc { "default";
					fixed: 0 1;
					min: 0 TIME_T;
					align: 0.5 0.0;
					rel1 { relative: 0.0 1.0; to_y: "image.icon"; }
					rel2 { relative: 1.0 1.0; to_y: "image.icon"; }
				}
			}
			textblock { PART_TIME; scale;
				desc { "default";
					fixed: 0 1;
					min: 0 TIME_H;
					align: 0.5 0.0;
					rel1 { relative: 1.0 1.0; to_x: "spacer.text.left"; to_y: "spacer.time.top"; }
					rel2 { relative: 0.0 1.0; to_x: "spacer.text.right"; to_y: "spacer.time.top"; }
					text.style: "time";
				}
			}
			spacer { "spacer.orig_time.top"; scale;
				desc { "default";
					fixed: 0 1;
					min: 0 ORIG_TIME_T;
					align: 0.5 1.0;
					rel1 { relative: 0.0 1.0; to_y: PART_TIME; }
					rel2 { relative: 1.0 1.0; to_y: PART_TIME; }
				}
			}
			textblock { PART_ORIG_TIME; scale;
				desc { "default";
					fixed: 0 1;
					min: 0 ORIG_TIME_H;
					align: 0.5 0.0;
					rel1 { relative: 1.0 0.0; to_x: "spacer.text.left"; to_y: "spacer.orig_time.top"; }
					rel2 { relative: 0.0 0.0; to_x: "spacer.text.right"; to_y: "spacer.orig_time.top"; }
					text.style: "orig_time";
				}
			}
			spacer { "spacer.dismiss.left"; scale;
				desc { "default";
					fixed: 1 0;
					min: (BTN_LR+BTN_WH/2) 0;
					align: 0.0 0.5;
					rel1 { relative: 0.0 0.0; to_x: "spacer.left"; }
					rel2 { relative: 0.0 1.0; to_x: "spacer.left"; }
				}
			}
			swallow { PART_BUTTON_DISMISS; scale;
				desc { "default";
					fixed: 1 1;
					min: BTN_FULL_WH BTN_FULL_WH;
					rel1 { relative: 1.0 0.5; to_x: "spacer.dismiss.left"; }
					rel2 { relative: 1.0 0.5; to_x: "spacer.dismiss.left"; }
				}
			}
			spacer { "spacer.snooze.right"; scale;
				desc { "default";
					fixed: 1 0;
					min: (BTN_LR+BTN_WH/2) 0;
					align: 1.0 0.5;
					rel1 { relative: 1.0 0.0; to_x: "spacer.right"; }
					rel2 { relative: 1.0 1.0; to_x: "spacer.right"; }
				}
			}
			swallow { PART_BUTTON_SNOOZE; scale;
				desc { "default";
					fixed: 1 1;
					min: BTN_FULL_WH BTN_FULL_WH;
					rel1 { relative: 0.0 0.5; to_x: "spacer.snooze.right"; }
					rel2 { relative: 0.0 0.5; to_x: "spacer.snooze.right"; }
				}
			}
		}
		programs {
			program {
				signal: "load";
				source: "*";
				after: "activate_arrow4";
			}
			ARROW_PROGRAM("arrow4", "arrow3", ARROW4_TIME, ARROW3_TIME)
			ARROW_PROGRAM("arrow3", "arrow2", ARROW3_TIME, ARROW2_TIME)
			ARROW_PROGRAM("arrow2", "arrow1", ARROW2_TIME, ARROW1_TIME)
			ARROW_PROGRAM("arrow1", "arrow4", ARROW1_TIME, ARROW4_TIME)
			program {
				signal: SIGNAL_DISMISS_SHOW;
				source: "*";
				action: STATE_SET "default";
				targets: "clipper.arrows_left" "clipper.arrows_right" "spacer.left";
				transition: TRANSITION_GLIDE(BTN_TIME);
			}
			program {
				signal: SIGNAL_DISMISS_HIDE;
				source: "*";
				action: STATE_SET "hidden";
				targets: "clipper.arrows_left" "clipper.arrows_right" "spacer.left";
				transition: TRANSITION_GLIDE(BTN_TIME);
			}
			program {
				signal: SIGNAL_SNOOZE_SHOW;
				source: "*";
				action: STATE_SET "default";
				targets: "clipper.arrows_left" "clipper.arrows_right" "spacer.right";
				transition: TRANSITION_GLIDE(BTN_TIME);
			}
			program {
				signal: SIGNAL_SNOOZE_HIDE;
				source: "*";
				action: STATE_SET "hidden";
				targets: "clipper.arrows_left" "clipper.arrows_right" "spacer.right";
				transition: TRANSITION_GLIDE(BTN_TIME);
			}
		}
	}
}