{
Evas_Object *viewer;
struct appdata *ad;
+ bundle *event_arg_bundle;
int max_width;
int max_height;
int is_landscape;
else
is_landscape = 1;
+
INFO("Size Provided by Viewer is %s[ %d X %d ]",
((width > MINICONTROL_MAX_WIDTH || height > MINICONTROL_MAX_HEIGHT) ? "bigger than max size, so resizing to max size[1200X112]": ""),
width, height);
evas_object_size_hint_min_set(viewer, max_width, max_height);
evas_object_size_hint_max_set(viewer, max_width, max_height);
+
+ /* The below code handles case when width provided by provider(music-player) is greater than MINICONTROL_MAX_WIDTH.
+ To handle the case we are sending an event to music-player, this event will cause music-player to resize the
+ minicontroller to MINICONTROL_MAX_WIDTH and MINICONTROL_MAX_HEIGHT. */
+ if (width > MINICONTROL_MAX_WIDTH) {
+ event_arg_bundle = bundle_create();
+ if (event_arg_bundle) {
+ char bundle_value_buffer[BUNDLE_BUFFER_LENGTH] = "resize_to_original";
+ bundle_add_str(event_arg_bundle, "resize", bundle_value_buffer);
+ INFO("Sending event to provider to resize mini-controller");
+ minicontrol_viewer_send_event("[musicplayer-mini]", MINICONTROL_VIEWER_EVENT_REPORT_ANGLE, event_arg_bundle);
+ bundle_free(event_arg_bundle);
+ }
+ }
}
static void _viewer_item_free(struct _viewer_item *item)