Loading : initial version
authorJin Yoon <jinny.yoon@samsung.com>
Mon, 13 Jul 2015 08:49:46 +0000 (17:49 +0900)
committerJin Yoon <jinny.yoon@samsung.com>
Mon, 13 Jul 2015 08:49:46 +0000 (17:49 +0900)
32 files changed:
inc/loading.h [new file with mode: 0644]
res/edje/adventure.edc
res/edje/images/1.png [new file with mode: 0755]
res/edje/images/10.png [new file with mode: 0755]
res/edje/images/11.png [new file with mode: 0755]
res/edje/images/12.png [new file with mode: 0755]
res/edje/images/13.png [new file with mode: 0755]
res/edje/images/14.png [new file with mode: 0755]
res/edje/images/15.png [new file with mode: 0755]
res/edje/images/16.png [new file with mode: 0755]
res/edje/images/17.png [new file with mode: 0755]
res/edje/images/18.png [new file with mode: 0755]
res/edje/images/19.png [new file with mode: 0755]
res/edje/images/2.png [new file with mode: 0755]
res/edje/images/20.png [new file with mode: 0755]
res/edje/images/21.png [new file with mode: 0755]
res/edje/images/22.png [new file with mode: 0755]
res/edje/images/23.png [new file with mode: 0755]
res/edje/images/24.png [new file with mode: 0755]
res/edje/images/25.png [new file with mode: 0755]
res/edje/images/26.png [new file with mode: 0755]
res/edje/images/27.png [new file with mode: 0755]
res/edje/images/3.png [new file with mode: 0755]
res/edje/images/4.png [new file with mode: 0755]
res/edje/images/5.png [new file with mode: 0755]
res/edje/images/6.png [new file with mode: 0755]
res/edje/images/7.png [new file with mode: 0755]
res/edje/images/8.png [new file with mode: 0755]
res/edje/images/9.png [new file with mode: 0755]
res/edje/loading.edc [new file with mode: 0644]
src/adventure.c
src/loading.c [new file with mode: 0644]

