This patch resolve the active/inactive issue of volume icons 24/212424/4 accepted/tizen/unified/20190822.105938 submit/tizen/20190822.065503
authorJagrat Patidar <j1.patidar@samsung.com>
Wed, 21 Aug 2019 17:09:38 +0000 (22:39 +0530)
committerJagrat Patidar <j1.patidar@samsung.com>
Thu, 22 Aug 2019 12:38:43 +0000 (18:08 +0530)
This patch corrects the active and inactive status of sound icons as per the UX guide (page - 22, 23, 24)

Change-Id: I5e355c0b6ac9e77b3501eb516d95fbb3454bc0de
Signed-off-by: Jagrat Patidar <j1.patidar@samsung.com>
inc/main.h
res/edje/volume_app.edc
res/images/private/volume/sound_off_icon_volume.png [new file with mode: 0644]
res/images/private/volume/sound_off_icon_volume_mute.png [new file with mode: 0644]
src/view.c

index ebd383f7a144af96b6f9b6e0ca68d923b9566e9e..f2bb6a930ab7667d9f3cd8a71fc2b2ecee041b36 100755 (executable)
 #define EDJ_APP EDJ_DIR"/volume_app.edj"
 
 #define IMG_VOLUME_ICON "sound_slider_icon_volume.png"
+#define IMG_VOLUME_ICON_OFF "sound_off_icon_volume.png"
 #define IMG_VOLUME_ICON_VIB "sound_slider_icon_volume_vibrate.png"
 #define IMG_VOLUME_ICON_MUTE "sound_slider_icon_volume_mute.png"
+#define IMG_VOLUME_ICON_MUTE_OFF "sound_off_icon_volume_mute.png"
 #define IMG_VOLUME_ICON_NOTI "sound_slider_icon_notification.png"
 #define IMG_VOLUME_ICON_NOTI_VIB "sound_slider_icon_notification_vibrate.png"
 #define IMG_VOLUME_ICON_NOTI_MUTE "sound_slider_icon_notification_mute.png"
