Android Open Source - TodoList Todo Cursor Adapter






From Project

Back to project page TodoList.

License

The source code is released under:

Apache License

If you think the Android project TodoList listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package lyc.app.adapter;
/* ww  w.jav a  2  s. c om*/

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.ResourceCursorAdapter;
import android.view.View;
import android.widget.TextView;

import lyc.app.App;
import lyc.app.DateUtils;
import lyc.app.R;

/**
 * Created by ivan on 14-9-26.
 */
public class TodoCursorAdapter extends ResourceCursorAdapter {

  public TodoCursorAdapter(Context context, int layout, Cursor cursor) {
    super(context, layout, cursor, -1);
  }

  @Override
  public void bindView(View view, Context context, Cursor cursor) {
    TextView titleTxtView = (TextView) view.findViewById(R.id.title_txtView);
    TextView planDateTxtView = (TextView) view.findViewById(R.id.planDate_TxtView);

    titleTxtView.setText(cursor.getString(cursor.getColumnIndex(App.Todo.COLUMN_TITLE)));
    planDateTxtView.setText(DateUtils.format(
        cursor.getLong(cursor.getColumnIndex(App.Todo.COLUMN_PLAN_FINISHED_DATE))));
  }
}




Java Source Code List

lyc.app.AddActivity.java
lyc.app.App.java
lyc.app.BootReceiver.java
lyc.app.DateUtils.java
lyc.app.MainActivity.java
lyc.app.TodoService.java
lyc.app.adapter.TodoCursorAdapter.java
lyc.app.fragment.FinishedTodoFragment.java
lyc.app.fragment.UnFinishedTodoFragment.java
lyc.app.provider.TodoProvider.java
lyc.simplesqlite.annotation.Column.java
lyc.simplesqlite.annotation.Table.java
lyc.simplesqlite.exception.AnnotationNotFoundException.java
lyc.simplesqlite.util.MetaData.java
lyc.simplesqlite.util.StringUtils.java