Commits

Michael Ma  committed 8983bb1

修正UI

  • Participants
  • Parent commits a59c001

Comments (0)

Files changed (14)

File Project/res/layout/bookmark_listview.xml

+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="@drawable/listview_style"
+    android:fadingEdge="none" >
+
+    <TextView
+        android:id="@+id/listNote"
+        android:layout_width="fill_parent"
+        android:layout_height="35dp"
+        android:paddingLeft="50dp"
+        android:paddingTop="5dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="30px" />
+
+    <TextView
+        android:id="@+id/listInfo"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_below="@id/listNote"
+        android:gravity="left"
+        android:paddingLeft="50dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="20px" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_centerVertical="true"
+        android:paddingLeft="10dp"
+        android:src="@drawable/bottom_button_bookmark" />
+
+</RelativeLayout>

File Project/res/layout/main.xml

 
         <ImageView
             android:id="@+id/mainSearch"
-            android:layout_width="36px"
-            android:layout_height="48px"
+            android:layout_width="26px"
+            android:layout_height="26px"
             android:layout_alignParentRight="true"
-            android:layout_marginRight="10dp"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
             android:src="@drawable/top_search_button" />
 
         <ImageView
             android:id="@+id/mainAdd"
-            android:layout_width="36px"
-            android:layout_height="48px"
-            android:layout_marginRight="10dp"
+            android:layout_width="26px"
+            android:layout_height="26px"
+            android:layout_marginRight="20dp"
             android:layout_toLeftOf="@id/mainSearch"
+            android:layout_marginTop="8dp"
             android:src="@drawable/top_add_button" />
     </RelativeLayout>
 
         <ListView
             android:id="@+id/mainListView"
             android:layout_width="fill_parent"
-            android:layout_height="fill_parent"
+            android:layout_height="wrap_content"
             android:cacheColorHint="#00000000"
             android:fadingEdge="none"
-            android:divider="#00000000"
             android:fadeScrollbars="true"
             android:scrollbars="vertical"
             android:scrollingCache="false" 
-            android:background="#e5e5e5">
+            android:background="#e5e5e5"
+            >
         </ListView>
     </RelativeLayout>
 

File Project/res/layout/main_listview.xml

-<?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:background="@drawable/listview_style"
-    android:fadingEdge="none" >
-
-    <TextView
-        android:id="@+id/listNote"
-        android:layout_width="fill_parent"
-        android:layout_height="35dp"
-        android:singleLine="true"
-        android:textColor="#000000"
-        android:textSize="30px" />
-
-    <TextView
-        android:id="@+id/listContent"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:gravity="right"
-        android:singleLine="true"
-        android:textColor="#000000"
-        android:textSize="28px" />
-
-    <TextView
-        android:id="@+id/listInfo"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_below="@id/listNote"
-        android:gravity="left"
-        android:singleLine="true"
-        android:textColor="#000000"
-        android:textSize="20px" />
-
-    <TextView
-        android:id="@+id/listDetail"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_below="@id/listNote"
-        android:gravity="right"
-        android:singleLine="true"
-        android:textSize="20px" />
-
-</RelativeLayout>

