Added guide text to passcode entry 90/136490/1
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Fri, 30 Jun 2017 03:27:33 +0000 (08:57 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Fri, 30 Jun 2017 03:30:34 +0000 (09:00 +0530)
Description: Added "Enter the password" and "Wrong password"
guide text to the passcode popup.

Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: Ie1958378b12d81efdb8a2ab6d248b2c64e901d2a

res/layout/network.edc
res/widget/entry.edc
src/common/utils.c
src/layout/layout_network.c

index 252ed9085245ce1886be1f55453b801180993d52..48e0cbb87fee1a4a7a96265e3ebdf5fb8bd6fa40 100644 (file)
@@ -205,15 +205,15 @@ group {
                                align, 1.0 0.0;
                                fixed, 0 1;
                                min, 300 50;
-color: 0 255 0 255;
-          rel1 {
-                  relative, 0.0 1.0;
-                  to, "padding.passcode.area";
-          }
-          rel2 {
-                  relative, 0.475 1.0;
-                  to, "padding.passcode.area";
-          }
+                               color: 0 255 0 255;
+                                  rel1 {
+                                          relative, 0.0 1.0;
+                                          to, "padding.passcode.area";
+                                  }
+                                  rel2 {
+                                          relative, 0.475 1.0;
+                                          to, "padding.passcode.area";
+                                  }
                        }
                }
 
@@ -1460,6 +1460,26 @@ group {
                        }
                }
 
+               part {
+                       name, PART_WIFI_PASSCODE_BG;
+                       type, RECT;
+                       scale, 1;
+                       description {
+                               color, 255 255 255 255;
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, "padding.passcode.area";
+                                       relative, 0.0 0.0;
+                                       offset, 1 1;
+                               }
+                               rel2 {
+                                       to, "padding.passcode.area";
+                                       relative, 1.0 1.0;
+                                       offset, -2 0;
+                               }
+                               fixed, 0 1;
+                       }
+               }
                part {
                        name, PART_WIFI_PASSCODE;
                        type, SWALLOW;
index c78b704c1bd9b0a82997517f460cec4d2d4642c9..805226679f349b775e5907cdce73fc768f86a0d6 100644 (file)
@@ -42,13 +42,18 @@ styles {
    style { name: "entry_ipaddr_guide_style";
       base: "font=BreezeSans:style=Light font_size=32 align=center color=#A5A5A5FF wrap=none text_class=entry left_margin=0 right_margin=0";
       tag:  "br" "";
-/*
-      tag:  "em" "+ font_style=Regular";
-      tag:  "link" "+ color=#333333 underline=on underline_color=#8008";
-      tag:  "hilight" "+ font_weight=Bold";
-      tag:  "preedit" "+ underline=on underline_color=#000";
-      tag:  "preedit_sel" "+ backing=on backing_color=#999999FF color=#AAAAAAFF";
-*/
+   }
+   style { name: "entry_passcode_guide_style";
+      base: "font=BreezeSans:style=Light font_size=32 color=#333 wrap=none text_class=entry left_margin=30 right_margin=0";
+      tag:  "br" "";
+   }
+   style { name: "entry_passcode_guide_style_warning";
+      base: "font=BreezeSans:style=Light font_size=32 color=#F00 wrap=none text_class=entry left_margin=30 right_margin=0";
+      tag:  "br" "";
+   }
+   style { name: "entry_passcode_style";
+      base: "font=BreezeSans:style=Light font_size=32 color=#333 wrap=none align=left text_class=entry left_margin=30 right_margin=0";
+      tag:  "br" "";
    }
 }
 
@@ -267,3 +272,86 @@ group { name: "elm/entry/base-single/input.field.ipaddr";
       }
    }
 }
