Add voice layout to Mobile profile 63/89363/1
authorsungwook79.park <sungwook79.park@samsung.com>
Fri, 23 Sep 2016 07:46:52 +0000 (16:46 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Fri, 23 Sep 2016 07:47:21 +0000 (16:47 +0900)
Change-Id: I77338f636babb40beb9d2552e1917a6d60ce307e
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
data/layout/mobile/LYT_PORTRAIT_STT.xml
res/mobile/edje/w-input-stt.edc
src/ise-stt-mode.cpp
src/ise.cpp

index 07a8b7f..16b1f80 100644 (file)
@@ -1,36 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <layout width="720" height="442" key_width="180" key_height="120" vibe_style="DEFAULT" sound_style="DEFAULT" label_type="3X4_STT">
   <image_path>
-    <button_normal>B09_panel_stt.png</button_normal>
+    <button_normal>B09_panel.png</button_normal>
   </image_path>
-  <background_image>
-    <rec button="pressed">stt_key_btn_press.png</rec>
-  </background_image>
-  <row x="452" y="26">
-    <key key_type="control" use_repeat_key="true" image_label_type="IMAGE_3X4">
-      <image_label>
-        <rec button="normal">w_sip_3x4_btn_ic_delete.png</rec>
-        <rec button="pressed">w_sip_3x4_btn_ic_delete.png</rec>
-      </image_label>
-      <key_value>
-        <rec>BackSpace</rec>
-      </key_value>
-    </key>
-  </row>
-  <row x="452">
-    <key key_type="control" custom_id="Enter">
-      <image_label>
-        <rec button="normal">w_sip_3x4_btn_ic_enter.png</rec>
-        <rec button="pressed">w_sip_3x4_btn_ic_enter.png</rec>
-        <rec button="disabled">w_sip_3x4_btn_ic_enter_d.png</rec>
-      </image_label>
-      <key_value>
-        <rec>Enter</rec>
-      </key_value>
-    </key>
-  </row>
-  <row x="98" y="82">
-    <key key_type="modechange" image_label_type="IMAGE_3X4">
+
+  <row x="10" y="341">
+    <key key_type="modechange" image_label_type="IMAGE_3X4" width="75" height="75">
       <image_label>
         <rec button="normal">more_option_icon_language.png</rec>
         <rec button="pressed">more_option_icon_language.png</rec>
       </key_value>
     </key>
   </row>
-  <row x="360" y="70">
-    <key button_type="uiitem" width="1" height="162">
+
+  <row x="188" y="341">
+    <key key_type="user" custom_id="Cancel" width="344" height="75" >
+      <label>
+        <rec>Cancel</rec>
+      </label>
       <background_image>
-        <rec button="normal">b_stt_center_line.png</rec>
-        <rec button="pressed">b_stt_center_line.png</rec>
-        <rec button="disabled">b_stt_center_line.png</rec>
+        <rec button="normal">B09_bubble_bg.png</rec>
+        <rec button="pressed">stt_key_btn_press.png</rec>
       </background_image>
+      <key_value>
+        <rec>Cancel</rec>
+      </key_value>
     </key>
   </row>
 </layout>
index b627c6f..82da638 100644 (file)
@@ -557,7 +557,7 @@ collections
                                        max, 360 100;
                                        rel1
                                        {
-                                               relative, 0 260/360;
+                                               relative, 0 0;
                                                to, "bg";
                                        }
                                        rel2
@@ -565,7 +565,6 @@ collections
                                                relative, 1 1;
                                                to, "bg";
                                        }
-                                       image.normal, "./tw_bottom_btn_bg.png";
                                        color: 128 128 128 128;
                                }
                                description
@@ -660,7 +659,7 @@ collections
                                {
                                        state, "recording" 0.0;
                                        inherit, "default" 0.0;
-                                       visible, 0;
+                                       visible, 1;
                                }
                                description
                                {
@@ -757,12 +756,12 @@ collections
                                        align, 0.5 0;
                                        rel1
                                        {
-                                               relative, 39/360 140/360;
+                                               relative, 39/360 50/360;
                                                to, "bg";
                                        }
                                        rel2
                                        {
-                                               relative, (360-39)/360 (140+42)/360;
+                                               relative, (360-39)/360 (50+42)/360;
                                                to, "bg";
                                        }
                                }
