mirror of https://github.com/tasks/tasks
Deleted old draggable TLF and associated stuff. Also rando unused activity
parent
5042e17b1f
commit
ec23d5b5d1
@ -1,127 +0,0 @@
|
|||||||
<?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:minHeight="57dip"
|
|
||||||
android:paddingTop="2dip"
|
|
||||||
android:paddingBottom="2dip"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:id="@+id/importance_legacy"
|
|
||||||
android:layout_width="4dip"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<!-- indent -->
|
|
||||||
<View android:id="@+id/indent"
|
|
||||||
android:layout_width="0dip"
|
|
||||||
android:layout_height="fill_parent"/>
|
|
||||||
|
|
||||||
<!-- grabber -->
|
|
||||||
<ImageView android:id="@+id/grabber"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:src="@drawable/grabber"/>
|
|
||||||
|
|
||||||
<RelativeLayout android:id="@+id/rowBody"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:background="@android:drawable/list_selector_background"
|
|
||||||
android:layout_marginTop="6dip"
|
|
||||||
android:layout_marginBottom="6dip"
|
|
||||||
android:paddingLeft="5dip">
|
|
||||||
|
|
||||||
|
|
||||||
<com.todoroo.astrid.ui.CheckableImageView
|
|
||||||
android:id="@+id/completeBox"
|
|
||||||
android:layout_width="45dip"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:minHeight="30dip"
|
|
||||||
android:scaleType="center"
|
|
||||||
android:layout_alignParentTop="true"
|
|
||||||
android:layout_marginLeft="2dip"
|
|
||||||
android:button="@drawable/btn_check" />
|
|
||||||
<!-- assignee photo -->
|
|
||||||
|
|
||||||
<greendroid.widget.AsyncImageView
|
|
||||||
android:id="@+id/picture"
|
|
||||||
android:layout_width="35dip"
|
|
||||||
android:layout_height="35dip"
|
|
||||||
android:layout_marginLeft="10dip"
|
|
||||||
astrid:defaultSrc="@drawable/icn_default_person_image"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/task_row"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toRightOf="@id/completeBox"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingLeft="5dip" >
|
|
||||||
|
|
||||||
<!-- 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" />
|
|
||||||
|
|
||||||
<!-- due date -->
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/taskActionContainer"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:minHeight="40dip"
|
|
||||||
android:layout_marginRight="4dip"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="right|center_vertical">
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/dueDate"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_marginRight="4dip"
|
|
||||||
android:gravity="center_vertical|right" />
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/taskActionIcon"
|
|
||||||
android:layout_width="20dip"
|
|
||||||
android:layout_height="20dip"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- details line 1 -->
|
|
||||||
<TextView android:id="@+id/details1"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/task_row"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_marginTop="-1dip"
|
|
||||||
style="@style/TextAppearance.TAd_ItemDetails"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<!-- details line 2 -->
|
|
||||||
<TextView android:id="@+id/details2"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/details1"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
style="@style/TextAppearance.TAd_ItemDetails"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!-- See the file "LICENSE" for the full license governing this code. -->
|
|
||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="100"
|
|
||||||
style="@style/Content">
|
|
||||||
|
|
||||||
<!-- No Tasks label -->
|
|
||||||
<TextView android:id="@android:id/empty"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:visibility="gone"
|
|
||||||
android:text="@string/TLA_no_items"
|
|
||||||
style="@style/TextAppearance.TLA_NoItems"/>
|
|
||||||
|
|
||||||
<com.commonsware.cwac.tlv.TouchListView
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:tlv="http://schemas.android.com/apk/res/com.timsu.astrid"
|
|
||||||
|
|
||||||
android:id="@android:id/list"
|
|
||||||
android:scrollbars="vertical"
|
|
||||||
android:cacheColorHint="#00000000"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="fill_parent"
|
|
||||||
android:drawSelectorOnTop="false"
|
|
||||||
android:smoothScrollbar="false"
|
|
||||||
|
|
||||||
tlv:normal_height="52dip"
|
|
||||||
tlv:grabber="@+id/grabber"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
package com.todoroo.astrid.activity;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.view.ViewGroup.LayoutParams;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
|
|
||||||
import com.todoroo.astrid.data.Task;
|
|
||||||
import com.todoroo.astrid.service.AstridDependencyInjector;
|
|
||||||
import com.todoroo.astrid.service.ThemeService;
|
|
||||||
import com.todoroo.astrid.ui.WebServicesView;
|
|
||||||
|
|
||||||
public class AdTestActivity extends Activity {
|
|
||||||
|
|
||||||
static {
|
|
||||||
AstridDependencyInjector.initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
ThemeService.applyTheme(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
WebServicesView webServicesView = new WebServicesView(this);
|
|
||||||
webServicesView.setLayoutParams(new FrameLayout.LayoutParams(
|
|
||||||
LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
|
|
||||||
webServicesView.setPadding(10, 10, 10, 10);
|
|
||||||
|
|
||||||
setContentView(webServicesView);
|
|
||||||
|
|
||||||
Task task = new Task();
|
|
||||||
task.setValue(Task.TITLE, "America (The Book)"); //$NON-NLS-1$
|
|
||||||
webServicesView.setTask(task);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
package com.todoroo.astrid.activity;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
|
||||||
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.view.MotionEvent;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnTouchListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.commonsware.cwac.tlv.TouchListView;
|
|
||||||
import com.timsu.astrid.R;
|
|
||||||
import com.todoroo.andlib.data.Property;
|
|
||||||
import com.todoroo.andlib.data.Property.IntegerProperty;
|
|
||||||
import com.todoroo.andlib.data.TodorooCursor;
|
|
||||||
import com.todoroo.astrid.adapter.TaskAdapter;
|
|
||||||
import com.todoroo.astrid.data.Task;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Activity for working with draggable task lists, like Google Tasks lists
|
|
||||||
*
|
|
||||||
* @author Tim Su <tim@todoroo.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DraggableTaskListFragment extends TaskListFragment {
|
|
||||||
|
|
||||||
// --- task list
|
|
||||||
|
|
||||||
/**
|
|
||||||
* If database has an indent property for determining how rows are indented,
|
|
||||||
* return it here so we can read it from the cursor and use it
|
|
||||||
*/
|
|
||||||
protected IntegerProperty getIndentProperty() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TouchListView getTouchListView() {
|
|
||||||
TouchListView tlv = (TouchListView) getListView();
|
|
||||||
return tlv;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected View getListBody(ViewGroup root) {
|
|
||||||
return getActivity().getLayoutInflater().inflate(R.layout.task_list_body_draggable, root, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) {
|
|
||||||
return new DraggableTaskAdapter(this, R.layout.task_adapter_draggable_row,
|
|
||||||
cursor, sqlQueryTemplate, false, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void setUpUiComponents() {
|
|
||||||
super.setUpUiComponents();
|
|
||||||
|
|
||||||
getTouchListView().setOnTouchListener(new OnTouchListener() {
|
|
||||||
@Override
|
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- task adapter
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Property<?>[] taskProperties() {
|
|
||||||
ArrayList<Property<?>> properties = new ArrayList<Property<?>>(Arrays.asList(TaskAdapter.PROPERTIES));
|
|
||||||
if(getIndentProperty() != null)
|
|
||||||
properties.add(getIndentProperty());
|
|
||||||
return properties.toArray(new Property<?>[properties.size()]);
|
|
||||||
}
|
|
||||||
|
|
||||||
private final class DraggableTaskAdapter extends TaskAdapter {
|
|
||||||
|
|
||||||
private DraggableTaskAdapter(TaskListFragment activity, int resource,
|
|
||||||
Cursor c, AtomicReference<String> query, boolean autoRequery,
|
|
||||||
OnCompletedTaskListener onCompletedTaskListener) {
|
|
||||||
super(activity, resource, c, query, autoRequery,
|
|
||||||
onCompletedTaskListener);
|
|
||||||
|
|
||||||
applyListeners = APPLY_LISTENERS_ROW_BODY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected ViewHolder getTagFromCheckBox(View v) {
|
|
||||||
return (ViewHolder)((View)v.getParent()).getTag();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public synchronized void setFieldContentsAndVisibility(View view) {
|
|
||||||
super.setFieldContentsAndVisibility(view);
|
|
||||||
|
|
||||||
ViewHolder viewHolder = (ViewHolder) view.getTag();
|
|
||||||
if(getIndentProperty() != null) {
|
|
||||||
int indent = viewHolder.task.getValue(getIndentProperty());
|
|
||||||
view.findViewById(R.id.indent).getLayoutParams().width =
|
|
||||||
(int) (displayMetrics.density * (indent * 20));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue