Made progress on draggable adapter. It starts without crashing and has a nice grabber icon

pull/14/head
Tim Su 14 years ago
parent e030d23a6f
commit 1cc0b07dd2

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@ -58,6 +58,12 @@
</LinearLayout>
<ImageView android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:scaleType="center"
android:src="@drawable/grabber"/>
</LinearLayout>
<TextView android:id="@+id/extendedDetails"

@ -29,7 +29,7 @@
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
tlv:normal_height="40dip"
tlv:normal_height="48dip"
tlv:grabber="@+id/icon"
tlv:remove_mode="slideRight"
/>

@ -1,4 +1,4 @@
<resources>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<declare-styleable name="TouchListView">
<attr name="normal_height" format="dimension" />
<attr name="expanded_height" format="dimension" />

@ -50,7 +50,7 @@ public class DraggableTaskListActivity extends TaskListActivity {
@Override
protected View getListBody(ViewGroup root) {
return getLayoutInflater().inflate(R.layout.task_list_body_draggable, root);
return getLayoutInflater().inflate(R.layout.task_list_body_draggable, root, false);
}
private final TouchListView.DropListener onDrop = new TouchListView.DropListener() {

@ -181,7 +181,7 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,
/**
* @return view to attach to the body of the task list. must contain two
* elements, a view with id android:id/empty and a list view with id
* android:id/list
* android:id/list. It should NOT be attached to root
*/
protected View getListBody(ViewGroup root) {
if(AndroidUtilities.getSdkVersion() > 3)

@ -17,18 +17,18 @@ import android.database.Cursor;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.Html.ImageGetter;
import android.text.Html.TagHandler;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.util.Linkify;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnClickListener;
import android.view.View.OnCreateContextMenuListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.CheckBox;
@ -365,10 +365,10 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
viewHolder.completeBox.setOnClickListener(completeBoxListener);
// context menu listener
container.setOnCreateContextMenuListener(listener);
//container.setOnCreateContextMenuListener(listener);
// tap listener
container.setOnClickListener(listener);
//container.setOnClickListener(listener);
}
/* ======================================================================

Loading…
Cancel
Save