summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2017-02-23 08:57:32 (GMT)
committerWonki Kim <wonki_.kim@samsung.com>2017-04-11 09:48:40 (GMT)
commit423597730ac2ee06f91d38e14672ff05ec3a1d99 (patch)
treefd367ae4336238ea2ed9d0645613ea7c112e7a41
parent1a91bb76968b3843326fdc14c9440ab60c40d45e (diff)
downloadefl-theme-tizen-mobile-423597730ac2ee06f91d38e14672ff05ec3a1d99.zip
efl-theme-tizen-mobile-423597730ac2ee06f91d38e14672ff05ec3a1d99.tar.gz
efl-theme-tizen-mobile-423597730ac2ee06f91d38e14672ff05ec3a1d99.tar.bz2
scroller: Support over-scroll effect on RTL moderefs/changes/57/124457/1
Because elm_layout flips it's relative automatically on RTL mode, current over-scroll effect doesn't work properly. this patch modify over-scroll related parts and program to work properly on RTL mode. Change-Id: I5b0033ee8d5a8b9607cf3a5a339bb88bd5168996 Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
-rw-r--r--mobile/widgets/scroller.edc281
1 files changed, 244 insertions, 37 deletions
diff --git a/mobile/widgets/scroller.edc b/mobile/widgets/scroller.edc
index dcdb8ed..7954daa 100644
--- a/mobile/widgets/scroller.edc
+++ b/mobile/widgets/scroller.edc
@@ -477,6 +477,7 @@ group { "elm/scroller/base/default";
public right_diff = 0, right_prev_diff = 0
public effect_right_down = 0, effect_right_start = 0, effect_right_reset = 0, effect_right_anim = 0;
public effect_right_end = 0, effect_right_move = 0, effect_right_max = 0;
+ public rtl_mode=0;
public timer0(val) {
new v;
v = get_int(sbvis_v);
@@ -1235,6 +1236,7 @@ group { "elm/scroller/base/handler";
public right_diff = 0, right_prev_diff = 0
public effect_right_down = 0, effect_right_start = 0, effect_right_reset = 0, effect_right_anim = 0;
public effect_right_end = 0, effect_right_move = 0, effect_right_max = 0;
+ public rtl_mode=0;
public timer0(val) {
new v;
v = get_int(sbvis_v);
@@ -1464,7 +1466,11 @@ group { "elm/scroller/base/effect";
if (!get_int(effect_##_dir##_end)) \
{ \
set_int(effect_##_dir##_end, 1); \
- run_program(PROGRAM:"edge_"#_dir"_end"); \
+ if (get_int(rtl_mode)) { \
+ run_program(PROGRAM:"edge_"#_dir"_rtl_end"); \
+ } else { \
+ run_program(PROGRAM:"edge_"#_dir"_ltr_end"); \
+ } \
} \
} \
} \
@@ -1478,36 +1484,55 @@ group { "elm/scroller/base/effect";
script { \
if (get_int(effect_##_dir##_start)) \
{ \
- set_state(PART:"shadow_"#_dir"1", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"1", "default", 0.0); \
- set_state(PART:"shadow_"#_dir"2", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"2", "default", 0.0); \
- set_state(PART:"shadow_"#_dir"3", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"3", "default", 0.0); \
- set_state(PART:"shadow_"#_dir"4", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"4", "default", 0.0); \
- set_state(PART:"shadow_"#_dir"5", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"5", "default", 0.0); \
- set_int(effect_##_dir##_reset, 0); \
- run_program(PROGRAM:"edge_"#_dir"_init"); \
+ if (get_int(rtl_mode)) { \
+ set_state(PART:"shadow_"#_dir"1", "default_rtl", 0.0); \
+ set_state(PART:"spacer_"#_dir"1", "default_rtl", 0.0); \
+ set_state(PART:"shadow_"#_dir"2", "default_rtl", 0.0); \
+ set_state(PART:"spacer_"#_dir"2", "default_rtl", 0.0); \
+ set_state(PART:"shadow_"#_dir"3", "default_rtl", 0.0); \
+ set_state(PART:"spacer_"#_dir"3", "default_rtl", 0.0); \
+ set_state(PART:"shadow_"#_dir"4", "default_rtl", 0.0); \
+ set_state(PART:"spacer_"#_dir"4", "default_rtl", 0.0); \
+ set_state(PART:"shadow_"#_dir"5", "default_rtl", 0.0); \
+ set_state(PART:"spacer_"#_dir"5", "default_rtl", 0.0); \
+ set_int(effect_##_dir##_reset, 0); \
+ run_program(PROGRAM:"edge_"#_dir"_rtl_init"); \
+ } else { \
+ set_state(PART:"shadow_"#_dir"1", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"1", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"2", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"2", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"3", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"3", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"4", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"4", "default", 0.0); \
+ set_state(PART:"shadow_"#_dir"5", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ set_int(effect_##_dir##_reset, 0); \
+ run_program(PROGRAM:"edge_"#_dir"_ltr_init"); \
+ }\
} \
} \
}
-#define SCROLL_EDGE_END_PROGRAM(_dir) \
- program { "edge_"#_dir"_end"; \
- action: STATE_SET "default"; \
+#define SCROLL_EDGE_END_PROGRAM_INTERNAL(_dir, _rtl) \
+ program { "edge_"#_dir#_rtl"_end"; \
+ action: STATE_SET "default"#_rtl; \
target: "shadow_"#_dir"1"; \
target: "shadow_"#_dir"2"; \
target: "shadow_"#_dir"3"; \
target: "shadow_"#_dir"4"; \
target: "shadow_"#_dir"5"; \
transition: SINUSOIDAL 0.3; \
- after: "edge_"#_dir"_init"; \
+ after: "edge_"#_dir#_rtl"_init"; \
}
-#define SCROLL_EDGE_INIT_PROGRAM(_dir) \
- program { "edge_"#_dir"_init"; \
+#define SCROLL_EDGE_END_PROGRAM(_dir) \
+ SCROLL_EDGE_END_PROGRAM_INTERNAL(_dir, _rtl) \
+ SCROLL_EDGE_END_PROGRAM_INTERNAL(_dir, _ltr)
+
+#define SCROLL_EDGE_INIT_PROGRAM_INTERNAL(_dir, _rtl) \
+ program { "edge_"#_dir#_rtl"_init"; \
script { \
set_int(effect_##_dir##_move, 0); \
if (!get_int(effect_##_dir##_reset)) \
@@ -1515,13 +1540,18 @@ group { "elm/scroller/base/effect";
set_int(effect_##_dir##_max, 0); \
set_int(_dir##_prev_diff, 0); \
set_int(effect_##_dir##_end, 0); \
- set_state(PART:"spacer_"#_dir"1", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"2", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"3", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"4", "default", 0.0); \
- set_state(PART:"spacer_"#_dir"5", "default", 0.0); \
+ set_state(PART:"spacer_"#_dir"1", "default"#_rtl, 0.0); \
+ set_state(PART:"spacer_"#_dir"2", "default"#_rtl, 0.0); \
+ set_state(PART:"spacer_"#_dir"3", "default"#_rtl, 0.0); \
+ set_state(PART:"spacer_"#_dir"4", "default"#_rtl, 0.0); \
+ set_state(PART:"spacer_"#_dir"5", "default"#_rtl, 0.0); \
} \
}
+
+#define SCROLL_EDGE_INIT_PROGRAM(_dir) \
+ SCROLL_EDGE_INIT_PROGRAM_INTERNAL(_dir, _rtl) \
+ SCROLL_EDGE_INIT_PROGRAM_INTERNAL(_dir, _ltr)
+
#define SCROLL_EDGE_PROGRAM(_dir) \
program { "edge_"#_dir; \
signal: "elm,edge,"#_dir; \
@@ -1531,25 +1561,33 @@ group { "elm/scroller/base/effect";
{ \
set_int(effect_##_dir##_start, 1); \
set_int(effect_##_dir##_anim, 1); \
- run_program(PROGRAM:"edge_"#_dir"_start"); \
+ if (get_int(rtl_mode)) { \
+ run_program(PROGRAM:"edge_"#_dir"_rtl_start");\
+ }else{\
+ run_program(PROGRAM:"edge_"#_dir"_ltr_start");\
+ }\
} \
} \
}
-#define SCROLL_EDGE_START_PROGRAM(_dir) \
- program { "edge_"#_dir"_start"; \
- action: STATE_SET "start"; \
+#define SCROLL_EDGE_START_PROGRAM_INTERNAL(_dir, _rtl) \
+ program { "edge_"#_dir#_rtl"_start"; \
+ action: STATE_SET "start"#_rtl; \
target: "shadow_"#_dir"1"; \
target: "shadow_"#_dir"2"; \
target: "shadow_"#_dir"3"; \
target: "shadow_"#_dir"4"; \
target: "shadow_"#_dir"5"; \
transition: SINUSOIDAL 0.2; \
- after: "edge_"#_dir"_after"; \
+ after: "edge_"#_dir#_rtl"_after"; \
}
-#define SCROLL_EDGE_AFTER_PROGRAM(_dir) \
- program { "edge_"#_dir"_after"; \
+#define SCROLL_EDGE_START_PROGRAM(_dir) \
+ SCROLL_EDGE_START_PROGRAM_INTERNAL(_dir, _rtl) \
+ SCROLL_EDGE_START_PROGRAM_INTERNAL(_dir, _ltr)
+
+#define SCROLL_EDGE_AFTER_PROGRAM_INTERNAL(_dir, _rtl) \
+ program { "edge_"#_dir#_rtl"_after"; \
script { \
new xx, yy; \
get_mouse(xx, yy); \
@@ -1566,12 +1604,16 @@ group { "elm/scroller/base/effect";
if (!get_int(effect_##_dir##_end)) \
{ \
set_int(effect_##_dir##_end, 1); \
- run_program(PROGRAM:"edge_"#_dir"_end"); \
+ run_program(PROGRAM:"edge_"#_dir#_rtl"_end"); \
} \
} \
} \
}
+#define SCROLL_EDGE_AFTER_PROGRAM(_dir) \
+ SCROLL_EDGE_AFTER_PROGRAM_INTERNAL(_dir, _rtl) \
+ SCROLL_EDGE_AFTER_PROGRAM_INTERNAL(_dir, _ltr)
+
#define SCROLL_EDGE_MOUSE_MOVE_PROGRAM_DIFF_VERNOR(_dir) \
set_int(_dir##_diff, (get_int(_dir##_move_y) - get_int(_dir##_down_y)));
@@ -1651,7 +1693,11 @@ group { "elm/scroller/base/effect";
if (!get_int(effect_##_dir##_end)) \
{ \
set_int(effect_##_dir##_end, 1); \
- run_program(PROGRAM:"edge_"#_dir"_end"); \
+ if (get_int(rtl_mode)) { \
+ run_program(PROGRAM:"edge_"#_dir"_rtl_end"); \
+ }else{ \
+ run_program(PROGRAM:"edge_"#_dir"_ltr_end"); \
+ } \
} \
} \
else \
@@ -1666,7 +1712,7 @@ group { "elm/scroller/base/effect";
fx3 = fx3 * SCROLLER_EFFECT_SHADOW_THIRD_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_THIRD_LAYER_MIN_SIZE; \
fx4 = fx4 * SCROLLER_EFFECT_SHADOW_FOURTH_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_FOURTH_LAYER_MIN_SIZE; \
fx5 = fx5 * SCROLLER_EFFECT_SHADOW_FIFTH_LAYER_MOVE_CORRECTION_VALUE + SCROLLER_EFFECT_SHADOW_FIFTH_LAYER_MIN_SIZE; \
- } \
+ } \
else \
{ \
set_int(effect_##_dir##_max, 1); \
@@ -1679,7 +1725,7 @@ group { "elm/scroller/base/effect";
SCROLL_EDGE_MOUSE_MOVE_PROGRAM_STATE_##_hor(_dir) \
} \
} \
- } \
+ } \
} \
}
@@ -1726,6 +1772,19 @@ group { "elm/scroller/base/effect";
max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
fixed: 1 0; \
} \
+ desc { "default_ltr"; \
+ inherit: "default"; \
+ } \
+ desc { "default_rtl"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ align: 1.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
+ fixed: 1 0; \
+ } \
}
#define SHADOW_PART_SPACER_right(_dir, _num, _NUM) \
spacer { "spacer_right"#_num; \
@@ -1740,6 +1799,19 @@ group { "elm/scroller/base/effect";
max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
fixed: 1 0; \
} \
+ desc { "default_ltr"; \
+ inherit: "default"; \
+ } \
+ desc { "default_rtl"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "bg"; \
+ align: 0.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MIN_SIZE -1; \
+ fixed: 1 0; \
+ } \
}
#define SHADOW_PART_RECT_top(_dir, _num, _NUM) \
rect { "shadow_top"#_num; \
@@ -1764,6 +1836,18 @@ group { "elm/scroller/base/effect";
rel2.to: "spacer_top"#_num; \
align: 0.5 1.0; \
} \
+ desc { "default_ltr"; \
+ inherit: "default"; \
+ } \
+ desc { "start_ltr"; \
+ inherit: "start"; \
+ } \
+ desc { "default_rtl"; \
+ inherit: "default"; \
+ } \
+ desc { "start_rtl"; \
+ inherit: "start"; \
+ } \
}
#define SHADOW_PART_RECT_bottom(_dir, _num, _NUM) \
rect { "shadow_bottom"#_num; \
@@ -1788,7 +1872,19 @@ group { "elm/scroller/base/effect";
rel2.to: "spacer_bottom"#_num; \
align: 0.5 0.0; \
} \
- }
+ desc { "default_ltr"; \
+ inherit: "default"; \
+ } \
+ desc { "start_ltr"; \
+ inherit: "start"; \
+ } \
+ desc { "default_rtl"; \
+ inherit: "default"; \
+ } \
+ desc { "start_rtl"; \
+ inherit: "start"; \
+ } \
+ }
#define SHADOW_PART_RECT_left(_dir, _num, _NUM) \
rect { "shadow_left"#_num; \
@@ -1814,6 +1910,32 @@ group { "elm/scroller/base/effect";
rel2.to: "spacer_left"#_num; \
align: 1.0 0.5; \
} \
+ desc { "default_ltr"; \
+ inherit: "default"; \
+ } \
+ desc { "start_ltr"; \
+ inherit: "start"; \
+ } \
+ desc { "default_rtl"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "bg"; \
+ rel2.offset: -1 -1; \
+ align: 0.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE -1; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 1 0; \
+ } \
+ desc { "start_rtl"; \
+ inherit: "default_rtl"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "spacer_left"#_num; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "spacer_left"#_num; \
+ align: 0.0 0.5; \
+ } \
}
#define SHADOW_PART_RECT_right(_dir, _num, _NUM) \
@@ -1840,6 +1962,32 @@ group { "elm/scroller/base/effect";
rel2.to: "spacer_right"#_num; \
align: 0.0 0.5; \
} \
+ desc { "default_ltr"; \
+ inherit:"default"; \
+ } \
+ desc { "start_ltr"; \
+ inherit: "start"; \
+ } \
+ desc { "default_rtl"; \
+ rel1.relative: 0.0 0.0; \
+ rel1.to: "bg"; \
+ rel2.relative: 0.0 1.0; \
+ rel2.to: "bg"; \
+ rel2.offset: -1 -1; \
+ align: 1.0 0.5; \
+ min: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE 0; \
+ max: SCROLLER_EFFECT_SHADOW_##_NUM##_LAYER_MAX_SIZE -1; \
+ color_class: "scroller/default/end_effect"; \
+ fixed: 1 0; \
+ } \
+ desc { "start_rtl"; \
+ inherit: "default_rtl"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.to: "spacer_right"#_num; \
+ rel2.relative: 1.0 1.0; \
+ rel2.to: "spacer_right"#_num; \
+ align: 1.0 0.5; \
+ } \
}
#define SHADOW_PART_LAYER(_dir, _num, _NUM) \
@@ -1852,8 +2000,65 @@ group { "elm/scroller/base/effect";
SHADOW_PART_LAYER(_dir, 3, THIRD) \
SHADOW_PART_LAYER(_dir, 4, FOURTH) \
SHADOW_PART_LAYER(_dir, 5, FIFTH)
-// Macro END
+#define SHADOW_MIRRORED_PROGRAM \
+ program { "rtl_mirrored"; \
+ signal: "edje,state,rtl"; \
+ source: "edje"; \
+ script { \
+ set_int(rtl_mode, 1); \
+ set_state(PART:"spacer_left1", "default_rtl", 0.0); \
+ set_state(PART:"spacer_left2", "default_rtl", 0.0); \
+ set_state(PART:"spacer_left3", "default_rtl", 0.0); \
+ set_state(PART:"spacer_left4", "default_rtl", 0.0); \
+ set_state(PART:"spacer_left5", "default_rtl", 0.0); \
+ set_state(PART:"spacer_right1", "default_rtl", 0.0); \
+ set_state(PART:"spacer_right2", "default_rtl", 0.0); \
+ set_state(PART:"spacer_right3", "default_rtl", 0.0); \
+ set_state(PART:"spacer_right4", "default_rtl", 0.0); \
+ set_state(PART:"spacer_right5", "default_rtl", 0.0); \
+ set_state(PART:"shadow_left1", "default_rtl", 0.0); \
+ set_state(PART:"shadow_left2", "default_rtl", 0.0); \
+ set_state(PART:"shadow_left3", "default_rtl", 0.0); \
+ set_state(PART:"shadow_left4", "default_rtl", 0.0); \
+ set_state(PART:"shadow_left5", "default_rtl", 0.0); \
+ set_state(PART:"shadow_right1", "default_rtl", 0.0); \
+ set_state(PART:"shadow_right2", "default_rtl", 0.0); \
+ set_state(PART:"shadow_right3", "default_rtl", 0.0); \
+ set_state(PART:"shadow_right4", "default_rtl", 0.0); \
+ set_state(PART:"shadow_right5", "default_rtl", 0.0); \
+ } \
+ } \
+ program { "ltr_mirrored"; \
+ signal: "edje,state,ltr"; \
+ source: "edje"; \
+ script { \
+ set_int(rtl_mode, 0); \
+ set_state(PART:"spacer_left1", "default", 0.0); \
+ set_state(PART:"spacer_left2", "default", 0.0); \
+ set_state(PART:"spacer_left3", "default", 0.0); \
+ set_state(PART:"spacer_left4", "default", 0.0); \
+ set_state(PART:"spacer_left5", "default", 0.0); \
+ set_state(PART:"spacer_right1", "default", 0.0); \
+ set_state(PART:"spacer_right2", "default", 0.0); \
+ set_state(PART:"spacer_right3", "default", 0.0); \
+ set_state(PART:"spacer_right4", "default", 0.0); \
+ set_state(PART:"spacer_right5", "default", 0.0); \
+ set_state(PART:"shadow_left1", "default", 0.0); \
+ set_state(PART:"shadow_left2", "default", 0.0); \
+ set_state(PART:"shadow_left3", "default", 0.0); \
+ set_state(PART:"shadow_left4", "default", 0.0); \
+ set_state(PART:"shadow_left5", "default", 0.0); \
+ set_state(PART:"shadow_right1", "default", 0.0); \
+ set_state(PART:"shadow_right2", "default", 0.0); \
+ set_state(PART:"shadow_right3", "default", 0.0); \
+ set_state(PART:"shadow_right4", "default", 0.0); \
+ set_state(PART:"shadow_right5", "default", 0.0); \
+ } \
+ }
+
+
+// Macro END
parts {
SHADOW_PART(top)
SHADOW_PART(bottom)
@@ -1934,6 +2139,7 @@ group { "elm/scroller/base/effect";
SCROLL_EDGE_START_PROGRAM(right)
SCROLL_EDGE_AFTER_PROGRAM(right)
SCROLL_EDGE_PROGRAM(right)
+ SHADOW_MIRRORED_PROGRAM
} // programs
}
@@ -2075,6 +2281,7 @@ group { "elm/scroller/base/handler/effect";
SCROLL_EDGE_START_PROGRAM(right)
SCROLL_EDGE_AFTER_PROGRAM(right)
SCROLL_EDGE_PROGRAM(right)
+ SHADOW_MIRRORED_PROGRAM
}
}