From c14223600cc825742ec00264c4a0fc50656a0447 Mon Sep 17 00:00:00 2001 From: Hover Ruan Date: Tue, 19 Feb 2013 18:28:04 +0800 Subject: [PATCH] Add book model --- AndroidManifest.xml | 4 +- pom.xml | 11 ++ res/layout/main.xml | 4 +- res/values/strings.xml | 4 +- .../github/hoverruan/libr/MainActivity.java | 106 ------------------ .../hoverruan/libr/mobile/LibrConstants.java | 8 ++ .../hoverruan/libr/mobile/domain/Book.java | 72 ++++++++++++ .../libr/mobile/domain/BookList.java | 45 ++++++++ .../libr/mobile/domain/BookParser.java | 19 ++++ .../hoverruan/libr/mobile/domain/User.java | 7 ++ .../libr/mobile/ui/MainActivity.java | 61 ++++++++++ .../libr/mobile/util/DownloadTask.java | 86 ++++++++++++++ .../libr/mobile/util/ToastUtils.java | 22 ++++ .../libr/mobile/domain/BookParserTest.java | 74 ++++++++++++ .../hoverruan/libr/mobile/domain/books.json | 92 +++++++++++++++ 15 files changed, 504 insertions(+), 111 deletions(-) delete mode 100644 src/main/java/com/github/hoverruan/libr/MainActivity.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/LibrConstants.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/domain/Book.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/domain/BookList.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/domain/BookParser.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/domain/User.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/ui/MainActivity.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/util/DownloadTask.java create mode 100644 src/main/java/com/github/hoverruan/libr/mobile/util/ToastUtils.java create mode 100644 src/test/java/com/github/hoverruan/libr/mobile/domain/BookParserTest.java create mode 100644 src/test/resources/com/github/hoverruan/libr/mobile/domain/books.json diff --git a/AndroidManifest.xml b/AndroidManifest.xml index f599437..1b0931f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="com.github.hoverruan.libr.mobile" android:versionCode="1" android:versionName="1.0-SNAPSHOT"> @@ -8,7 +8,7 @@ - + diff --git a/pom.xml b/pom.xml index 8ab5fd5..b49a95d 100644 --- a/pom.xml +++ b/pom.xml @@ -19,11 +19,22 @@ ${platform.version} provided + + junit + junit + 4.11 + test + com.google.android support-v4 r7 + + com.google.code.gson + gson + 2.2.2 + diff --git a/res/layout/main.xml b/res/layout/main.xml index 7f7ca8d..cf7a19b 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -7,10 +7,10 @@