File Project/res/layout/note_read.xml

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-	android:id="@+id/noteReadMain" android:orientation="vertical"
-	android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#e5e5e5">
-	<RelativeLayout android:id="@+id/mainTitlebar"
-		android:layout_width="fill_parent" android:layout_height="wrap_content"
-		android:layout_alignParentTop="true" android:background="@drawable/title_bar" >
-		<ImageView android:id="@+id/mainSearch" android:layout_width="36px"
-			android:layout_height="48px" android:layout_alignParentRight="true" android:src="@drawable/top_search_button" android:layout_marginRight="10dp"/>
-		<ImageView android:id="@+id/mainAdd" android:layout_width="36px"
-			android:layout_height="48px" android:layout_toLeftOf="@id/mainSearch" android:src="@drawable/top_add_button" android:layout_marginRight="10dp"/>
-	</RelativeLayout>
-	<TextView android:id="@+id/noteContent" android:layout_width="fill_parent"
-		android:layout_height="wrap_content" android:textColor="#000000" android:textSize="24px"/>
-</LinearLayout>
+    android:id="@+id/noteReadMain"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="#e5e5e5"
+    android:orientation="vertical" >
+
+    <RelativeLayout
+        android:id="@+id/mainTitlebar"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:background="@drawable/title_bar" >
+
+        <ImageView
+            android:id="@+id/mainSearch"
+            android:layout_width="26px"
+            android:layout_height="26px"
+            android:layout_alignParentRight="true"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
+            android:src="@drawable/top_search_button" />
+
+        <ImageView
+            android:id="@+id/mainAdd"
+            android:layout_width="26px"
+            android:layout_height="26px"
+            android:layout_marginRight="20dp"
+            android:layout_toLeftOf="@id/mainSearch"
+            android:layout_marginTop="8dp"
+            android:src="@drawable/top_add_button" />
+    </RelativeLayout>
+
+    <TextView
+        android:id="@+id/noteContent"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:textColor="#000000"
+        android:textSize="24px" />
+
+</LinearLayout>

File Project/res/layout/notebook_listview.xml

+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/notebookManageListview"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/listview_style"
+    android:orientation="horizontal" >
+
+    <TextView
+        android:id="@+id/notebookManageListName"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:layout_weight="3"
+        android:paddingLeft="50dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="30px" />
+
+    <TextView
+        android:id="@+id/notebookManageListCount"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
+        android:gravity="right"
+        android:paddingRight="20dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="28px" />
+
+    <ImageView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentLeft="true"
+        android:layout_centerVertical="true"
+        android:paddingLeft="10dp"
+        android:src="@drawable/bottom_button_notebook" />
+
+</RelativeLayout>

File Project/res/layout/notebookmanage_listview.xml

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/notebookManageListview"
     android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
+    android:layout_height="wrap_content"
     android:background="@drawable/listview_style"
     android:orientation="horizontal" >
 
     <TextView
         android:id="@+id/notebookManageListName"
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
         android:layout_weight="3"
+        android:gravity="center_vertical"
         android:singleLine="true"
         android:textColor="#000000"
-        android:textSize="30px" />
+        android:textSize="30px" 
+        android:paddingLeft="20dp"/>
 
     <TextView
         android:id="@+id/notebookManageListCount"
         android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerVertical="true"
         android:gravity="right"
         android:singleLine="true"
         android:textColor="#000000"
-        android:textSize="28px" />
-
-    <TextView
-        android:id="@+id/notebookManageListCreated"
-        android:layout_width="fill_parent"
-        android:layout_height="fill_parent"
-        android:layout_below="@id/notebookManageListCount"
-        android:gravity="right"
-        android:singleLine="true"
-        android:textSize="20px" />
+        android:textSize="28px" 
+        android:paddingRight="20dp"/>
 
 </RelativeLayout>

File Project/res/layout/notebookmanage_main.xml

 
         <ImageView
             android:id="@+id/mainSearch"
-            android:layout_width="36px"
-            android:layout_height="48px"
+            android:layout_width="26px"
+            android:layout_height="26px"
             android:layout_alignParentRight="true"
-            android:layout_marginRight="10dp"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
             android:src="@drawable/top_search_button" />
 
         <ImageView
             android:id="@+id/mainAdd"
-            android:layout_width="36px"
-            android:layout_height="48px"
-            android:layout_marginRight="10dp"
+            android:layout_width="26px"
+            android:layout_height="26px"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
             android:layout_toLeftOf="@id/mainSearch"
             android:src="@drawable/top_add_button" />
     </RelativeLayout>
         <TextView
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
+            android:paddingLeft="10dp"
             android:text="@string/noteBookManageHeader"
             android:textColor="#000000" />
     </LinearLayout>
-
+
     <ListView
         android:id="@+id/notebookManageMylist"
         android:layout_width="fill_parent"
         android:fadingEdge="none"
         android:scrollbars="vertical"
         android:scrollingCache="false" >
-
     </ListView>
 
 </LinearLayout>

File Project/res/layout/notes_display.xml

 
         <ImageView
             android:id="@+id/mainSearch"
