Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

[Needs improvement] Playlist dialog: Add checkmark to indicate if song is in playlist #432

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6bac337
Playlist dialog: Add checkmark to indicate if song is in playlist
Sogolumbo Feb 12, 2018
f9fba4e
Add Testing Code
Sogolumbo Feb 20, 2018
575bb69
Merge pull request #1 from kabouzeid/master
Sogolumbo Sep 5, 2018
132d597
Update README.md
Sogolumbo Sep 5, 2018
dfba214
Merge pull request #2 from kabouzeid/master
Sogolumbo Jan 12, 2019
67262fa
Update README.md
Sogolumbo Jan 12, 2019
d91f11a
Enable playlist-checking for adding multiple songs to a playlist
Sogolumbo Feb 8, 2019
e81f655
No more duplicate songs added to playlists; Code cleanup
Sogolumbo Feb 8, 2019
7b6f91e
Update README.md
Sogolumbo Feb 8, 2019
6a48d35
Update README.md
Sogolumbo Feb 8, 2019
8cbb569
Update README.md
Sogolumbo Feb 8, 2019
21c0971
Update README.md
Sogolumbo Feb 8, 2019
fa770ff
Update README.md
Sogolumbo Feb 8, 2019
eda7037
Update README.md
Sogolumbo Feb 8, 2019
8254527
Add efficient method PlaylistContains(Songs)
Sogolumbo Jun 3, 2019
2c1b25c
Update README.md
Sogolumbo Jun 3, 2019
780292f
Update README.md
Sogolumbo Jun 3, 2019
7896c8e
Merge remote-tracking branch 'upstream/master'
Sogolumbo Jul 21, 2019
4512b43
Change and add functions in PlaylistUtil
Sogolumbo Jul 21, 2019
7380f4c
Update README.md
Sogolumbo Jul 21, 2019
04fc392
Performance Improvements
Sogolumbo Jul 22, 2019
083d794
Merge branch 'master' into performance-test
Sogolumbo Jul 22, 2019
69505e5
Remove Performance Measurements
Sogolumbo Jul 22, 2019
c477a6d
Bugfix: Wrong Info about Songs in Playlist
Sogolumbo May 27, 2020
0c4e177
Update README.md
Sogolumbo May 27, 2020
14b35fc
Update README.md
Sogolumbo May 27, 2020
fcdba15
Update README.md
Sogolumbo May 27, 2020
ec16d51
Update README.md
Sogolumbo May 27, 2020
28cbfa8
Fix Logical Bug
Sogolumbo Aug 22, 2020
acbf3c5
First Prototype stage
Sogolumbo Aug 22, 2020
84b859f
Second Prototype stage
Sogolumbo Aug 22, 2020
f80dbd3
Remove cancel button from 'add to playlist' dialog
Sogolumbo Aug 29, 2020
66c169e
Change button name 'Apply' to 'Ok' in 'add to playlist...' dialog
Sogolumbo Aug 29, 2020
3984ea2
Update README.md
Sogolumbo Sep 2, 2020
92587c5
Update README.md
Sogolumbo Sep 14, 2020
e481f13
Update README.md
Sogolumbo Sep 14, 2020
ad0fb5c
Merge branch 'Playlist-Checkbox'
Sogolumbo Sep 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,35 @@
# Phonograph
# Phonograph ([Forked from kabouzeid](https://github.com/kabouzeid/Phonograph))

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://github.com/kabouzeid/Phonograph/blob/master/LICENSE.txt)

**A material designed local music player for Android.**

![Screenshots](./art/art.jpg?raw=true)
## About this fork
The purpose of this fork is to implement an easy to use and powerful way to manage your playlists. The goals are:
- [x] See whether the selected song is already in a playlist
- [x] See whether multiple songs are already in a playlist
- [x] Do not add songs to playlist which would become duplicates
- [ ] Material Design for the checkmark
- [ ] Be able to remove a song which is already in a playlist
- [ ] Option to remove duplicate songs from existing playlists
- [ ] Sync playlists (with other devices, using textfiles in Google Drive)


