Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package github.paroj.dsub2000.fragments;

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -115,6 +116,7 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
private ImageButton repeatButton;
private View toggleListButton;
private ImageButton starButton;
private ImageButton addToPlaylist;
private ImageButton bookmarkButton;
private ImageButton rateBadButton;
private ImageButton rateGoodButton;
Expand Down Expand Up @@ -211,6 +213,15 @@ public void onClick(View v) {
starButton.setVisibility(View.GONE);
}

addToPlaylist = (ImageButton)rootView.findViewById(R.id.download_add_to_playlist);
addToPlaylist.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Entry song = currentPlaying.getSong();
addToPlaylist(Collections.singletonList(song));
}
});

View.OnTouchListener touchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent me) {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout-land/download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
android:src="?attr/star"
android:tint="?attr/element_color"/>

<ImageButton
android:id="@+id/download_add_to_playlist"
style="@style/DownloadActionImageButton"
android:src="@drawable/ic_action_add"
android:tint="?attr/element_color" />

<ImageButton
android:id="@+id/download_playback_speed"
style="@style/DownloadActionImageButton"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout-large-land/download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@
android:src="?attr/star"
android:tint="?attr/element_color"/>

<ImageButton
android:id="@+id/download_add_to_playlist"
style="@style/DownloadActionImageButton"
android:src="@drawable/ic_action_add"
android:tint="?attr/element_color" />

<ImageButton
android:id="@+id/download_playback_speed"
style="@style/DownloadActionImageButton"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/layout-port/download.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@
style="@style/DownloadActionImageButton"
android:src="@drawable/ic_toggle_star" />

<ImageButton
android:id="@+id/download_add_to_playlist"
style="@style/DownloadActionImageButton"
android:src="@drawable/ic_action_add"
android:tint="@android:color/white" />

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drawable/ic_action_add was already existing, but colored black


<ImageButton
android:id="@+id/download_playback_speed"
style="@style/DownloadActionImageButton"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<item name="android:layout_height">wrap_content</item>
<item name="android:paddingTop">8dip</item>
<item name="android:paddingBottom">8dip</item>
<item name="android:paddingRight">16dip</item>
<item name="android:paddingLeft">16dip</item>
<item name="android:paddingRight">14dip</item>
<item name="android:paddingLeft">14dip</item>
</style>
</resources>