-            android:layout_width="36px"
-            android:layout_height="48px"
+            android:layout_width="26px"
+            android:layout_height="26px"
             android:layout_alignParentRight="true"
-            android:layout_marginRight="10dp"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
             android:src="@drawable/top_search_button" />
 
         <ImageView
             android:id="@+id/mainAdd"
-            android:layout_width="36px"
-            android:layout_height="48px"
-            android:layout_marginRight="10dp"
+            android:layout_width="26px"
+            android:layout_height="26px"
+            android:layout_marginRight="20dp"
+            android:layout_marginTop="8dp"
             android:layout_toLeftOf="@id/mainSearch"
             android:src="@drawable/top_add_button" />
     </RelativeLayout>
             android:id="@+id/notesNotebookName"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
-            android:textColor="#000000" 
-            />
+            android:textColor="#000000" />
     </LinearLayout>
 
     <ListView

File Project/res/layout/recentview_listview.xml

+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="@drawable/listview_style"
+    android:fadingEdge="none" >
+
+    <TextView
+        android:id="@+id/listNote"
+        android:layout_width="fill_parent"
+        android:layout_height="35dp"
+        android:paddingLeft="20dp"
+        android:paddingTop="5dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="30px" />
+
+    <TextView
+        android:id="@+id/listInfo"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_below="@id/listNote"
+        android:gravity="left"
+        android:paddingLeft="25dp"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="20px" />
+
+    <TextView
+        android:id="@+id/listDetail"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_below="@id/listNote"
+        android:gravity="right"
+        android:paddingRight="10dp"
+        android:singleLine="true"
+        android:textSize="20px" />
+
+</RelativeLayout>

File Project/src/com/noodle/note/activity/BookmarkIndexActivity.java

 import com.noodle.note.model.Bookmark;
 import com.noodle.note.model.Note;
 import com.noodle.note.persistent.unitofwork.Session;
-import com.noodle.note.utils.StringHelper;
-import com.noodle.note.utils.StringHelper.DateFormat;
 
 /**
  * 笔记本书签显示页面
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		initView();
-		
+
 	}
 
 	private void initView() {
 				contentMap.put("noteName", "位于笔记\"" + note.getTitle() + "\"第" + String.valueOf(bm.getLineNumber() + 1) + "行");
 				contentMap.put("noteId", bm.getNote().getId());
 				contentMap.put("startLine", bm.getLineNumber());
-				contentMap.put("created", "创建于:" + StringHelper.parseDate(bm.getCreated(), DateFormat.MONTH_DATE));
 				bookmarkList.add(contentMap);
 			}
 		} else {
 			noContentMap.put("noteId", -1);
 			bookmarkList.add(noContentMap);
 		}
-		SimpleAdapter listAdapter = new SimpleAdapter(this, bookmarkList, R.layout.main_listview, new String[] { "bookmarkName", "noteName", "created" }, new int[] {
-				R.id.listNote, R.id.listInfo, R.id.listDetail });
+		SimpleAdapter listAdapter = new SimpleAdapter(this, bookmarkList, R.layout.bookmark_listview, new String[] { "bookmarkName", "noteName" }, new int[] { R.id.listNote,
+				R.id.listInfo });
 		setListAdapter(listAdapter);
 		getListView().setDivider(new ColorDrawable(Color.TRANSPARENT));
 	}

File Project/src/com/noodle/note/activity/NotebookIndexActivity.java

 import com.noodle.note.model.Note;
 import com.noodle.note.model.Notebook;
 import com.noodle.note.persistent.unitofwork.Session;
-import com.noodle.note.utils.StringHelper;
-import com.noodle.note.utils.StringHelper.DateFormat;
 
 /**
  * 主页笔记本显示页面
 				int noteNumber = noteGateway.count(nb.getId());
 				contentMap.put("notebookName", nb.getName());
 				contentMap.put("noteNumber", "共" + noteNumber + "篇笔记");
-				contentMap.put("created", "创建于:" + StringHelper.parseDate(nb.getCreated(), DateFormat.MONTH_DATE_AND_HOUR_MINITE));
 				contentMap.put("id", nb.getId());
 				notebookList.add(contentMap);
 			}
 			noContentMap.put("id", -1);
 			notebookList.add(noContentMap);
 		}
-		SimpleAdapter listAdapter = new SimpleAdapter(this, notebookList, R.layout.main_listview, new String[] { "notebookName", "noteNumber", "created" }, new int[] {
-				R.id.listNote, R.id.listContent, R.id.listDetail });
+		SimpleAdapter listAdapter = new SimpleAdapter(this, notebookList, R.layout.notebook_listview	, new String[] { "notebookName", "noteNumber" }, new int[] {
+				R.id.notebookManageListName, R.id.notebookManageListCount});
 		setListAdapter(listAdapter);
 		getListView().setDivider(new ColorDrawable(Color.TRANSPARENT));
 	}

File Project/src/com/noodle/note/activity/NotebookManageActivity.java

 import com.noodle.note.model.Note;
 import com.noodle.note.model.Notebook;
 import com.noodle.note.persistent.unitofwork.Session;
-import com.noodle.note.utils.StringHelper;
-import com.noodle.note.utils.StringHelper.DateFormat;
 
 /**
  * 笔记本管理
 	 * 笔记本条目浏览中每个List的HashMap
 	 */
 	private ArrayList<HashMap<String, Object>> listItem = new ArrayList<HashMap<String, Object>>();
