~benoit.soyeux/tomdroid/sortingNote

« back to all changes in this revision

Viewing changes to src/org/tomdroid/ui/Notebooks.java

  • Committer: Benoit Soyeux
  • Date: 2010-11-28 20:54:49 UTC
  • Revision ID: benoit.soyeux@starbusiness.fr-20101128205449-cdrzr7nnav62isll
the Notebook filter functionality is now ended. it could be merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
import org.tomdroid.NoteManager;
5
5
import org.tomdroid.Notebook;
6
6
import org.tomdroid.R;
 
7
import org.tomdroid.sync.SyncManager;
7
8
 
8
9
import android.app.AlertDialog;
9
10
import android.app.ListActivity;
17
18
import android.view.Menu;
18
19
import android.view.MenuItem;
19
20
import android.view.View;
 
21
import android.widget.ImageView;
20
22
import android.widget.ListAdapter;
21
23
import android.widget.ListView;
22
24
import android.widget.TextView;
39
41
                
40
42
                // adapter that binds the ListView UI to the notebooks in the note manager
41
43
                adapter = NoteManager.getListAdapterNotebook(this);
42
 
                setListAdapter(adapter);
43
 
 
44
 
                // set the view shown when the list is empty
45
 
                // TODO default empty-list text is butt-ugly!
46
 
                listEmptyView = (TextView) findViewById(R.id.list_empty);
47
 
                getListView().setEmptyView(listEmptyView);
 
44
                setListAdapter(adapter);                
 
45
                
 
46
                // all notebooks
 
47
                final TextView allNotebooks = (TextView) findViewById(R.id.allNotebooks);
 
48
                allNotebooks.setOnClickListener(new View.OnClickListener() {
 
49
 
 
50
                        public void onClick(View v) {                                           
 
51
                                Bundle bundle = new Bundle();
 
52
                                bundle.putString("notebook", null);
 
53
 
 
54
                                Intent i = new Intent(v.getContext(), Tomdroid.class);
 
55
                                i.putExtras(bundle);
 
56
                                startActivity(i);
 
57
                        }
 
58
                });
 
59
                        
48
60
        }
49
61
 
50
62
        @Override
64
76
 
65
77
        @Override
66
78
        protected void onListItemClick(ListView l, View v, int position, long id) {
 
79
                Log.i(TAG,"onListItemClick");
67
80
                
68
81
                Cursor item = (Cursor) adapter.getItem(position);
69
82
                String notebook = item.getString(item.getColumnIndexOrThrow(Notebook.NAME));