+group { "elm/entry/base-password/input.field.passcode";
+   inherit: "elm/entry/base-single/input.field.ipaddr";
+   parts {
+      textblock { "elm.guide";
+         nomouse;
+         scale;
+         desc { "default";
+            fixed: 1 1;
+            text {
+               style: "entry_passcode_guide_style";
+               min: 0 1;
+               max: 0 1;
+            }
+         }
+         desc { "focused";
+            inherit: "default";
+         }
+         desc { "disabled";
+            inherit: "default";
+         }
+         desc { "hidden";
+            inherit: "default";
+            color: 0 0 0 0;
+         }
+         desc { "warning";
+            inherit: "default";
+            text.style: "entry_passcode_guide_style_warning";
+         }
+      }
+      textblock { "elm.text";
+         mouse;
+         scale;
+         entry_mode: PASSWORD;
+         select_mode: EXPLICIT;
+         cursor_mode: BEFORE;
+         multiline: 0;
+         source: "elm/entry/selection/input.field.ipaddr"; // selection under
+         source4: "elm/entry/cursor/input.field.ipaddr"; // cursorover
+         source5: "elm/entry/anchor/input.field.ipaddr"; // anchor under
+         desc { "default";
+            text {
+               style: "entry_passcode_guide_style";
+               repch: "*";
+               min: 1 1;
+               max: 0 1;
+            }
+         }
+         desc { "focused";
+            inherit: "default";
+            text.style: "entry_passcode_style";
+         }
+         desc { "disabled";
+            inherit: "default";
+            text.style: "entry_passcode_style";
+         }
+         description { state: "selected" 0.0;
+            inherit: "default" 0.0;
+            text.style: "entry_passcode_style";
+         }
+         description { state: "highlight" 0.0;
+            inherit: "default" 0.0;
+            text.style: "entry_passcode_style";
+         }
+         description { state: "enabled" 0.0;
+            inherit: "default" 0.0;
+            text.style: "entry_passcode_style";
+         }
+      }
+   }
+   programs {
+      program { name: "default";
+         signal: "guide_default"; source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "elm.guide";
+      }
+      program { name: "warning";
+         signal: "guide_warning"; source: "elm";
+         action: STATE_SET "warning" 0.0;
+         target: "elm.guide";
+      }
+
+   }
+}
index cdab319cdec204fce04cb16e9ed30370feceb854..0a9be5761abb1cead5949945c202765c9176961a 100755 (executable)
@@ -391,7 +391,7 @@ Evas_Object *utils_add_entry(Evas_Object *parent, const char *part,
                elm_entry_text_style_user_push(entry, text_style);
 
        if (is_password) {
-               elm_object_style_set(entry, "input.field.pin");
+               elm_object_style_set(entry, "input.field.passcode");
                elm_entry_password_set(entry, EINA_TRUE);
                elm_config_password_show_last_set(EINA_FALSE);
        }
index af031676bc497bb8faa7c132b3e8d9f3166c1951..33ba5ce6b770ec3e7129d18c3f0989d662e7ab7f 100644 (file)
@@ -1649,7 +1649,6 @@ static bool _draw_wifi_passcode_popup(struct _priv *priv, char *wifi_name,
                bool isReconnect)
 {
        Evas_Object *popup, *entry, *ly;
-       Evas_Object *scroller;
        Ecore_IMF_Context *ctx;
 
        if (priv->passcode_popup) {
@@ -1673,17 +1672,13 @@ static bool _draw_wifi_passcode_popup(struct _priv *priv, char *wifi_name,
 
 //     elm_object_part_text_set(ly, PART_WIFI_NAME, wifi_name);
 
-       scroller = elm_scroller_add(ly);
-       evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-       elm_object_part_content_set(ly, PART_WIFI_PASSCODE, scroller);
-
-       entry = utils_add_entry(ly, NULL, STYLE_ENTRY_PASSCODE_TXT, EINA_TRUE);
+       entry = utils_add_entry(ly, PART_WIFI_PASSCODE, NULL, EINA_TRUE);
        if (!entry) {
                _ERR("Add entry failed.");
                evas_object_del(popup);
                return false;
        }
-       elm_object_content_set(scroller, entry);
+       elm_entry_scrollable_set(entry, EINA_TRUE);
 
        elm_object_content_set(popup, ly);
 
@@ -1710,8 +1705,13 @@ static bool _draw_wifi_passcode_popup(struct _priv *priv, char *wifi_name,
        /* Set focus into entry */
        elm_object_focus_set(priv->passcode_popup, EINA_TRUE);
 
-       if (isReconnect)
-               elm_object_part_text_set(ly, PART_WIFI_POPUP_ERROR_MSG, STR_WIRELESS_WRONG_PWD);
+       if (isReconnect) {
+               elm_object_signal_emit(priv->passcode_entry, "guide_warning", SRC_ELM);
+               elm_object_part_text_set(priv->passcode_entry, "elm.guide", STR_WIRELESS_WRONG_PWD);
+       } else {
+               elm_object_signal_emit(priv->passcode_entry, "guide_default", SRC_ELM);
+               elm_object_part_text_set(priv->passcode_entry, "elm.guide", "Enter the password");
+       }
 
        evas_object_show(priv->passcode_popup);
        elm_object_focus_set(priv->passcode_entry, EINA_TRUE);