#define TEXT_FAVORITE_ADDED "Added to your favorite."
#define TEXT_FAVORITE_REMOVED "Removed from your favorite."
+#define TEXT_USB_ADDED "USB Connected"
+#define TEXT_USB_REMOVED "USB Disconnected"
+
+#define USB_ADDED 1
+#define USB_REMOVED 0
+
#define BOX_PADDING_SIZE 80
-#define TIME_TOAST_FAVORITE 5.0
+#define TIME_TOAST 5.0
#define ARRAY_SIZE(arr) (sizeof((arr)) / sizeof((arr)[0]))
return true;
}
-static void _hide_toast_favorite(struct _priv *priv)
+static void _hide_toast(struct _priv *priv)
{
if (priv->notify)
evas_object_hide(priv->notify);
if (favorite)
notify = util_add_notify(priv->base, STYLE_TOAST, STYLE_TOAST,
- TEXT_FAVORITE_ADDED, TIME_TOAST_FAVORITE);
+ TEXT_FAVORITE_ADDED, TIME_TOAST);
else
notify = util_add_notify(priv->base, STYLE_TOAST, STYLE_TOAST,
- TEXT_FAVORITE_REMOVED, TIME_TOAST_FAVORITE);
+ TEXT_FAVORITE_REMOVED, TIME_TOAST);
if (!notify) {
_ERR("failed to add notify object");
priv->notify = notify;
}
+static void _show_toast_usb(struct _priv *priv, int state)
+{
+ Evas_Object *notify;
+
+ if (state == USB_ADDED)
+ notify = util_add_notify(priv->base, STYLE_TOAST, STYLE_TOAST,
+ TEXT_USB_ADDED, TIME_TOAST);
+ else
+ notify = util_add_notify(priv->base, STYLE_TOAST, STYLE_TOAST,
+ TEXT_USB_REMOVED, TIME_TOAST);
+
+ priv->notify = notify;
+}
+
static void _media_db_updated_cb(media_content_error_e error,
int pid,
media_content_db_update_item_type_e update_item,
}
media_content_remove_db_updated_cb(priv->noti_h);
+
+ _hide_toast(priv);
}
static void _usb_changed_cb(void *data, int state)
/* to show base view */
while (viewmgr_active_view_count() > 1)
viewmgr_pop_view();
+
+ _show_toast_usb(priv, state);
}
static Evas_Object *_create(Evas_Object *win, void *data)
if (vdata->status == E_TOAST_SHOW)
_show_toast_favorite(priv, vdata->id);
else
- _hide_toast_favorite(priv);
+ _hide_toast(priv);
break;
case UPDATE_FAVORITE:
if (!data)