Procurares
Procurares

Reputation: 2249

DragSortListView item disappears Android

I'm using this library. Item of this ListView contains ImageView, and another custom View, which contains a lot of TextViews. While Floating any item - custom View disappears, background of item become black, but ImageView is still visible without any changes. Here is the question: How can i access directly that custom View, and, for example make text red colored while floating.

Upvotes: 0

Views: 1118

Answers (2)

vepzfe
vepzfe

Reputation: 4527

Use this code (taken from https://github.com/bauerca/drag-sort-listview/issues/86):

SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(mDragSortListView);
simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT);
mDragSortListView.setFloatViewManager(simpleFloatViewManager);

Upvotes: 0

Sca09
Sca09

Reputation: 381

In the documentation they provide here you can find the attribute:

float_background_color

With this configuration for the "DragSortListView" you can change the color when the content floats, something like:

<?xml version="1.0" encoding="utf-8"?>
<com.mobeta.android.dslv.DragSortListView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dslv="http://schemas.android.com/apk/res-auto"
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:paddingTop="0dp"
    android:paddingBottom="0dp"
    android:paddingLeft="10dp"
    android:layout_margin="10dp"
    android:dividerHeight="3dp"
    android:divider="@color/blue_light"
    android:fastScrollEnabled="true"
    dslv:drag_enabled="true"
    dslv:collapsed_height="2dp"
    dslv:drag_scroll_start="0.33"
    dslv:max_drag_scroll_speed="0.5"
    dslv:float_alpha="0.2"
    dslv:slide_shuffle_speed="0.3"
    dslv:track_drag_sort="false"
    dslv:use_default_controller="true"
    dslv:drag_handle_id="@id/drag_handle"
    dslv:sort_enabled="true"
    dslv:remove_enabled="true"
    dslv:drag_start_mode="onDown"
    dslv:remove_mode="flingRemove"
    dslv:float_background_color="@color/blue_light" />

Upvotes: 1

Related Questions