mirror of https://github.com/tasks/tasks
Started on reusable task adapter
parent
b409497c8d
commit
fb51a7334c
@ -1,7 +1,17 @@
|
||||
package com.todoroo.astrid.tags.reusable;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
import com.todoroo.andlib.data.TodorooCursor;
|
||||
import com.todoroo.astrid.activity.TaskListFragment;
|
||||
import com.todoroo.astrid.adapter.TaskAdapter;
|
||||
import com.todoroo.astrid.data.Task;
|
||||
|
||||
public class FeaturedTaskListFragment extends TaskListFragment {
|
||||
|
||||
@Override
|
||||
protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) {
|
||||
return new ReusableTaskAdapter(this, R.layout.reusable_task_adapter_row,
|
||||
cursor, sqlQueryTemplate, false, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
package com.todoroo.astrid.tags.reusable;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
import com.todoroo.astrid.activity.TaskListFragment;
|
||||
import com.todoroo.astrid.adapter.TaskAdapter;
|
||||
|
||||
public class ReusableTaskAdapter extends TaskAdapter {
|
||||
|
||||
public ReusableTaskAdapter(TaskListFragment fragment, int resource,
|
||||
Cursor c, AtomicReference<String> query, boolean autoRequery,
|
||||
OnCompletedTaskListener onCompletedTaskListener) {
|
||||
super(fragment, resource, c, query, autoRequery, onCompletedTaskListener);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:astrid="http://schemas.android.com/apk/res/com.timsu.astrid"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:drawable/list_selector_background"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/clone_task"
|
||||
android:layout_width="45dip"
|
||||
android:layout_height="45dip"
|
||||
android:layout_centerVertical="true"
|
||||
android:background="@android:color/black"/>
|
||||
|
||||
<!-- task name -->
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
style="@style/TextAppearance.TAd_ItemTitle"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="100"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="2" />
|
||||
|
||||
</LinearLayout>
|
||||
Loading…
Reference in New Issue