TizenRefApp-6819 Implement special NavigatorPage for Contacts-Groups navigator 23/83423/2
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Wed, 10 Aug 2016 14:40:41 +0000 (17:40 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Thu, 11 Aug 2016 11:16:51 +0000 (04:16 -0700)
Change-Id: I2f61f7f67055a49350594c5175b0f65021177051
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
lib-contacts/inc/Contacts/Chooser/ContactsGroupsNavigator.h
lib-contacts/res/list/CMakeLists.txt
lib-contacts/res/list/edje/ChooserTitleLayout.h [new file with mode: 0644]
lib-contacts/res/list/edje/ListPath.h
lib-contacts/res/list/edje/chooser-title-layout.edc [new file with mode: 0644]
lib-contacts/src/Contacts/Chooser/ContactsGroupsNavigator.cpp

index f6527a9..93afb8b 100644 (file)
@@ -48,10 +48,13 @@ namespace Contacts
                        void addGroupsView(Ux::SelectView *view);
 
                protected:
+                       virtual void onCreated() override;
+                       virtual void onPageAttached(Ui::NavigatorPage *page) override;
                        virtual Ui::TabPage *createPage(Ui::View *view, Elm_Object_Item *item) override;
 
                        Ux::SelectView *m_ContactsView;
                        Ux::SelectView *m_GroupsView;
+                       Evas_Object *m_TitleLayout;
                };
        }
 }
index 279ab46..87bdd9d 100644 (file)
@@ -1,4 +1,18 @@
+set(EDC_FILES chooser-title-layout.edc)
 set(EDJ_DIR "${RES_DIR}/list/edje")
 set(IMG_DIR "${RES_DIR}/list/images")
 
+foreach(EDC_FILE ${EDC_FILES})
+       get_filename_component(EDJ_FILE ${EDC_FILE} NAME_WE)
+       set(EDJ_FILE ${EDJ_FILE}.edj)
+
+       add_custom_target(${EDJ_FILE}
+               COMMAND edje_cc -id .. edje/${EDC_FILE} ${EDJ_FILE}
+               DEPENDS edje/${EDC_FILE}
+       )
+
+       add_dependencies(${PROJECT_NAME} ${EDJ_FILE})
+       install(FILES ${EDJ_FILE} DESTINATION ${EDJ_DIR})
+endforeach(${EDC_FILE})
+
 install(DIRECTORY images/ DESTINATION ${IMG_DIR})
diff --git a/lib-contacts/res/list/edje/ChooserTitleLayout.h b/lib-contacts/res/list/edje/ChooserTitleLayout.h
new file mode 100644 (file)
index 0000000..7cce680
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.
+ *
+ */
+
+#ifndef CHOOSER_TITLE_LAYOUT_H
+#define CHOOSER_TITLE_LAYOUT_H
+
+#include "ListPath.h"
+
+#define GROUP_CHOOSER_TITLE "chooser_title"
+#define PART_SELECTOR       "swallow.selector"
+#define PART_MULTI_BTN      "swallow.multi_btn"
+
+#endif /* CHOOSER_TITLE_LAYOUT_H */
index 65868cb..eef4144 100644 (file)
@@ -22,5 +22,6 @@
 #define LIST_EDJ_DIR "list/edje/"
 
 #define LIST_ADD_BUTTON_ICON    LIST_IMG_DIR"core_floating_icon_01.png"
+#define CHOOSER_TITLE_EDJ       LIST_EDJ_DIR"chooser-title-layout.edj"
 
 #endif /* LIST_PATH_H */
diff --git a/lib-contacts/res/list/edje/chooser-title-layout.edc b/lib-contacts/res/list/edje/chooser-title-layout.edc
new file mode 100644 (file)
index 0000000..3e0646f
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2015-2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 "ChooserTitleLayout.h"
+
+#define SELECTOR_LR 32
+#define SELECTOR_TB 20
+#define SELECTOR_H 120
+
+collections {
+       base_scale: 2.6;
+
+       group { GROUP_CHOOSER_TITLE;
+               parts {
+                       rect { "rect.bg"; scale;
+                               desc { "default";
+                                       min: 0 SELECTOR_H;
+                                       color: 250 250 250 255;
+                               }
+                       }
+                       spacer { "spacer.left_top"; scale;
+                               desc { "default";
+                                       min: SELECTOR_LR SELECTOR_TB;
+                                       align: 0.0 0.0;
+                                       rel1.relative: 0.0 0.0;
+                                       rel2.relative: 0.0 0.0;
+                               }
+                       }
+                       spacer { "spacer.right_bottom"; scale;
+                               desc { "default";
+                                       min: SELECTOR_LR SELECTOR_TB;
+                                       align: 1.0 1.0;
+                                       rel1.relative: 1.0 1.0;
+                                       rel2.relative: 1.0 1.0;
+                               }
+                       }
+                       swallow { PART_SELECTOR; scale;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       rel1 { relative: 1.0 1.0; to: "spacer.left_top"; }
+                                       rel2 { relative: 0.0 1.0; to_x: "spacer.right_bottom"; to_y: "spacer.left_top"; }
+                               }
+                       }
+                       swallow { PART_MULTI_BTN; scale;
+                               desc { "default";
+                                       align: 0.0 0.0;
+                                       rel1 { relative: 0.0 1.0; to_y: PART_SELECTOR; }
+                                       rel2 { relative: 1.0 1.0; }
+                               }
+                       }
+               }
+       }
+}
index 1c09bfc..0930a83 100644 (file)
 #include "Contacts/Chooser/ContactsGroupsNavigator.h"
 #include "Contacts/Chooser/ContactsPage.h"
 
+#include "App/Path.h"
 #include "Ui/Hoversel.h"
 #include "Ux/SelectView.h"
 
+#include "ChooserTitleLayout.h"
+
 using namespace Contacts::Chooser;
 
 ContactsGroupsNavigator::ContactsGroupsNavigator()
        : TabNavigator(new Ui::Hoversel()),
-         m_ContactsView(nullptr), m_GroupsView(nullptr)
+         m_ContactsView(nullptr), m_GroupsView(nullptr),
+         m_TitleLayout(nullptr)
 {
 }
 
@@ -41,6 +45,19 @@ void ContactsGroupsNavigator::addGroupsView(Ux::SelectView *view)
        addView(m_GroupsView);
 }
 
+void ContactsGroupsNavigator::onCreated()
+{
+       m_TitleLayout = elm_layout_add(getEvasObject());
+       elm_layout_file_set(m_TitleLayout, App::getResourcePath(CHOOSER_TITLE_EDJ).c_str(), GROUP_CHOOSER_TITLE);
+       elm_object_part_content_set(m_TitleLayout, PART_SELECTOR, getSelector()->create(m_TitleLayout));
+}
+
+void ContactsGroupsNavigator::onPageAttached(Ui::NavigatorPage *page)
+{
+       page->setStyle("empty");
+       page->setContent("title", m_TitleLayout);
+}
+
 Ui::TabPage *ContactsGroupsNavigator::createPage(Ui::View *view, Elm_Object_Item *item)
 {
        if (view == m_ContactsView) {