summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Kyryliuk <s.kyryliuk@partner.samsung.com>2017-02-24 17:06:54 +0200
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-02-28 07:31:38 -0800
commit35f3dbc5d02a28ec42f94880e987ccc8bdf86313 (patch)
tree29c59c0441d03d035cd39d3ba99745169385fe35
parent0e72a934e4787deed1cb67d2131bbebd5d652b38 (diff)
downloadalarm-35f3dbc5d02a28ec42f94880e987ccc8bdf86313.tar.gz
alarm-35f3dbc5d02a28ec42f94880e987ccc8bdf86313.tar.bz2
alarm-35f3dbc5d02a28ec42f94880e987ccc8bdf86313.zip
TizenRefApp-8076 Implement screen reader support for No Alarms view
Change-Id: I1299d57ba6d9289cea261a4a0fb1b9716e8f273c Signed-off-by: Sergii Kyryliuk <s.kyryliuk@partner.samsung.com>
-rw-r--r--alarm-app/res/list/edje/ListPath.h3
-rw-r--r--alarm-app/res/list/edje/add-button-style.edc110
-rw-r--r--alarm-app/res/list/edje/list-layout.edc89
-rw-r--r--alarm-app/src/AlarmApp.cpp3
-rw-r--r--alarm-app/src/List/AlarmsView.cpp15
5 files changed, 144 insertions, 76 deletions
diff --git a/alarm-app/res/list/edje/ListPath.h b/alarm-app/res/list/edje/ListPath.h
index 6f591d0..a0bd3a0 100644
--- a/alarm-app/res/list/edje/ListPath.h
+++ b/alarm-app/res/list/edje/ListPath.h
@@ -22,12 +22,13 @@
#define PATH_LIST_ITEM_STYLE LIST_EDJ_DIR"list-item-style.edj"
#define PATH_LIST_LAYOUT LIST_EDJ_DIR"list-layout.edj"
+#define PATH_ADD_BUTTON_STYLE LIST_EDJ_DIR"add-button-style.edj"
#define PATH_ICON_ADD_ALARM LIST_IMG_DIR"alarm_no_alarm_icon.png"
#define PATH_NO_ALARMS_BG LIST_IMG_DIR"tw_no_item_bg.png"
#define STYLE_ITEM_BOTTOM_BUTTON "bottom_button"
#define LAYOUT_NO_ALARMS "no_alarms"
-#define LAYOUT_ADD_ALARM "add_alarm"
+#define STYLE_BUTTON_ADD_ALARM "add_alarm"
#endif /* LIST_PATH_H */
diff --git a/alarm-app/res/list/edje/add-button-style.edc b/alarm-app/res/list/edje/add-button-style.edc
new file mode 100644
index 0000000..d3843c5
--- /dev/null
+++ b/alarm-app/res/list/edje/add-button-style.edc
@@ -0,0 +1,110 @@
+/*
+ * 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 "ListPath.h"
+
+#define ICON_WH 98
+
+#define TEXT_T 8
+#define TEXT_H 74
+#define TEXT_LR 60
+
+styles {
+ style {
+ name: "no_alarms_text";
+ base: "font=Tizen:style=Regular font_size=27 align=center color=#fff";
+ }
+}
+
+collections {
+ base_scale: 1.3;
+
+ group { "elm/button/base/"STYLE_BUTTON_ADD_ALARM;
+ parts {
+ image { "image"; scale;
+ images.image: PATH_ICON_ADD_ALARM COMP;
+ desc { "default";
+ fixed: 1 1;
+ min: ICON_WH ICON_WH;
+ align: 0.5 0.0;
+ rel1.relative: 0.5 0.0;
+ rel2.relative: 0.5 0.0;
+ image.normal: PATH_ICON_ADD_ALARM;
+ }
+ desc { "pressed";
+ inherit: "default";
+ color: 255 255 255 179;
+ }
+ }
+ spacer { "spacer.text.top"; scale;
+ desc { "default";
+ fixed: 0 1;
+ min: 0 TEXT_T;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to_y: "image"; }
+ rel2 { relative: 1.0 1.0; to_y: "image"; }
+ }
+ }
+ 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;
+ }
+ }
+ textblock { "elm.text"; scale;
+ desc { "default";
+ min: 0 TEXT_H;
+ rel1 { relative: 1.0 1.0; to_x: "spacer.text.left"; to_y: "spacer.text.top"; }
+ rel2 { relative: 0.0 1.0; to_x: "spacer.text.right"; }
+ text {
+ min: 1 0;
+ ellipsis: -1;
+ style: "no_alarms_text";
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,down,*";
+ source: "*";
+ action: STATE_SET "pressed";
+ target: "image";
+ }
+ program {
+ signal: "mouse,up,*";
+ source: "*";
+ action: STATE_SET "default";
+ target: "image";
+ }
+ program {
+ signal: "mouse,clicked,*";
+ source: "*";
+ action: SIGNAL_EMIT "elm,action,click" "";
+ }
+ }
+ }
+}
diff --git a/alarm-app/res/list/edje/list-layout.edc b/alarm-app/res/list/edje/list-layout.edc
index 454c2fe..0af566d 100644
--- a/alarm-app/res/list/edje/list-layout.edc
+++ b/alarm-app/res/list/edje/list-layout.edc
@@ -19,66 +19,21 @@
#define TITLE_T 51
#define TITLE_H 39
-#define ICON_R 5
#define ICON_T (25+16)
-#define ICON_WH 98
-#define TEXT_T 8
-#define TEXT_H 74
+
+#define TITLE_LR 64
styles {
style {
name: "no_alarms_title";
base: "font=Tizen:style=Bold font_size=30 align=center color=#4dcfff";
}
- style {
- name: "no_alarms_text";
- base: "font=Tizen:style=Regular font_size=27 align=center color=#fff";
- }
}
collections {
base_scale: 1.3;
- group { LAYOUT_ADD_ALARM;
- parts {
- spacer { "spacer.right"; scale;
- desc { "default";
- fixed: 1 0;
- min: ICON_R 0;
- align: 1.0 0.5;
- rel1.relative: 1.0 0.0;
- }
- }
- image { "image"; scale;
- images.image: PATH_ICON_ADD_ALARM COMP;
- desc { "default";
- min: ICON_WH ICON_WH;
- rel2 { relative: 0.0 1.0; to_x: "spacer.right"; }
- image.normal: PATH_ICON_ADD_ALARM;
- }
- desc { "pressed";
- inherit: "default";
- color: 255 255 255 179;
- }
- }
- }
- programs {
- program {
- signal: "mouse,down,*";
- source: "*";
- action: STATE_SET "pressed";
- target: "image";
- }
- program {
- signal: "mouse,up,*";
- source: "*";
- action: STATE_SET "default";
- target: "image";
- }
- }
- }
-
group { LAYOUT_NO_ALARMS;
parts {
image { "image.bg";
@@ -96,13 +51,28 @@ collections {
rel2.relative: 1.0 0.0;
}
}
+ spacer { "spacer.title.left"; scale;
+ desc { "default";
+ fixed: 1 0;
+ min: TITLE_LR 0;
+ align: 0.0 0.5;
+ rel2.relative: 0.0 1.0;
+ }
+ }
+ spacer { "spacer.title.right"; scale;
+ desc { "default";
+ fixed: 1 0;
+ min: TITLE_LR 0;
+ align: 1.0 0.5;
+ rel1.relative: 1.0 0.0;
+ }
+ }
textblock { "elm.text.title"; scale;
desc { "default";
- fixed: 0 1;
min: 0 TITLE_H;
align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to_y: "spacer.title.top"; }
- rel2 { relative: 1.0 1.0; to_y: "spacer.title.top"; }
+ rel1 { relative: 1.0 1.0; to_x: "spacer.title.left"; to_y: "spacer.title.top"; }
+ rel2 { relative: 0.0 1.0; to_x: "spacer.title.right"; to_y: "spacer.title.top"; }
text.style: "no_alarms_title";
}
}
@@ -123,25 +93,6 @@ collections {
rel2 { relative: 0.5 1.0; to_y: "spacer.icon.top"; }
}
}
- spacer { "spacer.text.top"; scale;
- desc { "default";
- fixed: 0 1;
- min: 0 TEXT_T;
- align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to_y: "elm.swallow.icon"; }
- rel2 { relative: 1.0 1.0; to_y: "elm.swallow.icon"; }
- }
- }
- textblock { "elm.text"; scale;
- desc { "default";
- fixed: 0 1;
- min: 0 TEXT_H;
- align: 0.5 0.0;
- rel1 { relative: 0.0 1.0; to_y: "spacer.text.top"; }
- rel2 { relative: 1.0 1.0; to_y: "spacer.text.top"; }
- text.style: "no_alarms_text";
- }
- }
}
}
}
diff --git a/alarm-app/src/AlarmApp.cpp b/alarm-app/src/AlarmApp.cpp
index 073c137..d668a95 100644
--- a/alarm-app/src/AlarmApp.cpp
+++ b/alarm-app/src/AlarmApp.cpp
@@ -58,9 +58,12 @@ bool AlarmApp::onCreate()
elm_theme_extension_add(nullptr, App::getResourcePath(PATH_LIST_ITEM_STYLE).c_str());
elm_theme_extension_add(nullptr, App::getResourcePath(PATH_ALARM_CHECK_STYLE).c_str());
elm_theme_extension_add(nullptr, App::getResourcePath(PATH_ALERT_BUTTON_STYLE).c_str());
+ elm_theme_extension_add(nullptr, App::getResourcePath(PATH_ADD_BUTTON_STYLE).c_str());
Application::onCreate();
getWindow()->setRotationEnabled(true);
+ elm_atspi_accessible_translation_domain_set(getWindow()->getEvasObject(), TEXT_DOMAIN);
+ elm_atspi_accessible_name_set(getWindow()->getEvasObject(), "WDS_ALM_HEADER_ALARM_ABB");
return true;
}
diff --git a/alarm-app/src/List/AlarmsView.cpp b/alarm-app/src/List/AlarmsView.cpp
index dab13cd..088b5a0 100644
--- a/alarm-app/src/List/AlarmsView.cpp
+++ b/alarm-app/src/List/AlarmsView.cpp
@@ -160,7 +160,13 @@ Evas_Object *AlarmsView::createNoContents(Evas_Object *parent)
Evas_Object *layout = elm_layout_add(parent);
elm_layout_file_set(layout, App::getResourcePath(PATH_LIST_LAYOUT).c_str(), LAYOUT_NO_ALARMS);
elm_object_translatable_part_text_set(layout, "elm.text.title", "WDS_ALM_HEADER_ALARM_ABB");
- elm_object_translatable_part_text_set(layout, "elm.text", "WDS_ALM_OPT_ADD_ALARM_ABB");
+
+ Evas_Object *edje = elm_layout_edje_get(layout);
+ Evas_Object *title = elm_access_object_register((Evas_Object *) edje_object_part_object_get(edje, "elm.text.title"), layout);
+ elm_atspi_accessible_role_set(title, ELM_ATSPI_ROLE_HEADER);
+ elm_atspi_accessible_translation_domain_set(title, TEXT_DOMAIN);
+ elm_atspi_accessible_name_set(title, "WDS_ALM_HEADER_ALARM_ABB");
+
elm_object_part_content_set(layout, "elm.swallow.icon", createAddButton(layout));
return layout;
@@ -169,14 +175,11 @@ Evas_Object *AlarmsView::createNoContents(Evas_Object *parent)
Evas_Object *AlarmsView::createAddButton(Evas_Object *parent)
{
Evas_Object *button = elm_button_add(parent);
- elm_object_style_set(button, "transparent");
+ elm_object_style_set(button, STYLE_BUTTON_ADD_ALARM);
+ elm_object_translatable_text_set(button, "WDS_ALM_OPT_ADD_ALARM_ABB");
evas_object_smart_callback_add(button, "clicked",
(Evas_Smart_Cb) makeCallback(&AlarmsView::onAddPressed), this);
- Evas_Object *image = elm_layout_add(button);
- elm_layout_file_set(image, App::getResourcePath(PATH_LIST_LAYOUT).c_str(), LAYOUT_ADD_ALARM);
- elm_object_content_set(button, image);
-
return button;
}