<option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1210835446" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.1883867003" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.cpp.compiler.option.1516130097" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="wearable-3.0-emulator.core_gcc49.i386.core.app"/>
+ <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private_gcc49.i386.core.app"/>
</option>
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.371616908" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/msg-service""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rua/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony-client""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ug-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vconf""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
<option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.146661021" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.480122954" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.c.compiler.option.756861607" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="wearable-3.0-emulator.core_gcc49.i386.core.app"/>
+ <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private_gcc49.i386.core.app"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks_inc.core.793002243" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/msg-service""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rua/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony-client""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ug-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vconf""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
#define EDJ_PATH "edje"
#define IMAGE_PATH "images"
-#define MAINT_LAYOUT_EDJ EDJ_PATH"/main_layout.edj"
-
+#define MAINT_LAYOUT_EDJ "main-layout.edj"
+#define ANIM_ITEM_EDJ "anim-item.edj"
+#define TASK_ITEM_EDJ "task-item.edj"
+#define ICONS_EDJ "icons.edj"
#endif /* RESOURCE_H_ */
--- /dev/null
+#include "defines.inl"
+
+#define FOCAL_RATIO 1.5
+#define OFFSET_FIX_RATIO 1.2
+#define TRANS_TIME 0.4
+#define OPACITY_RATIO 1.3
+
+collections {
+ base_scale: BASE_SCALE;
+ group
+ {
+ name: "anim_item";
+ parts{
+ part{
+ name: "focal.point";
+ type: RECT;
+ scale: 1;
+ description {
+ state : "default" 0.0;
+ color: 0 0 0 0;
+ fixed: 1 1;
+ }
+ description {
+ state : "zoom_out" 0.0;
+ inherit: "default" 0.0;
+ perspective {
+ zplane: (-WIN_H * FOCAL_RATIO);
+ }
+ }
+ }
+ part {
+ name : clipper_panel;
+ type : RECT;
+ description {
+ state : "default" 0.0;
+ color : 255 255 255 255;
+ }
+ description {
+ state : "hidden" 0.0;
+ color : 255 255 255 0;
+ }
+ description {
+ state : "visible" 0.0;
+ inherit: "default" 0.0;
+ }
+ description {
+ state : "transparent" 0.0;
+ color_class : "transparency_cc";
+ }
+ }
+ part {
+ name : "clipper_layout";
+ type : RECT;
+ description {
+ state : "default" 0.0;
+ color : 255 255 255 0;
+ }
+ description {
+ state : "hidden" 0.0;
+ color : 255 255 255 0;
+ }
+ description {
+ state : "visible" 0.0;
+ color : 255 255 255 255;
+ }
+ description {
+ state : "opaque" 0.0;
+ color_class : "opacity_cc";
+ }
+ }
+ part {
+ name: "bg";
+ type: RECT;
+ scale: 1;
+ mouse_events: 0;
+ repeat_events: 1;
+ clip_to : "clipper_layout";
+ description {
+ state: "default" 0.0;
+ rel1 {relative: 0.0 0.0;}
+ rel2 {relative: 1.0 1.0;}
+ color: 0 0 0 255;
+ }
+ }
+ part {
+ name: "swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ clip_to : "clipper_panel";
+ description {
+ state: "default" 0.0;
+ map {
+ on: 1;
+ smooth: 1;
+ perspective_on: 1;
+ perspective: "focal.point";
+ }
+ }
+ description {
+ state: "up" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.5 (-0.5 * OFFSET_FIX_RATIO);
+ rel2.relative: 0.5 (-0.5 * OFFSET_FIX_RATIO);
+ }
+ description {
+ state: "down" 0.0;
+ inherit: "default" 0.0;
+ rel1.relative: 0.5 (1.5 * OFFSET_FIX_RATIO);
+ rel2.relative: 0.5 (1.5 * OFFSET_FIX_RATIO);
+ }
+ description {
+ state: "hidden" 0.0;
+ inherit: "default" 0.0;
+ visible: 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ }
+ programs {
+ program
+ {
+ name : "set_to_default";
+ signal : "default_state";
+ source : "";
+ action : STATE_SET "default" 0.0;
+ target : "swallow.content";
+ target : "focal.point";
+ target : "clipper_panel";
+ target : "clipper_layout";
+ transition: BOUNCE 1.0 4.5 5.0;
+ }
+ program
+ {
+ name : "move_up";
+ signal : "move_up";
+ source : "";
+ action : STATE_SET "up" 0.0;
+ target : "swallow.content";
+ transition: LINEAR TRANS_TIME;
+ action : STATE_SET "up" 0.0;
+ after: "move_finished";
+ }
+ program
+ {
+ name : "move_down";
+ signal : "move_down";
+ source : "";
+ action : STATE_SET "down" 0.0;
+ target : "swallow.content";
+ transition: LINEAR TRANS_TIME;
+ after: "move_finished";
+ }
+ program
+ {
+ name : "zoom_out";
+ signal : "zoom_out";
+ source : "";
+ action : STATE_SET "zoom_out" 0.0;
+ target : "focal.point";
+ transition: LINEAR TRANS_TIME;
+ after: "zoom_finished";
+ }
+ program
+ {
+ name : "opacity_hidden";
+ signal : "opacity_hidden";
+ source : "";
+ action : STATE_SET "hidden" 0.0;
+ target : "clipper_panel";
+ target : "clipper_layout";
+ transition: LINEAR TRANS_TIME;
+ }
+ program {
+ name : "zoom_finished";
+ action : SIGNAL_EMIT "zoom_finished" "";
+ }
+ program {
+ name : "move_finished";
+ action : SIGNAL_EMIT "move_finished" "";
+ }
+ }
+ script {
+ set_offset(Float:ratio) {
+ custom_state(PART:"swallow.content", "default", 0.0);
+ new Float:relY = ratio * OFFSET_FIX_RATIO + 0.5;
+ set_state_val(PART:"swallow.content", STATE_REL1, 0.5, relY);
+ set_state_val(PART:"swallow.content", STATE_REL2, 0.5, relY);
+ set_state(PART:"swallow.content", "custom", 0.0);
+ }
+ set_focal(Float:ratio) {
+ new focal = round(ratio * WIN_H * FOCAL_RATIO);
+ if (focal > 0)
+ focal *= -1;
+ custom_state(PART:"focal.point", "default", 0.0);
+ set_state_val(PART:"focal.point", STATE_PERSP_ZPLANE, focal);
+ set_state(PART:"focal.point", "custom", 0.0);
+ }
+ set_opacity(Float:ratio) {
+ if (ratio < 0)
+ ratio *= -1;
+ new transp = round(OPACITY_RATIO * ratio * 255);
+ if(transp > 255)
+ transp = 255;
+ set_state(PART:"clipper_panel", "transparent", 0.0);
+ set_color_class("transparency_cc", 255, 255, 255, (255 - transp));
+ set_state(PART:"clipper_layout", "opaque", 0.0);
+ set_color_class("opacity_cc", 255, 255, 255, transp);
+ }
+ public message(Msg_Type:type, id, ...) {
+ new Float:ratio = getfarg(2);
+
+ // Normalize:
+ if(ratio > 1.0)
+ ratio = 1.0;
+ else if(ratio < -1.0)
+ ratio = -1.0;
+
+ set_offset(ratio);
+ set_focal(ratio);
+ set_opacity(ratio);
+ }
+ }
+ }
+}
\ No newline at end of file
--- /dev/null
+#define WIN_H 360
+#define WIN_W 360
+#define ITEM_W 245
+#define BASE_SCALE 1.3;
+
--- /dev/null
+#include "defines.inl"
+
+collections {
+ base_scale: BASE_SCALE;
+ group {
+ name: "del_icon";
+ images {
+ image: "clear_all_button_icon.png" COMP;
+ image: "clear_all_button_icon_disable.png" COMP;
+ }
+ parts {
+ part {
+ name: "bg";
+ type: IMAGE;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ image.normal: "clear_all_button_icon.png";
+ }
+ description {
+ state: "pressed" 0.0;
+ inherit: "default";
+ color: 180 180 180 255;
+ }
+ description {
+ state: "disabled" 0.0;
+ image.normal: "clear_all_button_icon_disable.png";
+ }
+ }
+ }
+ programs {
+ program { name: "pressed";
+ source: "";
+ signal: "pressed";
+ action: STATE_SET "pressed" 0.0;
+ target: "bg";
+ }
+ program { name: "default";
+ source: "";
+ signal: "default";
+ action: STATE_SET "default" 0.0;
+ target: "bg";
+ transition: LINEAR 0.1;
+ }
+ program { name: "disabled";
+ source: "";
+ signal: "disabled";
+ action: STATE_SET "disabled" 0.0;
+ target: "bg";
+ }
+ }
+ }
+}
* limitations under the License.
*/
+#include "defines.inl"
+
collections {
- base_scale : 1.3;
+ base_scale: BASE_SCALE;
+
color_classes{
color_class{
name: "AT013";
}
}
group {
- name : "taskmanager-layout";
+ name : "main_layout";
images {
image : "tw_bottom_btn_bg.png" COMP;
}
}
}
}
-} //collections
+}
--- /dev/null
+#include "defines.inl"
+
+collections {
+ base_scale: BASE_SCALE;
+ group {
+ name : "task_item";
+ images {
+ image : "mask.png" COMP;
+ image : "clear_all_button_icon.png" COMP;
+ image : "clear_all_button_icon_disable.png" COMP;
+ }
+ parts {
+ part {
+ name : "bg";
+ type : SPACER;
+ scale: 1;
+ description {
+ state : "default" 0.0;
+ min: ITEM_W WIN_H;
+ }
+ }
+ part {
+ name : "swl.app_name";
+ type : SWALLOW;
+ scale : 1;
+ description {
+ state : "default" 0.0;
+ align : 0.5 0.5;
+ rel1 {
+ relative : 102/WIN_W 27/WIN_H;
+ to : "bg";
+ }
+ rel2 {
+ relative : (WIN_W-102)/WIN_W (27+39)/WIN_H;
+ to : "bg";
+ }
+ color : 255 255 255 255;
+ }
+ description {
+ state : "show" 0.0;
+ inherit : "default" 0.0;
+ visible : 1;
+ }
+ description {
+ state : "hide" 0.0;
+ inherit : "default" 0.0;
+ visible : 0;
+ }
+ }
+ part {
+ name: "masking";
+ type: IMAGE;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ image.normal: "mask.png";
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ rel1 {
+ to : "img.app_image";
+ }
+ rel2 {
+ to : "img.app_image";
+ }
+ }
+ }
+ part {
+ name : "img.app_image";
+ type : SWALLOW;
+ clip_to: "masking";
+ scale : 1;
+ mouse_events : 1;
+ repeat_events : 0;
+ description {
+ state : "default" 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ align: 0.5 0.5;
+ rel1 { to : "bg"; }
+ rel2 { to : "bg"; }
+ min : 216 216;
+ max : 216 216;
+ }
+ description {
+ state : "icon_displaying" 0.0;
+ inherit : "default" 0.0;
+ min : 216 216;
+ max : 216 216;
+ }
+ description {
+ state : "closeall" 0.0;
+ inherit : "default" 0.0;
+ min : 176 176;
+ max : 176 176;
+ }
+ }
+ part{
+ name : "delete.touch";
+ type : SPACER;
+ scale : 1;
+ mouse_events : 1;
+ repeat_events : 1;
+ description {
+ state : "default" 0.0;
+ min : 75 75;
+ max : 75 75;
+ rel1 {
+ relative : (216-30)/216 40/216 ;
+ to : "img.app_image";
+ }
+ rel2 {
+ relative : (216-30)/216 40/216 ;
+ to : "img.app_image";
+ }
+ }
+ part {
+ name : "swl.delete_button";
+ type : SWALLOW ;
+ scale : 1;
+ mouse_events : 1;
+ description {
+ state : "default" 0.0;
+ rel1 {
+ relative : (216-63)/216 0;
+ to : "img.app_image";
+ }
+ rel2 {
+ relative : (216)/216 63/216 ;
+ to : "img.app_image";
+ }
+ }
+ description {
+ state : "pressed" 0.0;
+ inherit : "default" 0.0;
+ color : 128 128 128 255;
+ }
+ description {
+ state : "closeall" 0.0;
+ inherit : "default" 0.0;
+ min : 40 40;
+ max : 40 40;
+ color : 255 255 255 0;
+ }
+ description {
+ state : "hide" 0.0;
+ inherit : "default" 0.0;
+ visible: 0;
+ }
+ }
+ }
+ programs {
+ program {
+ name : "show,icon";
+ signal : "show,icon";
+ source : "bg";
+ action : STATE_SET "icon_displaying" 0.0;
+ target : "img.app_image";
+ }
+ program {
+ name : "closeall";
+ signal : "closeall";
+ source : "bg";
+ action : STATE_SET "closeall" 0.0;
+ target : "img.app_image";
+ target : "swl.delete_button";
+ transition : LINEAR 0.35;
+ }
+ program {
+ name : "closeall_emit";
+ signal : "closeall_emit";
+ source : "bg";
+ action : SIGNAL_EMIT "closeall_end" "closeall";
+ }
+ program {
+ name : "app,clicked";
+ signal : "mouse,clicked,1";
+ source : "img.app_image";
+ action : SIGNAL_EMIT "app_icon,clicked" "clicked";
+ }
+ program {
+ name : "show,name";
+ signal : "show,name";
+ source : "bg";
+ action : STATE_SET "show" 0.0 ;
+ target : "swl.app_name";
+ transition : LINEAR 0.35;
+ }
+ program {
+ name : "hide,name";
+ signal : "hide,name";
+ source : "bg";
+ action : STATE_SET "hide" 0.0;
+ target : "swl.app_name";
+ transition : LINEAR 0.35;
+ }
+ program {
+ name : "hide,delete,icon";
+ signal : "hide,delete";
+ source : "bg";
+ action : STATE_SET "hide" 0.0 ;
+ target : "swl.delete_button";
+ }
+ program {
+ name : "show,delete,icon";
+ signal : "show,delete";
+ source : "bg";
+ action : STATE_SET "default" 0.0 ;
+ target : "swl.delete_button";
+ }
+ }
+ }
+}
#include <app.h>
#include <app_control.h>
+#include "TaskMngrService.h"
+
namespace TaskMngr {
class Window;
class TaskMngrService;
static App &getInst();
int start(int argc, char *argv[]);
void exit();
+ TaskMngrService &getTaskMngr();
+ const TaskMngrService &getTaskMngr() const;
+ Window &getWindow();
+ const Window &getWindow() const;
private:
App();
static App m_AppInst;
Window *m_pWindow;
MainController *m_pRootController;
+ TaskMngrService m_TaskMngr;
};
}
--- /dev/null
+/*
+ * 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 DelButton_h_
+#define DelButton_h_
+
+#include "View.h"
+
+namespace TaskMngr
+{
+ class DelButton
+ : public View {
+
+ public:
+ DelButton(Evas_Object *parent);
+ virtual ~DelButton();
+
+ void disabled(bool state);
+
+ private:
+ void onPressed(Evas_Object *obj, void *event_info);
+ void onUnpressed(Evas_Object *obj, void *event_info);
+ };
+}
+
+#endif /* DelButton_h_ */
#define MainController_h_
#include "MainLayout.h"
+#include "TaskListView.h"
namespace TaskMngr {
class MainController
- : public MainLayout {
+ : public MainLayout
+ , private ITaskListViewListener {
+
public:
MainController(Evas_Object *parent);
virtual ~MainController();
private:
// MainLayout:
void onCloseAllButtonClicked() override;
+
+ // ITaskListViewListener:
+ void onPageChanged() override;
+ void onKillAnimFinished(TaskListViewItem &item) override;
+ void onClicked(TaskListViewItem &item) override;
+ void onKillAllAnimFinished() override;
+
+ private:
+ TaskListView *m_pTaskListView;
};
}
--- /dev/null
+/*
+ * 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 TaskListView_h_
+#define TaskListView_h_
+
+#include "View.h"
+#include "TaskListViewItem.h"
+
+namespace TaskMngr
+{
+ class ITaskListViewListener;
+
+ class TaskListView
+ : public View {
+
+ friend class TaskListViewItem;
+
+ public:
+ TaskListView(Evas_Object *parent);
+ virtual ~TaskListView();
+
+ void setListener(ITaskListViewListener *listener);
+ void appendItem(TaskListViewItem &item);
+ TaskListViewItem *getCurrentPage() const;
+ void playKillAllAnim();
+ void freezeScrollPush();
+ void freezeScrollPop();
+
+ private:
+ Evas_Object *createPadding();
+ void onDelRequest(TaskListViewItem &item);
+ void onAppClicked(TaskListViewItem &item);
+
+ private:
+ ITaskListViewListener *m_pListener;
+ Evas_Object *m_pScroller;
+ Evas_Object *m_pBox;
+ Evas_Object *m_RightPadding;
+ AppInfo m_AppInfo;
+ };
+
+ class ITaskListViewListener
+ {
+ public:
+ virtual ~ITaskListViewListener() {}
+ virtual void onPageChanged() {};
+ virtual void onKillAnimFinished(TaskListViewItem &item) {};
+ virtual void onClicked(TaskListViewItem &item) {};
+ virtual void onKillAllAnimFinished() {};
+ };
+}
+
+#endif /* TaskListView_h_ */
--- /dev/null
+/*
+ * 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 TaskListViewItem_h_
+#define TaskListViewItem_h_
+
+#include "View.h"
+#include "TaskMngrService.h"
+#include "DelButton.h"
+
+namespace TaskMngr
+{
+ class TaskListView;
+ class TaskListViewItem
+ : public View {
+ public:
+ TaskListViewItem(TaskListView &parent, const AppInfo &appInfo);
+ virtual ~TaskListViewItem();
+
+ static int getWidth();
+ static int getHeight();
+
+ void playKillAnim();
+ void playKillUpAnim();
+ void playKillDownAnim();
+
+ private:
+ void onMove(Evas *e, Evas_Object *obj, void *event_info);
+ void onDown(Evas *e, Evas_Object *obj, void *event_info);
+ void onUp(Evas *e, Evas_Object *obj, void *event_info);
+
+ void onKillAnimFinished(Evas_Object *obj, const char *emission, const char *source);
+
+ void onDelButtonClicked(Evas_Object *obj, void *event_info);
+ void onAppClicked(Evas_Object *obj, const char *emission, const char *source);
+
+ void setIcon(const std::string &path);
+ void setText(const std::string &text);
+ void showDelButton(bool show);
+
+ void setDefaultState();
+ void setZoomOutState();
+ void setOffsetUpState();
+ void setOffsetDownState();
+ void setOpacityState();
+
+ private:
+ TaskListView &m_Parent;
+ Evas_Object *m_pTaskLayout;
+ Edje_Message_Float m_EdjeMsg;
+ int m_DownYPos;
+ bool m_IsDragStart;
+ bool m_IsMouseDown;
+ AppInfo m_AppInfo;
+ DelButton *m_pDelButton;
+ double m_MoveDistance; // 0..1;
+ bool m_IsKillAnimPlaying;
+ bool m_IgnoreAppClick;
+ };
+}
+
+#endif /* TaskListViewItem_h_ */
m_pWindow->lower();
}
+TaskMngrService &App::getTaskMngr()
+{
+ return m_TaskMngr;
+}
+
+const TaskMngrService &App::getTaskMngr() const
+{
+ return m_TaskMngr;
+}
+
+Window &App::getWindow()
+{
+ ASSERT(m_pWindow, "Window is null");
+ return *m_pWindow;
+}
+
+const Window &App::getWindow() const
+{
+ return const_cast<App*>(this)->getWindow();
+}
+
int App::start(int argc, char *argv[])
{
ui_app_lifecycle_callback_s cbs = {};
--- /dev/null
+/*
+ * 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 "DelButton.h"
+#include "Resource.h"
+#include "Callback.h"
+
+using namespace TaskMngr;
+
+DelButton::DelButton(Evas_Object *parent)
+{
+ setEo(elm_button_add(parent));
+ evas_object_propagate_events_set(getEo(), false);
+ elm_object_style_set(getEo(), "transparent");
+ setContent((addLayout(parent, ICONS_EDJ, "del_icon")));
+ addSmartCb("pressed", makeCbFirst(&DelButton::onPressed), this);
+ addSmartCb("unpressed", makeCbFirst(&DelButton::onUnpressed), this);
+}
+
+DelButton::~DelButton()
+{
+}
+
+void DelButton::disabled(bool state)
+{
+ const char *sig = state ? "disabled" : "default";
+ emitSignal(getContent(), sig, "");
+}
+
+void DelButton::onPressed(Evas_Object *obj, void *event_info)
+{
+ emitSignal(getContent(), "pressed", "");
+}
+
+void DelButton::onUnpressed(Evas_Object *obj, void *event_info)
+{
+ emitSignal(getContent(), "default", "");
+}
#include "MainController.h"
#include "Logger.h"
+#include "App.h"
using namespace TaskMngr;
MainController::MainController(Evas_Object *parent)
: MainLayout(parent)
+ , m_pTaskListView(nullptr)
{
+ m_pTaskListView = new TaskListView(getEo());
+ m_pTaskListView->setListener(this);
+ setList(*m_pTaskListView);
+
+ //TODO: only for test will be removed.
+ AppInfo appInfo;
+ appInfo.icon = PathUtils::getResourcePath("images/test.jpg");
+ appInfo.name = "Hello";
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+
+
+ auto list = App::getInst().getTaskMngr().getAppInfo();
+ for (const AppInfo &appInfo : list) {
+ m_pTaskListView->appendItem(*new TaskListViewItem(*m_pTaskListView, appInfo));
+ }
}
MainController::~MainController()
{
LOG("");
}
+
+void MainController::onPageChanged()
+{
+ LOG("");
+}
+
+void MainController::onKillAnimFinished(TaskListViewItem &item)
+{
+ LOG("");
+}
+
+void MainController::onClicked(TaskListViewItem &item)
+{
+ LOG("");
+}
+
+void MainController::onKillAllAnimFinished()
+{
+ LOG("");
+}
MainLayout::MainLayout(Evas_Object *parent)
: m_pNoContent(nullptr)
{
- setEo(View::addLayout(parent, MAINT_LAYOUT_EDJ, "taskmanager-layout"));
+ setEo(View::addLayout(parent, MAINT_LAYOUT_EDJ, "main_layout"));
addSignalCb
(
"close_button,clicked",
--- /dev/null
+/*
+ * 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 "TaskListView.h"
+#include "App.h"
+#include "Window.h"
+
+using namespace TaskMngr;
+
+TaskListView::TaskListView(Evas_Object *parent)
+ : m_pListener(nullptr)
+ , m_pScroller(nullptr)
+ , m_pBox(nullptr)
+ , m_RightPadding(nullptr)
+{
+ m_pScroller = elm_scroller_add(parent);
+ setEo(m_pScroller);
+ elm_scroller_policy_set(m_pScroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
+ elm_scroller_bounce_set(m_pScroller, true, false);
+ elm_scroller_page_size_set(m_pScroller, TaskListViewItem::getWidth(), TaskListViewItem::getHeight());
+ elm_scroller_page_relative_set(m_pScroller, 0.0, 0.0);
+ elm_scroller_page_scroll_limit_set(m_pScroller, 1, 0);
+ elm_object_scroll_lock_y_set(m_pScroller, true);
+ elm_object_style_set(m_pScroller, "effect");
+
+ m_pBox = elm_box_add(m_pScroller);
+ elm_box_pack_end(m_pBox, createPadding());
+ m_RightPadding = createPadding();
+ elm_box_pack_end(m_pBox, m_RightPadding);
+ elm_box_horizontal_set(m_pBox, true);
+ elm_box_homogeneous_set(m_pBox, false);
+ expand(m_pBox);
+
+ elm_object_content_set(m_pScroller, m_pBox);
+}
+
+TaskListView::~TaskListView()
+{
+}
+
+Evas_Object *TaskListView::createPadding()
+{
+ static int screenWidth = 0;
+ if (screenWidth == 0)
+ App::getInst().getWindow().getScreenSize(nullptr, &screenWidth);
+
+ int padding = screenWidth - TaskListViewItem::getWidth();
+ padding = padding > 0 ? padding / 2 : 0;
+ Evas_Object *rect = evas_object_rectangle_add(getEvas());
+ evas_object_hide(rect);
+ evas_object_size_hint_min_set(rect, padding, 0);
+ evas_object_size_hint_max_set(rect, padding, 0);
+ return rect;
+}
+
+void TaskListView::setListener(ITaskListViewListener *listener)
+{
+ m_pListener = nullptr;
+}
+
+void TaskListView::appendItem(TaskListViewItem &item)
+{
+ item.show();
+ elm_box_pack_before(m_pBox, item, m_RightPadding);
+}
+
+TaskListViewItem *TaskListView::getCurrentPage() const
+{
+ return nullptr;
+}
+
+void TaskListView::playKillAllAnim()
+{
+
+}
+
+void TaskListView::freezeScrollPush()
+{
+ elm_object_scroll_freeze_push(m_pScroller);
+}
+
+void TaskListView::freezeScrollPop()
+{
+ elm_object_scroll_freeze_pop(m_pScroller);
+}
+
+void TaskListView::onDelRequest(TaskListViewItem &item)
+{
+
+}
+
+void TaskListView::onAppClicked(TaskListViewItem &item)
+{
+
+}
+
--- /dev/null
+/*
+ * 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 "TaskListViewItem.h"
+#include "TaskListView.h"
+#include "Callback.h"
+#include "PathUtils.h"
+#include "TaskListView.h"
+#include "Logger.h"
+#include "Window.h"
+#include "App.h"
+
+using namespace TaskMngr;
+
+#define WIDTH ELM_SCALE_SIZE(245)
+#define HEIGHT ELM_SCALE_SIZE(360)
+
+TaskListViewItem::TaskListViewItem(TaskListView &parent, const AppInfo &appInfo)
+ : m_Parent(parent)
+ , m_EdjeMsg()
+ , m_DownYPos(0)
+ , m_IsDragStart(false)
+ , m_IsMouseDown(false)
+ , m_AppInfo(appInfo)
+ , m_pDelButton(nullptr)
+ , m_MoveDistance(0)
+ , m_IsKillAnimPlaying(false)
+ , m_IgnoreAppClick(false)
+{
+ setEo(addLayout(parent, ANIM_ITEM_EDJ, "anim_item"));
+ addEventCb(EVAS_CALLBACK_MOUSE_MOVE, makeCbFirst(&TaskListViewItem::onMove), this);
+ addEventCb(EVAS_CALLBACK_MOUSE_DOWN, makeCbFirst(&TaskListViewItem::onDown), this);
+ addEventCb(EVAS_CALLBACK_MOUSE_UP, makeCbFirst(&TaskListViewItem::onUp), this);
+ addSignalCb("zoom_finished", "", makeCbFirst(&TaskListViewItem::onKillAnimFinished), this);
+ addSignalCb("move_finished", "", makeCbFirst(&TaskListViewItem::onKillAnimFinished), this);
+ expand();
+
+ m_pTaskLayout = View::addLayout(getEo(), TASK_ITEM_EDJ, "task_item");
+ elm_object_signal_callback_add(m_pTaskLayout, "app_icon,clicked", "clicked", makeCbFirst(&TaskListViewItem::onAppClicked), this);
+ showDelButton(true);
+ setContent(m_pTaskLayout, "swallow.content");
+
+ setText(m_AppInfo.name);
+ setIcon(m_AppInfo.icon);
+
+ m_pDelButton = new DelButton(m_pTaskLayout);
+ m_pDelButton->addSmartCb("clicked", makeCbFirst(&TaskListViewItem::onDelButtonClicked), this);
+ elm_object_part_content_set(m_pTaskLayout, "swl.delete_button", *m_pDelButton);
+}
+
+TaskListViewItem::~TaskListViewItem()
+{
+
+}
+
+void TaskListViewItem::setIcon(const std::string &path)
+{
+ if (path.empty())
+ return;
+
+ Evas_Object *icon = evas_object_image_add(getEvas());
+ evas_object_image_file_set(icon, path.c_str(), nullptr);
+ if (evas_object_image_load_error_get(icon) != EVAS_LOAD_ERROR_NONE)
+ {
+ LOG_ERROR("Can't load image: ", path);
+ // TODO: load default icon
+ }
+ elm_object_focus_allow_set(icon, false);
+ evas_object_image_filled_set(icon, true);
+ elm_object_part_content_set(m_pTaskLayout, "img.app_image", icon);
+}
+
+void TaskListViewItem::setText(const std::string &text)
+{
+ std::string decorText = "<align=center>" + text + "</align>";
+ Evas_Object *label = elm_label_add(m_pTaskLayout);
+ elm_object_focus_allow_set(label, false);
+ elm_object_text_set(label, decorText.c_str());
+ elm_object_part_content_set(m_pTaskLayout, "swl.app_name", label);
+}
+
+void TaskListViewItem::showDelButton(bool show)
+{
+ const char *sig = show ? "show,delete" : "hide,delete";
+ emitSignal(m_pTaskLayout, sig, "bg");
+}
+
+int TaskListViewItem::getWidth()
+{
+ return WIDTH;
+}
+
+int TaskListViewItem::getHeight()
+{
+ return HEIGHT;
+}
+
+void TaskListViewItem::playKillAnim()
+{
+ if (!m_IsKillAnimPlaying) {
+ m_IsKillAnimPlaying = true;
+ setZoomOutState();
+ setOpacityState();
+ }
+}
+
+void TaskListViewItem::playKillUpAnim()
+{
+ if (!m_IsKillAnimPlaying) {
+ m_IsKillAnimPlaying = true;
+ setZoomOutState();
+ setOpacityState();
+ setOffsetUpState();
+ }
+}
+
+void TaskListViewItem::playKillDownAnim()
+{
+ if (!m_IsKillAnimPlaying) {
+ m_IsKillAnimPlaying = true;
+ setZoomOutState();
+ setOpacityState();
+ setOffsetDownState();
+ }
+}
+
+void TaskListViewItem::setDefaultState()
+{
+ m_IsKillAnimPlaying = false;
+ emitSignal("default_state", "", true);
+}
+
+void TaskListViewItem::setZoomOutState()
+{
+ emitSignal("zoom_out", "", true);
+}
+
+void TaskListViewItem::setOffsetUpState()
+{
+ emitSignal("move_up", "", true);
+}
+
+void TaskListViewItem::setOffsetDownState()
+{
+ emitSignal("move_down", "", true);
+}
+
+void TaskListViewItem::setOpacityState()
+{
+ emitSignal("opacity_hidden", "", true);
+}
+
+void TaskListViewItem::onMove(Evas *e, Evas_Object *obj, void *event_info)
+{
+ auto *event = (Evas_Event_Mouse_Move*)event_info;
+
+ if (m_IsKillAnimPlaying ||
+ !m_IsMouseDown ||
+ (event->event_flags & EVAS_EVENT_FLAG_ON_HOLD))
+ return;
+
+ int delta = event->cur.output.y - m_DownYPos;
+ static const int dragThreshold = 25;
+
+ if (m_IsDragStart) {
+ static int screenWidth = 0;
+ if (screenWidth == 0)
+ App::getInst().getWindow().getScreenSize(nullptr, &screenWidth);
+
+ m_MoveDistance = delta / (double)screenWidth;;
+ m_EdjeMsg.val = m_MoveDistance;
+ edje_object_message_send(getEdje(), EDJE_MESSAGE_FLOAT, 1, &m_EdjeMsg);
+
+ } else if (abs(delta) > dragThreshold) {
+ m_MoveDistance = 0;
+ m_IsDragStart = true;
+ m_DownYPos = event->cur.output.y;
+ m_Parent.freezeScrollPush();
+ }
+}
+
+void TaskListViewItem::onDown(Evas *e, Evas_Object *obj, void *event_info)
+{
+ if (m_IsKillAnimPlaying)
+ return;
+
+ m_IgnoreAppClick = false;
+ auto *event = (Evas_Event_Mouse_Down*)event_info;
+ m_DownYPos = event->output.y;
+ m_IsMouseDown = true;
+}
+
+void TaskListViewItem::onUp(Evas *e, Evas_Object *obj, void *event_info)
+{
+ if (m_IsKillAnimPlaying)
+ return;
+
+ static const double killThreshold = 0.3;
+
+ m_IsMouseDown = false;
+ if (m_IsDragStart) {
+ m_IgnoreAppClick = true;
+ m_IsDragStart = false;
+ m_Parent.freezeScrollPop();
+
+ if (m_MoveDistance >= killThreshold)
+ playKillDownAnim();
+ else if (m_MoveDistance <= -killThreshold)
+ playKillUpAnim();
+ else
+ setDefaultState();
+
+ m_MoveDistance = 0;
+ }
+}
+
+void TaskListViewItem::onDelButtonClicked(Evas_Object *obj, void *event_info)
+{
+ LOG("");
+ playKillAnim();
+}
+
+void TaskListViewItem::onAppClicked(Evas_Object *obj, const char *emission, const char *source)
+{
+ if (!m_IgnoreAppClick && !m_IsKillAnimPlaying) {
+ LOG("");
+ m_Parent.onAppClicked(*this);
+ }
+}
+
+void TaskListViewItem::onKillAnimFinished(Evas_Object *obj, const char *emission, const char *source)
+{
+ LOG("");
+ m_IsKillAnimPlaying = false;
+ m_Parent.onDelRequest(*this);
+ destroy();
+}
+
BaseView();
virtual ~BaseView() {};
- operator Evas_Object *() const;
+ operator Eo *() const;
Eo *getEo() const;
/**
* @return absolute path in case of success, or empty string otherwise
*/
const std::string &getDownloadPath();
+
+ /**
+ * @brief Gets the absolute path to edje file
+ * @param[in] base edje file name
+ * @return absolute path to file
+ */
+ std::string getEdjePath(const std::string &fileName);
};
}
static void setText(Evas_Object *obj, const TText &text, const char *part = nullptr);
- static Evas_Object *addLayout(Evas_Object *parent, const std::string &edjePath, const std::string &group);
+ static Evas_Object *addLayout(Evas_Object *parent, const std::string &edjeName, const std::string &group);
protected:
virtual ~View();
Evas_Object *getConformEvasObject() const;
Evas_Object *getHostEvasObject() const;
void setContent(Evas_Object *content);
- void getScreenSize(int *x, int *y, int *w, int *h) const;
+ void getScreenSize(int *w, int *h) const;
int getRotation() const;
void lower();
void raise();
#include "PathUtils.h"
#include "Logger.h"
+#include "Resource.h"
#include <storage-expand.h>
#include <stdlib.h>
return downloadPath;
}
+
+std::string getEdjePath(const std::string &fileName)
+{
+ return getResourcePath(EDJ_PATH"/" + fileName);
+}
+
} // PathUtils
} // TaskMngr
processSignal(obj);
}
-Evas_Object *View::addLayout(Evas_Object *parent, const std::string &edjePath, const std::string &group)
+Evas_Object *View::addLayout(Evas_Object *parent, const std::string &edjeName, const std::string &group)
{
Evas_Object *layout = elm_layout_add(parent);
- std::string edjAbsPath = PathUtils::getResourcePath(edjePath);
+ std::string edjAbsPath = PathUtils::getEdjePath(edjeName);
elm_layout_file_set(layout, edjAbsPath.c_str(), group.c_str());
return layout;
}
elm_object_content_set(m_pConform, content);
}
-void Window::getScreenSize(int *x, int *y, int *w, int *h) const
+void Window::getScreenSize(int *w, int *h) const
{
- elm_win_screen_size_get(getEo(), x, y, w, h);
+ elm_win_screen_size_get(getEo(), nullptr, nullptr, w, h);
}
int Window::getRotation() const
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.taskmanager" version="1.0.0">
- <profile name="wearable" />
- <ui-application appid="org.tizen.taskmanager" exec="taskmanager" type="capp" multiple="false" taskmanage="true" nodisplay="false" hw-acceleration="on">
- <icon>taskmanager.png</icon>
- <label>taskmanager</label>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
- <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
- </privileges>
+ <profile name="wearable" />
+ <ui-application appid="org.tizen.taskmanager" exec="taskmanager" type="capp" multiple="false" taskmanage="true" nodisplay="false" hw-acceleration="on">
+ <icon>taskmanager.png</icon>
+ <label>taskmanager</label>
+ </ui-application>
+ <privileges>
+ <privilege>http://tizen.org/privilege/packagemanager.clearcache</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.kill.bgapp</privilege>
+ <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+ <privilege>http://tizen.org/privilege/packagemanager.info</privilege>
+ </privileges>
</manifest>