![image](https://user-images.githubusercontent.com/33571916/52509049-01e1c300-2bf7-11e9-979a-8cf872436ec2.png)

In the playlist-menu checkmarks indicate whether a song / a number of songs are already in a list.
The brackets around the checkmark show that only some of the songs are part of the playlist.

This fork is only different from kabouzeid/master in these commits:

[6bac337](https://github.com/Sogolumbo/Phonograph/commit/6bac3379636d97a68f50ebb1672654ef1aa310fb),
[d91f11a](https://github.com/Sogolumbo/Phonograph/commit/d91f11ad068192806979da79a0d089835d574524),
[e81f655](https://github.com/Sogolumbo/Phonograph/commit/e81f655c802bb2953d6e6d093cc3a1c774b897c4),
[8254527](https://github.com/Sogolumbo/Phonograph/commit/8254527339ba7e8acd5cc522b34e3ee724ba9b5a),
[4512b43](https://github.com/Sogolumbo/Phonograph/commit/4512b43529231a57636b7d62fcbade9fb81329b9).

## Contributing
I love any support, feedback or new ideas. So feel free to contribute in any possible way. I don't have any experience with android programming so I really need help D:

[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/com.kabouzeid.gramophone/)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png"
alt="Get it on Google Play"
height="80">](https://play.google.com/store/apps/details?id=com.kabouzeid.gramophone)
### Getting the App for non-Programmers
If you want the app but don't know how to build it feel free to send me a personal message. We will find a solution :)
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,41 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
}
final ArrayList<Song> songs = getArguments().getParcelableArrayList("songs");

if(songs != null && songs.size() == 1)
int[] songIds = new int[songs.size()];
if(songs != null)
{
//TODO: display checkboxes instead of checkmark
for(int i = 0; i < songs.size(); i++){
songIds[i] = songs.get(i).id;
}

for (int i = 0; i < playlists.size(); i++) {
int playlistId = playlists.get(i).id;

long startTime = System.currentTimeMillis();//TEMP
long startTime = System.currentTimeMillis();//TODO: remove stopwatch

Boolean[] songIsInPlaylist = new Boolean[playlists.size()];
for(int i = 0; i < playlists.size(); i++){
songIsInPlaylist[i] = PlaylistsUtil.doPlaylistContains(getActivity(), playlists.get(i).id, songs.get(0).id);
boolean isAnySongInPlaylist = PlaylistsUtil.doPlaylistContainsAnySong(getActivity(), playlistId, songIds);
long stopTime1 = System.currentTimeMillis();//TODO: remove stopwatch
boolean areAllSongsInPlaylist = PlaylistsUtil.doPlaylistContainsAllSongs(getActivity(), playlistId, songIds);
long stopTime2 = System.currentTimeMillis();//TODO: remove stopwatch

//TEMP
if(songIsInPlaylist[i]) {
playlistNames[i + 1] = playlists.get(i).name + " \u2713";
//TODO: display checkboxes instead of checkmark
if (isAnySongInPlaylist) {
if(areAllSongsInPlaylist){
playlistNames[i + 1] = playlists.get(i).name + " \u2713"; //Add checkmark
}
else{
playlistNames[i + 1] = playlists.get(i).name + " (\u2713)"; //Add checkmark in brackets
}
}
}

long difference = System.currentTimeMillis() - startTime;
long endTime = difference + startTime;
long stopTimeTotal = System.currentTimeMillis();//TODO: remove stopwatch
long Time1 = stopTime1 - startTime;
long Time2 = stopTime2 - stopTime1;
long Time3 = stopTimeTotal - stopTime2;
long TotalTime = stopTimeTotal - startTime;//TODO: remove stopwatch
int uselessAssignmentForDebugging = 7;//TODO: remove stopwatch
int c = uselessAssignmentForDebugging;//TODO: remove stopwatch
}
}

return new MaterialDialog.Builder(getActivity())
Expand All @@ -79,7 +96,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
CreatePlaylistDialog.create(songs).show(getActivity().getSupportFragmentManager(), "ADD_TO_PLAYLIST");
} else {
materialDialog.dismiss();
PlaylistsUtil.addToPlaylist(getActivity(), songs, playlists.get(i - 1).id, true);
PlaylistsUtil.addToPlaylistWithoutDuplicates(getActivity(), songs, songIds, playlists.get(i - 1).id, true);
}
})
.build();
Expand Down
Loading