remove padding due to draglist bug and make showqueue dragable
This commit is contained in:
parent
22b9422d3a
commit
0e1c948278
@ -22,7 +22,6 @@ THE SOFTWARE.
|
||||
-->
|
||||
<ch.blinkenlights.android.vanilla.DragTextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="3dip"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:gravity="left|center_vertical" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ListView
|
||||
<ch.blinkenlights.android.vanilla.DragListView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -2,7 +2,7 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<View
|
||||
android:id="@+id/playmark"
|
||||
@ -13,10 +13,12 @@
|
||||
android:id="@+id/text"
|
||||
android:background="@drawable/selectable_item_bg"
|
||||
android:maxLines="2"
|
||||
android:padding="3dip"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:gravity="left|center_vertical"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="44dip"
|
||||
android:paddingTop="2dip"
|
||||
android:paddingBottom="2dip"
|
||||
android:paddingLeft="6dip"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
@ -22,7 +22,6 @@ THE SOFTWARE.
|
||||
-->
|
||||
<ch.blinkenlights.android.vanilla.DragTextView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:padding="3dip"
|
||||
android:singleLine="true"
|
||||
android:textColor="#ffff"
|
||||
android:drawableLeft="@drawable/grabber"
|
||||
|
@ -72,7 +72,7 @@ public class DragListView extends ListView implements Handler.Callback {
|
||||
/**
|
||||
* Padding for each row in dip.
|
||||
*/
|
||||
public static final int PADDING = 3;
|
||||
public static final int PADDING = 0;
|
||||
/**
|
||||
* Background color of row while it is being dragged.
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@ import android.widget.ListView;
|
||||
import android.util.Log;
|
||||
|
||||
public class ShowQueueActivity extends Activity {
|
||||
private ListView mListView;
|
||||
private DragListView mListView;
|
||||
private ShowQueueAdapter listAdapter;
|
||||
|
||||
@Override
|
||||
@ -41,10 +41,11 @@ public class ShowQueueActivity extends Activity {
|
||||
setContentView(R.layout.showqueue_listview);
|
||||
|
||||
|
||||
mListView = (ListView) findViewById(R.id.list);
|
||||
mListView = (DragListView) findViewById(R.id.list);
|
||||
listAdapter = new ShowQueueAdapter(this, R.layout.showqueue_row);
|
||||
mListView.setAdapter(listAdapter);
|
||||
mListView.setFastScrollAlwaysVisible(true);
|
||||
mListView.setEditable(true);
|
||||
|
||||
mListView.setOnItemClickListener(new OnItemClickListener() {
|
||||
@Override
|
||||
|
@ -31,8 +31,11 @@ import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.util.Log;
|
||||
|
||||
public class ShowQueueAdapter extends ArrayAdapter<Song> {
|
||||
public class ShowQueueAdapter
|
||||
extends ArrayAdapter<Song>
|
||||
implements DragListView.DragAdapter {
|
||||
|
||||
int resource;
|
||||
Context context;
|
||||
@ -70,8 +73,18 @@ public class ShowQueueAdapter extends ArrayAdapter<Song> {
|
||||
|
||||
View pmark = ((View)row.findViewById(R.id.playmark));
|
||||
pmark.setVisibility( ( position == this.hl_row ? View.VISIBLE : View.INVISIBLE ));
|
||||
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void remove(int position) {
|
||||
// not implemented
|
||||
}
|
||||
|
||||
@Override
|
||||
public void move(int from, int to) {
|
||||
Log.v("VanillaMusic", "Moved FROM "+from+" to "+to);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user