Skip to content

Commit

Permalink
code cleanup, moved and renamed classes
Browse files Browse the repository at this point in the history
Signed-off-by: nuclearfog <[email protected]>
  • Loading branch information
nuclearfog committed Mar 17, 2022
1 parent b0f3f1c commit a23a928
Show file tree
Hide file tree
Showing 28 changed files with 54 additions and 46 deletions.
1 change: 1 addition & 0 deletions app/src/main/assets/licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@




</style>
</head>
<body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*
* @author nuclearfog
*/
public class MediaCallback extends MediaSessionCompat.Callback {
public class MediaButtonCallback extends MediaSessionCompat.Callback {

private MusicPlaybackService service;

public MediaCallback(MusicPlaybackService service) {
public MediaButtonCallback(MusicPlaybackService service) {
this.service = service;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ public void onCreate() {
// Initialize the handler
mPlayerHandler = new MusicPlayerHandler(this, thread.getLooper());
mSession = new MediaSessionCompat(getApplicationContext(), TAG);
mSession.setCallback(new MediaCallback(this), mPlayerHandler);
mSession.setCallback(new MediaButtonCallback(this), mPlayerHandler);
mSession.setPlaybackState(state);
mSession.setActive(true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

import com.andrew.apollo.R;
import com.andrew.apollo.cache.ImageFetcher;
import com.andrew.apollo.utils.PrefixHighlighter;
import com.andrew.apollo.model.Album;
import com.andrew.apollo.model.Artist;
import com.andrew.apollo.model.Music;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.PrefixHighlighter;

import java.util.Locale;

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/java/com/andrew/apollo/cache/ImageWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ public void addBitmapToCache(String key, Bitmap bitmap) {
}
}

/**
* @return reference to the image cache
*/
@Nullable
public ImageCache getImageCache() {
return mImageCache;
}

/**
* @return application context
*/
public Context getContext() {
return mContext;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* governing permissions and limitations under the License.
*/

package com.andrew.apollo.ui.views;
package com.andrew.apollo.menu;

import android.content.Context;
import android.graphics.Color;
Expand All @@ -24,9 +24,10 @@
import androidx.appcompat.app.AlertDialog;

import com.andrew.apollo.R;
import com.andrew.apollo.ui.views.ColorPickerView;
import com.andrew.apollo.ui.views.ColorPickerView.OnColorChangedListener;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.PreferenceUtils;
import com.andrew.apollo.ui.views.ColorPickerView.OnColorChangedListener;

import java.util.Locale;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
import com.andrew.apollo.R;
import com.andrew.apollo.receiver.PlaybackStatus;
import com.andrew.apollo.receiver.PlaybackStatus.PlayStatusListener;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.MusicUtils.ServiceToken;
import com.andrew.apollo.utils.NavUtils;
import com.andrew.apollo.ui.views.PlayPauseButton;
import com.andrew.apollo.ui.views.RepeatButton;
import com.andrew.apollo.ui.views.ShuffleButton;
import com.andrew.apollo.ui.views.theme.HoloSelector;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.MusicUtils.ServiceToken;
import com.andrew.apollo.utils.NavUtils;

import java.util.LinkedList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@
import com.andrew.apollo.receiver.PlaybackStatus.PlayStatusListener;
import com.andrew.apollo.ui.fragments.FragmentCallback;
import com.andrew.apollo.ui.fragments.QueueFragment;
import com.andrew.apollo.ui.views.PlayPauseButton;
import com.andrew.apollo.ui.views.RepeatButton;
import com.andrew.apollo.ui.views.RepeatingImageButton;
import com.andrew.apollo.ui.views.RepeatingImageButton.RepeatListener;
import com.andrew.apollo.ui.views.ShuffleButton;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.MusicUtils.ServiceToken;
import com.andrew.apollo.utils.NavUtils;
import com.andrew.apollo.utils.PreferenceUtils;
import com.andrew.apollo.utils.ThemeUtils;
import com.andrew.apollo.ui.views.PlayPauseButton;
import com.andrew.apollo.ui.views.RepeatButton;
import com.andrew.apollo.ui.views.RepeatingImageButton;
import com.andrew.apollo.ui.views.RepeatingImageButton.RepeatListener;
import com.andrew.apollo.ui.views.ShuffleButton;

import java.io.File;
import java.lang.ref.WeakReference;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
import com.andrew.apollo.ui.fragments.profile.LastAddedFragment;
import com.andrew.apollo.ui.fragments.profile.PlaylistSongFragment;
import com.andrew.apollo.ui.fragments.profile.PopularSongFragment;
import com.andrew.apollo.ui.views.ProfileTabCarousel;
import com.andrew.apollo.ui.views.ProfileTabCarousel.Listener;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.NavUtils;
import com.andrew.apollo.utils.PreferenceUtils;
import com.andrew.apollo.utils.SortOrder;
import com.andrew.apollo.utils.ThemeUtils;
import com.andrew.apollo.ui.views.ProfileTabCarousel;
import com.andrew.apollo.ui.views.ProfileTabCarousel.Listener;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.SearchAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.MusicSearchLoader;
import com.andrew.apollo.model.Album;
import com.andrew.apollo.model.Artist;
import com.andrew.apollo.model.Music;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.MusicUtils.ServiceToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
import androidx.loader.content.Loader;

import com.andrew.apollo.R;
import com.andrew.apollo.utils.Capitalize;
import com.andrew.apollo.loaders.SearchLoader;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.Capitalize;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.MusicUtils.ServiceToken;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ public static class BitmapWorkerTask extends AsyncTask<String, Void, Drawable[]>
/**
* Constructor of <code>BitmapWorkerTask</code>
*
* @param imageView The {@link ImageView} to use.
* @param imageType The type of image URL to fetch for.
* @param imageView The {@link ImageView} to use.
* @param mImageType The type of image URL to fetch for.
*/
public BitmapWorkerTask(ImageWorker imageWorker, String tag, ImageWorker.ImageType imageType, ImageView... imageView) {
public BitmapWorkerTask(ImageWorker imageWorker, String tag, ImageWorker.ImageType mImageType, ImageView[] imageView) {
super();
callback = new WeakReference<>(imageWorker);
mImageReference = new WeakReference<>(imageView);
imageView[0].setBackgroundResource(R.drawable.default_artwork);
mImageType = imageType;
this.mImageType = mImageType;
this.tag = tag;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.AlbumAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.AlbumLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Album;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ActivityBase;
import com.andrew.apollo.ui.activities.ActivityBase.MusicStateListener;
import com.andrew.apollo.utils.ApolloUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.ArtistAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.ArtistLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Artist;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ActivityBase;
import com.andrew.apollo.ui.activities.ActivityBase.MusicStateListener;
import com.andrew.apollo.utils.ApolloUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.FolderAdapter;
import com.andrew.apollo.loaders.FolderLoader;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.FolderLoader;
import com.andrew.apollo.ui.activities.ProfileActivity;
import com.andrew.apollo.utils.MusicUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import com.andrew.apollo.Config;
import com.andrew.apollo.R;
import com.andrew.apollo.adapters.GenreAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.GenreLoader;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Genre;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ProfileActivity;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
import com.andrew.apollo.Config;
import com.andrew.apollo.R;
import com.andrew.apollo.adapters.PlaylistAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.PlaylistLoader;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.menu.RenamePlaylist;
import com.andrew.apollo.model.Playlist;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ActivityBase;
import com.andrew.apollo.ui.activities.ActivityBase.MusicStateListener;
import com.andrew.apollo.ui.activities.ProfileActivity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@
import com.andrew.apollo.Config;
import com.andrew.apollo.R;
import com.andrew.apollo.adapters.SongAdapter;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DragScrollProfile;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DropListener;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.RemoveListener;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.NowPlayingCursor;
import com.andrew.apollo.loaders.QueueLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.provider.FavoritesStore;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DragScrollProfile;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DropListener;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.RemoveListener;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.NavUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.AlbumAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.RecentLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Album;
import com.andrew.apollo.provider.RecentStore;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ActivityBase;
import com.andrew.apollo.ui.activities.ActivityBase.MusicStateListener;
import com.andrew.apollo.utils.ApolloUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@

import com.andrew.apollo.R;
import com.andrew.apollo.adapters.SongAdapter;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.loaders.SongLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.provider.FavoritesStore;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ActivityBase;
import com.andrew.apollo.ui.activities.ActivityBase.MusicStateListener;
import com.andrew.apollo.utils.MusicUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Album;
import com.andrew.apollo.ui.views.dragdrop.VerticalScrollListener.ScrollableHeader;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.NavUtils;
import com.andrew.apollo.ui.views.dragdrop.VerticalScrollListener.ScrollableHeader;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
import com.andrew.apollo.Config;
import com.andrew.apollo.R;
import com.andrew.apollo.adapters.ProfileSongAdapter;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DropListener;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.RemoveListener;
import com.andrew.apollo.loaders.PlaylistSongLoader;
import com.andrew.apollo.menu.CreateNewPlaylist;
import com.andrew.apollo.menu.FragmentMenuItems;
import com.andrew.apollo.model.Song;
import com.andrew.apollo.provider.FavoritesStore;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DropListener;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.RemoveListener;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.utils.NavUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

import com.andrew.apollo.Config;
import com.andrew.apollo.R;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ProfileActivity.FragmentCallback;
import com.andrew.apollo.ui.views.ProfileTabCarousel;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DragScrollProfile;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.DropListener;
import com.andrew.apollo.ui.views.dragdrop.DragSortListView.RemoveListener;
import com.andrew.apollo.adapters.recycler.RecycleHolder;
import com.andrew.apollo.ui.activities.ProfileActivity.FragmentCallback;
import com.andrew.apollo.ui.views.ProfileTabCarousel;
import com.andrew.apollo.ui.views.dragdrop.VerticalScrollListener;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import androidx.appcompat.widget.AppCompatImageButton;

import com.andrew.apollo.R;
import com.andrew.apollo.ui.views.theme.HoloSelector;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.ui.views.theme.HoloSelector;

/**
* A custom {@link ImageButton} that represents the "play and pause" button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@

import com.andrew.apollo.MusicPlaybackService;
import com.andrew.apollo.R;
import com.andrew.apollo.ui.views.theme.HoloSelector;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.ui.views.theme.HoloSelector;

/**
* A custom {@link AppCompatImageButton} that represents the "repeat" button.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import androidx.appcompat.widget.AppCompatImageButton;

import com.andrew.apollo.R;
import com.andrew.apollo.ui.views.theme.HoloSelector;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.ui.views.theme.HoloSelector;

import java.lang.ref.WeakReference;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@

import com.andrew.apollo.MusicPlaybackService;
import com.andrew.apollo.R;
import com.andrew.apollo.ui.views.theme.HoloSelector;
import com.andrew.apollo.utils.ApolloUtils;
import com.andrew.apollo.utils.MusicUtils;
import com.andrew.apollo.ui.views.theme.HoloSelector;

/**
* @author Andrew Neal ([email protected])
Expand Down
Loading

0 comments on commit a23a928

Please sign in to comment.