Commits

mugulion committed f981afb Merge

Merge

  • Participants
  • Parent commits 7d17368, 9956a29

Comments (0)

Files changed (4)

File Project/res/drawable/listview_style.xml

+<?xml version="1.0" encoding="utf-8" ?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+	<item android:state_window_focused="false" android:drawable="@drawable/listitem" />
+	<item android:state_focused="true" android:state_pressed="true"
+		android:drawable="@drawable/listitem_pushed" />
+	<item android:state_focused="false" android:state_pressed="true"
+		android:drawable="@drawable/listitem_pushed" />
+	<item android:state_selected="true" android:drawable="@drawable/listitem_pushed" />
+	<item android:state_focused="true" android:drawable="@drawable/listitem_pushed" />
+</selector>

File Project/res/layout/main.xml

 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 	android:id="@+id/mainBackground" android:layout_width="fill_parent"
-	android:layout_height="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="#416132">
-		<ImageView android:layout_width="50dp" android:layout_height="wrap_content"
-			android:id="@+id/mainLogo" />
-		<ImageButton android:id="@+id/mainSearch" android:layout_width="30dp"
-			android:layout_height="30dp" android:layout_alignParentRight="true" />
-		<ImageButton android:id="@+id/mainAdd" android:layout_width="30dp"
-			android:layout_height="30dp" android:layout_toLeftOf="@id/mainSearch" />
+		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>
 	<RelativeLayout android:id="@+id/listContent"
 		android:layout_width="fill_parent" android:layout_height="wrap_content"
 		android:layout_below="@id/mainTitlebar">
-		<ListView android:id="@id/android:list" android:layout_width="fill_parent"
+		<ListView android:id="@+id/recentNoteList" android:layout_width="fill_parent"
 			android:layout_height="wrap_content" android:drawSelectorOnTop="false"
-			android:scrollbars="vertical" android:fadingEdge="none">
+			android:scrollbars="vertical" android:scrollingCache="false">
 		</ListView>
 	</RelativeLayout>
 	<RelativeLayout android:id="@+id/tabContent"
 		android:layout_width="fill_parent" android:layout_height="50dp"
-		android:layout_alignParentBottom="true" android:background="#456132">
+		android:layout_alignParentBottom="true" android:background="@drawable/bottom_button">
 		<LinearLayout android:orientation="horizontal"
 			android:layout_width="fill_parent" android:layout_height="fill_parent"
 			android:layout_weight="6.0">
 				android:layout_weight="1.0" android:layout_gravity="center_vertical">
 				<ImageView android:id="@+id/tab1" android:layout_width="wrap_content"
 					android:layout_height="wrap_content" android:layout_centerInParent="true"
-					android:src="@android:drawable/ic_media_play" />
+					android:src="@drawable/bottom_button_history" />
 			</RelativeLayout>
 			<RelativeLayout android:id="@+id/tabLayout2"
 				android:layout_width="fill_parent" android:layout_height="wrap_content"
 				android:layout_weight="1.0" android:layout_gravity="center_vertical">
 				<ImageView android:id="@+id/tab2" android:layout_width="wrap_content"
 					android:layout_height="wrap_content" android:layout_centerInParent="true"
-					android:src="@android:drawable/ic_media_pause" />
+					android:src="@drawable/bottom_button_notebook" />
 			</RelativeLayout>
 			<RelativeLayout android:id="@+id/tabLayout3"
 				android:layout_width="fill_parent" android:layout_height="wrap_content"
 				android:layout_weight="1.0" android:layout_gravity="center_vertical">
 				<ImageView android:id="@+id/tab3" android:layout_width="wrap_content"
 					android:layout_height="wrap_content" android:layout_centerInParent="true"
-					android:src="@android:drawable/ic_menu_share" />
+					android:src="@drawable/bottom_button_bookmark" />
 			</RelativeLayout>
 		</LinearLayout>
 	</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="#ffffff"
-    >
-    
+    android:layout_height="wrap_content"
+    android:background="@drawable/listview_style">
+
     <TextView
-        android:id="@+id/listNote" 
+        android:id="@+id/listNote"
         android:layout_width="wrap_content"
         android:layout_height="35dp"
-        android:textSize="11pt"
-        android:singleLine="true"/>
-    
-    <TextView 
-        android:id="@+id/listDetail" 
+        android:singleLine="true"
+        android:textSize="11pt" />
+
+    <TextView
+        android:id="@+id/listDetail"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
+        android:layout_below="@id/listNote"
         android:gravity="right"
-        android:textSize="10pt"
-        android:singleLine="true" android:layout_below="@id/listNote"/>
+        android:singleLine="true"
+        android:textSize="10pt" />
+
 </RelativeLayout>

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

 import android.view.View.OnClickListener;
 import android.view.ViewGroup.LayoutParams;
 import android.view.animation.TranslateAnimation;
-import android.widget.ImageButton;
 import android.widget.ImageView;
+import android.widget.ListView;
 import android.widget.RelativeLayout;
 
 import com.noodle.note.R;
 	private int startPosition;
 	private int endPosition = 0;
 
-	private ImageButton addButton;
-	private ImageButton searchButton;
-
+	private ImageView addButton;
+	private ImageView searchButton;
+	
 	@Override
 	public void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
 		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);
 
 		// 初始化滚动背景
 		RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
-		rl.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
+		rl.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
 		activeBackground = new ImageView(this);
 		activeBackground.setTag("activeBackground");
-		activeBackground.setImageResource(R.drawable.icon); // TODO 修改图片
-		addButton = (ImageButton) findViewById(R.id.mainAdd);
-		searchButton = (ImageButton) findViewById(R.id.mainSearch);
+		activeBackground.setImageResource(R.drawable.bottom_button_activeline);
+		addButton = (ImageView) findViewById(R.id.mainAdd);
+		searchButton = (ImageView) findViewById(R.id.mainSearch);
 
 		// 默认滚动背景位置
 		switch (defaultActiveBackgroundId) {
 		default:
 			break;
 		}
-
+		
 		// 获得内容页面
 		View view = getLocalActivityManager().startActivity("recentView", new Intent(MainActivity.this, RecentViewActivity.class)).getDecorView();
 		listContentLayout.addView(view);
 		relativeLayout.removeView(old);
 		ImageView iv = new ImageView(this);
 		iv.setTag("currentActiveBackground");
-		iv.setImageResource(R.drawable.icon); // TODO 修改图片
+		iv.setImageResource(R.drawable.bottom_button_activeline);
 		tabContentLayout.addView(iv, rl);
 	}