TizenRefApp-7941 Implement base view(layout) and view controller. 96/111896/1
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 24 Jan 2017 14:05:16 +0000 (16:05 +0200)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Tue, 24 Jan 2017 14:05:16 +0000 (16:05 +0200)
Change-Id: I5b8597eca9e3c13d842c2a5daf3242d8f6aee498
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
23 files changed:
edje/images/b_recent_widget_del_bg.png [new file with mode: 0755]
edje/images/b_recent_widget_del_icon.png [new file with mode: 0755]
edje/images/b_recent_widget_del_shadow.png [new file with mode: 0755]
edje/images/clear_all_button_icon.png [new file with mode: 0644]
edje/images/clear_all_button_icon_disable.png [new file with mode: 0755]
edje/images/fake_image.png [new file with mode: 0755]
edje/images/recent_btn_close_bg.png [new file with mode: 0755]
edje/images/recent_btn_close_icon.png [new file with mode: 0755]
edje/images/recent_circle_bg_mask.png [new file with mode: 0755]
edje/images/recent_no_recent_icon.png [new file with mode: 0755]
edje/images/tw_bottom_btn_bg.png [new file with mode: 0644]
edje/images/tw_no_item_bg.png [new file with mode: 0755]
edje/images/widget_circle_bg_ef1.png [new file with mode: 0755]
edje/images/widget_circle_bg_ef2.png [new file with mode: 0755]
res/edje/main_layout.edc [new file with mode: 0644]
res/edje/taskmanager.edc [deleted file]
src/App/inc/App.h
src/App/inc/MainController.h [new file with mode: 0644]
src/App/inc/MainLayout.h [new file with mode: 0644]
src/App/inc/Resource.h
src/App/src/App.cpp
src/App/src/MainController.cpp [new file with mode: 0644]
src/App/src/MainLayout.cpp [new file with mode: 0644]

