Commits

Jiangge Zhang  committed a59c001 Merge

合并

  • Participants
  • Parent commits 683e65f, 73e4a34

Comments (0)

Files changed (13)

File Project/res/layout/notebook_manage.xml

-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    android:orientation="vertical" 
-    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:layout_marginRight="10dp"
-            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_toLeftOf="@id/mainSearch"
-            android:src="@drawable/top_add_button" />
-    </RelativeLayout>
-
-    <LinearLayout
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" >
-
-        <TextView
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/noteBookManageHeader" 
-            android:textColor="#000000"/>
-    </LinearLayout>
-
-    <ListView
-        android:id="@+id/notebookManageMylist"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:clickable="true"
-        android:scrollbars="vertical" >
-    </ListView>
-
-</LinearLayout>

File Project/res/layout/notebook_manage_listview.xml

-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout 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" >
-
-    <LinearLayout
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:orientation="vertical" >
-
-        <TextView
-            android:id="@+id/notebookManageListName"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="3"
-            android:singleLine="true"
-            android:textSize="20dp" />
-
-        <TextView
-            android:id="@+id/notebookManageListCount"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:singleLine="true"
-            android:textSize="10dp" />
-    </LinearLayout>
-
-</LinearLayout>

File Project/res/layout/notebookmanage_listview.xml

 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<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:layout_height="fill_parent"
     android:background="@drawable/listview_style"
     android:orientation="horizontal" >
 
-    <LinearLayout
+    <TextView
+        android:id="@+id/notebookManageListName"
         android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:orientation="vertical" >
+        android:layout_height="fill_parent"
+        android:layout_weight="3"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="30px" />
 
-        <TextView
-            android:id="@+id/notebookManageListName"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:layout_weight="3"
-            android:singleLine="true"
-            android:textSize="20dp" />
+    <TextView
+        android:id="@+id/notebookManageListCount"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:gravity="right"
+        android:singleLine="true"
+        android:textColor="#000000"
+        android:textSize="28px" />
 
-        <TextView
-            android:id="@+id/notebookManageListCount"
-            android:layout_width="fill_parent"
-            android:layout_height="wrap_content"
-            android:singleLine="true"
-            android:textSize="10dp" />
-    </LinearLayout>
+    <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" />
 
-</LinearLayout>
+</RelativeLayout>

File Project/res/layout/notebookmanage_main.xml

             android:src="@drawable/top_add_button" />
     </RelativeLayout>
 
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" >
+
+        <TextView
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/noteBookManageHeader"
+            android:textColor="#000000" />
+    </LinearLayout>
+
     <ListView
         android:id="@+id/notebookManageMylist"
         android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="fill_parent"
         android:clickable="true"
-        android:scrollbars="vertical" >
+        android:divider="#00000000"
+        android:fadeScrollbars="true"
+        android:fadingEdge="none"
+        android:scrollbars="vertical"
+        android:scrollingCache="false" >
+
     </ListView>
 
 </LinearLayout>

File Project/res/layout/notes_display.xml

             android:src="@drawable/top_add_button" />
     </RelativeLayout>
 
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" >
+
+        <TextView
+            android:id="@+id/notesNotebookName"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:textColor="#000000" 
+            />
+    </LinearLayout>
+
     <ListView
         android:id="@+id/notesList"
         android:layout_width="fill_parent"
-        android:layout_height="wrap_content"
-        android:clickable="true"
-        android:scrollbars="vertical" >
+        android:layout_height="fill_parent"
+        android:background="#e5e5e5"
+        android:cacheColorHint="#00000000"
+        android:divider="#00000000"
+        android:fadeScrollbars="true"
+        android:fadingEdge="none"
+        android:scrollbars="vertical"
+        android:scrollingCache="false" >
     </ListView>
 
     <LinearLayout

File Project/res/layout/notes_display_listview.xml

             android:layout_height="wrap_content"
             android:layout_weight="3"
             android:singleLine="true"
