[cng1985] r627 committed - 增加广告,完成初步整合

1 view
Skip to first unread message

cng...@googlecode.com

unread,
Sep 12, 2011, 9:59:54 PM9/12/11
to cng...@googlegroups.com
Revision: 627
Author: cng1985
Date: Mon Sep 12 18:58:48 2011
Log: 增加广告,完成初步整合
http://code.google.com/p/cng1985/source/detail?r=627

Modified:
/books/AndroidManifest.xml
/books/res/layout/ui_main.xml
/books/res/layout/widget_book.xml
/books/src/com/baoyi/adapter/BooksAdapter.java
/books/src/com/baoyi/widget/BookWidget.java
/books/src/com/iym/bookstore/MainUI.java

=======================================
--- /books/AndroidManifest.xml Thu Sep 8 02:30:34 2011
+++ /books/AndroidManifest.xml Mon Sep 12 18:58:48 2011
@@ -18,7 +18,7 @@
android:label="@string/app_name" />
<activity android:name="com.adwo.adsdk.AdwoAdBrowserActivity"
android:label="@string/app_name" />
- <meta-data android:value="7ff6616d5c27412ab28158c26405b14a"
+ <meta-data android:value="d6202a0dce2c46858daee8e098d09078"
android:name="Adwo_PID" />

<activity
=======================================
--- /books/res/layout/ui_main.xml Fri Sep 9 04:18:50 2011
+++ /books/res/layout/ui_main.xml Mon Sep 12 18:58:48 2011
@@ -10,7 +10,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"></ImageView>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
- android:background="@drawable/bgdown">
+ android:background="@drawable/bgdown">
<ImageButton android:background="@null" android:id="@+id/imageButton1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/books_tushu"></ImageButton>
@@ -25,7 +25,9 @@
android:layout_height="wrap_content"
android:id="@+id/imageButton4"></ImageButton>
</LinearLayout>
<ListView android:layout_height="wrap_content"
android:id="@+id/listView1"
- android:layout_width="fill_parent"
android:background="#ffffffff"></ListView>
+ android:layout_width="fill_parent" android:background="@null"
+ android:layout_marginTop="-35dip" android:choiceMode="none"
+ android:cacheColorHint="#00000000"></ListView>
</LinearLayout>
<include layout="@layout/common_ad_bottom" />
</RelativeLayout>
=======================================
--- /books/res/layout/widget_book.xml Thu Sep 8 02:30:34 2011
+++ /books/res/layout/widget_book.xml Mon Sep 12 18:58:48 2011
@@ -1,7 +1,51 @@
<?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">
- <TextView android:text="TextView" android:id="@+id/titleview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:paddingLeft="5dip"
+ android:orientation="horizontal"
+ android:gravity="top|left"
+>
+ <ImageView
+ android:id="@+id/library_tree_item_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="fill_parent"
+ android:adjustViewBounds="false"
+ />
+ <RelativeLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingTop="6dp"
+ >
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:orientation="vertical"
+ >
+ <TextView
+ android:id="@+id/library_tree_item_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:ellipsize="marquee"
+ android:marqueeRepeatLimit="marquee_forever"
+ />
+ <TextView
+ android:id="@+id/library_tree_item_childrenlist"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="5dip"
+ android:layout_below="@id/library_tree_item_name"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:ellipsize="marquee"
+ android:marqueeRepeatLimit="marquee_forever"
+ />
+ </LinearLayout>
+ </RelativeLayout>
</LinearLayout>
=======================================
--- /books/src/com/baoyi/adapter/BooksAdapter.java Thu Sep 8 23:22:59 2011
+++ /books/src/com/baoyi/adapter/BooksAdapter.java Mon Sep 12 18:58:48 2011
@@ -25,6 +25,7 @@
for (FBTree fbTree : datas) {
BookWidget item=new BookWidget(context);
item.setTitle(fbTree.getName());
+ item.setAuthor(fbTree.getSecondString());
widgets.add(item);
}
}
=======================================
--- /books/src/com/baoyi/widget/BookWidget.java Thu Sep 8 01:57:02 2011
+++ /books/src/com/baoyi/widget/BookWidget.java Mon Sep 12 18:58:48 2011
@@ -10,14 +10,18 @@
public class BookWidget extends LinearLayout{

private TextView noveltext;
-
+ private TextView author;
public BookWidget(Context context) {
super(context);
LayoutInflater.from(getContext()).inflate(R.layout.widget_book, this);
- noveltext = (TextView) findViewById(R.id.titleview);
+ noveltext = (TextView) findViewById(R.id.library_tree_item_name);
+ author= (TextView) findViewById(R.id.library_tree_item_childrenlist);
}
public void setTitle(String title){
noveltext.setText(title);
}
+ public void setAuthor(String title){
+ author.setText(title);
+ }

}
=======================================
--- /books/src/com/iym/bookstore/MainUI.java Fri Sep 9 01:21:37 2011
+++ /books/src/com/iym/bookstore/MainUI.java Mon Sep 12 18:58:48 2011
@@ -1,11 +1,14 @@
package com.iym.bookstore;

import org.geometerplus.android.fbreader.BookInfoActivity;
+import org.geometerplus.android.fbreader.SQLiteBooksDatabase;
+import org.geometerplus.android.fbreader.library.InitializationService;
import org.geometerplus.android.fbreader.library.LibraryBaseActivity;
import org.geometerplus.android.fbreader.library.LibraryTopLevelActivity;
import org.geometerplus.android.fbreader.network.NetworkLibraryActivity;
import org.geometerplus.fbreader.library.Book;
import org.geometerplus.fbreader.library.BookTree;
+import org.geometerplus.fbreader.library.BooksDatabase;
import org.geometerplus.fbreader.library.Library;

import android.app.Activity;
@@ -109,7 +112,8 @@
});

init();
- aa();
+ initData();
+ //aa();
}

private ImageButton tushu;
@@ -125,9 +129,16 @@
BooksAdapter adapter;

private void initData() {
+ DatabaseInstance = SQLiteBooksDatabase.Instance();
+ if (DatabaseInstance == null) {
+ DatabaseInstance = new SQLiteBooksDatabase(this, "LIBRARY");
+ }
+
+
adapter = new BooksAdapter(this);
// adapter.set
- LibraryInstance = LibraryBaseActivity.LibraryInstance;
+ LibraryInstance = new Library();
+ LibraryInstance.synchronize();
try {
adapter.setDatas(LibraryInstance.byTitle());
listView.setAdapter(adapter);
@@ -160,7 +171,7 @@
protected static final int BOOK_INFO_REQUEST = 1;

Library LibraryInstance;
-
+ static BooksDatabase DatabaseInstance;
private void aa() {
Intent intent = new Intent(this, LibraryTopLevelActivity.class);
startActivity(intent);
@@ -168,7 +179,7 @@

@Override
protected void onResume() {
- initData();
+ //initData();
super.onResume();
}

Reply all
Reply to author
Forward
0 new messages