diff --git a/edje/images/b_recent_widget_del_bg.png b/edje/images/b_recent_widget_del_bg.png
new file mode 100755 (executable)
index 0000000..27e25bc
Binary files /dev/null and b/edje/images/b_recent_widget_del_bg.png differ
diff --git a/edje/images/b_recent_widget_del_icon.png b/edje/images/b_recent_widget_del_icon.png
new file mode 100755 (executable)
index 0000000..0b1f72f
Binary files /dev/null and b/edje/images/b_recent_widget_del_icon.png differ
diff --git a/edje/images/b_recent_widget_del_shadow.png b/edje/images/b_recent_widget_del_shadow.png
new file mode 100755 (executable)
index 0000000..925e782
Binary files /dev/null and b/edje/images/b_recent_widget_del_shadow.png differ
diff --git a/edje/images/clear_all_button_icon.png b/edje/images/clear_all_button_icon.png
new file mode 100644 (file)
index 0000000..4ba500c
Binary files /dev/null and b/edje/images/clear_all_button_icon.png differ
diff --git a/edje/images/clear_all_button_icon_disable.png b/edje/images/clear_all_button_icon_disable.png
new file mode 100755 (executable)
index 0000000..6f48ef4
Binary files /dev/null and b/edje/images/clear_all_button_icon_disable.png differ
diff --git a/edje/images/fake_image.png b/edje/images/fake_image.png
new file mode 100755 (executable)
index 0000000..1d16145
Binary files /dev/null and b/edje/images/fake_image.png differ
diff --git a/edje/images/recent_btn_close_bg.png b/edje/images/recent_btn_close_bg.png
new file mode 100755 (executable)
index 0000000..356aa43
Binary files /dev/null and b/edje/images/recent_btn_close_bg.png differ
diff --git a/edje/images/recent_btn_close_icon.png b/edje/images/recent_btn_close_icon.png
new file mode 100755 (executable)
index 0000000..1d36546
Binary files /dev/null and b/edje/images/recent_btn_close_icon.png differ
diff --git a/edje/images/recent_circle_bg_mask.png b/edje/images/recent_circle_bg_mask.png
new file mode 100755 (executable)
index 0000000..1d16145
Binary files /dev/null and b/edje/images/recent_circle_bg_mask.png differ
diff --git a/edje/images/recent_no_recent_icon.png b/edje/images/recent_no_recent_icon.png
new file mode 100755 (executable)
index 0000000..556a792
Binary files /dev/null and b/edje/images/recent_no_recent_icon.png differ
diff --git a/edje/images/tw_bottom_btn_bg.png b/edje/images/tw_bottom_btn_bg.png
new file mode 100644 (file)
index 0000000..d924082
Binary files /dev/null and b/edje/images/tw_bottom_btn_bg.png differ
diff --git a/edje/images/tw_no_item_bg.png b/edje/images/tw_no_item_bg.png
new file mode 100755 (executable)
index 0000000..2e06046
Binary files /dev/null and b/edje/images/tw_no_item_bg.png differ
diff --git a/edje/images/widget_circle_bg_ef1.png b/edje/images/widget_circle_bg_ef1.png
new file mode 100755 (executable)
index 0000000..44f3a1a
Binary files /dev/null and b/edje/images/widget_circle_bg_ef1.png differ
diff --git a/edje/images/widget_circle_bg_ef2.png b/edje/images/widget_circle_bg_ef2.png
new file mode 100755 (executable)
index 0000000..de5ec3f
Binary files /dev/null and b/edje/images/widget_circle_bg_ef2.png differ
diff --git a/res/edje/main_layout.edc b/res/edje/main_layout.edc
new file mode 100644 (file)
index 0000000..d65ef3f
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * Task Manager
+ * Copyright (c) 2013 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.
+ */
+
+collections {
+    base_scale : 1.3;
+    color_classes{
+       color_class{
+           name: "AT013";
+           color: 255 255 255 255;
+       }
+    }
+    styles {
+        style {
+            name: "style_no_apps";
+            base: "font="TIZEN":style=Regular text_class="AT013" font_size=28 align=center color=#FFFFFF wrap=mixed color_class=AT013";
+            tag: "br" "\n";
+            tag: "hilight" "+ color=#ffff";
+            tag: "b" "+ color=#ffff";
+            tag: "tab" "\t";
+         }
+    }
+    group {
+        name : "taskmanager-layout";
+        images {
+            image : "tw_bottom_btn_bg.png" COMP;
+        }
+        parts {
+            part {
+                name : "bg";
+                type : RECT;
+                description {
+                    state : "default" 0.0;
+                    color : 0 0 0 255;
+                }
+            }
+            part {
+                name : "color_clipper";
+                type : RECT;
+                description {
+                    state : "default" 0.0;
+                    color : 255 255 255 255;
+                }
+                description {
+                    state : "closeall" 0.0;
+                    color : 255 255 255 0;
+                }
+            }
+            part { name: "swl.bg";
+                type: SWALLOW;
+                scale: 1;
+                description { state: "default" 0.0;
+                    visible: 1;
+                }
+                description { state: "hide" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 0;
+                }
+            }
+            part {
+                name : "swl.list";
+                type : SWALLOW;
+                scale : 1;
+                description {
+                    state : "default" 0.0;
+                    rel1 {
+                        relative : 0.0 0.0;
+                        to : "bg";
+                    }
+                    rel2 {
+                        relative : 1.0 1.0;
+                        to : "bg";
+                    }
+                }
+            }
+            part {
+                name : "swl.index";
+                type : SWALLOW;
+                clip_to : "color_clipper";
+                scale : 1;
+                repeat_events: 1;
+                description {
+                    state : "default" 0.0;
+                }
+            }
+            part {
+                name: "close_all_bg";
+                type: IMAGE;
+                scale: 1;
+                mouse_events: 1;
+                description {
+                    state: "default" 0.0;
+                    rel1 { relative: 0.5 1.0; to: "bg"; }
+                    rel2 { relative: 0.5 1.0; to: "bg"; }
+                    image {
+                        normal: "tw_bottom_btn_bg.png";
+                    }
+                    align: 0.5 1.0;
+                    fixed : 1 1;
+                    min : 360 100;
+                    max : 360 100;
+                    color: 51 51 51 178;
+                    visible: 0;
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    color: 75 75 75 178;
+                    visible: 1;
+                }
+                description {
+                    state: "show" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                }
+                description {
+                    state: "disabled" 0.0;
+                    inherit: "default" 0.0;
+                    color: 33 33 33 255;
+                    visible: 1;
+                }
+            }
+            part {
+                name: "close_all_text";
+                type: TEXTBLOCK;
+                scale: 1;
+                repeat_events: 1;
+                description {
+                    state: "default" 0.0;
+                    rel1 { relative: 0.0 0.0; to: "close_all_bg"; }
+                    rel2 { relative: 1.0 1.0; to: "close_all_bg"; }
+                    min : 160 42;
+                    max : 160 42;
+                    align: 0.5 0.5;
+                    fixed: 1 1;
+                    visible: 0;
+                    text {
+                        text_class: "AT013";
+                        style : style_no_apps;
+                        min : 0 1;
+                        align : 0.5 0.5;
+                    }
+                }
+                description {
+                    state: "pressed" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                }
+                description {
+                    state: "show" 0.0;
+                    inherit: "default" 0.0;
+                    visible: 1;
+                }
+                description {
+                    state: "disabled" 0.0;
+                    inherit: "default" 0.0;
+                    color: 33 33 33 255;
+                    visible: 1;
+                }
+            }
+        }
+        programs {
+            program {
+                name : "show_bg";
+                signal : "show_bg";
+                source : "*";
+                action : STATE_SET "default" 0.0;
+               target : "swl.bg";
+            }
+            program {
+                name : "hide_bg";
+                signal : "hide_bg";
+                source : "*";
+                action : STATE_SET "hide" 0.0;
+               target : "swl.bg";
+            }
+            program {
+                name : "close,clicked";
+                signal : "mouse,clicked,1";
+                source : "close_all_bg";
+                action : SIGNAL_EMIT "close_button,clicked" "clicked";
+            }
+            program {
+                name : "close,pressed";
+                signal : "mouse,down,1";
+                source : "close_all_bg";
+                action : STATE_SET "pressed" 0.0;
+                target : "close_all_text";
+                target : "close_all_bg";
+            }
+            program {
+                name : "close,unpressed";
+                signal : "mouse,up,1";
+                source : "close_all_bg";
+                action : STATE_SET "show" 0.0;
+                target : "close_all_text";
+                target : "close_all_bg";
+                transition : LINEAR 0.15;
+            }
+            program {
+                name : "show_close";
+                signal : "show_close";
+                source : "*";
+                action : STATE_SET "show" 0.0;
+                target : "close_all_text";
+                target : "close_all_bg";
+            }
+            program {
+                name : "hide_close";
+                signal : "hide_close";
+                source : "*";
+                action : STATE_SET "default" 0.0;
+                target : "close_all_text";
+                target : "close_all_bg";
+            }
+            program {
+                name : "closeall";
+                signal : "closeall";
+                source : "bg";
+                action : STATE_SET "closeall" 0.0;
+                target : "color_clipper";
+            //    transition : LINEAR 0.35;
+            }
+        }
+    }
+} //collections
diff --git a/res/edje/taskmanager.edc b/res/edje/taskmanager.edc
deleted file mode 100644 (file)
index 252aeb9..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-collections {
-   group { name: "main";
-      parts {
-         part { name: "txt_title";
-            type: TEXT;
-            mouse_events: 0;
-            description { state: "default" 0.0;
-               text { text: "Hello Tizen"; font: "Tizen:style=regular"; size: 20; min: 1 1; align: 0.5 0; ellipsis: -1; }
-               color: 0 255 255 255;
-            }
-         }
-      }
-   }
-}
index 57b3c03..a2ef6df 100644 (file)
@@ -24,6 +24,7 @@ namespace TaskMngr
 {
     class Window;
     class TaskMngrService;
+    class MainController;
 
     class App
     {
@@ -51,6 +52,7 @@ namespace TaskMngr
         private:
             static App m_AppInst;
             Window *m_pWindow;
+            MainController *m_pRootController;
     };
 }
 
diff --git a/src/App/inc/MainController.h b/src/App/inc/MainController.h
new file mode 100644 (file)
index 0000000..d75b916
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2016  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.
+ */
+
+#ifndef MainController_h_
+#define MainController_h_
+
+#include "MainLayout.h"
+
+namespace TaskMngr
+{
+    class MainController
+        : public MainLayout
+    {
+        public:
+            MainController(Evas_Object *parent);
+            virtual ~MainController();
+
+        private:
+            // MainLayout:
+            void onCloseAllButtonClicked() override;
+    };
+}
+
+#endif /* MainController_h_ */
diff --git a/src/App/inc/MainLayout.h b/src/App/inc/MainLayout.h
new file mode 100644 (file)
index 0000000..f7a5a28
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2016  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.
+ */
+
+#ifndef MainLayout_h_
+#define MainLayout_h_
+
+#include "View.h"
+
+namespace TaskMngr
+{
+    class MainLayout
+        : public View
+    {
+        public:
+            MainLayout(Evas_Object *parent);
+            virtual ~MainLayout();
+
+            void setList(Evas_Object *obj);
+            void setIndex(Evas_Object *obj);
+            void showNoContents(bool show);
+            void showCloseButton(bool show);
+
+        protected:
+            virtual void onCloseAllButtonClicked() {};
+
+        private:
+            Evas_Object *m_pNoContent;
+    };
+}
+
+#endif /* MainLayout_h_ */
index c581924..a617cc8 100644 (file)
@@ -20,5 +20,7 @@
 #define EDJ_PATH "edje"
 #define IMAGE_PATH "images"
 
