mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-16 19:50:35 +01:00
On album list view text items can be minimized/maximized when long click.
(cherry picked from commit 8a3f6b2)
This commit is contained in:
parent
40f475a24b
commit
a0a8c86924
@ -46,7 +46,9 @@ import org.moire.ultrasonic.util.EntryByDiscAndTrackComparator;
|
|||||||
import org.moire.ultrasonic.util.Pair;
|
import org.moire.ultrasonic.util.Pair;
|
||||||
import org.moire.ultrasonic.util.TabActivityBackgroundTask;
|
import org.moire.ultrasonic.util.TabActivityBackgroundTask;
|
||||||
import org.moire.ultrasonic.util.Util;
|
import org.moire.ultrasonic.util.Util;
|
||||||
|
import org.moire.ultrasonic.view.AlbumView;
|
||||||
import org.moire.ultrasonic.view.EntryAdapter;
|
import org.moire.ultrasonic.view.EntryAdapter;
|
||||||
|
import org.moire.ultrasonic.view.SongView;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@ -137,6 +139,22 @@ public class SelectAlbumActivity extends SubsonicTabActivity
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
albumListView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
if (view instanceof AlbumView) {
|
||||||
|
AlbumView albumView = (AlbumView) view;
|
||||||
|
albumView.maximizeOrMinimize();
|
||||||
|
}
|
||||||
|
if (view instanceof SongView) {
|
||||||
|
SongView songView = (SongView) view;
|
||||||
|
songView.maximizeOrMinimize();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
selectButton = (ImageView) findViewById(R.id.select_album_select);
|
selectButton = (ImageView) findViewById(R.id.select_album_select);
|
||||||
playNowButton = (ImageView) findViewById(R.id.select_album_play_now);
|
playNowButton = (ImageView) findViewById(R.id.select_album_play_now);
|
||||||
playNextButton = (ImageView) findViewById(R.id.select_album_play_next);
|
playNextButton = (ImageView) findViewById(R.id.select_album_play_next);
|
||||||
|
@ -49,6 +49,7 @@ public class AlbumView extends UpdateView
|
|||||||
private MusicDirectory.Entry entry;
|
private MusicDirectory.Entry entry;
|
||||||
private EntryAdapter.AlbumViewHolder viewHolder;
|
private EntryAdapter.AlbumViewHolder viewHolder;
|
||||||
private ImageLoader imageLoader;
|
private ImageLoader imageLoader;
|
||||||
|
private boolean maximized = false;
|
||||||
|
|
||||||
public AlbumView(Context context, ImageLoader imageLoader)
|
public AlbumView(Context context, ImageLoader imageLoader)
|
||||||
{
|
{
|
||||||
@ -94,6 +95,20 @@ public class AlbumView extends UpdateView
|
|||||||
return this.entry;
|
return this.entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void maximizeOrMinimize() {
|
||||||
|
if (maximized) {
|
||||||
|
maximized = false;
|
||||||
|
} else {
|
||||||
|
maximized = true;
|
||||||
|
}
|
||||||
|
if (this.viewHolder.title != null) {
|
||||||
|
this.viewHolder.title.setSingleLine(!maximized);
|
||||||
|
}
|
||||||
|
if (this.viewHolder.artist != null) {
|
||||||
|
this.viewHolder.artist.setSingleLine(!maximized);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void setAlbum(final MusicDirectory.Entry album)
|
public void setAlbum(final MusicDirectory.Entry album)
|
||||||
{
|
{
|
||||||
viewHolder.cover_art.setTag(album);
|
viewHolder.cover_art.setTag(album);
|
||||||
|
@ -71,6 +71,7 @@ public class SongView extends UpdateView implements Checkable
|
|||||||
private DownloadFile downloadFile;
|
private DownloadFile downloadFile;
|
||||||
private boolean playing;
|
private boolean playing;
|
||||||
private EntryAdapter.SongViewHolder viewHolder;
|
private EntryAdapter.SongViewHolder viewHolder;
|
||||||
|
private boolean maximized = false;
|
||||||
|
|
||||||
public SongView(Context context)
|
public SongView(Context context)
|
||||||
{
|
{
|
||||||
@ -427,6 +428,20 @@ public class SongView extends UpdateView implements Checkable
|
|||||||
viewHolder.check.toggle();
|
viewHolder.check.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void maximizeOrMinimize() {
|
||||||
|
if (maximized) {
|
||||||
|
maximized = false;
|
||||||
|
} else {
|
||||||
|
maximized = true;
|
||||||
|
}
|
||||||
|
if (this.viewHolder.title != null) {
|
||||||
|
this.viewHolder.title.setSingleLine(!maximized);
|
||||||
|
}
|
||||||
|
if (this.viewHolder.artist != null) {
|
||||||
|
this.viewHolder.artist.setSingleLine(!maximized);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public enum ImageType
|
public enum ImageType
|
||||||
{
|
{
|
||||||
none,
|
none,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user