Removed bus. Will be replaced by an intent system soon.
This commit is contained in:
parent
564ee7bdae
commit
b808491206
26 changed files with 14 additions and 382 deletions
|
|
@ -1,22 +0,0 @@
|
|||
package com.kabouzeid.gramophone.model;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class DataBaseChangedEvent {
|
||||
public static final int PLAYLISTS_CHANGED = 0;
|
||||
public static final int ALBUMS_CHANGED = 1;
|
||||
public static final int ARTISTS_CHANGED = 2;
|
||||
public static final int SONGS_CHANGED = 3;
|
||||
public static final int DATABASE_CHANGED = 4;
|
||||
|
||||
private final int action;
|
||||
|
||||
public DataBaseChangedEvent(int action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
public int getAction() {
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
package com.kabouzeid.gramophone.model;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class NavigationDrawerItem {
|
||||
|
||||
public final String title;
|
||||
public final int imageRes;
|
||||
|
||||
public NavigationDrawerItem(String title, int imageRes) {
|
||||
this.title = title;
|
||||
this.imageRes = imageRes;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package com.kabouzeid.gramophone.model;
|
||||
|
||||
/**
|
||||
* @author Karim Abou Zeid (kabouzeid)
|
||||
*/
|
||||
public class UIPreferenceChangedEvent {
|
||||
public static final int THEME_CHANGED = 0;
|
||||
public static final int ALBUM_OVERVIEW_PALETTE_CHANGED = 1;
|
||||
public static final int COLORED_NAVIGATION_BAR_ARTIST_CHANGED = 2;
|
||||
public static final int COLORED_NAVIGATION_BAR_ALBUM_CHANGED = 3;
|
||||
public static final int COLORED_NAVIGATION_BAR_PLAYLIST_CHANGED = 4;
|
||||
public static final int COLORED_NAVIGATION_BAR_TAG_EDITOR_CHANGED = 5;
|
||||
public static final int COLORED_NAVIGATION_BAR_CURRENT_PLAYING_CHANGED = 6;
|
||||
public static final int COLORED_NAVIGATION_BAR_CHANGED = 10;
|
||||
public static final int COLORED_NAVIGATION_BAR_OTHER_SCREENS_CHANGED = 7;
|
||||
public static final int COLORED_NOTIFICATION_CHANGED = 11;
|
||||
|
||||
private final int action;
|
||||
private final Object value;
|
||||
|
||||
public UIPreferenceChangedEvent(int action, Object value) {
|
||||
this.action = action;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,8 @@ package com.kabouzeid.gramophone.model.smartplaylist;
|
|||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.App;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.LastAddedLoader;
|
||||
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtil;
|
||||
|
||||
|
|
@ -30,6 +28,5 @@ public class LastAddedPlaylist extends AbsSmartPlaylist {
|
|||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
PreferenceUtil.getInstance(context).setLastAddedCutoffTimestamp(System.currentTimeMillis());
|
||||
App.bus.post(new DataBaseChangedEvent(DataBaseChangedEvent.PLAYLISTS_CHANGED));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ package com.kabouzeid.gramophone.model.smartplaylist;
|
|||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.App;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.TopAndRecentlyPlayedTracksLoader;
|
||||
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.provider.SongPlayCountStore;
|
||||
|
||||
|
|
@ -30,6 +28,5 @@ public class MyTopTracksPlaylist extends AbsSmartPlaylist {
|
|||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
SongPlayCountStore.getInstance(context).clear();
|
||||
App.bus.post(new DataBaseChangedEvent(DataBaseChangedEvent.PLAYLISTS_CHANGED));
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,8 @@ package com.kabouzeid.gramophone.model.smartplaylist;
|
|||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.kabouzeid.gramophone.App;
|
||||
import com.kabouzeid.gramophone.R;
|
||||
import com.kabouzeid.gramophone.loader.TopAndRecentlyPlayedTracksLoader;
|
||||
import com.kabouzeid.gramophone.model.DataBaseChangedEvent;
|
||||
import com.kabouzeid.gramophone.model.Song;
|
||||
import com.kabouzeid.gramophone.provider.RecentlyPlayedStore;
|
||||
|
||||
|
|
@ -30,6 +28,5 @@ public class RecentlyPlayedPlaylist extends AbsSmartPlaylist {
|
|||
@Override
|
||||
public void clear(@NonNull Context context) {
|
||||
RecentlyPlayedStore.getInstance(context).clear();
|
||||
App.bus.post(new DataBaseChangedEvent(DataBaseChangedEvent.PLAYLISTS_CHANGED));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue