Modify the genlist item style for IOT profile 67/260667/3 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.5/unified/20211028.092953 accepted/tizen/7.0/unified/20221110.061631 accepted/tizen/7.0/unified/hotfix/20221116.104254 accepted/tizen/8.0/unified/20231005.092342 accepted/tizen/unified/20210702.133354 submit/tizen/20210701.031252 submit/tizen_6.5/20211028.161201 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 1 Jul 2021 01:38:26 +0000 (10:38 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 1 Jul 2021 01:42:53 +0000 (10:42 +0900)
Change-Id: Ie3f8c122ffde971a4d24112377948f1dd5a278e4
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
CMakeLists.txt
packaging/org.tizen.bluetooth-share-ui.spec
src/bt-share-ui-main.c
src/bt-share-ui-main.h
src/bt-share-ui-resource.h
src/bt-share-ui-view.c

index ab8e391..71b1826 100644 (file)
@@ -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
index 36ec435..d5f453e 100755 (executable)
@@ -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)
 
index ba4b88b..bd78c27 100644 (file)
 #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("+");
index 651edd0..3aeb4f1 100644 (file)
@@ -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;
index 0b8c67c..c279beb 100644 (file)
@@ -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"
 
index 73a83e7..7f7a35d 100644 (file)
@@ -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;