enable flingRemove in playlist editor

This commit is contained in:
Adrian Ulrich 2015-08-10 21:02:11 +02:00
parent 0f1c7a6da9
commit ea88a0ac17
2 changed files with 14 additions and 0 deletions

View File

@ -26,4 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
dslv:drag_enabled="false"
dslv:drag_start_mode="onMove"
dslv:float_background_color="?float_color"
dslv:remove_enabled="true"
dslv:remove_mode="flingRemove"
dslv:fling_handle_id="@+id/dragger"
dslv:drag_handle_id="@+id/dragger"/>

View File

@ -47,6 +47,7 @@ public class PlaylistActivity extends Activity
, AbsListView.OnItemClickListener
, DialogInterface.OnClickListener
, DragSortListView.DropListener
, DragSortListView.RemoveListener
{
/**
* The SongTimeline play mode corresponding to each
@ -104,6 +105,7 @@ public class PlaylistActivity extends Activity
view.setOnItemClickListener(this);
view.setOnCreateContextMenuListener(this);
view.setDropListener(this);
view.setRemoveListener(this);
mListView = view;
View header = LayoutInflater.from(this).inflate(R.layout.playlist_buttons, null);
@ -293,4 +295,13 @@ public class PlaylistActivity extends Activity
mAdapter.moveItem(from, to);
}
/**
* Fired from adapter listview if user fling-removed an item
* @param position The position of the removed item
*/
@Override
public void remove(int position) {
mAdapter.removeItem(position);
}
}