Skip to content

Commit

Permalink
trashed the playlist feature, due to poor impl and gson hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-atul committed Nov 27, 2022
1 parent f4b2e12 commit be72bee
Show file tree
Hide file tree
Showing 27 changed files with 14 additions and 971 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

| Lite | Online |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Github release v0.10](https://github.com/AP-Atul/music_player_lite/releases/download/v0.10/mplite.apk) | [Github release v0.3](https://github.com/AP-Atul/music_player_lite/releases/download/v0.3/mplite_online.apk) |
| [Github release v0.11](https://github.com/AP-Atul/music_player_lite/releases/download/v0.11/mplite.apk) | [Github release v0.3](https://github.com/AP-Atul/music_player_lite/releases/download/v0.3/mplite_online.apk) |
| <a href="https://apt.izzysoft.de/fdroid/index/apk/com.atul.musicplayer"><img src="https://github.com/AP-Atul/music_player_lite/raw/main/assets/IzzyOnDroid.png" width="200px"></a> | <a href="https://apt.izzysoft.de/fdroid/index/apk/com.atul.musicplayeronline"><img src="https://github.com/AP-Atul/music_player_lite/raw/main/assets/IzzyOnDroid.png" width="200px"></a> |
| <a href="https://play.google.com/store/apps/details?id=com.atul.musicplayer"><img src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" width="200px"></a> | |

Expand All @@ -35,7 +35,7 @@ Join the community of discord!
- Automatic scanning of media files
- Browse/ Sort/ Search albums and artists
- Change between Dark and Light Modes
- Create playlists by long pressing on music
- Create playlists by long pressing on music (removed due to issues)
- Easily search songs by keywords
- Lock screen controls and play in the notification bar
- Headset controls
Expand All @@ -44,13 +44,13 @@ Join the community of discord!

### Todo

- [ ] Add playlist feature (with proper db implementations)
- [ ] Improve playlist selection window
- [ ] Add feature to edit the filename (or include in tag editor?)
- [ ] Support API version 33 (multiple api changes to do)
- [ ] Complete Material Design ?
- [ ] Blacklist ?
- [ ] Fix equalizer and tag editor (not working good enough)
- [ ] Fix service termination on app close
- [ ] Improve UI

### References
Expand Down
15 changes: 2 additions & 13 deletions src/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
applicationId "com.atul.musicplayer"
minSdkVersion 23
targetSdkVersion 33
versionCode 10
versionName "0.10"
versionCode 11
versionName "0.11"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -39,21 +39,10 @@ android {

dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'

implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.lifecycle:lifecycle-livedata:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.3.1'

implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'commons-io:commons-io:2.6'

androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation 'android.arch.persistence.room:runtime:1.1.1'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
implementation 'com.google.code.gson:gson:2.8.7'
}
6 changes: 0 additions & 6 deletions src/app/src/main/java/com/atul/musicplayer/MPConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ public class MPConstants {
public static final String CHANNEL_ID = "com.atul.musicplayerlite.CHANNEL_ID";
public static final int REQUEST_CODE = 100;

public static final int IMAGE_REQ_CODE = 444;

public static final float VOLUME_DUCK = 0.2f;
public static final float VOLUME_NORMAL = 1.0f;
public static final int AUDIO_NO_FOCUS_NO_DUCK = 0;
Expand All @@ -33,7 +31,6 @@ public class MPConstants {
R.drawable.ic_music_note,
R.drawable.ic_artist,
R.drawable.ic_library_music,
R.drawable.ic_playlist,
R.drawable.ic_settings,
};
public static final String SETTINGS_THEME = "shared_pref_theme";
Expand Down Expand Up @@ -95,9 +92,6 @@ public class MPConstants {
public static final int SORT_ALBUM_BY_TITLE = 0;
public static final int SORT_ALBUM_BY_DURATION = 1;
public static final int SORT_ALBUM_BY_SONGS = 2;
public static final int DATABASE_VERSION = 1;
public static final String MUSIC_TABLE = "music";
public static final String DATABASE_NAME = "playlist";
public static final String PLAY_STORE_LINK = "https://play.google.com/store/apps/details?id=com.atul.musicplayer";
public static MusicSelectListener musicSelectListener;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.atul.musicplayer.activities;

import android.content.Context;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
Expand All @@ -14,19 +13,16 @@
import com.atul.musicplayer.MPPreferences;
import com.atul.musicplayer.R;
import com.atul.musicplayer.adapter.SongsAdapter;
import com.atul.musicplayer.dialogs.SongOptionDialog;
import com.atul.musicplayer.helper.ThemeHelper;
import com.atul.musicplayer.listener.MusicSelectListener;
import com.atul.musicplayer.listener.PlayListListener;
import com.atul.musicplayer.model.Album;
import com.atul.musicplayer.model.Music;
import com.bumptech.glide.Glide;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;

import java.util.Locale;

public class SelectedAlbumActivity extends AppCompatActivity implements PlayListListener {
public class SelectedAlbumActivity extends AppCompatActivity {

private final
MusicSelectListener musicSelectListener = MPConstants.musicSelectListener;
Expand Down Expand Up @@ -57,11 +53,9 @@ protected void onCreate(Bundle savedInstanceState) {

RecyclerView recyclerView = findViewById(R.id.songs_layout);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new SongsAdapter(musicSelectListener, this, album.music));
recyclerView.setAdapter(new SongsAdapter(musicSelectListener, album.music));

shuffleControl.setOnClickListener(v -> {
musicSelectListener.playQueue(album.music, true);
});
shuffleControl.setOnClickListener(v -> musicSelectListener.playQueue(album.music, true));

setAlbumDataToUi();
setUpOptions();
Expand Down Expand Up @@ -97,10 +91,4 @@ private void setAlbumDataToUi() {
.placeholder(R.drawable.ic_album_art)
.into(albumArt);
}

@Override
public void option(Context context, Music music) {
SongOptionDialog dialog = new SongOptionDialog(context, music);
dialog.show();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.atul.musicplayer.activities;

import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

Expand All @@ -14,11 +13,9 @@
import com.atul.musicplayer.R;
import com.atul.musicplayer.adapter.HorizontalAlbumsAdapter;
import com.atul.musicplayer.adapter.SongsAdapter;
import com.atul.musicplayer.dialogs.SongOptionDialog;
import com.atul.musicplayer.helper.ThemeHelper;
import com.atul.musicplayer.listener.AlbumSelectListener;
import com.atul.musicplayer.listener.MusicSelectListener;
import com.atul.musicplayer.listener.PlayListListener;
import com.atul.musicplayer.model.Album;
import com.atul.musicplayer.model.Artist;
import com.atul.musicplayer.model.Music;
Expand All @@ -29,7 +26,7 @@
import java.util.List;
import java.util.Locale;

public class SelectedArtistActivity extends AppCompatActivity implements AlbumSelectListener, PlayListListener {
public class SelectedArtistActivity extends AppCompatActivity implements AlbumSelectListener {

private final
MusicSelectListener musicSelectListener = MPConstants.musicSelectListener;
Expand Down Expand Up @@ -64,7 +61,7 @@ protected void onCreate(Bundle savedInstanceState) {

songsRecyclerView.setLayoutManager(new LinearLayoutManager(this));
musicList.addAll(defAlbum.music);
songsAdapter = new SongsAdapter(musicSelectListener, this, musicList);
songsAdapter = new SongsAdapter(musicSelectListener, musicList);
songsRecyclerView.setAdapter(songsAdapter);

albumsRecyclerView.setLayoutManager(
Expand All @@ -74,9 +71,7 @@ protected void onCreate(Bundle savedInstanceState) {
albumsRecyclerView.setAdapter(albumsAdapter);

ExtendedFloatingActionButton shuffleControl = findViewById(R.id.shuffle_button);
shuffleControl.setOnClickListener(v -> {
musicSelectListener.playQueue(musicList, true);
});
shuffleControl.setOnClickListener(v -> musicSelectListener.playQueue(musicList, true));

setUpOptions();
}
Expand Down Expand Up @@ -107,10 +102,4 @@ public void selectedAlbum(Album album) {
albumSongsCount.setText(String.format(Locale.getDefault(), "%d Songs",
album.music.size()));
}

@Override
public void option(Context context, Music music) {
SongOptionDialog dialog = new SongOptionDialog(context, music);
dialog.show();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import com.atul.musicplayer.fragments.AlbumsFragment;
import com.atul.musicplayer.fragments.ArtistsFragment;
import com.atul.musicplayer.fragments.PlaylistFragment;
import com.atul.musicplayer.fragments.SettingsFragment;
import com.atul.musicplayer.fragments.SongsFragment;
import com.atul.musicplayer.listener.MusicSelectListener;
Expand All @@ -32,7 +31,6 @@ public void setFragments() {
fragments.add(SongsFragment.newInstance(selectListener));
fragments.add(ArtistsFragment.newInstance());
fragments.add(AlbumsFragment.newInstance());
fragments.add(PlaylistFragment.newInstance());
fragments.add(SettingsFragment.newInstance());
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import com.atul.musicplayer.R;
import com.atul.musicplayer.helper.MusicLibraryHelper;
import com.atul.musicplayer.listener.MusicSelectListener;
import com.atul.musicplayer.listener.PlayListListener;
import com.atul.musicplayer.model.Music;
import com.bumptech.glide.Glide;

Expand All @@ -23,13 +22,11 @@
public class SongsAdapter extends RecyclerView.Adapter<SongsAdapter.MyViewHolder> {

private final List<Music> musicList;
private final PlayListListener playListListener;
public MusicSelectListener listener;

public SongsAdapter(MusicSelectListener listener, PlayListListener playListListener, List<Music> musics) {
public SongsAdapter(MusicSelectListener listener, List<Music> musics) {
this.listener = listener;
this.musicList = musics;
this.playListListener = playListListener;
}

@NonNull
Expand Down Expand Up @@ -93,11 +90,6 @@ public MyViewHolder(@NonNull View itemView) {

itemView.findViewById(R.id.root_layout).setOnClickListener(v ->
listener.playQueue(musicList.subList(getAdapterPosition(), musicList.size()), false));

itemView.findViewById(R.id.root_layout).setOnLongClickListener(v -> {
playListListener.option(itemView.getContext(), musicList.get(getAdapterPosition()));
return true;
});
}
}
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit be72bee

Please sign in to comment.