Switching panes in EDC file
This code snippet shows how to change application layout by switching panes in the runtime.
//layout definitions in .edc file
collections{
group {
name: "button_left";
parts {
part { name: "button_left";
type: EXTERNAL;
source: "elm/button";
description {
state: "default" 0.0;
params {
string: "label" "pane left";
}
}
}
}
}
group {
name: "button_right";
parts {
part { name: "button_right";
type: EXTERNAL;
source: "elm/button";
description {
state: "default" 0.0;
params {
string: "label" "pane right";
}
}
}
}
}
group {
name: "main";
parts {
part { name: "panes";
type: EXTERNAL;
source: "elm/panes";
description {
state: "default" 0.0;
rel1.relative: 0 0;
rel2.relative: 1 1;
params {
string: "content left" "button_left";
string: "content right" "button_right";
}
}
description {
state: "second_layout" 0.0;
rel1.relative: 0 0;
rel2.relative: 1 1;
params {
string: "content left" "button_right";
string: "content right" "button_left";
}
}
}
}
programs {
program { name: "switch_layout";
signal: "animation,play";
source: "switch_layout";
action: STATE_SET "second_layout" 0.0;
target: "panes";
}
}
}
}
//C code for triggering switch animation
void switch_layout(appdata_s* ad){
Evas_Object *edje_layout = elm_layout_edje_get(ad->layout);
edje_object_signal_emit(edje_layout, "animation,play", "switch_layout");
}