Car selection stub screen added 40/183340/3
authorMichal Skorupinski <m.skorupinsk@samsung.com>
Thu, 12 Jul 2018 10:22:10 +0000 (12:22 +0200)
committerMichal Skorupinski <m.skorupinsk@samsung.com>
Thu, 12 Jul 2018 10:24:00 +0000 (12:24 +0200)
Change-Id: I0a0216c2c6ecefbd6460885d1521836319bc6bf5
Signed-off-by: Michal Skorupinski <m.skorupinsk@samsung.com>
.gitignore
inc/controller/controller_connect_to_car.h
inc/view/view_car_selection.h [new file with mode: 0644]
inc/view_manager/view_manager.h
src/controller/controller_connect_to_car.c
src/view/view_car_selection.c [new file with mode: 0644]
src/view/view_connect_to_car.c
src/viewmanager/view_manager.c

index ef28b00..a94dfaa 100644 (file)
@@ -1,3 +1,5 @@
 /Debug/
 *.edj
 *.orig
+crash-info/
+.sign/
index 81f7cb6..ee901c3 100644 (file)
@@ -22,5 +22,6 @@
 
 s_controller *controller_connect_to_car_init(t_view_update_cb view_update_cb);
 void controller_connect_to_car_back_btn(void);
+void controller_connect_to_car_next_page();
 
 #endif /* CONTROLLER_CONTROLLER_CONNECT_TO_CAR_H_ */
diff --git a/inc/view/view_car_selection.h b/inc/view/view_car_selection.h
new file mode 100644 (file)
index 0000000..1acbe44
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2018 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Flora License, Version 1.1 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://floralicense.org/license/
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+#ifndef VIEW_VIEW_CAR_SELECTION_H_
+#define VIEW_VIEW_CAR_SELECTION_H_
+
+void car_selection_init(Evas_Object *parent);
+
+#endif /* VIEW_VIEW_CAR_SELECTION_H_ */
index a0e0e33..aaedfd1 100644 (file)
@@ -22,6 +22,7 @@
 
 typedef enum _e_view_id {
        VIEW_CONNECT_TO_CAR,
+       VIEW_CAR_SELECTION,
 } view_id;
 
 void view_manager_set_view(view_id id);
index d9d465f..b3fb116 100644 (file)
@@ -18,6 +18,7 @@
 #include <model/model_app.h>
 #include <assert.h>
 #include "gear-racing-controller.h"
+#include "view_manager/view_manager.h"
 
 static s_controller *controller = NULL;
 
@@ -31,8 +32,19 @@ void controller_connect_to_car_init(t_view_update_cb view_update_cb)
        controller->view_update_cb = view_update_cb;
 }
 
+void controller_connect_to_car_destroy(void)
+{
+       free(controller);
+}
 void controller_connect_to_car_back_btn(void)
 {
        dlog_print(DLOG_DEBUG, LOG_TAG, "% s %s", basename(__FILE__), __FUNCTION__);
-       free(controller);
+       controller_connect_to_car_destroy();
+}
+
+void controller_connect_to_car_next_page()
+{
+       //TODO model
+       view_manager_set_view(VIEW_CAR_SELECTION);
+       controller_connect_to_car_destroy();
 }
diff --git a/src/view/view_car_selection.c b/src/view/view_car_selection.c
new file mode 100644 (file)
index 0000000..092f0de
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2018 Samsung Electronics Co., Ltd.
+*
+* Licensed under the Flora License, Version 1.1 (the License);
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://floralicense.org/license/
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an AS IS BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include "gear-racing-controller.h"
+#include "view/view_base.h"
+#include "view/view_car_selection.h"
+#include "controller/controller_connect_to_car.h"
+#include "view_manager/view_manager.h"
+
+typedef struct _s_connect_to_car {
+       Evas_Object *layout;
+} s_connect_to_car;
+
+static s_connect_to_car s_info = { 0,};
+
+static void _layout_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       elm_win_lower(view_manager_get_win());
+       controller_connect_to_car_back_btn();
+}
+
+static void _ok_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       //TODO implement
+}
+
+static void _car_selection_create_gui(Evas_Object *parent)
+{
+       s_info.layout = view_base_create_layout(parent);
+       eext_object_event_callback_add(s_info.layout, EEXT_CALLBACK_BACK, _layout_back_cb, NULL);
+       elm_layout_text_set(s_info.layout, "txt_title", "Car selection");
+
+       view_base_create_button(s_info.layout, "Button_Ok", "Ok", _ok_button_clicked_cb, NULL);
+       view_base_create_button(s_info.layout, "Button_Cancel", "Cancel", NULL, NULL);
+}
+
+void car_selection_init(Evas_Object *parent)
+{
+       _car_selection_create_gui(parent);
+}
index 761f3af..6ff425a 100644 (file)
@@ -31,6 +31,11 @@ static void _layout_back_cb(void *data, Evas_Object *obj, void *event_info)
        controller_connect_to_car_back_btn();
 }
 
+static void _ok_button_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       controller_connect_to_car_next_page();
+}
+
 static void connect_to_car_create_gui(Evas_Object *parent)
 {
        s_info.layout = view_base_create_layout(parent);
@@ -38,7 +43,7 @@ static void connect_to_car_create_gui(Evas_Object *parent)
        eext_object_event_callback_add(s_info.layout, EEXT_CALLBACK_BACK, _layout_back_cb, NULL);
        elm_layout_text_set(s_info.layout, "txt_title", "Connect to a car?");
 
-       view_base_create_button(s_info.layout, "Button_Ok", "Ok", NULL, NULL);
+       view_base_create_button(s_info.layout, "Button_Ok", "Ok", _ok_button_clicked_cb, NULL);
        view_base_create_button(s_info.layout, "Button_Cancel", "Cancel", NULL, NULL);
 }
 
index 2cf1873..de3dd6b 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <assert.h>
 #include <view/view_connect_to_car.h>
+#include <view/view_car_selection.h>
 #include <view_manager/view_manager.h>
 
 typedef struct _s_ui {
@@ -61,6 +62,9 @@ void view_manager_set_view(view_id id)
                case VIEW_CONNECT_TO_CAR:
                        connect_to_car_init(s_info.conform);
                        break;
+               case VIEW_CAR_SELECTION:
+                       car_selection_init(s_info.conform);
+                       break;
                default:
                        break;
        }