<TextView android:text="@+string/updatorNoteTitle" android:textStyle="bold" android:background="#99cccc" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="0px"></TextView>
<Spinner android:id="@+id/updatorNoteSpinner" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_marginLeft="5px"></Spinner>
<LinearLayout android:id="@+id/updatorNoteLayout" android:layout_width="fill_parent" android:layout_height="wrap_content">
- <TextView android:id="@+id/updatorNoteText" android:text="@+string/updatorNoteText" android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="left|center" android:background="#cccccc" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="fill_parent" android:layout_marginLeft="10px" android:paddingLeft="10px"></TextView>
+ <TextView android:id="@+id/updatorNoteText" android:text="@+string/updatorNoteText" android:textAppearance="?android:attr/textAppearanceLarge" android:gravity="left|center" android:scrollHorizontally="true" android:ellipsize="end" android:background="#cccccc" android:layout_width="wrap_content" android:layout_weight="1" android:layout_height="fill_parent" android:layout_marginLeft="10px" android:paddingLeft="10px"></TextView>
<Button android:id="@+id/updatorNoteButton" android:text="@+string/updatorNoteButton" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
public class NoteTypeListActivity extends BaseActivity {\r
private EditPrefUtil pref = new EditPrefUtil(this);\r
\r
+ private static List<NoteListItem> itemList = null;\r
private LinearLayout layoutView = null;\r
private TextView messageText = null;\r
private ListView listView = null;\r
closeButon.setEnabled(false);\r
\r
// updateList();\r
- int noteItemType = pref.getInt(Constant.PREF_NOTE_ITEM_TYPE_TMP,\r
- Constant.NOTE_ITEM_TYPE_ALL);\r
- NoteTypeListTask task = new NoteTypeListTask(this, noteItemType);\r
- AsyncTaskCommand command = new AsyncTaskCommand(this, task);\r
- command.setTitle(getString(R.string.noteTypeDialogTitle));\r
- command.setButtonTitle(getString(R.string.cancelButton));\r
- command.execute("");\r
- \r
+ if (itemList == null){\r
+ int noteItemType = pref.getInt(Constant.PREF_NOTE_ITEM_TYPE_TMP,\r
+ Constant.NOTE_ITEM_TYPE_ALL);\r
+ NoteTypeListTask task = new NoteTypeListTask(this, noteItemType);\r
+ AsyncTaskCommand command = new AsyncTaskCommand(this, task);\r
+ command.setTitle(getString(R.string.noteTypeDialogTitle));\r
+ command.setButtonTitle(getString(R.string.cancelButton));\r
+ command.execute("");\r
+ }\r
+ else {\r
+ setList(itemList); \r
+ }\r
setStatus();\r
}\r
\r
NoteListItem item = new NoteListItem(iItem.getText(), iItem);\r
itemList.add(item);\r
}\r
+ \r
+ setList(itemList);\r
+\r
+ setStatus();\r
+ }\r
\r
+ private void setList(List<NoteListItem> itemList) {\r
NoteListViewArrayAdapter adapter = new NoteListViewArrayAdapter(this,\r
R.layout.simple_list_item_1, itemList);\r
listView.setAdapter(adapter);\r
-\r
- closeButon.setEnabled(true);\r
- setStatus();\r
+ \r
+ NoteTypeListActivity.itemList = itemList;\r
}\r
\r
private void setStatus() {\r
+ closeButon.setEnabled(itemList != null);\r
layoutView.setVisibility(View.GONE);\r
}\r
+ \r
+ public static void init(){\r
+ itemList = null;\r
+ }\r
}\r
sortRadio1.setEnabled(false);
sortRadio2.setEnabled(false);
timeCheckBox.setEnabled(false);
+ timeButton.setEnabled(false);
return;
}
sortRadio1.setEnabled(false);
sortRadio2.setEnabled(false);
timeCheckBox.setEnabled(false);
+ timeButton.setEnabled(false);
return;
}
sortRadio1.setEnabled(true);
sortRadio2.setEnabled(true);
timeCheckBox.setEnabled(true);
+ timeButton.setEnabled(true);
}
public static void init(Context context) {