summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoHyun Pyun <dh79.pyun@samsung.com>2021-07-01 10:38:26 +0900
committerDoHyun Pyun <dh79.pyun@samsung.com>2021-07-01 10:42:53 +0900
commit945cf410334e1fe05f7bac8b08f3793d55515e66 (patch)
tree548ad2d7fa5145a2fa275a7b5ce50aecdaf549b0
parentf3d21e3868ed5bf63a102a9cc7adea4d9e81db97 (diff)
downloadbluetooth-share-ui-accepted/tizen_7.0_unified_hotfix.tar.gz
bluetooth-share-ui-accepted/tizen_7.0_unified_hotfix.tar.bz2
bluetooth-share-ui-accepted/tizen_7.0_unified_hotfix.zip
Change-Id: Ie3f8c122ffde971a4d24112377948f1dd5a278e4 Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
-rw-r--r--CMakeLists.txt1
-rwxr-xr-xpackaging/org.tizen.bluetooth-share-ui.spec3
-rw-r--r--src/bt-share-ui-main.c43
-rw-r--r--src/bt-share-ui-main.h13
-rw-r--r--src/bt-share-ui-resource.h3
-rw-r--r--src/bt-share-ui-view.c26
6 files changed, 83 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab8e391..71b1826 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,7 @@ pkg_check_modules(pkgs REQUIRED
evas
gobject-2.0
aul
+ capi-system-info
capi-appfw-application
capi-network-bluetooth
bluetooth-share-api
diff --git a/packaging/org.tizen.bluetooth-share-ui.spec b/packaging/org.tizen.bluetooth-share-ui.spec
index 36ec435..d5f453e 100755
--- a/packaging/org.tizen.bluetooth-share-ui.spec
+++ b/packaging/org.tizen.bluetooth-share-ui.spec
@@ -4,7 +4,7 @@
Name: org.tizen.bluetooth-share-ui
Summary: bluetooth share UI application
Version: 0.6.0
-Release: 1
+Release: 2
Group: TO_BE_FILLED
License: Flora-1.1
Source0: %{name}-%{version}.tar.gz
@@ -22,6 +22,7 @@ BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(capi-network-bluetooth)
+BuildRequires: pkgconfig(capi-system-info)
BuildRequires: pkgconfig(bluetooth-share-api)
BuildRequires: pkgconfig(notification)
diff --git a/src/bt-share-ui-main.c b/src/bt-share-ui-main.c
index ba4b88b..bd78c27 100644
--- a/src/bt-share-ui-main.c
+++ b/src/bt-share-ui-main.c
@@ -49,10 +49,53 @@
#include <bluetooth.h>
#include <bluetooth_internal.h>
#include <bundle_internal.h>
+#include <system_info.h>
bt_share_appdata_t *app_state = NULL;
bt_share_appdata_t app_data = {0,};
+tizen_profile_t _get_tizen_profile()
+{
+ static tizen_profile_t profile = _PROFILE_UNKNOWN;
+ char *profileName = NULL;
+
+ if (__builtin_expect(profile != _PROFILE_UNKNOWN, 1))
+ return profile;
+
+ system_info_get_platform_string("http://tizen.org/feature/profile", &profileName);
+ if (!profileName)
+ return _PROFILE_UNKNOWN;
+
+ switch (*profileName) {
+ case 'm':
+ case 'M':
+ profile = _PROFILE_MOBILE;
+ break;
+ case 'w':
+ case 'W':
+ profile = _PROFILE_WEARABLE;
+ break;
+ case 't':
+ case 'T':
+ profile = _PROFILE_TV;
+ break;
+ case 'i':
+ case 'I':
+ if (!strncasecmp(profileName, "ivi", 3))
+ profile = _PROFILE_IVI;
+ else if (!strncasecmp(profileName, "iot", 3))
+ profile = _PROFILE_IOT;
+ else
+ profile = _PROFILE_COMMON;
+ break;
+ default: // common or unknown ==> ALL ARE COMMON.
+ profile = _PROFILE_COMMON;
+ }
+ free(profileName);
+
+ return profile;
+}
+
static void __bt_lang_changed_cb(app_event_info_h event_info, void *data)
{
DBG("+");
diff --git a/src/bt-share-ui-main.h b/src/bt-share-ui-main.h
index 651edd0..3aeb4f1 100644
--- a/src/bt-share-ui-main.h
+++ b/src/bt-share-ui-main.h
@@ -89,6 +89,19 @@ typedef enum {
BT_LAUNCH_TRANSFER_LIST
} bt_share_launch_mode_t;
+typedef enum {
+ _PROFILE_UNKNOWN = 0,
+ _PROFILE_MOBILE = 0x1,
+ _PROFILE_WEARABLE = 0x2,
+ _PROFILE_TV = 0x4,
+ _PROFILE_IVI = 0x8,
+ _PROFILE_IOT = 0x10,
+ _PROFILE_COMMON = 0x20,
+} tizen_profile_t;
+
+tizen_profile_t _get_tizen_profile();
+#define TIZEN_COMMON ((_get_tizen_profile()) == _PROFILE_COMMON)
+
typedef struct {
bt_share_launch_mode_t launch_mode;
bt_adapter_state_e bt_status;
diff --git a/src/bt-share-ui-resource.h b/src/bt-share-ui-resource.h
index 0b8c67c..c279beb 100644
--- a/src/bt-share-ui-resource.h
+++ b/src/bt-share-ui-resource.h
@@ -104,6 +104,9 @@ extern "C" {
#define BT_SHARE_ITEM_PART_DEVICE_NAME_TITLE "elm.text"
#define BT_SHARE_ITEM_PART_DEVICE_NAME "elm.text.sub"
+#define BT_SHARE_ITEM_PART_DEVICE_NAME_TITLE_COMMON "elm.icon"
+#define BT_SHARE_ITEM_PART_DEVICE_NAME_COMMON "elm.end"
+
#define BT_SHARE_ITEM_PART_TRANSFER_TYPE_TITLE "elm.text"
#define BT_SHARE_ITEM_PART_TRANSFER_STATUS "elm.text.sub"
diff --git a/src/bt-share-ui-view.c b/src/bt-share-ui-view.c
index 73a83e7..7f7a35d 100644
--- a/src/bt-share-ui-view.c
+++ b/src/bt-share-ui-view.c
@@ -385,14 +385,24 @@ static Evas_Object *__bt_tr_icon_get(void *data, Evas_Object *obj,
ERR("Error in setting layout file");
#endif
icon = elm_progressbar_add(obj);
- elm_object_style_set(icon, "process_medium");
+
+ if (TIZEN_COMMON)
+ elm_object_style_set(icon, "process_small");
+ else
+ elm_object_style_set(icon, "process_medium");
+
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(icon, TRUE);
return icon;
} else if (info->tr_status == BT_TRANSFER_PENDING) {
icon = elm_progressbar_add(obj);
- elm_object_style_set(icon, "process_medium");
+
+ if (TIZEN_COMMON)
+ elm_object_style_set(icon, "process_small");
+ else
+ elm_object_style_set(icon, "process_medium");
+
evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, 0.5);
evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_progressbar_pulse(icon, TRUE);
@@ -643,9 +653,11 @@ static char *__bt_tr_device_label_get(void *data, Evas_Object *obj,
retv_if(ad->transfer_info == NULL, NULL);
- if (!strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME_TITLE)) {
+ if (!strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME_TITLE) ||
+ !strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME_TITLE_COMMON)) {
return g_strdup(BT_STR_DEVICENAME);
- } else if (!strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME)) {
+ } else if (!strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME) ||
+ !strcmp(part, BT_SHARE_ITEM_PART_DEVICE_NAME_COMMON)) {
bt_share_transfer_data_t *transfer_info = ad->transfer_info;
DBG_SECURE("Device : %s", transfer_info->device_name);
if (ad->bt_status == BT_ADAPTER_ENABLED) {
@@ -1294,7 +1306,11 @@ static Evas_Object *__bt_add_tr_data_genlist(Evas_Object *parent,
elm_genlist_homogeneous_set(genlist, EINA_TRUE);
ad->tr_device_itc = elm_genlist_item_class_new();
if (ad->tr_device_itc) {
- ad->tr_device_itc->item_style = "type1";
+ if (TIZEN_COMMON)
+ ad->tr_device_itc->item_style = "2line";
+ else
+ ad->tr_device_itc->item_style = "type1";
+
ad->tr_device_itc->func.text_get = __bt_tr_device_label_get;
ad->tr_device_itc->func.content_get = NULL;
ad->tr_device_itc->func.state_get = NULL;