TBT_APP_AUTO_ROTATION_ENABLED,
TBT_APP_LOCATION_SERVICE_ENABLED,
TBT_APP_WIFI_HOTSPOT_ENABLED,
-
+
TBT_APP_SCREEN_MIRROR_SINK,
TBT_APP_ATTACH_PANEL,
TBT_APP_NSD_SSDP_REMOTE,
TBT_APP_STORAGE,
-
+
TBT_APP_RADIO,
-
+
TBT_APP_SOUND_MANAGER,
TBT_APP_SOUND_MANAGER_DEVICE,
TBT_APP_MEDIA_KEY,
-
+
TBT_APP_PACKAGE_MANAGER,
TBT_APP_NOTIFICATION_TEXT,
-
+
TBT_APP_NOTIFICATION_TIME,
TBT_APP_NOTIFICATION_TITLE,
TBT_APP_NOTIFICATION_IMAGE,
-
+
TBT_APP_CONNECTION,
TBT_APP_SYSTEM_SETTINGS_FONT,
TBT_APP_STT_ERROR,
- TBT_APP_SMARTCARD
+ TBT_APP_SMARTCARD,
+ TBT_APP_MOTION_DETECTION
} tbt_app_type_e;
FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_MENU,
FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_BACK,
FEATURE_FIDO_UAF,
-
+ FEATURE_ACTIVITY_RECOGNITION,
ALL_FEATURES
}features_e;
[FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_VOLUME] = "tizen.org/system/input.key.volume",
[FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_MENU] = "tizen.org/system/input.key.menu",
[FEATURE_TIZEN_ORG_SYSTEM_INPUT_KEY_BACK] = "tizen.org/system/input.key.back",
- [FEATURE_FIDO_UAF] = "tizen.org/feature/fido.uaf"
-
+ [FEATURE_FIDO_UAF] = "tizen.org/feature/fido.uaf",
+ [FEATURE_ACTIVITY_RECOGNITION] = "tizen.org/feature/activity_recognition"
};
#endif /* __TBT_INFO_H__ */
#define TBT_MODULE_SMARTCARD
#define TBT_MODULE_APP_SMARTCARD
+#define TBT_MODULE_MOTION
+#define TBT_MODULE_APP_MOTION_DETECTION
#endif
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *
+ *******************************************************************************/
+/**
+ * @file tbt-motion-detection-view.h
+ * @brief Detect motion in device
+ * @since_tizen 3.0
+ * @author Maneesha Karn (maneesha.k@samsung.com)
+ * @date August, 2017
+ * @bug NA
+ * @credit
+ *
+ */
+
+#ifndef __TBT_MOTION_DETECTION_VIEW_H__
+#define __TBT_MOTION_DETECTION_VIEW_H__
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MOTION
+
+#include <Evas.h>
+#include "model/tbt-list.h"
+
+#include <activity_recognition.h>
+#include <gesture_recognition.h>
+
+/**
+ * @typedef _motion_detection_view
+ * @since_tizen 4.0
+ * @brief A motion detection handler
+ */
+typedef struct _motion_detection_view motion_detection_view;
+
+/**
+ * @brief Add motion detection view
+ * @since_tizen 3.0
+ * @param[in] app The pointer to _app_data instance
+ * @param[in] navi The naviframe object
+ * @return motion detection view data
+ */
+motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item);
+
+#endif //TBT_MODULE_MOTION
+#endif // __TBT_MOTION_DETECTION_VIEW_H__
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ */
+
+#define TEXT_HEIGHT 0.08
+#define CONTENT_X_PAD 0.15
+
+collections
+{
+ base_scale: 1.8;
+ group
+ {
+ name: "motion_detection_viewer";
+ parts{
+ part{
+ name: "activity_text";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ visible: 1;
+ rel1 {relative: 0.0 0.0; }
+ rel2 {relative: 1.0 TEXT_HEIGHT; }
+ }
+ }
+
+ part{
+ name: "activity_image";
+ type: SWALLOW;
+ description{
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ max : 100 100;
+ min : 100 100;
+ visible: 1;
+ rel1{
+ relative: 1.0 1.0;
+ to_y: "activity_text";
+ }
+ rel2{
+ relative: 0.0 0.80;
+ }
+ }
+ }
+ part{
+ name: "controlr_part";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align : 0 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ to_y: "activity_image";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ visible: 1;
+ }//Ending description
+ }//Ending part
+ }//Ending parts
+ }//Ending group
+}//Ending collections
.icon_name = "dummy",
.info = "DALi Scroll Functionality",
.result = 0,
+ },
+ #endif
+#endif
+#ifdef TBT_MODULE_MOTION
+ #ifdef TBT_MODULE_APP_MOTION_DETECTION
+ {
+ .name = "Motion Detection",
+ .parent = "Motion",
+ .apptype = TBT_APP_MOTION_DETECTION,
+ .icon_name = "dummy",
+ .file_name = "images/Not_Detecting.jpg",
+ .info = "1.Please press Start Detection <br/>2. Perform corresponding activity with phone in hand(Stationary, Walk, Run and In Vehicle <br/>3. Once done press Stop Detection <br/>4. If All Activities are indicated on the label then Test Case Pass else Fail",
+ .result = 0,
+ .required_features_count = 1,
+ .features_required = {FEATURE_ACTIVITY_RECOGNITION}
}
#endif
#endif
"tizen.org/feature/vision.face_recognition",
"tizen.org/feature/vision.image_recognition",
"tizen.org/feature/vision.qrcode_generation",
- "tizen.org/feature/vision.qrcode_recognition"};
+ "tizen.org/feature/vision.qrcode_recognition",
+ "tizen.org/feature/activity_recognition"};
char chResult[1000];
int i;
#include "view/tbt-mtp-view.h"
#include "view/tbt-nsd-dns-sd-view.h"
#include "view/tbt-nsd-ssdp-view.h"
-#include "view/tbt-storage-view.h"
+//#include "view/tbt-storage-view.h"
#include "view/tbt-radio-view.h"
#include "view/tbt-sound-manager-view.h"
#include "view/tbt-media-key-view.h"
#include "view/tbt-tts-view.h"
#include "view/tbt-stt-view.h"
#include "view/tbt-smartcard-view.h"
-
+#include "view/tbt-motion-detection-view.h"
typedef struct
{
break;
#endif
#endif
-
+ #ifdef TBT_MODULE_MOTION
+ case TBT_APP_MOTION_DETECTION:
+ motion_detection_view_add(view->navi, info, it);
+ break;
+ #endif
default:
assert(false);
break;
--- /dev/null
+/*******************************************************************************
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ *******************************************************************************/
+/**
+ * @file tbt-motion-detection-view.c
+ * @brief shows motion detected and indicates the same on display
+ *
+ * @author Maneesha Karn (maneesha.k@samsung.com)
+ * @date August, 2017
+ * @bug no known bug
+ * @credit
+ *
+ */
+
+#include "utils/app_module_config.h"
+#ifdef TBT_MODULE_MOTION
+
+#include <Elementary.h>
+
+#include "utils/logger.h"
+#include "utils/config.h"
+#include "utils/ui-utils.h"
+#include "view/tbt-motion-detection-view.h"
+#include "view/tbt-common-view.h"
+
+
+enum
+{
+ ACTIVITY_TOOLBAR_ITEM_INDEX_STATIONARY = 0,
+ ACTIVITY_TOOLBAR_ITEM_INDEX_WALK,
+ ACTIVITY_TOOLBAR_ITEM_INDEX_RUN,
+ ACTIVITY_TOOLBAR_ITEM_INDEX_IN_VEHICLE,
+ ACTIVITY_TOOLBAR_ITEM_INDEX_COUNT_MAX
+} ACTIVITY_TOOLBAR_ITEM_INDEXS;
+
+
+struct _motion_detection_view
+{
+ common_view* view;
+ activity_h handle;
+ Evas_Object *start_detection_button;
+ Evas_Object *stop_detection_button;
+ Evas_Object *activity_image;
+ Evas_Object *activity_label;
+};
+
+static void _app_destroy_cb(void* this);
+static void _start_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info);
+static void _stop_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info);
+static char * _motion_get_activity_type(activity_type_e activity_type);
+static Evas_Object *add_control_layout(motion_detection_view *this, Evas_Object *parent);
+static void activity_recognition_callback_check_type(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data);
+static char *_activity_error(int activity_error);
+
+
+/**
+ * @function motion_detection_view_add
+ * @since_tizen 2.3
+ * @description Motion Detection View Add
+ * @parameter Evas_Object*: Evas Object Pointer, tbt_info*: Tbt Info Pointer, Elm_Object_Item*: Elm Object Item Pointer
+ * @return motion_detection_view*
+ */
+motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item)
+{
+ RETVM_IF(NULL == navi, NULL, "navi is null");
+
+ int x,y,w,h;
+ evas_object_geometry_get(navi, &x, &y, &w, &h);
+ DBG("Dim: %d %d %d %d", x, y, w, h);
+
+ motion_detection_view *this = NULL;
+ this = calloc(1, sizeof(motion_detection_view));
+ RETVM_IF(!this, NULL, "calloc failed");
+
+ this->view = calloc(1, sizeof(common_view));
+ RETVM_IF(!this->view, NULL, "calloc failed");
+
+ tbt_info->layout_group = "motion_detection_viewer";
+ tbt_info->layout_file = get_edje_path("motion_detection_viewer.edj");
+
+ common_view_add(navi, tbt_info, item, this->view, _app_destroy_cb, this);
+
+ RETVM_IF(NULL == this->view, NULL, "navi is null");
+
+ this->activity_label = ui_utils_label_add(this->view->layout, "Activity Status");
+ RETVM_IF(NULL == this->activity_label, NULL, "Label is null");
+
+ elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label);
+ ui_utils_label_set_text(this->activity_label, "Activity Status", "left");
+ const char *file_path;
+ file_path = get_resource_path(this->view->tbt_info->file_name);
+ this->activity_image = ui_utils_create_image(this->view->layout, file_path);
+
+ //int x,y,w,h;
+ evas_object_geometry_get(this->activity_image, &x, &y, &w, &h);
+ DBG("Dim: %d %d %d %d", x, y, w, h);
+
+ RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed");
+
+ elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image);
+
+ Evas_Object *control = add_control_layout(this, this->view->layout);
+ elm_object_part_content_set(this->view->layout, "controlr_part", control);
+ evas_object_show(control);
+ return this;
+}
+
+
+
+
+/**
+ * @function _activity_error
+ * @since_tizen 3.0
+ * @description Return string name of Activity Error detected
+ * @parameter int activity_error
+ * @return static char *
+ */
+static char *_activity_error(int activity_error)
+{
+ char error[50];
+ switch(activity_error)
+ {
+ case ACTIVITY_ERROR_ALREADY_STARTED :
+ strcpy(error,"ACTIVITY_ERROR_ALREADY_STARTED");
+ break;
+ case ACTIVITY_ERROR_INVALID_OPERATION:
+ strcpy(error,"ACTIVITY_ERROR_INVALID_OPERATION");
+ break;
+ case ACTIVITY_ERROR_INVALID_PARAMETER:
+ strcpy(error,"ACTIVITY_ERROR_INVALID_PARAMETER");
+ break;
+ case ACTIVITY_ERROR_NOT_STARTED :
+ strcpy(error,"ACTIVITY_ERROR_NOT_STARTED");
+ break;
+ case ACTIVITY_ERROR_NOT_SUPPORTED :
+ strcpy(error,"ACTIVITY_ERROR_NOT_SUPPORTED");
+ break;
+ case ACTIVITY_ERROR_OPERATION_FAILED:
+ strcpy(error,"ACTIVITY_ERROR_OPERATION_FAILED");
+ break;
+ case ACTIVITY_ERROR_OUT_OF_MEMORY:
+ strcpy(error,"ACTIVITY_ERROR_OUT_OF_MEMORY");
+ break;
+ case ACTIVITY_ERROR_PERMISSION_DENIED:
+ strcpy(error,"ACTIVITY_ERROR_PERMISSION_DENIED");
+ break;
+ default:
+ strcpy(error, "Unrecognized Error");
+ }
+ return strdup(error);
+ }
+
+
+
+/**
+ * @function _motion_get_activity_type
+ * @since_tizen 3.0
+ * @description Return string name of Activity detected
+ * @parameter activity_type_e activity_type
+ * @return static char *
+ */
+static char * _motion_get_activity_type(activity_type_e activity_type)
+{
+ DBG("_motion_get_activity_type");
+ const int LEN = 100;
+ char string[LEN];
+ switch(activity_type)
+ {
+ case ACTIVITY_STATIONARY :
+ snprintf(string, LEN, "Activity Stationary");
+ DBG("ACTIVITY_STATIONARY ");
+ break;
+ case ACTIVITY_WALK:
+ snprintf(string, LEN, "Activity is Walking");
+ DBG("ACTIVITY_WALK");
+ break;
+ case ACTIVITY_RUN:
+ snprintf(string, LEN, "Activity is Running");
+ DBG("ACTIVITY_RUN");
+ break;
+ case ACTIVITY_IN_VEHICLE :
+ snprintf(string, LEN, "Activity is In Vehicle");
+ DBG("ACTIVITY_IN_VEHICLE ");
+ break;
+ default :
+ snprintf(string, LEN, "Unrecognized Activity");
+ DBG("Unrecognized Activity");
+ }
+ return strdup(string);
+}
+
+
+/**
+ * @function _start_detection_button_pressed_cb
+ * @since_tizen 3.0
+ * @description Callback called when an activity is detected
+ * @parameter void
+ * @return void *data, Evas_Object *obj, void *event_info
+ */
+static void _start_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ DBG(" start_detection_button_pressed_cb ");
+
+ RETM_IF(NULL == data, "data is NULL");
+
+ motion_detection_view *this = NULL;
+ this = (motion_detection_view*)data;
+ RETM_IF(NULL == this, "view is NULL");
+ activity_type_e activity_type = ACTIVITY_STATIONARY;
+
+ int nRet = activity_start_recognition(this->handle, activity_type, activity_recognition_callback_check_type, this);
+
+ if(nRet != ACTIVITY_ERROR_NONE)
+ {
+ this->view->tbt_info->result = TBT_INFO_RESULT_NOT_SUPPORTED;
+ elm_genlist_item_update(this->view->item);
+ elm_naviframe_item_pop(this->view->navi);
+ activity_stop_recognition(this->handle);
+ activity_release(this->handle);
+ RETM_IF(nRet != ACTIVITY_ERROR_NONE, "activity_start_recognition failed for activity type = %s",_motion_get_activity_type(activity_type));
+ }
+}
+
+
+
+/**
+ * @function activity_recognition_callback_check_type
+ * @since_tizen 3.0
+ * @description To Check the activity type
+ * @parameter void
+ * @return activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data
+ */
+static void activity_recognition_callback_check_type(activity_type_e activity, const activity_data_h data, double timestamp, activity_error_e error, void *user_data)
+{
+ char label[200]={'\0'};
+ DBG("activity_recognition_callback_check_type");
+ RETM_IF(NULL == user_data, "User data is NULL");
+ motion_detection_view *this = (motion_detection_view*)user_data;
+ snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", _motion_get_activity_type(activity));
+ ui_utils_label_set_text(this->activity_label, label, "left");
+ return;
+}
+
+
+
+/**
+ * @function _stop_detection_button_pressed_cb
+ * @since_tizen 3.0
+ * @description To handle stop detection button pressed event
+ * @parameter void
+ * @return void *data, Evas_Object *obj, void *event_info
+ */
+
+
+static void _stop_detection_button_pressed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ DBG(" _stop_detection_button_pressed_cb ");
+ RETM_IF(NULL == data, "data is NULL");
+ motion_detection_view *this = NULL;
+ this = (motion_detection_view*)data;
+ RETM_IF(NULL == this, "view is NULL");
+ activity_stop_recognition(this->handle);
+ activity_release(this->handle);
+}
+
+
+/**
+ * @function add_control_layout
+ * @since_tizen 3.0
+ * @description To add buttons to the view
+ * @parameter void
+ * @return motion_detection_view *this, Evas_Object *parent
+ */
+
+static Evas_Object *add_control_layout(motion_detection_view *this, Evas_Object *parent)
+{
+ DBG("add_control_layout__");
+
+ RETVM_IF(NULL == this, NULL, "view is NULL");
+ RETVM_IF(NULL == parent, NULL, "parent is NULL");
+
+ Evas_Object *table = elm_table_add(parent);
+
+ evas_object_size_hint_weight_set(table, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(table, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(table);
+
+ this->start_detection_button = ui_utils_push_button_add(this, table, "Start Detection", _start_detection_button_pressed_cb);
+ RETVM_IF(NULL == this->start_detection_button, NULL, "this->start_detection_button is NULL");
+ elm_table_pack(table, this->start_detection_button, 0, 0, 1, 1);
+ this->stop_detection_button= ui_utils_push_button_add(this, table, "Stop Detection", _stop_detection_button_pressed_cb);
+ RETVM_IF(NULL == this->stop_detection_button, NULL, "this->stop_detection_button is NULL");
+ elm_table_pack(table, this->stop_detection_button, 1, 0, 1, 1);
+
+ return table;
+}
+
+
+/**
+ * @function _app_destroy_cb
+ * @since_tizen 2.3
+ * @description App Destroy Cb
+ * @parameter void*: Void Pointer
+ * @return static void
+ */
+static void _app_destroy_cb(void* this)
+{
+ RETM_IF(NULL == this, "data is NULL");
+
+ motion_detection_view *view = NULL;
+ view = (motion_detection_view*)this;
+ RETM_IF(NULL == view, "view is NULL");
+
+ SAFE_DELETE(view->view);
+ SAFE_DELETE(view);
+}
+
+#endif