diff --git a/inc/loading.h b/inc/loading.h
new file mode 100644 (file)
index 0000000..6a016b5
--- /dev/null
@@ -0,0 +1,2 @@
+extern Evas_Object *loading_create(Evas_Object *parent);
+extern void loading_destroy(Evas_Object *loading);
index 2cc8c01..cbf3ec7 100644 (file)
@@ -1,17 +1,27 @@
 collections {
    group { name: "main";
       parts {
-         part { name: "txt_title";
-            type: TEXT;
+         part { name: "bg";
+            type: RECT;
             mouse_events: 0;
             description { state: "default" 0.0;
                align: 0.0 0.0;
                rel1 { relative: 0.0 0.0; }
-               rel2 { relative: 0.0 0.0; }
-               text { font: "Tizen:style=regular"; size: 20; min: 1 1; }
+               rel2 { relative: 1.0 1.0; }
                color: 0 0 0 255;
             }
-         }
+               part {
+                       name: "loading";
+                       type: SWALLOW;
+                       mouse_events: 0;
+                       description {
+                               state: "default" 0.0;
+                               rel1 { relative: 0.5 0.5; to: "bg"; }
+                               rel2 { relative: 0.5 0.5; to: "bg"; }
+                               align: 0.5 0.5;
+                               visible: 1;
+                       }
+               }
       }
    }
 }
diff --git a/res/edje/images/1.png b/res/edje/images/1.png
new file mode 100755 (executable)
index 0000000..2a26113
Binary files /dev/null and b/res/edje/images/1.png differ
diff --git a/res/edje/images/10.png b/res/edje/images/10.png
new file mode 100755 (executable)
index 0000000..317f135
Binary files /dev/null and b/res/edje/images/10.png differ
diff --git a/res/edje/images/11.png b/res/edje/images/11.png
new file mode 100755 (executable)
index 0000000..350f8dd
Binary files /dev/null and b/res/edje/images/11.png differ
diff --git a/res/edje/images/12.png b/res/edje/images/12.png
new file mode 100755 (executable)
index 0000000..ef39993
Binary files /dev/null and b/res/edje/images/12.png differ
diff --git a/res/edje/images/13.png b/res/edje/images/13.png
new file mode 100755 (executable)
index 0000000..ccfb5b0
Binary files /dev/null and b/res/edje/images/13.png differ
diff --git a/res/edje/images/14.png b/res/edje/images/14.png
new file mode 100755 (executable)
index 0000000..ef0320a
Binary files /dev/null and b/res/edje/images/14.png differ
diff --git a/res/edje/images/15.png b/res/edje/images/15.png
new file mode 100755 (executable)
index 0000000..df9b0f4
Binary files /dev/null and b/res/edje/images/15.png differ
diff --git a/res/edje/images/16.png b/res/edje/images/16.png
new file mode 100755 (executable)
index 0000000..14cb22d
Binary files /dev/null and b/res/edje/images/16.png differ
diff --git a/res/edje/images/17.png b/res/edje/images/17.png
new file mode 100755 (executable)
index 0000000..205eae7
Binary files /dev/null and b/res/edje/images/17.png differ
diff --git a/res/edje/images/18.png b/res/edje/images/18.png
new file mode 100755 (executable)
index 0000000..46be1b0
Binary files /dev/null and b/res/edje/images/18.png differ
diff --git a/res/edje/images/19.png b/res/edje/images/19.png
new file mode 100755 (executable)
index 0000000..ce7738b
Binary files /dev/null and b/res/edje/images/19.png differ
diff --git a/res/edje/images/2.png b/res/edje/images/2.png
new file mode 100755 (executable)
index 0000000..a480bbd
Binary files /dev/null and b/res/edje/images/2.png differ
diff --git a/res/edje/images/20.png b/res/edje/images/20.png
new file mode 100755 (executable)
index 0000000..cef266d
Binary files /dev/null and b/res/edje/images/20.png differ
diff --git a/res/edje/images/21.png b/res/edje/images/21.png
new file mode 100755 (executable)
index 0000000..8fc79a8
Binary files /dev/null and b/res/edje/images/21.png differ
diff --git a/res/edje/images/22.png b/res/edje/images/22.png
new file mode 100755 (executable)
index 0000000..99b0de5
Binary files /dev/null and b/res/edje/images/22.png differ
diff --git a/res/edje/images/23.png b/res/edje/images/23.png
new file mode 100755 (executable)
index 0000000..e0a35ce
Binary files /dev/null and b/res/edje/images/23.png differ
diff --git a/res/edje/images/24.png b/res/edje/images/24.png
new file mode 100755 (executable)
index 0000000..8a33372
Binary files /dev/null and b/res/edje/images/24.png differ
diff --git a/res/edje/images/25.png b/res/edje/images/25.png
new file mode 100755 (executable)
index 0000000..8531df6
Binary files /dev/null and b/res/edje/images/25.png differ
diff --git a/res/edje/images/26.png b/res/edje/images/26.png
new file mode 100755 (executable)
index 0000000..8cad05f
Binary files /dev/null and b/res/edje/images/26.png differ
diff --git a/res/edje/images/27.png b/res/edje/images/27.png
new file mode 100755 (executable)
index 0000000..856a217
Binary files /dev/null and b/res/edje/images/27.png differ
diff --git a/res/edje/images/3.png b/res/edje/images/3.png
new file mode 100755 (executable)
index 0000000..a946f85
Binary files /dev/null and b/res/edje/images/3.png differ
diff --git a/res/edje/images/4.png b/res/edje/images/4.png
new file mode 100755 (executable)
index 0000000..73d7785
Binary files /dev/null and b/res/edje/images/4.png differ
diff --git a/res/edje/images/5.png b/res/edje/images/5.png
new file mode 100755 (executable)
index 0000000..a99ad7c
Binary files /dev/null and b/res/edje/images/5.png differ
diff --git a/res/edje/images/6.png b/res/edje/images/6.png
new file mode 100755 (executable)
index 0000000..8dbcba5
Binary files /dev/null and b/res/edje/images/6.png differ
diff --git a/res/edje/images/7.png b/res/edje/images/7.png
new file mode 100755 (executable)
index 0000000..1f2645a
Binary files /dev/null and b/res/edje/images/7.png differ
diff --git a/res/edje/images/8.png b/res/edje/images/8.png
new file mode 100755 (executable)
index 0000000..332b24d
Binary files /dev/null and b/res/edje/images/8.png differ
diff --git a/res/edje/images/9.png b/res/edje/images/9.png
new file mode 100755 (executable)
index 0000000..3d6c25c
Binary files /dev/null and b/res/edje/images/9.png differ
diff --git a/res/edje/loading.edc b/res/edje/loading.edc
new file mode 100644 (file)
index 0000000..1ed306c
--- /dev/null
@@ -0,0 +1,112 @@
+images {
+       image: "1.png" COMP;
+       image: "2.png" COMP;
+       image: "3.png" COMP;
+       image: "4.png" COMP;
+       image: "5.png" COMP;
+       image: "6.png" COMP;
+       image: "7.png" COMP;
+       image: "8.png" COMP;
+       image: "9.png" COMP;
+       image: "10.png" COMP;
+       image: "11.png" COMP;
+       image: "12.png" COMP;
+       image: "13.png" COMP;
+       image: "14.png" COMP;
+       image: "15.png" COMP;
+       image: "16.png" COMP;
+       image: "17.png" COMP;
+       image: "18.png" COMP;
+       image: "19.png" COMP;
+       image: "20.png" COMP;
+       image: "21.png" COMP;
+       image: "22.png" COMP;
+       image: "23.png" COMP;
+       image: "24.png" COMP;
+       image: "25.png" COMP;
+       image: "26.png" COMP;
+       image: "27.png" COMP;
+}
+
+collections {
+       group {
+               name: "loading";
+
+               parts {
+                       part {
+                               name: "bg";
+                               type: SPACER;
+                               mouse_events: 0;
+                               description {
+                                       state: "default" 0.0;
+                                       rel1 { relative: 0.0 0.0; }
+                                       rel2 { relative: 1.0 1.0; }
+                               }
+                       }
+                       part {
+                               name: "loading";
+                               type: IMAGE;
+                               scale: 1;
+                               mouse_events: 0;
+                               description {
+                                       rel1 { relative: 0.5 0.5; }
+                                       rel2 { relative: 0.5 0.5; }
+                                       state: "default" 0.0;
+                                       image {
+                                               normal: "27.png";
+                                               tween: "1.png";
+                                               tween: "2.png";
+                                               tween: "3.png";
+                                               tween: "4.png";
+                                               tween: "5.png";
+                                               tween: "6.png";               
+                                               tween: "7.png";
+                                               tween: "8.png";
+                                               tween: "9.png";
+                                               tween: "10.png";
+                                               tween: "11.png";
+                                               tween: "12.png";
+                                               tween: "13.png";
+                                               tween: "14.png";               
+                                               tween: "15.png";
+                                               tween: "16.png";
+                                               tween: "17.png";
+                                               tween: "18.png";
+                                               tween: "19.png";
+                                               tween: "20.png";
+                                               tween: "21.png";
+                                               tween: "22.png";               
+                                               tween: "23.png";
+                                               tween: "24.png";
+                                               tween: "25.png";
+                                               tween: "26.png";
+                                               tween: "27.png";
+                               }
+                                       align: 0.5 0.5;
+                                       min: 100 100;
+                                       visible: 1;
+                               }
+                       }
+               }
+
+               programs {
+                       program {
+                               name: "on";
+                               signal: "show";
+                               action: STATE_SET "default" 0.0;
+                               target: "loading";
+                               transition: LINEAR 1;
+                               after: "wait";
+                       }
+                       program {
+                               name: "wait";
+                               in: 1 0;
+                               after: "on";
+                       }
+                       program {
+                               name: "end";
+                               action: SIGNAL_EMIT "end" "loading";
+                       }
+               }
+       }
+}
\ No newline at end of file
index b3a1753..ed3dd69 100644 (file)
  */
 
 #include <tizen.h>
+#include <Elementary.h>
 #include "adventure.h"
 #include "log.h"
 #include "webview.h"
+#include "loading.h"
 
 typedef struct appdata{
        Evas_Object* win;
@@ -32,9 +34,40 @@ win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
        ui_app_exit();
 }
 
+static Evas_Object *_create_adventure(Evas_Object *parent)
+{
+       Evas_Object *adventure = NULL;
+       char *path = NULL;
+       char full_path[PATH_LEN] = {0, };
+
+       adventure = elm_layout_add(parent);
+       retv_if(!adventure, NULL);
+
+       path = app_get_resource_path();
+       retv_if(!path, NULL);
+
+       snprintf(full_path, sizeof(full_path), "%s/edje/adventure.edj", path);
+
+       elm_layout_file_set(adventure, full_path, "main");
+       evas_object_size_hint_weight_set(adventure, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(adventure, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_show(adventure);
+
+       return adventure;
+}
+
+static void _destroy_adventure(Evas_Object *adventure)
+{
+       ret_if(!adventure);
+       evas_object_del(adventure);
+}
+
 static void
 create_base_gui(appdata_s *ad)
 {
+       Evas_Object *adventure = NULL;
+       Evas_Object *loading = NULL;
+
        /* Window */
        ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
        elm_win_conformant_set(ad->win, EINA_TRUE);
@@ -55,6 +88,18 @@ create_base_gui(appdata_s *ad)
        elm_win_resize_object_add(ad->win, ad->conform);
        evas_object_show(ad->conform);
 
+       adventure = _create_adventure(ad->conform);
+       if (!adventure)
+               _E("cannot create the adventure ui");
+       else
+               elm_object_content_set(ad->conform, adventure);
+
+       loading = loading_create(adventure);
+       if (!loading)
+               _E("cannot load the loading image");
+       else
+               elm_object_part_content_set(adventure, "loading", loading);
+
        /* Show window after base gui is set up */
        evas_object_show(ad->win);
 
@@ -74,13 +119,6 @@ static void
 app_control(app_control_h app_control, void *data)
 {
        appdata_s *ad = data;
-       Evas_Object *webview = NULL;
-
-       webview = webview_create(ad->conform);
-       ret_if(!webview);
-       elm_object_content_set(ad->conform, webview);
-
-       webview_set_url(webview, "http://www.naver.com");
 }
 
 static void
diff --git a/src/loading.c b/src/loading.c
new file mode 100644 (file)
index 0000000..2111f07
--- /dev/null
@@ -0,0 +1,41 @@
+#include <Elementary.h>
+#include <app.h>
+#include "log.h"
+#include "adventure.h"
+
+Evas_Object *loading_create(Evas_Object *parent)
+{
+       Evas_Object *loading = NULL;
+       char *path = NULL;
+       char full_path[PATH_LEN] = {0, };
+
+       retv_if(!parent, NULL);
+
+       path = app_get_resource_path();
+       retv_if(!path, NULL);
+
+       snprintf(full_path, sizeof(full_path), "%s/edje/loading.edj", path);
+
+       loading = elm_layout_add(parent);
+       goto_if(!loading, error);
+
+       elm_layout_file_set(loading, full_path, "loading");
+       evas_object_size_hint_weight_set(loading, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(loading, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_show(loading);
+
+       free(path);
+       return loading;
+
+error:
+       free(path);
+       return NULL;
+}
+
+
+
+void loading_destroy(Evas_Object *loading)
+{
+       ret_if(!loading);
+       evas_object_del(loading);
+}