yuji_k64613.a1b6400@sandbox.evernote.com
https://sandbox.evernote.com/Login.action
-git://git.sourceforge.jp/gitroot/evermemo/source.git
+git push yuji_k64613@git.sourceforge.jp:/gitroot/evermemo/source.git master
\ No newline at end of file
android:layout_width="fill_parent"\r
android:layout_height="wrap_content"\r
android:gravity="center_vertical"\r
+ android:background="#99cccc"\r
/>\r
public class NoteListViewArrayAdapter extends ArrayAdapter<NoteListItem> {
private LayoutInflater inflater;
- private View headerView = null;
- private View titleView = null;
+// private View headerView = null;
+// private View titleView = null;
public NoteListViewArrayAdapter(Context context, int resourceId,
List<NoteListItem> items) {
return view;
}
-// @Override
-// public boolean isEnabled(int position) {
-// NoteListItem item = getItem(position);
-// return item.getNote() != null;
-// }
+ @Override
+ public boolean isEnabled(int position) {
+ NoteListItem item = getItem(position);
+ return item.getNote() != null;
+ }
}
cancelButtonOnClick();
}});
- List<Note> list = NoteDao.getInstance().search();
+ List<Note> list = NoteDao.getInstance().search(this);
}
private void addButtonOnClick(){
}
return result.toString();
}
+
+ public static boolean isNull(String str){
+ return str == null || str.length() == 0;
+ }
public static String getUsername(Context context){
EditPrefUtil pref = new EditPrefUtil(context);
public final static String PREF_PASSWORD = "PASSWORD";
public final static String PREF_NOTE = "NOTE";
public final static String PREF_HEADER = "HEADER";
+ public final static String PREF_NOTE_DAO = "NOTE_DAO";
public final static int TOGGLE_SIZE = 5;
}
import java.util.ArrayList;
import java.util.List;
+import android.content.Context;
+
+import com.yuji.em.common.CommonUtil;
+import com.yuji.em.common.Constant;
+import com.yuji.em.utility.EditPrefUtil;
+
public class NoteDao {
+ private static final String DELM = "\t";
private static NoteDao instance;
+ private int size = Constant.TOGGLE_SIZE;
public static NoteDao getInstance(){
if (instance == null){
return instance;
}
- public List<Note> search(){
+ public List<Note> search(Context context){
+ EditPrefUtil pref = new EditPrefUtil(context);
+ String data = pref.get(Constant.PREF_NOTE_DAO);
+
+ if (CommonUtil.isNull(data)){
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < size; i++){
+ sb.append("a");
+ sb.append(DELM);
+ sb.append("b");
+ sb.append(DELM);
+ }
+ data = sb.toString();
+
+ // TODO
+ // \95Û\91¶
+ }
+
+ String[] strs = data.split("\\t");
+ if (strs.length != size * 2){
+ return null;
+ }
+
List<Note> list = new ArrayList<Note>();
- Note n;
+ Note n;
+ for (int i = 0; i < size; i++){
+ n = new Note(strs[i * 2], strs[i * 2 + 1]);
+ list.add(n);
+ }
- n = new Note("1", "\83^\83C\83g\83\8bA");
- list.add(n);
- n = new Note("1", "\83^\83C\83g\83\8bB");
- list.add(n);
- n = new Note("1", "\83^\83C\83g\83\8bC");
- list.add(n);
return list;
}
}