/Debug/
*.edj
*.orig
+crash-info/
+.sign/
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_ */
--- /dev/null
+/*
+* 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_ */
typedef enum _e_view_id {
VIEW_CONNECT_TO_CAR,
+ VIEW_CAR_SELECTION,
} view_id;
void view_manager_set_view(view_id id);
#include <model/model_app.h>
#include <assert.h>
#include "gear-racing-controller.h"
+#include "view_manager/view_manager.h"
static s_controller *controller = NULL;
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();
}
--- /dev/null
+/*
+* 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);
+}
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);
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);
}
#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 {
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;
}