mirror of
https://github.com/ultrasonic/ultrasonic
synced 2025-02-09 16:28:56 +01:00
If items are maximized they will return to minimize form when scrolling.
(cherry picked from commit ada247d)
This commit is contained in:
parent
a17b2f978c
commit
3f2f59020c
@ -27,6 +27,7 @@ import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ListView;
|
||||
@ -107,6 +108,31 @@ public class SelectAlbumActivity extends SubsonicTabActivity
|
||||
}
|
||||
});
|
||||
|
||||
refreshAlbumListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView view, int scrollState) {
|
||||
for (int i=0;i<albumListView.getChildCount();i++) {
|
||||
Object child = albumListView.getChildAt(i);
|
||||
if (child instanceof AlbumView) {
|
||||
AlbumView albumView = (AlbumView) child;
|
||||
if (albumView.isMaximized()) {
|
||||
albumView.maximizeOrMinimize();
|
||||
}
|
||||
}
|
||||
if (child instanceof SongView) {
|
||||
SongView songView = (SongView) child;
|
||||
if (songView.isMaximized()) {
|
||||
songView.maximizeOrMinimize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
}
|
||||
});
|
||||
|
||||
header = LayoutInflater.from(this).inflate(R.layout.select_album_header, albumListView, false);
|
||||
|
||||
albumListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
|
||||
|
@ -428,6 +428,10 @@ public class SongView extends UpdateView implements Checkable
|
||||
viewHolder.check.toggle();
|
||||
}
|
||||
|
||||
public boolean isMaximized() {
|
||||
return maximized;
|
||||
}
|
||||
|
||||
public void maximizeOrMinimize() {
|
||||
if (maximized) {
|
||||
maximized = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user