-	
+
 	private ImageView addButton;
 	private ImageView searchButton;
 
 			for (Notebook nb : list) {
 				HashMap<String, Object> contentMap = new HashMap<String, Object>();
 				contentMap.put("notebookname", nb.getName());
-				contentMap.put("notebookcount", "共有"+noteGateway.count(nb.getId()) + "篇笔记");
-				contentMap.put("created", "创建于:"+StringHelper.parseDate(nb.getCreated(), DateFormat.MONTH_DATE_AND_HOUR_MINITE));
+				contentMap.put("notebookcount", "共" + noteGateway.count(nb.getId()) + "篇笔记");
 				contentMap.put("id", nb.getId());
 				listItem.add(contentMap);
 			}
 			noContentMap.put("id", -1);
 			listItem.add(noContentMap);
 		}
-		SimpleAdapter listItemAdapter = new SimpleAdapter(this, listItem, R.layout.notebookmanage_listview, new String[] { "notebookname", "notebookcount","created" }, new int[] {
-				R.id.notebookManageListName, R.id.notebookManageListCount,R.id.notebookManageListCreated });
+		SimpleAdapter listItemAdapter = new SimpleAdapter(this, listItem, R.layout.notebookmanage_listview, new String[] { "notebookname", "notebookcount" }, new int[] {
+				R.id.notebookManageListName, R.id.notebookManageListCount });
 		listView.setAdapter(listItemAdapter);
 	}
 

File Project/src/com/noodle/note/activity/NotesDisplayActivity.java

 		NoteGateway noteGateway = (NoteGateway) Session.getInstance(this).query(Note.class);
 		NotebookGateway notebookGateway = (NotebookGateway) Session.getInstance(this).query(Notebook.class);
 		HashMap<String, Integer> conditions = new HashMap<String, Integer>();
+		
 		Notebook notebook = notebookGateway.findById(notebookId);
 		notebookName.setText(notebook.getName());
 		conditions.put("notebook_id", notebookId);

File Project/src/com/noodle/note/activity/RecentViewActivity.java

 			noContentMap.put("id", -1);
 			noteList.add(noContentMap);
 		}
-		SimpleAdapter listAdapter = new SimpleAdapter(this, noteList, R.layout.main_listview, new String[] { "noteTitle", "visited", "bookmarkNumber" }, new int[] { R.id.listNote,
+		SimpleAdapter listAdapter = new SimpleAdapter(this, noteList, R.layout.recentview_listview, new String[] { "noteTitle", "visited", "bookmarkNumber" }, new int[] { R.id.listNote,
 				R.id.listDetail, R.id.listInfo });
 		setListAdapter(listAdapter);
 		getListView().setDivider(new ColorDrawable(Color.TRANSPARENT));