@@ -801,7 +800,7 @@ collections
                                                fit: 1 1;
                                                style, "textblock_style";
                                        }
-                                       color, 255 255 255 255;
+                                       color, 51 204 255 255;
                                }
                                description
                                {
index 308d4c4..8f66e16 100644 (file)
@@ -129,7 +129,11 @@ static Eina_Bool hide_guide_text(void *data)
 
 static void set_guide_text(VoiceData *vd, const char* text, bool translatable)
 {
+#ifdef _WEARABLE
     elm_object_signal_emit(vd->layout_main, "idle,state,guide_text,bottom", "elm");
+#else
+    elm_object_signal_emit(vd->layout_main, "idle,state,guide_text,up", "elm");
+#endif
 
     if (translatable)
         elm_object_domain_translatable_part_text_set(vd->layout_main, "elm.text", PACKAGE, text);
index 980fa92..130cb7a 100644 (file)
@@ -651,6 +651,11 @@ void CCoreEventCallback::on_process_input_device_event(sclu32 &type, sclchar *da
                 *ret = 1;
             }
         }
+        if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE) {
+            ise_show_stt_mode(NATIVE_WINDOW_CAST(g_core.get_main_window()));
+        } else {
+            ise_hide_stt_mode();
+        }
     }
 #endif
 }
@@ -803,6 +808,12 @@ on_input_mode_changed(const sclchar *key_value, sclulong key_event, sclint key_t
                 SCLRotation rotation = g_ui->get_rotation();
                 ise_show_emoticon_layout(current_emoticon_group, ROTATION_TO_DEGREE(rotation), false, g_core.get_main_window());
             }
+
+            if (!strcmp(key_value, USER_KEYSTRING_VOICE)) {
+                ise_show_stt_mode(NATIVE_WINDOW_CAST(g_core.get_main_window()));
+            } else {
+                ise_hide_stt_mode();
+            }
         }
     }
 
@@ -1018,7 +1029,17 @@ SCLEventReturnType CUIEventCallback::on_event_key_clicked(SclUIEventDesc event_d
             } else if (strcmp(event_desc.key_value, USER_KEYSTRING_CLIPBOARD) == 0) {
                 eldbus_proxy_call(cbhm_proxy_get(), "CbhmShow", NULL, NULL, -1, "s", "0");
                 ret = SCL_EVENT_DONE;
-            } else {
+            } else if (strcmp(event_desc.key_value, "Cancel") == 0) {
+                ret = SCL_EVENT_DONE;
+                if (strcmp(g_ui->get_input_mode(), "STT_3X4") == 0 ) {
+                    g_keyboard_state.need_reset = TRUE;
+                    voice_result_string_flush();
+                    ise_hide_stt_mode();
+                    ise_set_layout(ISE_LAYOUT_STYLE_NORMAL, 0);
+                    if (g_keyboard_state.visible_state)
+                        ise_show(g_keyboard_state.ic);
+                }
+            }  else {
                 const sclchar *input_mode = g_ui->get_input_mode();
                 if ((NULL != input_mode) && (!strcmp(input_mode, "EMOTICON_LAYOUT"))) {
                     if (is_emoticon_show()) {
@@ -1085,6 +1106,11 @@ ise_reset_context()
     LOGD("");
     _reset_multitap_state(true);
     _language_manager.reset_language(g_config_values.selected_language.c_str());
+
+    if (strcmp(g_ui->get_input_mode(), "STT_3X4") != 0 ) {
+        g_keyboard_state.need_reset = TRUE;
+        ise_hide_stt_mode();
+    }
 }
 
 void
@@ -1321,11 +1347,6 @@ ise_show(int ic)
     }
 
     g_keyboard_state.visible_state = TRUE;
-    if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE) {
-        ise_show_stt_mode(NATIVE_WINDOW_CAST(g_core.get_main_window()));
-    } else {
-        ise_hide_stt_mode();
-    }
 
 #ifdef _WEARABLE
     int dot_num = 5;
@@ -1434,7 +1455,8 @@ ise_hide()
     _reset_shift_state();
     _reset_multitap_state(true);
 
-    if (g_keyboard_state.layout == ISE_LAYOUT_STYLE_VOICE) {
+    if (strcmp(g_ui->get_input_mode(), "STT_3X4") == 0 ) {
+        g_keyboard_state.need_reset = TRUE;
         ise_hide_stt_mode();
     }