index 4713589c09ae5db5f2ced429550becaf0fa3dce2..66fafbe42bb8ffa08b8d574c9c90d274d87365c9 100755 (executable)
@@ -240,6 +240,8 @@ group { \
 collections {
 
 RESOURCE_IMAGE_ORI(sound_slider_icon_volume.png);
+RESOURCE_IMAGE_ORI(sound_off_icon_volume.png);
+RESOURCE_IMAGE_ORI(sound_off_icon_volume_mute.png);
 RESOURCE_IMAGE(sound_slider_icon_volume_vibrate.png);
 RESOURCE_IMAGE_ORI(sound_slider_icon_volume_mute.png);
 RESOURCE_IMAGE(sound_slider_icon_notification.png);
@@ -378,13 +380,12 @@ RESOURCE_IMAGE(00_volume_icon_settings_pressed.png);
 
                        part {
                                name : "ic_sound_mute";
-                               type : IMAGE;
+                               type : SWALLOW;
                                clip_to: "clipper";
                                scale : 1;
                                description {
                                        state : "default" 0.0;
                                        fixed : 1 1;
-                                       image.normal: "sound_slider_icon_volume_mute.png";
                                        rel1 { relative : IC_SOUND_MUTE_X_MIN IC_SOUND_MUTE_Y_MIN; to : "clipper";}
                                        rel2 { relative : IC_SOUND_MUTE_X_MAX IC_SOUND_MUTE_Y_MAX; to : "clipper";}
                                        aspect : 1 1;
@@ -575,6 +576,7 @@ RESOURCE_IMAGE(00_volume_icon_settings_pressed.png);
                                target : "popup_bg";
                                target : "bg";
                                target : "ic_sound";
+                               target : "ic_sound_mute";
                                target : "ic_setting";
                                target : "sw.slider";
                                target : "divider";
@@ -587,6 +589,7 @@ RESOURCE_IMAGE(00_volume_icon_settings_pressed.png);
                                target : "popup_bg";
                                target : "bg";
                                target : "ic_sound";
+                               target : "ic_sound_mute";
                                target : "ic_setting";
                                target : "sw.slider";
                                target : "divider";
@@ -599,6 +602,7 @@ RESOURCE_IMAGE(00_volume_icon_settings_pressed.png);
                                target : "popup_bg";
                                target : "bg";
                                target : "ic_sound";
+                               target : "ic_sound_mute";
                                target : "ic_setting";
                                target : "sw.slider";
                                target : "divider";
diff --git a/res/images/private/volume/sound_off_icon_volume.png b/res/images/private/volume/sound_off_icon_volume.png
new file mode 100644 (file)
index 0000000..eed4280
Binary files /dev/null and b/res/images/private/volume/sound_off_icon_volume.png differ
diff --git a/res/images/private/volume/sound_off_icon_volume_mute.png b/res/images/private/volume/sound_off_icon_volume_mute.png
new file mode 100644 (file)
index 0000000..deb8eb5
Binary files /dev/null and b/res/images/private/volume/sound_off_icon_volume_mute.png differ
index 6367835e69beeb72731f909ab31ba598633b0ef1..2886bf80ea2efd33c897b3c4884cab6226c79fa1 100755 (executable)
@@ -37,6 +37,7 @@ struct _view_s_info {
        Evas_Object *evas;
        Evas_Object *ly_outer;
        Evas_Object *icon_volume;
+       Evas_Object *icon_volume_mute;
        Evas_Object *icon_setting;
        Evas_Object *slider;
        Evas_Object *warning_popup;
@@ -323,18 +324,27 @@ void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibrati
 {
        _D("Volume icon set");
        char *img = NULL;
+       char *img_mute = NULL;
 
        if (sound == -1 || vibration == -1) {
-               img = IMG_VOLUME_ICON_MUTE;
+               img = IMG_VOLUME_ICON_OFF;
+               img_mute = IMG_VOLUME_ICON_MUTE;
                _D("img : %s", img);
                elm_image_file_set(view_info.icon_volume, volume_view_get_file_path(EDJ_APP), img);
+               elm_image_file_set(view_info.icon_volume_mute, volume_view_get_file_path(EDJ_APP), img_mute);
                return;
        }
 
        switch (sound_type) {
        case SOUND_TYPE_ALARM:
        case SOUND_TYPE_RINGTONE:
-               img = IMG_VOLUME_ICON;
+               if (sound > 0) {
+                       img = IMG_VOLUME_ICON;
+                       img_mute = IMG_VOLUME_ICON_MUTE_OFF;
+               } else {
+                       img = IMG_VOLUME_ICON_OFF;
+                       img_mute = IMG_VOLUME_ICON_MUTE;
+               }
                break;
        case SOUND_TYPE_MEDIA:
                if (volume_sound_sound_manager_volume_get(sound_type) > 0)
@@ -358,11 +368,13 @@ void volume_view_volume_icon_set(sound_type_e sound_type, int sound, int vibrati
                break;
        default:
                img = IMG_VOLUME_ICON;
+               img_mute = IMG_VOLUME_ICON_MUTE_OFF;
                break;
        }
 
        _D("img : %s", img);
        elm_image_file_set(view_info.icon_volume, volume_view_get_file_path(EDJ_APP), img);
+       elm_image_file_set(view_info.icon_volume_mute, volume_view_get_file_path(EDJ_APP), img_mute);
 }
 
 void volume_view_volume_icon_name_set_for_access(sound_type_e sound_type)
@@ -575,6 +587,12 @@ volume_error_e volume_view_layout_create(Evas_Object *win)
        elm_object_part_content_set(ly_outer, "ic_sound", icon_volume);
        view_info.icon_volume = icon_volume;
 
+       /* make volume mute icon */
+       Evas_Object *icon_volume_mute = _volume_icon_make();
+       retv_if(!icon_volume_mute, VOLUME_ERROR_FAIL);
+       elm_object_part_content_set(ly_outer, "ic_sound_mute", icon_volume_mute);
+       view_info.icon_volume_mute = icon_volume_mute;
+
        /* make slider */
        Evas_Object *slider = _slider_make();
        retv_if(!slider, VOLUME_ERROR_FAIL);