+#define  MAINT_LAYOUT_EDJ EDJ_PATH"/main_layout.edj"
+
 
 #endif /* RESOURCE_H_ */
index b817708..1e3bc9d 100644 (file)
@@ -19,6 +19,7 @@
 #include "Logger.h"
 #include "Callback.h"
 #include "Window.h"
+#include "MainController.h"
 
 using namespace TaskMngr;
 
@@ -26,6 +27,7 @@ App App::m_AppInst;
 
 App::App()
     : m_pWindow(nullptr)
+    , m_pRootController(nullptr)
 {
 }
 
@@ -79,6 +81,10 @@ bool App::onCreate()
     m_pWindow = new Window;
     m_pWindow->show();
 
+    m_pRootController = new MainController(m_pWindow->getHostEvasObject());
+    m_pWindow->setContent(*m_pRootController);
+    m_pRootController->showCloseButton(true);
+
     return true;
 }
 
diff --git a/src/App/src/MainController.cpp b/src/App/src/MainController.cpp
new file mode 100644 (file)
index 0000000..2a2ba4d
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016  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 "MainController.h"
+#include "Logger.h"
+
+using namespace TaskMngr;
+
+MainController::MainController(Evas_Object *parent)
+    : MainLayout(parent)
+{
+}
+
+MainController::~MainController()
+{
+}
+
+void MainController::onCloseAllButtonClicked()
+{
+    LOG("");
+}
diff --git a/src/App/src/MainLayout.cpp b/src/App/src/MainLayout.cpp
new file mode 100644 (file)
index 0000000..1320bfb
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2016  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 "MainLayout.h"
+#include "Resource.h"
+
+using namespace TaskMngr;
+
+MainLayout::MainLayout(Evas_Object *parent)
+    : m_pNoContent(nullptr)
+{
+    setEo(View::addLayout(parent, MAINT_LAYOUT_EDJ, "taskmanager-layout"));
+    addSignalCb
+    (
+        "close_button,clicked",
+        "clicked",
+        [](void *data, Evas_Object *obj, const char *emission, const char *source)
+        {
+            static_cast<MainLayout*>(data)->onCloseAllButtonClicked();
+        }, this);
+    showCloseButton(true);
+    setText("CLOSE ALL", "close_all_text"); // TODO: localization
+}
+
+MainLayout::~MainLayout()
+{
+}
+
+void MainLayout::setList(Evas_Object *obj)
+{
+    setContent(obj, "swl.list");
+}
+
+void MainLayout::setIndex(Evas_Object *obj)
+{
+    setContent(obj, "swl.index");
+}
+
+void MainLayout::showNoContents(bool show)
+{
+    if (show && !m_pNoContent)
+    {
+        m_pNoContent = elm_layout_add(getEo());
+        elm_layout_theme_set(getEo(), "layout", "nocontents", "text");
+        setContent(m_pNoContent, "swl.bg");
+    }
+
+    const char *sig = show ? "show_bg" : "hide_bg";
+    emitSignal(sig, "*");
+}
+
+void MainLayout::showCloseButton(bool show)
+{
+    const char *sig = show ? "show_close" : "hide_close";
+    emitSignal(sig, "*");
+}