public void performUpdate(Context context, Bundle bundle, String what) {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);
String errorState = getErrorState(context.getResources());
final boolean playing = bundle.getBoolean("ISPLAYING");
if (errorState != null && !errorState.equals(lastErrorState)) {
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
initGallery((String)errorState,views, null);
} else {
if(CMDNEXT.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
views.setBoolean(R.id.boxwidget, "PrevNextAnimation", true);
}
else if(CMDPREVIOUS.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
views.setBoolean(R.id.boxwidget, "PrevNextAnimation", false);
}
else if(WIDGET_SHINGING.equals(what))
{
views.setBoolean(R.id.boxwidget, "colorShining", playing);
}
else if(QUEUE_CHANGED.equals(what) || PLAYSTATE_CHANGED.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
initGallery(null, views, what);
}
else
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
}
}
lastErrorState = errorState;
if (playing) {
views.setImageViewResource(R.id.control_play, R.drawable.app_pause);
} else {
views.setImageViewResource(R.id.control_play, R.drawable.app_play);
}
linkButtons(context, views, playing);
pushUpdate(context, null, views);
}
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.main);
String errorState = getErrorState(context.getResources());
final boolean playing = bundle.getBoolean("ISPLAYING");
if (errorState != null && !errorState.equals(lastErrorState)) {
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
initGallery((String)errorState,views, null);
} else {
if(CMDNEXT.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
views.setBoolean(R.id.boxwidget, "PrevNextAnimation", true);
}
else if(CMDPREVIOUS.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
views.setBoolean(R.id.boxwidget, "PrevNextAnimation", false);
}
else if(WIDGET_SHINGING.equals(what))
{
views.setBoolean(R.id.boxwidget, "colorShining", playing);
}
else if(QUEUE_CHANGED.equals(what) || PLAYSTATE_CHANGED.equals(what))
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
initGallery(null, views, what);
}
else
{
views.setBundle(R.id.boxwidget, "updatePlaylist", bundle);
}
}
lastErrorState = errorState;
if (playing) {
views.setImageViewResource(R.id.control_play, R.drawable.app_pause);
} else {
views.setImageViewResource(R.id.control_play, R.drawable.app_play);
}
linkButtons(context, views, playing);
pushUpdate(context, null, views);
}