-            android:textSize="20dp" />
+            android:textSize="30px" />
 
         <TextView
             android:id="@+id/noteListCreated"
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:singleLine="true"
-            android:textSize="10dp" />
+            android:textSize="20px" />
     </LinearLayout>
 
 </LinearLayout>

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

 
 import android.app.ListActivity;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.ListView;
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		initView();
+		
 	}
 
 	private void initView() {
 				HashMap<String, Object> contentMap = new HashMap<String, Object>();
 				Note note = noteGateway.findById(bm.getNote().getId());
 				contentMap.put("bookmarkName", bm.getName());
-				contentMap.put("noteName", "位于笔记" + note.getTitle() + " 第" + String.valueOf(bm.getLineNumber() + 1) + "行");
+				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));
 		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 });
 		setListAdapter(listAdapter);
+		getListView().setDivider(new ColorDrawable(Color.TRANSPARENT));
 	}
 
 	/**

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

 		tab1 = (ImageView) findViewById(R.id.tab1);
 		tab2 = (ImageView) findViewById(R.id.tab2);
 		tab3 = (ImageView) findViewById(R.id.tab3);
-
+		
 		// 初始化滚动背景
 		RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
 		rl.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);

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

 
 import android.app.ListActivity;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.ListView;
 		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 });
 		setListAdapter(listAdapter);
+		getListView().setDivider(new ColorDrawable(Color.TRANSPARENT));
 	}
 
 	@Override

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;
 
 /**
  * 笔记本管理
 	 * manage页面listview项的接口设置以及监听器设置
 	 */
 	public void setListeners() {
-		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);
 		listView.setOnItemClickListener(oicl);
 		listView.setOnCreateContextMenuListener(longpressmenu);
 		addButton.setOnClickListener(addButtonListener);
 			bundle.putString("notebookName", notebookName);
 			intent.putExtras(bundle);
 			startActivity(intent);
+			overridePendingTransition(0, 0);
 			NotebookManageActivity.this.finish();
 			break;
 		// 长按菜单的“删除”操作
 			Intent selfintent = new Intent();
 			selfintent.setClass(NotebookManageActivity.this, NotebookManageActivity.class);
 			startActivity(selfintent);
+			overridePendingTransition(0, 0);
 			NotebookManageActivity.this.finish();
 			break;
-		// 长按菜单的“分享”操作
-		// TODO待实现
-		case 2:
-			break;
 		}
 		return super.onContextItemSelected(item);
 	}
 			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("notebookcount", "共有"+noteGateway.count(nb.getId()) + "篇笔记");
+				contentMap.put("created", "创建于:"+StringHelper.parseDate(nb.getCreated(), DateFormat.MONTH_DATE_AND_HOUR_MINITE));
 				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 });
+		listView.setAdapter(listItemAdapter);
 	}
 
 	/**

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

 import android.widget.ImageView;
 import android.widget.ListView;
 import android.widget.SimpleAdapter;
+import android.widget.TextView;
 
 import com.noodle.note.R;
 import com.noodle.note.gateway.NoteGateway;
+import com.noodle.note.gateway.NotebookGateway;
 import com.noodle.note.model.Note;
+import com.noodle.note.model.Notebook;
 import com.noodle.note.persistent.unitofwork.Session;
 
 /**
 	private ImageView addButton;
 	private ImageView searchButton;
 
+	private TextView notebookName;
+
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		setContentView(R.layout.notes_display);
 		addButton = (ImageView) findViewById(R.id.mainAdd);
 		searchButton = (ImageView) findViewById(R.id.mainSearch);
+
 		initView();
 		setListener();
 	}
 	 */
 	private void initView() {
 		listView = (ListView) findViewById(R.id.notesList);
+		notebookName = (TextView) findViewById(R.id.notesNotebookName);
 		int notebookId = (Integer) this.getIntent().getExtras().get("id");
 		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);
 		notes = noteGateway.findBy(conditions);
 		if (!notes.isEmpty()) {
 		}
 	}
 
-
 	/**
 	 * 顶部按钮监听器
 	 */

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

 
 import android.app.ListActivity;
 import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
 import android.os.Bundle;
 import android.view.View;
 import android.widget.ListView;
 		SimpleAdapter listAdapter = new SimpleAdapter(this, noteList, R.layout.main_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));
 	}
 
 	/**

File Project/src/com/noodle/note/gateway/NoteGateway.java

 		db.close();
 		return notes;
 	}
-
+	
+	
 	/**
 	 * 注入笔记对象所有属性
 	 *