Commits

mugulion committed 7d17368

修改了notebookManageActivity的menu图标与背景
以及bookmarkManageActivity的背景

  • Participants
  • Parent commits a6a0ab4

Comments (0)

Files changed (6)

Project/res/layout/note_bookmark.xml

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 	android:id="@+id/bookmarkMain" android:orientation="vertical"
-	android:layout_width="fill_parent" android:layout_height="fill_parent">
+	android:layout_width="fill_parent" android:layout_height="fill_parent"
+	android:background="#e5e5e5">
 	<TextView android:id="@+id/bookmarkTitle" android:layout_width="fill_parent"
 		android:layout_height="wrap_content" android:text="@string/bookmarkTitle"
 		android:textSize="25dp" android:singleLine="true" />

Project/res/layout/notebookmanage_main.xml

 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/notebookManageMain"
 	android:orientation="vertical" android:layout_width="fill_parent"
-	android:layout_height="fill_parent" >
+	android:layout_height="fill_parent" android:background="#e5e5e5">
 	<ListView android:id="@+id/notebookManageMylist" android:layout_width="fill_parent"
 		android:layout_height="wrap_content" android:scrollbars="vertical" android:clickable="true"></ListView>
 	<LinearLayout android:layout_width="fill_parent"

Project/res/menu/notebook_manage_menu.xml

+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+	<item android:id="@+id/notebookManageTab1" android:icon="@android:drawable/ic_menu_add" android:title="@string/notebookManageTab1" />
+</menu>

Project/res/values/notebook_manage_menu.xml

+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="notebookManageTab1">新建笔记本</string>
+</resources>

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

 		tabLayout1 = (RelativeLayout) findViewById(R.id.tabLayout1);
 		tabLayout2 = (RelativeLayout) findViewById(R.id.tabLayout2);
 		tabLayout3 = (RelativeLayout) findViewById(R.id.tabLayout3);
+		
 		tab1 = (ImageView) findViewById(R.id.tab1);
 		tab2 = (ImageView) findViewById(R.id.tab2);
 		tab3 = (ImageView) findViewById(R.id.tab3);

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

 import android.view.ContextMenu;
 import android.view.ContextMenu.ContextMenuInfo;
 import android.view.Menu;
+import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.View.OnCreateContextMenuListener;
 	 */
 	@Override
 	public boolean onCreateOptionsMenu(Menu menu) {
-		String tab1Name = "新增笔记本";
-		String tab2Name = "更多";
-		menu.add(0, Menu.FIRST, 0, tab1Name);
-		menu.add(0, Menu.FIRST + 1, 0, tab2Name);
-		return super.onCreateOptionsMenu(menu);
+		MenuInflater inflater = getMenuInflater();
+		inflater.inflate(R.menu.notebook_manage_menu, menu);
+		return true;
 	}
 
 	/** 
 	public boolean onOptionsItemSelected(MenuItem item) {
 		switch (item.getItemId()) {
 		/** Menu中的“新增笔记本”操作 */
-		case Menu.FIRST:
+		case R.id.notebookManageTab1:
 			Intent intent = new Intent();
 			intent.setClass(NotebookManageActivity.this, NotebookManageCreatActivity.class);
 			startActivity(intent);
 			NotebookManageActivity.this.finish();
 			break;
-		/** Menu中的“更多”操作 */
-		// TODO 待实现
-		case Menu.FIRST + 1:
-			break;
 		}
 		return super.onOptionsItemSelected(item);
 	}