liuyuqi-dellpc 4 years ago
commit
3a25d13453
100 changed files with 4767 additions and 0 deletions
  1. 13 0
      .classpath
  2. 3 0
      .gitignore
  3. 33 0
      .project
  4. 101 0
      AndroidManifest.xml
  5. BIN
      libs/android-support-v4.jar
  6. BIN
      libs/commons-codec.jar
  7. BIN
      libs/commons-httpclient-3.1.jar
  8. BIN
      libs/commons-logging-1.1.jar
  9. 40 0
      proguard.cfg
  10. 11 0
      project.properties
  11. BIN
      res/drawable-hdpi/ic_launcher.png
  12. BIN
      res/drawable-ldpi/ic_launcher.png
  13. BIN
      res/drawable-mdpi/avatar.jpg
  14. BIN
      res/drawable-mdpi/bg.9.png
  15. BIN
      res/drawable-mdpi/btn_bg_d.9.png
  16. BIN
      res/drawable-mdpi/btn_bg_n.9.png
  17. BIN
      res/drawable-mdpi/btn_bg_s.9.png
  18. BIN
      res/drawable-mdpi/edit_focused_theme_black.png
  19. BIN
      res/drawable-mdpi/edit_over_theme_black.png
  20. BIN
      res/drawable-mdpi/edit_theme_black.png
  21. BIN
      res/drawable-mdpi/footviewbg.png
  22. BIN
      res/drawable-mdpi/goicon.jpg
  23. BIN
      res/drawable-mdpi/ic_launcher.png
  24. BIN
      res/drawable-mdpi/image.png
  25. BIN
      res/drawable-mdpi/item_bg_triangle.9.png
  26. BIN
      res/drawable-mdpi/loading.png
  27. BIN
      res/drawable-mdpi/mq_widget_bg.9.png
  28. BIN
      res/drawable-mdpi/newblog_pic.png
  29. BIN
      res/drawable-mdpi/newblog_pic_sel.png
  30. BIN
      res/drawable-mdpi/old_ic_launcher.png
  31. BIN
      res/drawable-mdpi/search_bg_backup.png
  32. BIN
      res/drawable-mdpi/title_button_normal.png
  33. BIN
      res/drawable-mdpi/title_button_selected.png
  34. BIN
      res/drawable-mdpi/triangle.png
  35. 5 0
      res/drawable/gray_gradient.xml
  36. 10 0
      res/drawable/imagechoosebutton_bg.xml
  37. 19 0
      res/drawable/progresscolor.xml
  38. 10 0
      res/drawable/titlebutton_bg.xml
  39. 8 0
      res/drawable/widget_arrow_selector.xml
  40. 12 0
      res/drawable/widget_btn.xml
  41. 95 0
      res/layout/.svn/all-wcprops
  42. 538 0
      res/layout/.svn/entries
  43. 5 0
      res/layout/.svn/prop-base/dialog.xml.svn-base
  44. 5 0
      res/layout/.svn/prop-base/layout_a.xml.svn-base
  45. 5 0
      res/layout/.svn/prop-base/layout_b.xml.svn-base
  46. 5 0
      res/layout/.svn/prop-base/main.xml.svn-base
  47. 5 0
      res/layout/.svn/prop-base/myview.xml.svn-base
  48. 5 0
      res/layout/.svn/prop-base/pull_to_refresh_header.xml.svn-base
  49. 5 0
      res/layout/.svn/prop-base/sharefootview.xml.svn-base
  50. 5 0
      res/layout/.svn/prop-base/shareheader.xml.svn-base
  51. 5 0
      res/layout/.svn/prop-base/sharemain.xml.svn-base
  52. 5 0
      res/layout/.svn/prop-base/tabactivity.xml.svn-base
  53. 5 0
      res/layout/.svn/prop-base/timeline.xml.svn-base
  54. 5 0
      res/layout/.svn/prop-base/userinfo.xml.svn-base
  55. 5 0
      res/layout/.svn/prop-base/userlist.xml.svn-base
  56. 5 0
      res/layout/.svn/prop-base/web.xml.svn-base
  57. 5 0
      res/layout/.svn/prop-base/weibo.xml.svn-base
  58. 19 0
      res/layout/.svn/text-base/dialog.xml.svn-base
  59. 37 0
      res/layout/.svn/text-base/layout_a.xml.svn-base
  60. 37 0
      res/layout/.svn/text-base/layout_b.xml.svn-base
  61. 6 0
      res/layout/.svn/text-base/main.xml.svn-base
  62. 69 0
      res/layout/.svn/text-base/myview.xml.svn-base
  63. 54 0
      res/layout/.svn/text-base/pull_to_refresh_header.xml.svn-base
  64. 37 0
      res/layout/.svn/text-base/sharefootview.xml.svn-base
  65. 36 0
      res/layout/.svn/text-base/shareheader.xml.svn-base
  66. 27 0
      res/layout/.svn/text-base/sharemain.xml.svn-base
  67. 24 0
      res/layout/.svn/text-base/tabactivity.xml.svn-base
  68. 44 0
      res/layout/.svn/text-base/timeline.xml.svn-base
  69. 82 0
      res/layout/.svn/text-base/userinfo.xml.svn-base
  70. 34 0
      res/layout/.svn/text-base/userlist.xml.svn-base
  71. 14 0
      res/layout/.svn/text-base/web.xml.svn-base
  72. 89 0
      res/layout/.svn/text-base/weibo.xml.svn-base
  73. 19 0
      res/layout/dialog.xml
  74. 25 0
      res/layout/infortab.xml
  75. 37 0
      res/layout/layout_a.xml
  76. 37 0
      res/layout/layout_b.xml
  77. 6 0
      res/layout/main.xml
  78. 69 0
      res/layout/myview.xml
  79. 54 0
      res/layout/pull_to_refresh_header.xml
  80. 37 0
      res/layout/sharefootview.xml
  81. 36 0
      res/layout/shareheader.xml
  82. 27 0
      res/layout/sharemain.xml
  83. 24 0
      res/layout/tabactivity.xml
  84. 44 0
      res/layout/timeline.xml
  85. 82 0
      res/layout/userinfo.xml
  86. 36 0
      res/layout/userlist.xml
  87. 14 0
      res/layout/web.xml
  88. 141 0
      res/layout/weibo.xml
  89. 8 0
      res/values/attrs.xml
  90. 9 0
      res/values/strings.xml
  91. 14 0
      res/values/styles.xml
  92. 5 0
      res/xml/animation.xml
  93. 84 0
      src/com/ouling/weibo/CommentMentionDialog.java
  94. 361 0
      src/com/ouling/weibo/FriendsOrFollowsList.java
  95. 498 0
      src/com/ouling/weibo/InfoActivity.java
  96. 307 0
      src/com/ouling/weibo/MainActivity.java
  97. 77 0
      src/com/ouling/weibo/OAuth/OAuthConstant.java
  98. 333 0
      src/com/ouling/weibo/OAuth/OAuthUserList.java
  99. 633 0
      src/com/ouling/weibo/ShareActivity.java
  100. 168 0
      src/com/ouling/weibo/UserInfo.java

+ 13 - 0
.classpath

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry kind="lib" path="libs/android-support-v4.jar"/>
+	<classpathentry kind="lib" path="libs/commons-codec.jar"/>
+	<classpathentry kind="lib" path="libs/commons-httpclient-3.1.jar"/>
+	<classpathentry kind="lib" path="libs/commons-logging-1.1.jar"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="gen"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
+	<classpathentry kind="output" path="bin/classes"/>
+</classpath>

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/bin
+/gen
+/.settings

+ 33 - 0
.project

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>oulingWeibo</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.android.ide.eclipse.adt.ApkBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

+ 101 - 0
AndroidManifest.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.ouling.weibo"
+    android:versionCode="1"
+    android:versionName="1.0" >
+
+    <uses-sdk android:minSdkVersion="8" />
+
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
+
+    <application
+        android:configChanges="keyboardHidden|orientation"
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/app_name"
+        android:screenOrientation="portrait" >
+        <activity
+            android:name=".OAuth.OAuthUserList"
+            android:label="@string/app_name"
+            android:launchMode="singleTask"
+            android:screenOrientation="portrait" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+                <data
+                    android:host="UserList"
+                    android:scheme="ouling" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".MainActivity"
+            android:configChanges="keyboardHidden|orientation"
+            android:screenOrientation="portrait" >
+        </activity>
+        <activity
+            android:name=".InfoActivity"
+            android:configChanges="keyboardHidden|orientation"
+            android:screenOrientation="portrait" >
+        </activity>
+        <activity
+            android:name=".ShareActivity"
+            android:configChanges="keyboardHidden|orientation"
+            android:label="@string/app_name"
+            android:launchMode="singleTask"
+            android:screenOrientation="portrait" >
+            <intent-filter>
+                <action android:name="android.intent.action.SEND" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <data android:mimeType="text/plain" />
+                <data android:mimeType="image/*" />
+            </intent-filter>
+        </activity>
+        <activity
+            android:name=".ViewActivity"
+            android:configChanges="keyboard"
+            android:screenOrientation="portrait" >
+        </activity>
+        <activity android:name=".util.MyView" />
+        <activity android:name=".FriendsOrFollowsList" />
+        <activity android:name=".UserWeibo" />
+        <activity android:name=".UserInfo" >
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.BROWSABLE" />
+
+                <data
+                    android:host="sina_profile"
+                    android:scheme="ouling" >
+                </data>
+            </intent-filter>
+        </activity>
+        <activity android:name=".util.WebViewActivity" />
+
+        <!-- 
+        <receiver android:name=".util.WeiboAppWidget" >
+            <intent-filter >
+                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
+            </intent-filter>
+
+            <meta-data
+                android:name="android.appwidget.provider"
+                android:resource="@xml/animation" >
+            </meta-data>
+        </receiver>
 -->
+        
+        
+        <service android:name=".util.AppWidgetAnimationService" />
+    </application>
+
+</manifest>

BIN
libs/android-support-v4.jar


BIN
libs/commons-codec.jar


BIN
libs/commons-httpclient-3.1.jar


BIN
libs/commons-logging-1.1.jar


+ 40 - 0
proguard.cfg

@@ -0,0 +1,40 @@
+-optimizationpasses 5
+-dontusemixedcaseclassnames
+-dontskipnonpubliclibraryclasses
+-dontpreverify
+-verbose
+-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
+
+-keep public class * extends android.app.Activity
+-keep public class * extends android.app.Application
+-keep public class * extends android.app.Service
+-keep public class * extends android.content.BroadcastReceiver
+-keep public class * extends android.content.ContentProvider
+-keep public class * extends android.app.backup.BackupAgentHelper
+-keep public class * extends android.preference.Preference
+-keep public class com.android.vending.licensing.ILicensingService
+
+-keepclasseswithmembernames class * {
+    native <methods>;
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet);
+}
+
+-keepclasseswithmembers class * {
+    public <init>(android.content.Context, android.util.AttributeSet, int);
+}
+
+-keepclassmembers class * extends android.app.Activity {
+   public void *(android.view.View);
+}
+
+-keepclassmembers enum * {
+    public static **[] values();
+    public static ** valueOf(java.lang.String);
+}
+
+-keep class * implements android.os.Parcelable {
+  public static final android.os.Parcelable$Creator *;
+}

+ 11 - 0
project.properties

@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+#
+# This file must be checked in Version Control Systems.
+#
+# To customize properties used by the Ant build system use,
+# "ant.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-21

BIN
res/drawable-hdpi/ic_launcher.png


BIN
res/drawable-ldpi/ic_launcher.png


BIN
res/drawable-mdpi/avatar.jpg


BIN
res/drawable-mdpi/bg.9.png


BIN
res/drawable-mdpi/btn_bg_d.9.png


BIN
res/drawable-mdpi/btn_bg_n.9.png


BIN
res/drawable-mdpi/btn_bg_s.9.png


BIN
res/drawable-mdpi/edit_focused_theme_black.png


BIN
res/drawable-mdpi/edit_over_theme_black.png


BIN
res/drawable-mdpi/edit_theme_black.png


BIN
res/drawable-mdpi/footviewbg.png


BIN
res/drawable-mdpi/goicon.jpg


BIN
res/drawable-mdpi/ic_launcher.png


BIN
res/drawable-mdpi/image.png


BIN
res/drawable-mdpi/item_bg_triangle.9.png


BIN
res/drawable-mdpi/loading.png


BIN
res/drawable-mdpi/mq_widget_bg.9.png


BIN
res/drawable-mdpi/newblog_pic.png


BIN
res/drawable-mdpi/newblog_pic_sel.png


BIN
res/drawable-mdpi/old_ic_launcher.png


BIN
res/drawable-mdpi/search_bg_backup.png


BIN
res/drawable-mdpi/title_button_normal.png


BIN
res/drawable-mdpi/title_button_selected.png


BIN
res/drawable-mdpi/triangle.png


+ 5 - 0
res/drawable/gray_gradient.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<shape android:shape="rectangle"
+  xmlns:android="http://schemas.android.com/apk/res/android">
+    <gradient android:startColor="#ffcfcfcf" android:endColor="#ff7f7f7f" android:angle="270.0" />
+</shape>

+ 10 - 0
res/drawable/imagechoosebutton_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+        <item android:state_focused="true" android:state_pressed="false"
+                android:drawable="@drawable/newblog_pic_sel" />
+        <item android:state_focused="true" android:state_pressed="true"
+                android:drawable="@drawable/newblog_pic_sel" />
+        <item android:state_focused="false" android:state_pressed="true"
+                android:drawable="@drawable/newblog_pic_sel" />
+        <item android:drawable="@drawable/newblog_pic" />
+</selector>

+ 19 - 0
res/drawable/progresscolor.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+	android:pivotX="50%" android:pivotY="50%" android:fromDegrees="0"
+	android:toDegrees="360">
+
+
+	<shape android:shape="ring" android:innerRadiusRatio="3"
+		android:thicknessRatio="8" android:useLevel="false">
+
+
+		<gradient android:type="sweep" android:useLevel="false"
+			android:startColor="#000000" android:centerColor="#FFFFFF"
+			android:centerY="0.50" android:endColor="#FFFF00" />
+
+	</shape>
+
+</rotate>

+ 10 - 0
res/drawable/titlebutton_bg.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+        <item android:state_focused="true" android:state_pressed="false"
+                android:drawable="@drawable/title_button_selected" />
+        <item android:state_focused="true" android:state_pressed="true"
+                android:drawable="@drawable/title_button_selected" />
+        <item android:state_focused="false" android:state_pressed="true"
+                android:drawable="@drawable/title_button_selected" />
+        <item android:drawable="@drawable/title_button_normal" />
+</selector>

+ 8 - 0
res/drawable/widget_arrow_selector.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+	<item android:state_pressed="false" android:drawable="@drawable/edit_theme_black" />
+	<item android:state_pressed="true" android:drawable="@drawable/edit_over_theme_black" />
+	<item android:state_focused="true" android:drawable="@drawable/edit_focused_theme_black" />
+	<item android:state_window_focused="false"
+		android:drawable="@drawable/edit_focused_theme_black" />
+</selector>

+ 12 - 0
res/drawable/widget_btn.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+	<item android:state_focused="false" android:state_selected="false"
+		android:state_pressed="false" android:drawable="@drawable/btn_bg_n" />
+	<item android:state_focused="false" android:state_selected="true"
+		android:state_pressed="false" android:drawable="@drawable/btn_bg_d" />
+	<item android:state_focused="true" android:state_selected="false"
+		android:state_pressed="false" android:drawable="@drawable/btn_bg_s" />
+	<item android:state_focused="true" android:drawable="@drawable/btn_bg_s" />
+
+</selector>

+ 95 - 0
res/layout/.svn/all-wcprops

@@ -0,0 +1,95 @@
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/svn/!svn/ver/4/trunk/WEIBO_SYSU_G17/res/layout
+END
+myview.xml
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/myview.xml
+END
+tabactivity.xml
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/tabactivity.xml
+END
+main.xml
+K 25
+svn:wc:ra_dav:version-url
+V 56
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/main.xml
+END
+sharefootview.xml
+K 25
+svn:wc:ra_dav:version-url
+V 65
+/svn/!svn/ver/4/trunk/WEIBO_SYSU_G17/res/layout/sharefootview.xml
+END
+userinfo.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/!svn/ver/7/trunk/WEIBO_SYSU_G17/res/layout/userinfo.xml
+END
+dialog.xml
+K 25
+svn:wc:ra_dav:version-url
+V 58
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/dialog.xml
+END
+pull_to_refresh_header.xml
+K 25
+svn:wc:ra_dav:version-url
+V 74
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/pull_to_refresh_header.xml
+END
+weibo.xml
+K 25
+svn:wc:ra_dav:version-url
+V 57
+/svn/!svn/ver/7/trunk/WEIBO_SYSU_G17/res/layout/weibo.xml
+END
+timeline.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/!svn/ver/7/trunk/WEIBO_SYSU_G17/res/layout/timeline.xml
+END
+sharemain.xml
+K 25
+svn:wc:ra_dav:version-url
+V 61
+/svn/!svn/ver/4/trunk/WEIBO_SYSU_G17/res/layout/sharemain.xml
+END
+userlist.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/userlist.xml
+END
+shareheader.xml
+K 25
+svn:wc:ra_dav:version-url
+V 63
+/svn/!svn/ver/4/trunk/WEIBO_SYSU_G17/res/layout/shareheader.xml
+END
+web.xml
+K 25
+svn:wc:ra_dav:version-url
+V 55
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/web.xml
+END
+layout_a.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/layout_a.xml
+END
+layout_b.xml
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/svn/!svn/ver/3/trunk/WEIBO_SYSU_G17/res/layout/layout_b.xml
+END

+ 538 - 0
res/layout/.svn/entries

@@ -0,0 +1,538 @@
+10
+
+dir
+5
+https://tofu-sina-weibo.googlecode.com/svn/trunk/WEIBO_SYSU_G17/res/layout
+https://tofu-sina-weibo.googlecode.com/svn
+
+
+
+2011-12-31T17:20:52.537539Z
+4
+alfredtofu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+c031328e-3932-9a2f-6bc5-4f902c1a51d3
+
+myview.xml
+file
+
+
+
+
+2011-12-28T17:38:50.000000Z
+abe49a89e6c419c95266e1dd941db596
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2400
+
+tabactivity.xml
+file
+
+
+
+
+2011-12-29T16:38:08.000000Z
+66c5399618d33c5f8e223cbc185e4d0b
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+833
+
+main.xml
+file
+
+
+
+
+2011-12-26T12:36:44.000000Z
+c0343fc66c7ee0262d36f6b398937b41
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+199
+
+sharefootview.xml
+file
+
+
+
+
+2011-12-31T15:35:14.344148Z
+7a5e4dac909f9216874678b760baa578
+2011-12-31T17:20:52.537539Z
+4
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1580
+
+userinfo.xml
+file
+7
+
+
+
+2012-01-01T04:01:51.851508Z
+83fad9361253134b864ab6b59b687eeb
+2012-01-01T06:42:07.260036Z
+7
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3657
+
+dialog.xml
+file
+
+
+
+
+2011-12-27T09:12:24.000000Z
+f4b0634617fd3919cdee4e4c20f87442
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+607
+
+pull_to_refresh_header.xml
+file
+
+
+
+
+2011-12-26T10:20:38.000000Z
+221aee14b9c8c5b9eeeac4ea750caa89
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2044
+
+weibo.xml
+file
+7
+
+
+
+2012-01-01T06:28:30.659557Z
+5210dd94a772c423c7f07e0a9d52247b
+2012-01-01T06:42:07.260036Z
+7
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3960
+
+timeline.xml
+file
+7
+
+
+
+2012-01-01T04:50:59.646675Z
+0402581ffdb8ac76a490d9d56bd982ea
+2012-01-01T06:42:07.260036Z
+7
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1948
+
+sharemain.xml
+file
+
+
+
+
+2011-12-31T16:05:04.665400Z
+29647f568bd8debee6b50346381baf38
+2011-12-31T17:20:52.537539Z
+4
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1333
+
+userlist.xml
+file
+
+
+
+
+2011-12-29T11:06:52.000000Z
+988a21b42557942220267aa59608e202
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1083
+
+shareheader.xml
+file
+
+
+
+
+2011-12-31T14:47:09.412063Z
+00cea7a7a6d3e7e1ac1bd899c9c20397
+2011-12-31T17:20:52.537539Z
+4
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1265
+
+layout_a.xml
+file
+
+
+
+
+2011-11-30T03:08:38.000000Z
+5c8c311dbc76eda1568722264e7e4984
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1947
+
+web.xml
+file
+
+
+
+
+2011-12-28T05:03:22.000000Z
+51d1e168b3e8471ca963cccd30f8b354
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+428
+
+layout_b.xml
+file
+
+
+
+
+2011-11-30T03:08:40.000000Z
+5c8c311dbc76eda1568722264e7e4984
+2011-12-31T12:01:51.995301Z
+3
+alfredtofu
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1947
+

+ 5 - 0
res/layout/.svn/prop-base/dialog.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/layout_a.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/layout_b.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/main.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/myview.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/pull_to_refresh_header.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/sharefootview.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/shareheader.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/sharemain.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/tabactivity.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/timeline.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/userinfo.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/userlist.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/web.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 5 - 0
res/layout/.svn/prop-base/weibo.xml.svn-base

@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END

+ 19 - 0
res/layout/.svn/text-base/dialog.xml.svn-base

@@ -0,0 +1,19 @@
+<?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" >
+
+    <EditText
+        android:id="@+id/dialog_et"
+        android:layout_width="250dip"
+        android:layout_height="100dip" 
+        android:layout_gravity="center_horizontal"/>
+
+    <CheckBox
+        android:id="@+id/dialog_cb"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="评论并转发" />
+
+</LinearLayout>

+ 37 - 0
res/layout/.svn/text-base/layout_a.xml.svn-base

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="horizontal" android:background="@drawable/mq_widget_bg"
+	android:layout_width="310dip" android:layout_height="76dip">
+	<FrameLayout android:id="@+id/FrameLayout"
+		android:layout_height="fill_parent" android:layout_width="fill_parent"
+		android:layout_weight="1">
+		<LinearLayout android:id="@+id/MoveIn"
+			android:layout_height="fill_parent" android:layout_width="fill_parent"
+			android:layoutAnimation="@anim/in_move">
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_InImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+		<LinearLayout android:layout_height="fill_parent"
+			android:layout_width="fill_parent" android:id="@+id/MoveOut"
+			android:layoutAnimation="@anim/out_move">
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_OutImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+	</FrameLayout>
+<!-- 	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector_up"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black_up"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_up"></ImageButton> 
+		-->
+	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_down"></ImageButton>
+
+</LinearLayout>

+ 37 - 0
res/layout/.svn/text-base/layout_b.xml.svn-base

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="horizontal" android:background="@drawable/mq_widget_bg"
+	android:layout_width="310dip" android:layout_height="76dip">
+	<FrameLayout android:id="@+id/FrameLayout"
+		android:layout_height="fill_parent" android:layout_width="fill_parent"
+		android:layout_weight="1">
+		<LinearLayout android:id="@+id/MoveIn"
+			android:layout_height="fill_parent" android:layout_width="fill_parent"
+			android:layoutAnimation="@anim/in_move">
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_InImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+		<LinearLayout android:layout_height="fill_parent"
+			android:layout_width="fill_parent" android:id="@+id/MoveOut"
+			android:layoutAnimation="@anim/out_move">
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_OutImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+	</FrameLayout>
+<!-- 	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector_up"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black_up"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_up"></ImageButton> 
+		-->
+	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_down"></ImageButton>
+
+</LinearLayout>

+ 6 - 0
res/layout/.svn/text-base/main.xml.svn-base

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent" >
+
+</TabHost>

+ 69 - 0
res/layout/.svn/text-base/myview.xml.svn-base

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tofuxmlns="http://schemas.android.com/apk/res/cn.com.alfred.weibo"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent" >
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:orientation="vertical" >
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" >
+
+            <Button
+                android:id="@+id/btn_return"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="cancel" />
+
+            <Button
+                android:id="@+id/btn_save"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="save" />
+        </LinearLayout>
+
+        <FrameLayout
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent" >
+
+            <cn.com.alfred.weibo.util.MyImageView
+                android:id="@+id/imageView"
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
+                tofuxmlns:gif="true" />
+
+            <ZoomControls
+                android:id="@+id/zoomControls"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal|bottom" />
+        </FrameLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/myview_waitingView"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:gravity="center"
+        android:orientation="horizontal" >
+
+        <ProgressBar
+            style="?android:attr/progressBarStyleSmallTitle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingLeft="10dip"
+            android:text="加载中..." />
+    </LinearLayout>
+
+</FrameLayout>

+ 54 - 0
res/layout/.svn/text-base/pull_to_refresh_header.xml.svn-base

@@ -0,0 +1,54 @@
+<?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:paddingTop="10dip"
+    android:paddingBottom="15dip"
+    android:gravity="center"
+        android:id="@+id/pull_to_refresh_header"
+    >
+    <ProgressBar 
+        android:id="@+id/pull_to_refresh_progress"
+        android:indeterminate="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="30dip"
+        android:layout_marginRight="20dip"
+        android:layout_marginTop="10dip"
+        android:visibility="gone"
+        android:layout_centerVertical="true"
+        style="?android:attr/progressBarStyleSmallTitle"
+        />
+    <ImageView
+        android:id="@+id/pull_to_refresh_image"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="30dip"
+        android:layout_marginRight="20dip"
+        android:visibility="gone"
+        android:layout_gravity="center"
+        android:gravity="center"
+        android:src="@drawable/goicon"
+        />
+    <TextView
+        android:id="@+id/pull_to_refresh_text"
+        android:text="@string/pull_to_refresh_tap_label"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textStyle="bold"
+        android:paddingTop="5dip"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center"
+        />
+    <TextView
+        android:id="@+id/pull_to_refresh_updated_at"
+        android:layout_below="@+id/pull_to_refresh_text"
+        android:visibility="gone"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center"
+        />
+</RelativeLayout>

+ 37 - 0
res/layout/.svn/text-base/sharefootview.xml.svn-base

@@ -0,0 +1,37 @@
+<?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="wrap_content"
+	android:background="@drawable/footviewbg" android:orientation="horizontal">
+
+	<LinearLayout android:layout_width="fill_parent"
+		android:layout_height="55dip" android:orientation="horizontal">
+
+		<ImageButton android:id="@+id/share_imagechoose"
+			android:layout_width="55dip" android:layout_height="40dip"
+			android:background="@drawable/imagechoosebutton_bg" android:gravity="center_vertical"
+			android:layout_gravity="center_vertical">
+		</ImageButton>
+
+		<ImageView android:id="@+id/share_image"
+			android:layout_width="55dip" android:layout_height="55dip"
+			android:layout_gravity="center" android:padding="20dip"
+			android:gravity="center">
+		</ImageView>
+	</LinearLayout>
+
+	<LinearLayout android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:layout_alignParentRight="true"
+		android:layout_centerVertical="true" android:gravity="center_vertical"
+		android:orientation="horizontal">
+
+		<Button android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:id="@+id/btn_add_emotion"
+			android:text="输入文字" />
+		<TextView android:id="@+id/share_word_counter"
+			android:layout_width="35dip" android:layout_height="fill_parent"
+			android:gravity="center_vertical|right" android:paddingRight="5dip"
+			android:text="140" android:textColor="#000000" android:textSize="14.0sp">
+		</TextView>
+	</LinearLayout>
+
+</RelativeLayout>

+ 36 - 0
res/layout/.svn/text-base/shareheader.xml.svn-base

@@ -0,0 +1,36 @@
+<?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="55dip"
+    android:gravity="center_vertical"
+    android:orientation="vertical" 
+    android:paddingBottom="12dip">
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dip"
+        android:background="#ff666666" />
+    <RelativeLayout
+        android:id="@+id/AppAwareHeader"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/gray_gradient"
+        android:gravity="center_vertical"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/btn_share"
+            android:layout_width="55dip"
+            android:layout_height="40dip"
+            android:layout_alignParentRight="true"
+            android:background="@drawable/titlebutton_bg"
+            android:text="分享" >
+        </Button>
+    </RelativeLayout>
+    <View
+        android:id="@+id/ViewBorderMain"
+        android:layout_width="fill_parent"
+        android:layout_height="1.0dip"
+        android:layout_weight="0.0"
+        android:background="#ff456028" />
+</LinearLayout>

+ 27 - 0
res/layout/.svn/text-base/sharemain.xml.svn-base

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="vertical" android:layout_width="fill_parent"
+	android:layout_height="fill_parent">
+	<RelativeLayout android:layout_width="fill_parent"
+		android:layout_height="wrap_content" android:background="#FFFFFF"
+		android:gravity="top" android:layout_weight="1">
+
+		<LinearLayout android:id="@+id/share_image_view"
+			android:orientation="vertical" android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:gravity="left"
+			android:layout_alignParentBottom="true">
+			<include layout="@layout/sharefootview" />
+		</LinearLayout>
+		<EditText android:id="@+id/share_content"
+			android:layout_width="fill_parent" android:layout_height="fill_parent"
+			android:hint="说点什么吧..." android:scrollbars="vertical"
+			android:gravity="top" android:layout_above="@id/share_image_view" />
+	</RelativeLayout>
+	<GridView android:id="@+id/gridView" android:layout_width="fill_parent"
+		android:layout_height="fill_parent" android:layout_weight="1"
+		android:padding="10dp" android:verticalSpacing="10dp"
+		android:horizontalSpacing="10dp" android:numColumns="auto_fit"
+		android:columnWidth="60dp" android:stretchMode="columnWidth"
+		android:gravity="center">
+	</GridView>
+</LinearLayout>

+ 24 - 0
res/layout/.svn/text-base/tabactivity.xml.svn-base

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+	android:id="@android:id/tabhost"
+	android:layout_width="fill_parent"
+	android:layout_height="fill_parent"
+	android:orientation="vertical" >
+
+	<RelativeLayout android:id="@+id/contentLayout"
+	    android:layout_width="fill_parent"
+	    android:layout_height="fill_parent">
+	    <FrameLayout android:id="@android:id/tabcontent"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_above="@android:id/tabs"
+            />
+	    <TabWidget 
+			android:id="@android:id/tabs" 
+			android:layout_width="fill_parent"
+			android:layout_height="wrap_content" 
+        	android:layout_alignParentBottom="true"
+			/>
+	</RelativeLayout>
+
+</TabHost>

+ 44 - 0
res/layout/.svn/text-base/timeline.xml.svn-base

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="wrap_content" android:layout_height="wrap_content"
+	android:textColor="#ddeeeeee" android:orientation="horizontal">
+
+	<cn.com.alfred.weibo.widget.AsyncImageView
+		android:id="@+id/wbicon" android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:layout_margin="8px">
+	</cn.com.alfred.weibo.widget.AsyncImageView>
+
+	<LinearLayout android:layout_width="fill_parent"
+		android:layout_height="wrap_content" android:layout_marginBottom="5px"
+		android:layout_marginTop="5px" android:orientation="vertical"
+		android:paddingLeft="0px" android:paddingRight="5px">
+
+		<RelativeLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content">
+
+			<TextView android:id="@+id/wbuser" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" android:layout_alignParentLeft="true"
+				android:textColor="#424952" android:textSize="17sp">
+			</TextView>
+
+			<ImageView android:id="@+id/wbimage" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" android:layout_marginRight="5px"
+				android:layout_marginTop="3px" android:layout_toLeftOf="@+id/wbtime"
+				android:visibility="gone" android:src="@drawable/image">
+			</ImageView>
+
+			<TextView android:id="@+id/wbtime" android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+				android:layout_alignParentRight="true" android:textColor="#f7a200"
+				android:textSize="14sp">
+			</TextView>
+		</RelativeLayout>
+
+		<cn.com.alfred.weibo.widget.HighLightTextView
+			android:id="@+id/wbtext" android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:layout_marginTop="4px"
+			android:textColor="#424952" android:textSize="14sp" android:autoLink="web|phone|email">
+		</cn.com.alfred.weibo.widget.HighLightTextView>
+	</LinearLayout>
+
+</LinearLayout>

+ 82 - 0
res/layout/.svn/text-base/userinfo.xml.svn-base

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent" android:layout_height="fill_parent"
+	android:orientation="vertical"  android:background="@drawable/bg">
+
+	<TextView android:id="@+id/userinfo_failed"
+		android:layout_width="fill_parent" android:layout_height="wrap_content"
+		android:visibility="gone" android:textColor="#424952" />
+
+	<LinearLayout android:id="@+id/userinfo_ll"
+		android:layout_width="fill_parent" android:layout_height="wrap_content"
+		android:orientation="vertical" android:visibility="gone">
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<cn.com.alfred.weibo.widget.AsyncImageView
+				android:id="@+id/userinfo_pic" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" />
+
+			<TextView android:id="@+id/userinfo_tv_name"
+				android:layout_width="wrap_content" android:layout_height="wrap_content"
+				android:paddingLeft="10dip" android:text="昵称" android:textColor="#424952"/>
+		</LinearLayout>
+
+		<TextView android:id="@+id/userinfo_tv_location"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="地址"
+			android:textColor="#424952" />
+
+		<TextView android:id="@+id/userinfo_tv_url"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="博客"
+			android:textColor="#424952" />
+
+		<TextView android:id="@+id/userinfo_tv_description"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="介绍"
+			android:textColor="#424952" />
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<Button android:id="@+id/userinfo_btn_friends"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="关注" />
+
+			<Button android:id="@+id/userinfo_btn_weibo"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="微博" />
+		</LinearLayout>
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<Button android:id="@+id/userinfo_btn_follows"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="粉丝" />
+
+			<Button android:id="@+id/userinfo_btn_refresh"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="刷新" />
+		</LinearLayout>
+	</LinearLayout>
+
+	<LinearLayout android:id="@+id/userinfo_waitingView"
+		android:layout_width="fill_parent" android:layout_height="fill_parent"
+		android:orientation="horizontal" android:gravity="center">
+
+		<ProgressBar style="?android:attr/progressBarStyleSmallTitle"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:indeterminateDrawable="@drawable/progresscolor" />
+
+		<TextView android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:paddingLeft="10dip"
+			android:text="加载中..." android:textColor="#000000"/>
+	</LinearLayout>
+
+</FrameLayout>

+ 34 - 0
res/layout/.svn/text-base/userlist.xml.svn-base

@@ -0,0 +1,34 @@
+<?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:background="@drawable/bg"
+    android:orientation="vertical" >
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/btn_addUser"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="添加用户" />
+
+        <Button
+            android:id="@+id/btn_deleteUser"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:text="删除用户" />
+    </LinearLayout>
+
+    <ListView
+        android:id="@+id/user_list"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" >
+    </ListView>
+
+</LinearLayout>

+ 14 - 0
res/layout/.svn/text-base/web.xml.svn-base

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView 
+	xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical"
+    android:background="#FFFFFF"
+    >
+	  <WebView
+	   	android:layout_height="wrap_content"
+	    android:layout_width="wrap_content"
+	    android:id="@+id/web">
+	  </WebView>
+</ScrollView>

+ 89 - 0
res/layout/.svn/text-base/weibo.xml.svn-base

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent" android:layout_height="fill_parent"
+	android:background="#F0FFFF" android:orientation="vertical">
+	<FrameLayout android:layout_width="fill_parent"
+		android:layout_height="fill_parent" android:background="#F0FFFF"
+		android:orientation="vertical" android:id="@+id/weibo_ff"
+		android:visibility="gone">
+		<ScrollView android:layout_width="fill_parent"
+			android:layout_height="fill_parent">
+
+			<LinearLayout android:layout_width="fill_parent"
+				android:layout_height="fill_parent" android:orientation="vertical">
+
+				<LinearLayout android:layout_width="fill_parent"
+					android:layout_height="wrap_content" android:padding="10dip">
+
+					<cn.com.alfred.weibo.widget.AsyncImageView
+						android:id="@+id/weibo_avatar" android:layout_width="wrap_content"
+						android:layout_height="wrap_content" />
+
+					<TextView android:id="@+id/weibo_screenName"
+						android:layout_width="wrap_content" android:layout_height="wrap_content"
+						android:layout_gravity="center_vertical" android:paddingLeft="10dip"
+						android:textColor="#000000" />
+				</LinearLayout>
+
+				<cn.com.alfred.weibo.widget.HighLightTextView
+					android:id="@+id/weibo_text" android:layout_width="fill_parent"
+					android:layout_height="wrap_content" android:padding="10dip"
+					android:textColor="#000000" android:autoLink="web|phone|email"/>
+
+				<cn.com.alfred.weibo.widget.AsyncImageView
+					android:id="@+id/weibo_pic" android:layout_width="wrap_content"
+					android:layout_height="wrap_content" android:layout_gravity="center_horizontal"
+					android:paddingBottom="20dip" android:paddingTop="10dip"
+					android:visibility="gone" />
+
+				<LinearLayout android:layout_width="fill_parent"
+					android:layout_height="wrap_content" android:orientation="horizontal">
+
+					<Button android:id="@+id/weibo_btn_retweet"
+						android:layout_width="fill_parent" android:layout_height="fill_parent"
+						android:layout_weight="1" android:text="转发" />
+
+					<Button android:id="@+id/weibo_btn_comment"
+						android:layout_width="fill_parent" android:layout_height="fill_parent"
+						android:layout_weight="1" android:text="评论" />
+				</LinearLayout>
+			</LinearLayout>
+		</ScrollView>
+
+		<SlidingDrawer android:id="@+id/slidingdrawer"
+			android:layout_width="fill_parent" android:layout_height="fill_parent"
+			android:content="@+id/slide_content" android:handle="@+id/slide_handle">
+
+			<ImageButton android:id="@id/slide_handle"
+				android:layout_width="50dip" android:layout_height="44dip"
+				android:src="@drawable/goicon" />
+
+			<LinearLayout android:id="@id/slide_content"
+				android:layout_width="fill_parent" android:layout_height="fill_parent"
+				android:background="#ffffff" android:orientation="vertical">
+				<TextView android:id="@+id/weibo_no_comment"
+					android:layout_width="fill_parent" android:layout_height="wrap_content"
+					android:textColor="#000000" android:orientation="vertical"
+					android:padding="10dip" android:text="暂无评论" android:layout_weight="1" />
+				<ListView android:id="@+id/slide_listView"
+					android:layout_width="fill_parent" android:layout_height="fill_parent"
+					android:layout_weight="1">
+				</ListView>
+			</LinearLayout>
+		</SlidingDrawer>
+	</FrameLayout>
+
+	<LinearLayout android:id="@+id/weibo_waitingView"
+		android:layout_width="fill_parent" android:layout_height="fill_parent"
+		android:orientation="horizontal" android:gravity="center">
+
+		<ProgressBar style="?android:attr/progressBarStyleSmallTitle"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:indeterminateDrawable="@drawable/progresscolor" />
+
+		<TextView android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:paddingLeft="10dip"
+			android:text="加载中..." android:textColor="#000000" />
+	</LinearLayout>
+
+</FrameLayout>

+ 19 - 0
res/layout/dialog.xml

@@ -0,0 +1,19 @@
+<?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" >
+
+    <EditText
+        android:id="@+id/dialog_et"
+        android:layout_width="250dip"
+        android:layout_height="100dip" 
+        android:layout_gravity="center_horizontal"/>
+
+    <CheckBox
+        android:id="@+id/dialog_cb"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="评论并转发" />
+
+</LinearLayout>

+ 25 - 0
res/layout/infortab.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@android:id/tabhost"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical" >
+
+    <RelativeLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent" >
+
+        <TabWidget
+            android:id="@android:id/tabs"
+            android:layout_alignParentTop="true"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content" />
+
+        <FrameLayout
+            android:id="@android:id/tabcontent"
+            android:layout_below="@android:id/tabs"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent" />
+    </RelativeLayout>
+
+</TabHost>

+ 37 - 0
res/layout/layout_a.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="horizontal" android:background="@drawable/mq_widget_bg"
+	android:layout_width="310dip" android:layout_height="76dip">
+	<FrameLayout android:id="@+id/FrameLayout"
+		android:layout_height="fill_parent" android:layout_width="fill_parent"
+		android:layout_weight="1">
+		<LinearLayout android:id="@+id/MoveIn"
+			android:layout_height="fill_parent" android:layout_width="fill_parent"
+			>
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_InImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+		<LinearLayout android:layout_height="fill_parent"
+			android:layout_width="fill_parent" android:id="@+id/MoveOut"
+			>
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_OutImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+	</FrameLayout>
+<!-- 	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector_up"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black_up"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_up"></ImageButton> 
+		-->
+	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_down"></ImageButton>
+
+</LinearLayout>

+ 37 - 0
res/layout/layout_b.xml

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="horizontal" android:background="@drawable/mq_widget_bg"
+	android:layout_width="310dip" android:layout_height="76dip">
+	<FrameLayout android:id="@+id/FrameLayout"
+		android:layout_height="fill_parent" android:layout_width="fill_parent"
+		android:layout_weight="1">
+		<LinearLayout android:id="@+id/MoveIn"
+			android:layout_height="fill_parent" android:layout_width="fill_parent"
+			>
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_InImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+		<LinearLayout android:layout_height="fill_parent"
+			android:layout_width="fill_parent" android:id="@+id/MoveOut"
+			>
+			<ImageView android:layout_height="fill_parent"
+				android:layout_width="fill_parent" android:id="@+id/Move_OutImage"
+				android:scaleType="fitXY" android:adjustViewBounds="true"></ImageView>
+		</LinearLayout>
+	</FrameLayout>
+<!-- 	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector_up"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black_up"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_up"></ImageButton> 
+		-->
+	<ImageButton android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:src="@drawable/widget_arrow_selector"
+		android:clickable="true" android:focusable="true"
+		android:background="@drawable/edit_theme_black"
+		android:focusableInTouchMode="true" android:adjustViewBounds="true"
+		android:scaleType="fitXY" android:id="@+id/btn_down"></ImageButton>
+
+</LinearLayout>

+ 6 - 0
res/layout/main.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent" >
+
+</TabHost>

+ 69 - 0
res/layout/myview.xml

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:oulingxmlns="http://schemas.android.com/apk/res/com.ouling.weibo"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent" >
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:orientation="vertical" >
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal" >
+
+            <Button
+                android:id="@+id/btn_return"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="cancel" />
+
+            <Button
+                android:id="@+id/btn_save"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_weight="1"
+                android:text="save" />
+        </LinearLayout>
+
+        <FrameLayout
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent" >
+
+            <com.ouling.weibo.util.MyImageView
+                android:id="@+id/imageView"
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent"
+                oulingxmlns:gif="true" />
+
+            <ZoomControls
+                android:id="@+id/zoomControls"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal|bottom" />
+        </FrameLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/myview_waitingView"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:gravity="center"
+        android:orientation="horizontal" >
+
+        <ProgressBar
+            style="?android:attr/progressBarStyleSmallTitle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingLeft="10dip"
+            android:text="加载中..." />
+    </LinearLayout>
+
+</FrameLayout>

+ 54 - 0
res/layout/pull_to_refresh_header.xml

@@ -0,0 +1,54 @@
+<?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:paddingTop="10dip"
+    android:paddingBottom="15dip"
+    android:gravity="center"
+        android:id="@+id/pull_to_refresh_header"
+    >
+    <ProgressBar 
+        android:id="@+id/pull_to_refresh_progress"
+        android:indeterminate="true"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="30dip"
+        android:layout_marginRight="20dip"
+        android:layout_marginTop="10dip"
+        android:visibility="gone"
+        android:layout_centerVertical="true"
+        style="?android:attr/progressBarStyleSmallTitle"
+        />
+    <ImageView
+        android:id="@+id/pull_to_refresh_image"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="30dip"
+        android:layout_marginRight="20dip"
+        android:visibility="gone"
+        android:layout_gravity="center"
+        android:gravity="center"
+        android:src="@drawable/goicon"
+        />
+    <TextView
+        android:id="@+id/pull_to_refresh_text"
+        android:text="@string/pull_to_refresh_tap_label"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:textStyle="bold"
+        android:paddingTop="5dip"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center"
+        />
+    <TextView
+        android:id="@+id/pull_to_refresh_updated_at"
+        android:layout_below="@+id/pull_to_refresh_text"
+        android:visibility="gone"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:gravity="center"
+        />
+</RelativeLayout>

+ 37 - 0
res/layout/sharefootview.xml

@@ -0,0 +1,37 @@
+<?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="wrap_content"
+	android:background="@drawable/footviewbg" android:orientation="horizontal">
+
+	<LinearLayout android:layout_width="fill_parent"
+		android:layout_height="55dip" android:orientation="horizontal">
+
+		<ImageButton android:id="@+id/share_imagechoose"
+			android:layout_width="55dip" android:layout_height="40dip"
+			android:background="@drawable/imagechoosebutton_bg" android:gravity="center_vertical"
+			android:layout_gravity="center_vertical">
+		</ImageButton>
+
+		<ImageView android:id="@+id/share_image"
+			android:layout_width="55dip" android:layout_height="55dip"
+			android:layout_gravity="center" android:padding="20dip"
+			android:gravity="center">
+		</ImageView>
+	</LinearLayout>
+
+	<LinearLayout android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:layout_alignParentRight="true"
+		android:layout_centerVertical="true" android:gravity="center_vertical"
+		android:orientation="horizontal">
+
+		<Button android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:id="@+id/btn_add_emotion"
+			android:text="输入文字" />
+		<TextView android:id="@+id/share_word_counter"
+			android:layout_width="35dip" android:layout_height="fill_parent"
+			android:gravity="center_vertical|right" android:paddingRight="5dip"
+			android:text="140" android:textColor="#000000" android:textSize="14.0sp">
+		</TextView>
+	</LinearLayout>
+
+</RelativeLayout>

+ 36 - 0
res/layout/shareheader.xml

@@ -0,0 +1,36 @@
+<?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="55dip"
+    android:gravity="center_vertical"
+    android:orientation="vertical" 
+    android:paddingBottom="12dip">
+
+    <View
+        android:layout_width="fill_parent"
+        android:layout_height="1dip"
+        android:background="#ff666666" />
+    <RelativeLayout
+        android:id="@+id/AppAwareHeader"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/gray_gradient"
+        android:gravity="center_vertical"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/btn_share"
+            android:layout_width="55dip"
+            android:layout_height="40dip"
+            android:layout_alignParentRight="true"
+            android:background="@drawable/titlebutton_bg"
+            android:text="分享" >
+        </Button>
+    </RelativeLayout>
+    <View
+        android:id="@+id/ViewBorderMain"
+        android:layout_width="fill_parent"
+        android:layout_height="1.0dip"
+        android:layout_weight="0.0"
+        android:background="#ff456028" />
+</LinearLayout>

+ 27 - 0
res/layout/sharemain.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:orientation="vertical" android:layout_width="fill_parent"
+	android:layout_height="fill_parent">
+	<RelativeLayout android:layout_width="fill_parent"
+		android:layout_height="wrap_content" android:background="#FFFFFF"
+		android:gravity="top" android:layout_weight="1">
+
+		<LinearLayout android:id="@+id/share_image_view"
+			android:orientation="vertical" android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:gravity="left"
+			android:layout_alignParentBottom="true">
+			<include layout="@layout/sharefootview" />
+		</LinearLayout>
+		<EditText android:id="@+id/share_content"
+			android:layout_width="fill_parent" android:layout_height="fill_parent"
+			android:hint="说点什么吧..." android:scrollbars="vertical"
+			android:gravity="top" android:layout_above="@id/share_image_view" />
+	</RelativeLayout>
+	<GridView android:id="@+id/gridView" android:layout_width="fill_parent"
+		android:layout_height="fill_parent" android:layout_weight="1"
+		android:padding="10dp" android:verticalSpacing="10dp"
+		android:horizontalSpacing="10dp" android:numColumns="auto_fit"
+		android:columnWidth="60dp" android:stretchMode="columnWidth"
+		android:gravity="center">
+	</GridView>
+</LinearLayout>

+ 24 - 0
res/layout/tabactivity.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
+	android:id="@android:id/tabhost"
+	android:layout_width="fill_parent"
+	android:layout_height="fill_parent"
+	android:orientation="vertical" >
+
+	<RelativeLayout 
+	    android:layout_width="fill_parent"
+	    android:layout_height="fill_parent">
+	    <FrameLayout android:id="@android:id/tabcontent"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_above="@android:id/tabs"
+            />
+	    <TabWidget 
+			android:id="@android:id/tabs" 
+			android:layout_width="fill_parent"
+			android:layout_height="wrap_content" 
+        	android:layout_alignParentBottom="true"
+			/>
+	</RelativeLayout>
+
+</TabHost>

+ 44 - 0
res/layout/timeline.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="wrap_content" android:layout_height="wrap_content"
+	android:textColor="#ddeeeeee" android:orientation="horizontal">
+
+	<com.ouling.weibo.util.AsyncImageView
+		android:id="@+id/wbicon" android:layout_width="wrap_content"
+		android:layout_height="wrap_content" android:layout_margin="8px">
+	</com.ouling.weibo.util.AsyncImageView>
+
+	<LinearLayout android:layout_width="fill_parent"
+		android:layout_height="wrap_content" android:layout_marginBottom="5px"
+		android:layout_marginTop="5px" android:orientation="vertical"
+		android:paddingLeft="0px" android:paddingRight="5px">
+
+		<RelativeLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content">
+
+			<TextView android:id="@+id/wbuser" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" android:layout_alignParentLeft="true"
+				android:textColor="#424952" android:textSize="17sp">
+			</TextView>
+
+			<ImageView android:id="@+id/wbimage" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" android:layout_marginRight="5px"
+				android:layout_marginTop="3px" android:layout_toLeftOf="@+id/wbtime"
+				android:visibility="gone" android:src="@drawable/image">
+			</ImageView>
+
+			<TextView android:id="@+id/wbtime" android:layout_width="wrap_content"
+				android:layout_height="wrap_content"
+				android:layout_alignParentRight="true" android:textColor="#f7a200"
+				android:textSize="14sp">
+			</TextView>
+		</RelativeLayout>
+
+		<com.ouling.weibo.util.HighLightTextView
+			android:id="@+id/wbtext" android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:layout_marginTop="4px"
+			android:textColor="#424952" android:textSize="14sp" android:autoLink="web|phone|email">
+		</com.ouling.weibo.util.HighLightTextView>
+	</LinearLayout>
+
+</LinearLayout>

+ 82 - 0
res/layout/userinfo.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="fill_parent" android:layout_height="fill_parent"
+	android:orientation="vertical"  android:background="@drawable/bg">
+
+	<TextView android:id="@+id/userinfo_failed"
+		android:layout_width="fill_parent" android:layout_height="wrap_content"
+		android:visibility="gone" android:textColor="#424952" />
+
+	<LinearLayout android:id="@+id/userinfo_ll"
+		android:layout_width="fill_parent" android:layout_height="wrap_content"
+		android:orientation="vertical" android:visibility="gone">
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<com.ouling.weibo.util.AsyncImageView
+				android:id="@+id/userinfo_pic" android:layout_width="wrap_content"
+				android:layout_height="wrap_content" />
+
+			<TextView android:id="@+id/userinfo_tv_name"
+				android:layout_width="wrap_content" android:layout_height="wrap_content"
+				android:paddingLeft="10dip" android:text="昵称" android:textColor="#424952"/>
+		</LinearLayout>
+
+		<TextView android:id="@+id/userinfo_tv_location"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="地址"
+			android:textColor="#424952" />
+
+		<TextView android:id="@+id/userinfo_tv_url"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="博客"
+			android:textColor="#424952" />
+
+		<TextView android:id="@+id/userinfo_tv_description"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:paddingLeft="10dip" android:paddingTop="10dip" android:text="介绍"
+			android:textColor="#424952" />
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<Button android:id="@+id/userinfo_btn_friends"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="关注" />
+
+			<Button android:id="@+id/userinfo_btn_weibo"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="微博" />
+		</LinearLayout>
+
+		<LinearLayout android:layout_width="fill_parent"
+			android:layout_height="wrap_content" android:orientation="horizontal"
+			android:paddingLeft="10dip" android:paddingTop="10dip">
+
+			<Button android:id="@+id/userinfo_btn_follows"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="粉丝" />
+
+			<Button android:id="@+id/userinfo_btn_refresh"
+				android:layout_width="fill_parent" android:layout_height="wrap_content"
+				android:layout_weight="1" android:text="刷新" />
+		</LinearLayout>
+	</LinearLayout>
+
+	<LinearLayout android:id="@+id/userinfo_waitingView"
+		android:layout_width="fill_parent" android:layout_height="fill_parent"
+		android:orientation="horizontal" android:gravity="center">
+
+		<ProgressBar style="?android:attr/progressBarStyleSmallTitle"
+			android:layout_width="wrap_content" android:layout_height="wrap_content"
+			android:indeterminateDrawable="@drawable/progresscolor" />
+
+		<TextView android:layout_width="wrap_content"
+			android:layout_height="wrap_content" android:paddingLeft="10dip"
+			android:text="加载中..." android:textColor="#000000"/>
+	</LinearLayout>
+
+</FrameLayout>

+ 36 - 0
res/layout/userlist.xml

@@ -0,0 +1,36 @@
+<?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:background="@drawable/bg"
+    android:orientation="vertical" >
+
+    <ListView
+        android:id="@+id/user_list"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" 
+        android:layout_weight="1"
+        >
+    </ListView>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/btn_addUser"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="添加用户" />
+
+        <Button
+            android:id="@+id/btn_deleteUser"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_weight="1"
+            android:text="删除用户" />
+    </LinearLayout>
+
+</LinearLayout>

+ 14 - 0
res/layout/web.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView 
+	xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:orientation="vertical"
+    android:background="#FFFFFF"
+    >
+	  <WebView
+	   	android:layout_height="wrap_content"
+	    android:layout_width="wrap_content"
+	    android:id="@+id/web">
+	  </WebView>
+</ScrollView>

+ 141 - 0
res/layout/weibo.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="#F0FFFF"
+    android:orientation="vertical" >
+
+    <FrameLayout
+        android:id="@+id/weibo_ff"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:background="#F0FFFF"
+        android:orientation="vertical"
+        android:visibility="gone" >
+
+        <ScrollView
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent" >
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical" >
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="10dip" >
+
+                    <com.ouling.weibo.util.AsyncImageView
+                        android:id="@+id/weibo_avatar"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content" />
+
+                    <TextView
+                        android:id="@+id/weibo_screenName"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:paddingLeft="10dip"
+                        android:textColor="#000000" />
+                </LinearLayout>
+
+                <com.ouling.weibo.util.HighLightTextView
+                    android:id="@+id/weibo_text"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:autoLink="web|phone|email"
+                    android:padding="10dip"
+                    android:textColor="#000000" />
+
+                <com.ouling.weibo.util.AsyncImageView
+                    android:id="@+id/weibo_pic"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:paddingBottom="20dip"
+                    android:paddingTop="10dip"
+                    android:visibility="gone" />
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal" >
+
+                    <Button
+                        android:id="@+id/weibo_btn_retweet"
+                        android:layout_width="fill_parent"
+                        android:layout_height="fill_parent"
+                        android:layout_weight="1"
+                        android:text="转发" />
+
+                    <Button
+                        android:id="@+id/weibo_btn_comment"
+                        android:layout_width="fill_parent"
+                        android:layout_height="fill_parent"
+                        android:layout_weight="1"
+                        android:text="评论" />
+                </LinearLayout>
+
+                <!--
+		<SlidingDrawer android:id="@+id/slidingdrawer"
+			android:layout_width="fill_parent" android:layout_height="fill_parent"
+			android:content="@+id/slide_content" android:handle="@+id/slide_handle">
+
+			<ImageButton android:id="@id/slide_handle"
+				android:layout_width="50dip" android:layout_height="44dip"
+				android:src="@drawable/goicon" />
+                -->
+                <!--
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:background="#ffffff"
+                    android:orientation="vertical" >
+                -->
+
+                <TextView
+                    android:id="@+id/weibo_no_comment"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:orientation="vertical"
+                    android:padding="10dip"
+                    android:text="暂无评论"
+                    android:textColor="#000000" />
+
+                <ListView
+                    android:id="@+id/comment_listView"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1" >
+                </ListView>
+            </LinearLayout>
+            <!-- </LinearLayout> -->
+        </ScrollView>
+        <!-- </SlidingDrawer> -->
+    </FrameLayout>
+
+    <LinearLayout
+        android:id="@+id/weibo_waitingView"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:gravity="center"
+        android:orientation="horizontal" >
+
+        <ProgressBar
+            style="?android:attr/progressBarStyleSmallTitle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:indeterminateDrawable="@drawable/progresscolor" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingLeft="10dip"
+            android:text="加载中..."
+            android:textColor="#000000" />
+    </LinearLayout>
+
+</FrameLayout>

+ 8 - 0
res/values/attrs.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <declare-styleable name="oulingxmlns">
+        <attr format="boolean" name="gif" />
+    </declare-styleable>
+
+</resources>

+ 9 - 0
res/values/strings.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<resources>
+    <string name="hello">Hello World, WEIBO!</string>
+    <string name="app_name">O新浪微博</string>
+    <string name="pull_to_refresh_pull_label">下拉刷新</string>
+    <string name="pull_to_refresh_release_label">松开后刷新</string>
+    <string name="pull_to_refresh_refreshing_label">刷新...</string>
+    <string name="pull_to_refresh_tap_label">Tap to refresh...</string>
+</resources>

+ 14 - 0
res/values/styles.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resources>
+    <style name="CustomWindowTitleBackground"> 
+    	<item name="android:background">@drawable/gray_gradient</item> 
+	</style>
+	<style name="test" parent="android:Theme"> 
+	    <item name="android:windowTitleSize">40dp</item> 
+	    <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
+	</style>
+	<style name="mytheme" parent="android:Theme.Black">
+		<item name="android:textSize">15sp</item>
+		<item name="android:textColor">#FFFFFFFF</item>
+	</style>
+</resources>

+ 5 - 0
res/xml/animation.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
+    android:minWidth="294dip"
+    android:minHeight="72dip"
+    android:updatePeriodMillis="0" android:initialLayout="@layout/layout_a"/>

+ 84 - 0
src/com/ouling/weibo/CommentMentionDialog.java

@@ -0,0 +1,84 @@
+package com.ouling.weibo;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.Toast;
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+
+//用于显示评论转发的提示
+
+public class CommentMentionDialog {
+
+	private CheckBox checkBox;
+	private EditText editText;
+
+	public CommentMentionDialog(final Context context, final boolean isComment,
+			final long weiboID, final String cid) {
+
+		LayoutInflater inflater = ((Activity) context).getLayoutInflater();
+		View layout = inflater.inflate(R.layout.dialog, null);
+
+		new AlertDialog.Builder(context)
+				.setView(layout)
+				.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+
+					@Override
+					public void onClick(DialogInterface dialog, int which) {
+						try {
+							Weibo weibo = OAuthConstant.getInstance().getWeibo();
+							String text = editText.getText().toString();
+							String msg = "";
+							if (TextUtils.isEmpty(text)) {
+								Toast.makeText(context, "说点什么吧",
+										Toast.LENGTH_LONG).show();
+								return;
+							}
+							if (text.length() > 140) {
+								Toast.makeText(context, "要评论的内容太长了",
+										Toast.LENGTH_LONG).show();
+								return;
+							}
+							if (isComment) {
+								weibo.updateComment(text, weiboID + "", cid);
+								msg = "评论成功";
+								if (checkBox.isChecked()) {
+									weibo.updateStatus(text, weiboID);
+									msg = "评论且转发成功";
+								}
+							} else {
+								weibo.updateStatus(text, weiboID);
+								msg = "转发成功";
+								if (checkBox.isChecked()) {
+									weibo.updateComment(text, weiboID + "", cid);
+									msg = "评论且转发成功";
+								}
+							}
+							Toast.makeText(context, msg, Toast.LENGTH_LONG)
+									.show();
+						} catch (WeiboException e) {
+							e.printStackTrace();
+							Toast.makeText(context, "评论或转发失败",
+									Toast.LENGTH_LONG).show();
+						}
+					}
+				})
+				.setNegativeButton("取消", new DialogInterface.OnClickListener() {
+
+					@Override
+					public void onClick(DialogInterface dialog, int which) {
+					}
+				}).setTitle(isComment ? "评论微博" : "转发微博").show();
+
+		checkBox = (CheckBox) layout.findViewById(R.id.dialog_cb);
+		editText = (EditText) layout.findViewById(R.id.dialog_et);
+	}
+}

+ 361 - 0
src/com/ouling/weibo/FriendsOrFollowsList.java

@@ -0,0 +1,361 @@
+package com.ouling.weibo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.listener.OnGetMoreListener;
+import com.ouling.weibo.listener.OnRefreshListener;
+import com.ouling.weibo.basic.User;
+import com.ouling.weibo.basic.UserWapper;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+import com.ouling.weibo.org.json.JSONException;
+import com.ouling.weibo.org.json.JSONObject;
+import com.ouling.weibo.util.AsyncImageView;
+import com.ouling.weibo.util.AutoGetMoreListView;
+import com.ouling.weibo.util.ImageRel;
+import com.ouling.weibo.util.InfoHelper;
+import com.ouling.weibo.util.WaitingView;
+
+import android.app.Activity;
+import android.app.NotificationManager;
+import android.content.Intent;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+public class FriendsOrFollowsList extends Activity implements
+		OnRefreshListener, OnGetMoreListener {
+
+	static class ViewHolder {
+
+		AsyncImageView asyncImageView;
+		TextView info;
+		Button btn;
+	}
+
+	private FriendsOrFollowsListAdapter adapter;
+	private AutoGetMoreListView autoGetMoreListView;
+	private List<User> list = new ArrayList<User>();
+	private List<JSONObject> list_relations = new ArrayList<JSONObject>();
+	private boolean flag; // true for follower, false for friends
+	private String cid;
+	private UserWapper curUserWapper; 
+	private Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+				case InfoHelper.LOADING_DATA_FAILED:
+					Toast.makeText(FriendsOrFollowsList.this, "获取信息失败",
+							Toast.LENGTH_LONG).show();
+					FriendsOrFollowsList.this.finish();
+					break;
+				case InfoHelper.LOADING_DATA_COMPLETED:
+					adapter.notifyDataSetChanged();
+					FriendsOrFollowsList.this
+							.setContentView(autoGetMoreListView);
+					Toast.makeText(FriendsOrFollowsList.this, "刷新完成",
+							Toast.LENGTH_LONG).show();
+					break;
+			}
+		}
+	};
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+		setContentView(new WaitingView(this));
+		cid = null;
+		Bundle bundle = getIntent().getExtras();
+		if (bundle != null) {
+			flag = bundle.getBoolean("flag");	//判断获取关注还是粉丝
+			cid = bundle.getString("cid");
+		}
+		if (TextUtils.isEmpty(cid))
+			cid = OAuthConstant.getInstance().getAccessToken().getUserId() + "";
+
+		autoGetMoreListView = new AutoGetMoreListView(this);
+		autoGetMoreListView.setLayoutParams(new LayoutParams(
+				LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
+		adapter = new FriendsOrFollowsListAdapter();
+		autoGetMoreListView.setAdapter(adapter);
+		autoGetMoreListView.setOnItemClickListener(new OnItemClickListener() {
+
+			@Override
+			public void onItemClick(AdapterView<?> parent, View view,
+					int position, long id) {
+				Intent intent = new Intent(FriendsOrFollowsList.this,
+						UserInfo.class);
+				if (position <= list.size())
+					intent.putExtra("cid", list.get(position - 1).getId() + "");
+				startActivity(intent);
+			}
+		});
+		autoGetMoreListView.setOnRefreshListener(this);
+		autoGetMoreListView.setOnGetMoreListener(this);
+		// setContentView(autoGetMoreListView);
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+				try {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					if (flag) {
+						curUserWapper = weibo.getFollowersStatuses(cid, -1);
+						list = curUserWapper.getUsers();
+						NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+						notificationManager
+								.cancel(MainActivity.UNREAD_FOLLOWER);
+						weibo.resetCount(4);
+					} else {
+						curUserWapper = weibo.getFriendsStatuses(cid, -1);
+						list = curUserWapper.getUsers();
+					}
+					getRelation(false, 0);
+					handler.sendEmptyMessage(InfoHelper.LOADING_DATA_COMPLETED);
+				} catch (WeiboException e) {
+					e.printStackTrace();
+					handler.sendEmptyMessage(InfoHelper.LOADING_DATA_FAILED);
+				}
+			}
+		}).start();
+
+	}
+
+	protected void getRelation(boolean isGetMore, int beg) {
+		if (!isGetMore)
+			list_relations.clear();
+		Weibo weibo = OAuthConstant.getInstance().getWeibo();
+		for (int index = beg; index < list.size(); index++) {
+			User user = list.get(index);
+			try {
+				list_relations.add(weibo.showFriendships(OAuthConstant
+						.getInstance().getAccessToken().getUserId()
+						+ "", user.getId() + ""));
+			} catch (WeiboException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+
+	class FriendsOrFollowsListAdapter extends BaseAdapter {
+
+		@Override
+		public int getCount() {
+			return list.size();
+		}
+
+		@Override
+		public User getItem(int position) {
+			return list.get(position);
+		}
+
+		@Override
+		public long getItemId(int position) {
+			return position;
+		}
+
+		@Override
+		public View getView(int position, View convertView, ViewGroup parent) {
+			final User user = list.get(position);
+			final ViewHolder holder;
+			if (convertView == null) {
+				LinearLayout friLayout = new LinearLayout(FriendsOrFollowsList.this);
+				friLayout.setOrientation(LinearLayout.HORIZONTAL);
+
+				LinearLayout reLayout = new LinearLayout(FriendsOrFollowsList.this);
+				reLayout.setOrientation(LinearLayout.VERTICAL);
+				reLayout.setLayoutParams(new LayoutParams(130, LayoutParams.WRAP_CONTENT));
+				AsyncImageView asyncImageView = new AsyncImageView(
+						FriendsOrFollowsList.this);
+				TextView info = new TextView(FriendsOrFollowsList.this);
+				final Button btn = new Button(FriendsOrFollowsList.this);
+
+				reLayout.addView(asyncImageView);
+				reLayout.addView(btn);
+				friLayout.addView(reLayout);
+				friLayout.addView(info);
+				convertView = friLayout;
+
+				holder = new ViewHolder();
+				holder.asyncImageView = asyncImageView;
+				holder.info = info;
+				holder.btn = btn;
+				convertView.setTag(holder);
+
+			} else {
+				holder = (ViewHolder) convertView.getTag();
+			}
+
+			holder.asyncImageView.setPadding(10, 10, 10, 10);
+			holder.asyncImageView.setProgressBitmaps(ImageRel
+					.getBitmaps_avatar(FriendsOrFollowsList.this));
+			holder.asyncImageView.setUrl(user.getProfileImageURL().toString());
+			String info_text = "昵称: "
+					+ user.getScreenName()
+					+ "\n性别: "
+					+ (user.getGender().equals("m") ? "男" : "女")
+					+ "\n所在地: "
+					+ user.getLocation()
+					+ "\n博客地址:"
+					+ ((user.getURL() != null) ? user.getURL().toString() : "无")
+					+ "\n粉丝数: " + user.getFollowersCount() + "\n关注数: "
+					+ user.getFriendsCount();
+			// Weibo weibo = OAuthConstant.getInstance().getWeibo();
+
+			final String sex = (user.getGender().equals("m") ? "他" : "她");
+			boolean following = false;
+			boolean followed = true;
+			try {
+				JSONObject object = list_relations.get(position);
+				JSONObject source = object.getJSONObject("source");
+				JSONObject target = object.getJSONObject("target");
+				following = Boolean.valueOf(target.getString("followed_by")); // 我是否关注他
+				followed = Boolean.valueOf(source.getString("followed_by")); // 他是否关注我
+				if (following && followed) {
+					info_text = info_text + "\n" + "互相关注";
+				} else {
+					if (following) {
+						info_text = info_text + "\n" + "我已关注" + sex;
+					} else {
+						info_text = info_text + "\n" + "我未关注" + sex;
+					}
+					if (followed) {
+						info_text = info_text + "\n" + sex + "已关注我";
+					} else {
+						info_text = info_text + "\n" + sex + "未关注我";
+					}
+				}
+			}
+			// catch (WeiboException e) {
+			// e.printStackTrace();
+			// }
+			catch (JSONException e) {
+				e.printStackTrace();
+			} catch (Exception e) {
+
+			}
+
+			holder.info.setPadding(10, 5, 10, 10);
+			holder.info.setText(info_text);
+			holder.info.setTextColor(Color.BLACK);
+
+			if (following)
+				holder.btn.setText("取消关注");
+			else
+				holder.btn.setText("关注" + sex);
+			holder.btn.setOnClickListener(new OnClickListener() {
+
+				@Override
+				public void onClick(View v) {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					if (holder.btn.getText().equals("关注" + sex)) {
+						try {
+							// 官方要求要用post,函数createFriendship(id)是用get
+							weibo.createFriendshipByUserid(user.getId() + "");
+							holder.btn.setText("取消关注");
+							Toast.makeText(FriendsOrFollowsList.this, "关注成功!",
+									Toast.LENGTH_SHORT).show();
+						} catch (WeiboException e) {
+							e.printStackTrace();
+							Toast.makeText(FriendsOrFollowsList.this, "关注失败!",
+									Toast.LENGTH_SHORT).show();
+						}
+					} else {
+						try {
+							weibo.destroyFriendship(user.getId() + "");
+							holder.btn.setText("关注" + sex);
+							Toast.makeText(FriendsOrFollowsList.this,
+									"取消关注成功!", Toast.LENGTH_SHORT).show();
+						} catch (WeiboException e) {
+							e.printStackTrace();
+							Toast.makeText(FriendsOrFollowsList.this,
+									"取消关注失败!", Toast.LENGTH_SHORT).show();
+						}
+					}
+
+				}
+			});
+			holder.btn.setFocusable(false);
+
+			return convertView;
+		}
+	}
+
+	@Override
+	public void onGetMore() {
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+				if (curUserWapper.getNextCursor() != 0) {
+					try {
+						Weibo weibo = OAuthConstant.getInstance().getWeibo();
+						List<User> tmp;
+						if (flag) {
+
+							curUserWapper = weibo.getFollowersStatuses(cid,
+									curUserWapper.getNextCursor());
+							tmp = curUserWapper.getUsers();
+						} else {
+							curUserWapper = weibo.getFriendsStatuses(cid,
+									curUserWapper.getNextCursor());
+							tmp = curUserWapper.getUsers();
+						}
+						list.addAll(tmp);
+						getRelation(true, list.size() - tmp.size());
+					} catch (WeiboException e) {
+						e.printStackTrace();
+					}
+				}
+				autoGetMoreListView.getMoreFinished();
+			}
+		}).start();
+	}
+
+	@Override
+	public void onRefresh() {
+
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+				try {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					List<User> tmp;
+					if (flag)
+						tmp = weibo.getFollowersStatuses(cid);
+					else
+						tmp = weibo.getFriendsStatuses(cid);
+					list.clear();
+					list = tmp;
+					getRelation(false, 0);
+				} catch (WeiboException e) {
+					e.printStackTrace();
+				}
+				autoGetMoreListView.refreshFinished();
+			}
+		}).start();
+	}
+}

+ 498 - 0
src/com/ouling/weibo/InfoActivity.java

@@ -0,0 +1,498 @@
+package com.ouling.weibo;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import android.app.AlertDialog;
+import android.app.NotificationManager;
+import android.app.TabActivity;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.MenuItem.OnMenuItemClickListener;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.FrameLayout;
+import android.widget.TabHost;
+import android.widget.TabHost.OnTabChangeListener;
+import android.widget.TabHost.TabContentFactory;
+import android.widget.TabHost.TabSpec;
+import android.widget.TabWidget;
+import android.widget.Toast;
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.basic.Comment;
+import com.ouling.weibo.basic.Status;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+import com.ouling.weibo.basic.WeiboResponse;
+import com.ouling.weibo.util.InfoHelper;
+import com.ouling.weibo.util.AutoGetMoreListView;
+import com.ouling.weibo.util.WaitingView;
+
+/**
+ * 显示评论(包括发出和收到)以及@我的列表
+ * 
+ * 
+ */
+public class InfoActivity extends TabActivity implements TabContentFactory,
+		OnTabChangeListener, OnMenuItemClickListener {
+
+	private TabHost tabHost;
+	private FrameLayout frameLayout;
+	private AutoGetMoreListView autoGetMoreListView;
+	private WeiboAdapter infoAdapter;
+	private List<WeiboResponse> commentToMe = new ArrayList<WeiboResponse>();
+	private List<WeiboResponse> commentByMe = new ArrayList<WeiboResponse>();
+	private List<WeiboResponse> mentions = new ArrayList<WeiboResponse>();
+	private boolean[] isCompleted = new boolean[3];
+	private boolean[] isRunning = new boolean[3];
+	private boolean isFirst;
+	private int preIndex;
+	private int[] preListIndex = new int[3];
+	private WaitingView waitingView;
+	private Runnable[] runnables = new Runnable[3];
+	private static String[] texts = new String[] { "“我收到的评论”", "“我发出的评论”",
+			"“获取“@我的微博”" };
+	private Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			isRunning[msg.arg1] = false;
+			switch (msg.what) {
+			case InfoHelper.LOADING_DATA_FAILED:
+				Toast.makeText(InfoActivity.this,
+						"刷新" + texts[msg.arg1] + "失败, 可通过menu键刷新",
+						Toast.LENGTH_LONG).show();
+				break;
+			case InfoHelper.LOADING_DATA_COMPLETED:
+				isCompleted[msg.arg1] = true;
+				infoAdapter.notifyDataSetChanged();
+				Log.d("tabHost.getCurrentTab(): " + tabHost.getCurrentTab(),
+						"msg.arg1: " + msg.arg1);
+				if (tabHost.getCurrentTab() == msg.arg1) {
+					Log.d("setVisibility", "setVisibility");
+					waitingView.setVisibility(View.GONE);
+					autoGetMoreListView.setVisibility(View.VISIBLE);
+					// autoGetMoreListView.setSelection(1);
+
+					// 不知道为什么第一次启动这个TabActivity的时候,infoAdapter.notifyDataSetChanged()没作用,通过这种方式可以解决,但是并不好
+					if (isFirst) {
+						isFirst = false;
+						tabHost.setCurrentTab((msg.arg1 + 1) % 3);
+						tabHost.setCurrentTab(msg.arg1);
+					}
+				}
+				Toast.makeText(InfoActivity.this,
+						"刷新" + texts[msg.arg1] + "完成", Toast.LENGTH_LONG)
+						.show();
+				break;
+			}
+
+		}
+	};
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		// setContentView(R.layout.tabactivity);
+
+		isFirst = true;
+
+		Arrays.fill(isCompleted, false);
+		Arrays.fill(isRunning, false);
+		Arrays.fill(preListIndex, 1);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+
+		// frameLayout = (FrameLayout) findViewById(android.R.id.tabcontent);
+		frameLayout = new FrameLayout(this);
+		autoGetMoreListView = new AutoGetMoreListView(this);
+		waitingView = new WaitingView(this);
+		frameLayout.addView(autoGetMoreListView);
+		frameLayout.addView(waitingView);
+		autoGetMoreListView.setVisibility(View.GONE);
+		waitingView.setVisibility(View.VISIBLE);
+
+		infoAdapter = new WeiboAdapter(commentByMe, this, 0,
+				autoGetMoreListView);
+		autoGetMoreListView.setAdapter(infoAdapter);
+		autoGetMoreListView.setOnItemClickListener(itemClickListener);
+		autoGetMoreListView.setOnRefreshListener(infoAdapter);
+		autoGetMoreListView.setOnGetMoreListener(infoAdapter);
+
+		initThread();
+
+		initTabHost();
+
+		Bundle bundle = this.getIntent().getExtras();
+		int type = 0;
+		if (bundle != null) {
+			type = bundle.getInt("type", 0);
+			NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
+			if (type == 0)
+				notificationManager.cancel(MainActivity.UNREAD_COMMENT);
+			else if (type == 2)
+				notificationManager.cancel(MainActivity.UNREAD_MENTION);
+		}
+		preIndex = type;
+		tabHost.setCurrentTab(type);
+		switch (type) {
+		case 0:
+			infoAdapter.setCurList(commentByMe);
+			break;
+		case 1:
+			infoAdapter.setCurList(commentToMe);
+			break;
+		case 2:
+			infoAdapter.setCurList(mentions);
+			break;
+		}
+		infoAdapter.setType(type);
+		infoAdapter.notifyDataSetChanged();
+	}
+
+	// 设置界面
+	private void initTabHost() {
+		setContentView(R.layout.infortab);
+		tabHost = this.getTabHost();
+
+		TabSpec ts1 = tabHost.newTabSpec("COMMENT_TO_ME").setIndicator("收到的评论")
+				.setContent(this);
+		tabHost.addTab(ts1);
+
+		TabSpec ts2 = tabHost.newTabSpec("COMMENT_BY_ME").setIndicator("发出的评论");
+		ts2.setContent(this);
+		tabHost.addTab(ts2);
+
+		TabSpec ts3 = tabHost.newTabSpec("MENTION").setIndicator("@我")
+				.setContent(this);
+		tabHost.addTab(ts3);
+
+		tabHost.setOnTabChangedListener(this);
+
+		TabWidget widget = tabHost.getTabWidget();
+		for (int i = 0; i < 3; i++) {
+			View view = widget.getChildAt(i);
+			view.setBackgroundResource(R.drawable.widget_btn);
+
+			final int index = i;
+			view.setOnClickListener(new OnClickListener() {
+
+				@Override
+				public void onClick(View v) {
+					if (tabHost.getCurrentTab() == index) {
+						autoGetMoreListView.setSelection(1);
+						preListIndex[index] = 1;
+
+					} else {
+
+						preListIndex[preIndex] = autoGetMoreListView
+								.getFirstVisiblePosition();
+						tabHost.setCurrentTab(index);
+
+						if (isCompleted[index]) {
+							waitingView.setVisibility(View.GONE);
+							autoGetMoreListView.setVisibility(View.VISIBLE);
+						} else {
+							waitingView.setVisibility(View.VISIBLE);
+							autoGetMoreListView.setVisibility(View.GONE);
+						}
+
+						switch (index) {
+						case 0:
+							infoAdapter.setCurList(commentToMe);
+							break;
+						case 1:
+							infoAdapter.setCurList(commentByMe);
+							break;
+						case 2:
+							infoAdapter.setCurList(mentions);
+							break;
+						}
+						infoAdapter.setType(index);
+						infoAdapter.notifyDataSetChanged();
+
+						if (preListIndex[index] < infoAdapter.getCount() + 2)
+							autoGetMoreListView
+									.setSelection(preListIndex[index]);
+					}
+					Log.d("preIndex: " + preIndex, "index: " + index);
+					preIndex = index;
+					for (int i = 0; i < 3; i++) {
+						Log.d("preListIndex " + i, preListIndex[i] + "");
+					}
+				}
+			});
+		}
+	}
+
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+		for (int i = 1; i <= 3; i++)
+			menu.add(1, i, i, "刷新" + texts[i - 1]).setOnMenuItemClickListener(
+					this);
+		menu.add(1, 4, 4, "刷新全部").setOnMenuItemClickListener(this);
+		menu.add(1, 5, 5, "发微博").setIntent(
+				new Intent(this, ShareActivity.class));
+		return true;
+	}
+
+	@Override
+	public boolean onMenuItemClick(MenuItem item) {
+		if (item.getItemId() > 4)
+			return false;
+		if (item.getItemId() != 4) {
+			if (!isRunning[item.getItemId() - 1]) {
+				new Thread(runnables[item.getItemId() - 1]).start();
+				isRunning[item.getItemId() - 1] = true;
+			}
+		} else {
+			for (int i = 0; i < 3; i++) {
+				if (!isRunning[i]) {
+					new Thread(runnables[i]).start();
+					isRunning[i] = true;
+				}
+			}
+		}
+
+		return true;
+	}
+
+	@Override
+	public View createTabContent(String tag) {
+		if (!isRunning[tabHost.getCurrentTab()]) {
+			new Thread(runnables[tabHost.getCurrentTab()]).start();
+			isRunning[tabHost.getCurrentTab()] = true;
+		}
+		return frameLayout;
+	}
+
+	@Override
+	public void onTabChanged(String tabId) {
+		if (isCompleted[tabHost.getCurrentTab()]) {
+			waitingView.setVisibility(View.GONE);
+			autoGetMoreListView.setVisibility(View.VISIBLE);
+		} else {
+			waitingView.setVisibility(View.VISIBLE);
+			autoGetMoreListView.setVisibility(View.GONE);
+		}
+
+		if (tabId.equals("COMMENT_BY_ME"))
+			infoAdapter.setCurList(commentByMe);
+		else if (tabId.equals("COMMENT_TO_ME"))
+			infoAdapter.setCurList(commentToMe);
+		else
+			infoAdapter.setCurList(mentions);
+		infoAdapter.setType(InfoActivity.this.getTabHost().getCurrentTab());
+		infoAdapter.notifyDataSetChanged();
+	}
+
+	private void initThread() {
+		runnables[0] = new Runnable() {
+
+			@Override
+			public void run() {
+				Message msg = new Message();
+				try {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					commentToMe.clear();
+					commentToMe.addAll(weibo.getCommentsToMe());
+					msg.what = InfoHelper.LOADING_DATA_COMPLETED;
+				} catch (WeiboException e) {
+					e.printStackTrace();
+					msg.what = InfoHelper.LOADING_DATA_FAILED;
+				}
+				msg.arg1 = 0;
+				handler.sendMessage(msg);
+			}
+		};
+
+		runnables[1] = new Runnable() {
+
+			@Override
+			public void run() {
+				Message msg = new Message();
+				try {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					commentByMe.clear();
+					commentByMe.addAll(weibo.getCommentsByMe());
+					msg.what = InfoHelper.LOADING_DATA_COMPLETED;
+				} catch (WeiboException e) {
+					e.printStackTrace();
+					msg.what = InfoHelper.LOADING_DATA_FAILED;
+				}
+				msg.arg1 = 1;
+				handler.sendMessage(msg);
+			}
+		};
+
+		runnables[2] = new Runnable() {
+
+			@Override
+			public void run() {
+				Message msg = new Message();
+				try {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					mentions.clear();
+					mentions.addAll(weibo.getMentions());
+					msg.what = InfoHelper.LOADING_DATA_COMPLETED;
+				} catch (WeiboException e) {
+					e.printStackTrace();
+					msg.what = InfoHelper.LOADING_DATA_FAILED;
+				}
+				msg.arg1 = 2;
+				handler.sendMessage(msg);
+			}
+		};
+	}
+
+	//对点击处理
+	private OnItemClickListener itemClickListener = new OnItemClickListener() {
+
+		@Override
+		public void onItemClick(AdapterView<?> parent, View view,
+				final int position, long id) {
+			new AlertDialog.Builder(InfoActivity.this).setItems(
+					new CharSequence[] { "评论", "查看原微博", "查看个人资料" },
+					new DialogInterface.OnClickListener() {
+
+						@Override
+						public void onClick(DialogInterface dialog, int which) {
+							if (which == 2) {
+								Intent intent = new Intent(InfoActivity.this,
+										UserInfo.class);
+								switch (tabHost.getCurrentTab()) {
+								case 0:
+									if (position > commentToMe.size() - 1)
+										return;
+
+									intent.putExtra(
+											"cid",
+											((Comment) commentToMe
+													.get(position - 1))
+													.getUser().getId()
+													+ "");
+
+									break;
+
+								case 1:
+									if (position > commentByMe.size() - 1)
+										return;
+
+									intent.putExtra(
+											"cid",
+											((Comment) commentByMe
+													.get(position - 1))
+													.getUser().getId()
+													+ "");
+
+									break;
+
+								case 2:
+									if (position > mentions.size() - 1)
+										return;
+
+									intent.putExtra(
+											"cid",
+											((Status) mentions
+													.get(position - 1))
+													.getUser().getId()
+													+ "");
+									break;
+								}
+								startActivity(intent);
+								return;
+							}
+
+							if (which == 0) {
+								switch (tabHost.getCurrentTab()) {
+								case 0:
+									if (position > commentToMe.size() - 1)
+										return;
+
+									new CommentMentionDialog(InfoActivity.this,
+											true, ((Comment) commentToMe
+													.get(position - 1))
+													.getStatus().getId(),
+											((Comment) commentToMe
+													.get(position - 1)).getId()
+													+ "");
+									break;
+
+								case 1:
+									if (position > commentByMe.size() - 1)
+										return;
+
+									new CommentMentionDialog(InfoActivity.this,
+											true, ((Comment) commentByMe
+													.get(position - 1))
+													.getStatus().getId(),
+											((Comment) commentByMe
+													.get(position - 1)).getId()
+													+ "");
+									break;
+
+								case 2:
+									if (position > mentions.size() - 1)
+										return;
+
+									new CommentMentionDialog(
+											InfoActivity.this,
+											true,
+											(((Status) mentions
+													.get(position - 1)).getId()),
+											null);
+									break;
+								}
+								return;
+							}
+
+							Intent intent = new Intent(InfoActivity.this,
+									ViewActivity.class);
+							switch (tabHost.getCurrentTab()) {
+							case 0:
+								if (position > commentToMe.size() - 1)
+									return;
+
+								intent.putExtra("cid", ((Comment) commentToMe
+										.get(position - 1)).getStatus().getId());
+								break;
+
+							case 1:
+								if (position > commentByMe.size() - 1)
+									return;
+
+								intent.putExtra("cid", ((Comment) commentByMe
+										.get(position - 1)).getStatus().getId());
+								break;
+
+							case 2:
+								if (position > mentions.size() - 1)
+									return;
+
+								intent.putExtra("cid", ((Status) mentions
+										.get(position - 1)).getId());
+								break;
+							default:
+								return;
+							}
+							InfoActivity.this.startActivity(intent);
+						}
+
+					}).show();
+
+		}
+	};
+
+}

+ 307 - 0
src/com/ouling/weibo/MainActivity.java

@@ -0,0 +1,307 @@
+package com.ouling.weibo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.TabActivity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.MenuItem.OnMenuItemClickListener;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.FrameLayout;
+import android.widget.TabHost;
+import android.widget.TabHost.TabContentFactory;
+import android.widget.TabHost.TabSpec;
+import android.widget.TabWidget;
+import android.widget.Toast;
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.OAuth.OAuthUserList;
+import com.ouling.weibo.basic.Count;
+import com.ouling.weibo.basic.Status;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+import com.ouling.weibo.basic.WeiboResponse;
+import com.ouling.weibo.db.DBAdapter;
+import com.ouling.weibo.pic.WeiboEmotion;
+import com.ouling.weibo.util.InfoHelper;
+import com.ouling.weibo.util.AutoGetMoreListView;
+import com.ouling.weibo.util.WaitingView;
+
+/**
+ * 显示用户自己以及其关注的人的微博列表/用户的个人资料
+ * 
+ * 
+ */
+public class MainActivity extends TabActivity implements TabContentFactory
+		 {
+
+	public static int UNREAD_COMMENT = 1000;
+	public static int UNREAD_FOLLOWER = 2000;
+	public static int UNREAD_MENTION = 3000;
+
+	private TabHost tabHost;
+	private WeiboAdapter msgAdapter;
+	private List<WeiboResponse> friendsTimeline = new ArrayList<WeiboResponse>();
+	private AutoGetMoreListView autoGetMoreListView;
+	private int preIndex = 0;
+	private FrameLayout ff;
+
+	private WaitingView waitingView;
+	private Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+			case InfoHelper.LOADING_DATA_FAILED:
+				Toast.makeText(MainActivity.this, "获取信息失败", Toast.LENGTH_LONG)
+						.show();
+				MainActivity.this.finish();
+				break;
+			case InfoHelper.LOADING_DATA_COMPLETED:
+				msgAdapter.notifyDataSetChanged();
+				waitingView.setVisibility(View.GONE);
+				autoGetMoreListView.setVisibility(View.VISIBLE);
+				DBAdapter.getInstance(MainActivity.this).saveFriendTimeline(
+						friendsTimeline);
+				autoGetMoreListView.setSelection(1);
+				Toast.makeText(MainActivity.this, "刷新首页微博完成", Toast.LENGTH_LONG)
+						.show();
+				break;
+			default:
+				break;
+			}
+		}
+	};
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+
+		waitingView = new WaitingView(this);
+
+		autoGetMoreListView = new AutoGetMoreListView(this);
+		msgAdapter = new WeiboAdapter(friendsTimeline, this, 3,
+				autoGetMoreListView);
+		autoGetMoreListView.setAdapter(msgAdapter);
+		autoGetMoreListView.setOnGetMoreListener(msgAdapter);
+		autoGetMoreListView.setOnRefreshListener(msgAdapter);
+		autoGetMoreListView.setOnItemClickListener(new OnItemClickListener() {
+
+			@Override
+			public void onItemClick(AdapterView<?> parent, View view,
+					int position, long id) {
+				Intent intent = new Intent(MainActivity.this,
+						ViewActivity.class);
+				intent.putExtra("cid",
+						((Status) friendsTimeline.get(position - 1)).getId());
+				startActivityForResult(intent, 1);
+			}
+		});
+
+		initTab();
+
+	}
+	
+	//初始化切换布局
+	private void initTab() {
+		setContentView(R.layout.tabactivity);
+		tabHost = this.getTabHost();
+		tabHost.setBackgroundResource(R.drawable.bg);
+		ff = new FrameLayout(this);
+
+		TabSpec ts1 = tabHost.newTabSpec("HOME").setIndicator("首页");
+		ts1.setContent(this);
+		tabHost.addTab(ts1);
+
+		TabSpec ts2 = tabHost.newTabSpec("MSG").setIndicator("消息")
+				.setContent(new Intent(this, InfoActivity.class));
+		tabHost.addTab(ts2);
+
+		TabSpec ts3 = tabHost.newTabSpec("INFO").setIndicator("资料")
+				.setContent(new Intent(this, UserInfo.class));
+		tabHost.addTab(ts3);
+		
+		//切换改变时
+			TabWidget widget = tabHost.getTabWidget();
+			for (int i = 0; i < 3; i++) {
+				View view = widget.getChildAt(i);
+				view.setBackgroundResource(R.drawable.widget_btn);
+				final int index = i;
+				view.setOnClickListener(new OnClickListener() {
+
+					@Override
+					public void onClick(View v) {
+							preIndex = tabHost.getCurrentTab();
+							if (tabHost.getCurrentTab() == index) {
+								autoGetMoreListView.setSelection(1);
+							} else {
+								tabHost.setCurrentTab(index);
+								preIndex = tabHost.getCurrentTab();
+							}
+					}
+				});
+			}
+		}
+	
+	
+	
+	//发微博
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+		menu.add(1, 1, 1, "发微博").setIntent(
+				new Intent(this, ShareActivity.class));
+//		Intent intent1 = new Intent(this, FriendsOrFollowsList.class);
+//		intent1.putExtra("flag", false);
+		return true;
+	}
+
+	
+
+	public static void unReadNotify(Context context) {
+		Weibo weibo = OAuthConstant.getInstance().getWeibo();
+		Count unread_count;
+		try {
+			unread_count = weibo.getUnread();
+			NotificationManager notificationManager = (NotificationManager) context
+					.getSystemService(NOTIFICATION_SERVICE);
+			if (unread_count.getComments() != 0) {
+				Notification notification = new Notification(R.drawable.image,
+						"你有" + unread_count.getComments() + "条未读评论.",
+						System.currentTimeMillis());
+				Intent intent = new Intent(context, InfoActivity.class);
+				intent.putExtra("type", 0);
+				PendingIntent contentIntent = PendingIntent.getActivity(
+						context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+				notification.setLatestEventInfo(context,
+						"你有" + unread_count.getComments() + "条未读评论.", "",
+						contentIntent);
+				notification.defaults = Notification.DEFAULT_ALL;
+				notificationManager.notify(UNREAD_COMMENT, notification);
+			}
+			if (unread_count.getMentions() != 0) {
+				Notification notification = new Notification(R.drawable.image,
+						"你有" + unread_count.getMentions() + "条未读@你的微薄.",
+						System.currentTimeMillis());
+				Intent intent = new Intent(context, InfoActivity.class);
+				intent.putExtra("type", 2);
+				PendingIntent contentIntent = PendingIntent.getActivity(
+						context, UNREAD_MENTION, intent,
+						PendingIntent.FLAG_UPDATE_CURRENT);
+				notification.setLatestEventInfo(context,
+						"你有" + unread_count.getMentions() + "条未读@你的微薄.", "",
+						contentIntent);
+				notification.defaults = Notification.DEFAULT_ALL;
+				notificationManager.notify(UNREAD_MENTION, notification);
+			}
+			if (unread_count.getFollowers() != 0) {
+				Notification notification = new Notification(R.drawable.image,
+						"你有" + unread_count.getFollowers() + "新的关注者.",
+						System.currentTimeMillis());
+				Intent intent = new Intent(context, FriendsOrFollowsList.class);
+				intent.putExtra("flag", true);
+				PendingIntent contentIntent = PendingIntent.getActivity(
+						context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+				notification.setLatestEventInfo(context,
+						"你有" + unread_count.getFollowers() + "新的关注者.", "",
+						contentIntent);
+				notification.defaults = Notification.DEFAULT_ALL;
+				notificationManager.notify(UNREAD_FOLLOWER, notification);
+			}
+
+			if (unread_count.getDm() != 0) {
+				Notification notification = new Notification(R.drawable.image,
+						"你有" + unread_count.getDm() + "条未读的私信.",
+						System.currentTimeMillis());
+				Intent intent = new Intent(context, OAuthUserList.class);
+				PendingIntent contentIntent = PendingIntent.getActivity(
+						context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+				notification.setLatestEventInfo(context,
+						"你有" + unread_count.getDm() + "条未读的私信.", "",
+						contentIntent);
+				notification.defaults = Notification.DEFAULT_ALL;
+				notificationManager.notify(UNREAD_FOLLOWER, notification);
+			}
+		} catch (WeiboException e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	public void onActivityResult(int requestCode, int resultCode, Intent data) {
+		tabHost.setCurrentTab(preIndex);
+	}
+
+	//首页显示微博
+	@Override
+	public View createTabContent(String tag) {
+		if (tag.equals("HOME")) {
+			ff.addView(waitingView);
+			ff.addView(autoGetMoreListView);
+			autoGetMoreListView.setVisibility(View.GONE);
+			new Thread(new Runnable() {
+
+				@Override
+				public void run() {
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					try {
+						friendsTimeline.addAll(weibo.getFriendsTimeline());
+						handler.sendEmptyMessage(InfoHelper.LOADING_DATA_COMPLETED);
+					} catch (WeiboException e) {
+						e.printStackTrace();
+						handler.sendEmptyMessage(InfoHelper.LOADING_DATA_FAILED);
+					}
+					unReadNotify(MainActivity.this);
+				}
+			}).start();
+		}
+		return ff;
+	}
+
+	
+
+//	@Override
+//	public boolean onMenuItemClick(MenuItem item) {
+//		switch (item.getItemId()) {
+//		case 4:
+//			Toast.makeText(MainActivity.this, "开始下载表情包,请稍候...",
+//					Toast.LENGTH_LONG).show();
+//			new Thread(new Runnable() {
+//
+//				@Override
+//				public void run() {
+//					WeiboEmotion.downloadEmotions(handler);
+//				}
+//			}).start();
+//			return true;
+//		case 5:
+//			Toast.makeText(MainActivity.this, "开始更新表情包,请稍候...",
+//					Toast.LENGTH_LONG).show();
+//			new Thread(new Runnable() {
+//
+//				@Override
+//				public void run() {
+//					WeiboEmotion.updateEmotions(handler);
+//				}
+//			}).start();
+//			return true;
+//		}
+//		return false;
+//	}
+
+}

+ 77 - 0
src/com/ouling/weibo/OAuth/OAuthConstant.java

@@ -0,0 +1,77 @@
+package com.ouling.weibo.OAuth;
+
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.http.AccessToken;
+import com.ouling.weibo.http.RequestToken;
+
+/**
+ * 进行OAuth认证。在用户使用新浪微博时,必须先进行认证 
+*/
+public class OAuthConstant {
+
+	private static Weibo weibo = null;
+	private static OAuthConstant instance = null;
+	private RequestToken requestToken;
+	private AccessToken accessToken;
+	private String token;
+	private String tokenSecret;
+
+	private OAuthConstant() {
+	};
+
+	public static synchronized OAuthConstant getInstance() {
+		if (instance == null)
+			instance = new OAuthConstant();
+		return instance;
+	}
+
+	public Weibo getWeibo() {
+		if (weibo == null)
+			weibo = new Weibo();
+		return weibo;
+	}
+
+	public AccessToken getAccessToken() {
+		return accessToken;
+	}
+
+	public void setAccessToken(AccessToken accessToken) {
+		this.accessToken = accessToken;
+		this.token = accessToken.getToken();
+		this.tokenSecret = accessToken.getTokenSecret();
+		if (weibo == null)
+			weibo = new Weibo();
+
+		weibo.setToken(accessToken);
+	}
+
+	public RequestToken getRequestToken() {
+		return requestToken;
+	}
+
+	public void setRequestToken(RequestToken requestToken) {
+		this.requestToken = requestToken;
+	}
+
+	public String getToken() {
+		return token;
+	}
+
+	public void setToken(String token) {
+		this.token = token;
+	}
+
+	public String getTokenSecret() {
+		return tokenSecret;
+	}
+
+	public void setTokenSecret(String tokenSecret) {
+		this.tokenSecret = tokenSecret;
+	}
+
+	public static void initData() {
+		instance = null;
+		weibo = null;
+	}
+
+}

+ 333 - 0
src/com/ouling/weibo/OAuth/OAuthUserList.java

@@ -0,0 +1,333 @@
+package com.ouling.weibo.OAuth;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.apache.commons.codec.binary.Base64;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
+import android.graphics.Color;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.Gravity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.ViewGroup.LayoutParams;
+import android.widget.AbsListView;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.TextView;
+import android.widget.Toast;
+import com.ouling.weibo.MainActivity;
+import com.ouling.weibo.R;
+import com.ouling.weibo.basic.User;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+import com.ouling.weibo.db.DBAdapter;
+import com.ouling.weibo.http.AccessToken;
+import com.ouling.weibo.http.RequestToken;
+//import com.ouling.weibo.widget.WebViewActivity;
+import com.ouling.weibo.util.WebViewActivity;
+
+/**
+ * 显示已经过验证的用户列表,用于选择登录的用户 添加删除验证用户
+ */
+public class OAuthUserList extends Activity {
+
+	private static final int DIS_MODE = 1;// 选择登录用户界面
+	private static final int DELETE_MODE = 2;// 删除用户界面
+
+	private boolean[] isCheck;
+	private ArrayList<AccessToken> users = new ArrayList<AccessToken>();
+	private UserAdapter userAdapter;
+	private Button btn_addUser;
+	private Button btn_deleteUser;
+	private boolean mode;//登录模式为true,删除模式为false
+
+	private Handler handler = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+			case DIS_MODE:
+				btn_deleteUser.setText("删除用户");
+				btn_addUser.setText("添加用户");
+				mode = true;
+				break;
+			case DELETE_MODE:
+				btn_deleteUser.setText("取消");
+				btn_addUser.setText("确定");
+				mode = false;
+				isCheck = new boolean[users.size()];
+				Arrays.fill(isCheck, false);
+				break;
+			}
+			users = DBAdapter.getInstance(OAuthUserList.this)
+					.getAllUsersAccessToken();
+			userAdapter.notifyDataSetChanged();
+		}
+	};
+
+	/** Called when the activity is first created. */
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.userlist);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+
+		mode = true;
+
+		btn_addUser = (Button) findViewById(R.id.btn_addUser);
+		btn_addUser.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				if (mode) {
+					OAuthConstant.initData();
+					// 新浪微博认证页面
+					Weibo weibo = OAuthConstant.getInstance().getWeibo();
+					try {
+						RequestToken requestToken = weibo
+								.getOAuthRequestToken("ouling://UserList");
+						Uri uri = Uri.parse(requestToken.getAuthenticationURL()
+								+ "&from=xweibo");
+						OAuthConstant.getInstance().setRequestToken(
+								requestToken);
+						Intent intent = new Intent(OAuthUserList.this,
+								WebViewActivity.class);
+						intent.putExtra("url", uri.toString());
+						OAuthUserList.this.startActivity(intent);
+					} catch (WeiboException e) {
+						e.printStackTrace();
+					}
+				} else {
+					// 删除用户模式时,为确定删除
+					for (int i = 0; i < users.size(); i++) {
+						if (isCheck[i])
+							DBAdapter.getInstance(OAuthUserList.this)
+									.deleteUserToken(users.get(i));
+					}
+					handler.sendEmptyMessage(DIS_MODE);
+				}
+			}
+		});
+
+		btn_deleteUser = (Button) findViewById(R.id.btn_deleteUser);
+		btn_deleteUser.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				if (mode) {
+					handler.sendEmptyMessage(DELETE_MODE);
+				} else {
+					handler.sendEmptyMessage(DIS_MODE);
+				}
+			}
+		});
+
+		// 列出所有已经验证的用户
+		ListView listView = (ListView) findViewById(R.id.user_list);
+		userAdapter = new UserAdapter(this);
+		listView.setAdapter(userAdapter);
+		listView.setDividerHeight(5);
+		listView.setOnItemClickListener(new OnItemClickListener() {
+
+			@Override
+			public void onItemClick(AdapterView<?> parent, View view,
+					int position, long id) {
+				if (mode) {
+					// 选择认证用户登录,认证后不再需要输入密码
+					OAuthConstant.getInstance().setAccessToken(
+							users.get(position));
+					try {
+						ByteArrayOutputStream byaos = new ByteArrayOutputStream();
+						SharedPreferences sp = OAuthUserList.this
+								.getSharedPreferences("ouling",
+										Context.MODE_PRIVATE);
+						Editor editor = sp.edit();
+						ObjectOutputStream oos = new ObjectOutputStream(byaos);
+						oos.writeObject(users.get(position));
+						String s = new String(Base64.encodeBase64(byaos
+								.toByteArray()));
+						editor.putString("accessToken", s);
+						editor.commit();
+					} catch (IOException e) {
+						e.printStackTrace();
+						Toast.makeText(OAuthUserList.this, "保存token失败",
+								Toast.LENGTH_LONG).show();
+					}
+					
+					//跳转到微博用户界面
+					startActivity(new Intent(OAuthUserList.this,
+							MainActivity.class));
+				} else {
+					//删除模式时,为勾选或为勾选
+					isCheck[position] = !isCheck[position];
+					((ViewHolder) view.getTag()).checkBox
+							.setChecked(isCheck[position]);
+				}
+			}
+
+		});
+
+	}
+
+	@Override
+	public void onResume() {
+		super.onResume();
+		handler.sendEmptyMessage(DIS_MODE);
+	}
+
+	@Override
+	/*当该activity继续运行时,调用该方法。
+	 * 当完成用户认证后,返回时调用	
+	*/
+	public void onNewIntent(Intent intent) {
+		super.onNewIntent(intent);
+//		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+//		System.setProperty("weibo4j.oauth.consumerSecret",
+//				Weibo.CONSUMER_SECRET);
+		Uri uri = intent.getData();
+		try {
+			//保存用户认证后的返回信息
+			RequestToken requestToken = OAuthConstant.getInstance()
+					.getRequestToken();
+			AccessToken accessToken = requestToken.getAccessToken(uri
+					.getQueryParameter("oauth_verifier"));
+
+			OAuthConstant.getInstance().setAccessToken(accessToken);
+			Weibo weibo = OAuthConstant.getInstance().getWeibo();
+			weibo.setToken(OAuthConstant.getInstance().getToken(),
+					OAuthConstant.getInstance().getTokenSecret());
+			User user = weibo.showUser(accessToken.getUserId() + "");
+			accessToken.setScreenName(user.getScreenName());
+			DBAdapter.getInstance(this).saveUserToken(accessToken);
+			users = DBAdapter.getInstance(this).getAllUsersAccessToken();
+			userAdapter.notifyDataSetChanged();
+		} catch (Exception e) {
+			e.printStackTrace();
+			Toast.makeText(this, "添加失败", Toast.LENGTH_LONG).show();
+		}
+		this.onResume();
+	}
+
+	// 带选择框的listview的适配器
+	class UserAdapter extends BaseAdapter {
+
+		Context context;
+
+		public UserAdapter(Context context) {
+			this.context = context;
+		}
+
+		@Override
+		public int getCount() {
+			return users.size();
+		}
+
+		@Override
+		public AccessToken getItem(int position) {
+			return users.get(position);
+		}
+
+		@Override
+		public long getItemId(int position) {
+			return position;
+		}
+
+		@Override
+		public View getView(final int position, View convertView,
+				ViewGroup parent) {
+			View view;
+			ViewHolder holder;
+			if (convertView != null) {
+				holder = (ViewHolder) convertView.getTag();
+				view = convertView;
+			} else {
+				LinearLayout linearLayout = new LinearLayout(context);
+				linearLayout.setBackgroundResource(R.drawable.item_bg_triangle);
+				linearLayout.setLayoutParams(new AbsListView.LayoutParams(
+						LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+				linearLayout.setOrientation(LinearLayout.HORIZONTAL);
+				linearLayout.setGravity(Gravity.CENTER_VERTICAL);
+
+				CheckBox checkBox = new CheckBox(context);
+				checkBox.setLayoutParams(new LayoutParams(
+						LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+				checkBox.setGravity(Gravity.RIGHT);
+				linearLayout.addView(checkBox);
+
+				ImageView imageView = new ImageView(context);
+				LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
+						40, 40);
+				lp.weight = 1;
+				imageView.setImageResource(R.drawable.triangle);
+				linearLayout.addView(imageView, lp);
+
+				TextView tv = new TextView(context);
+				tv.setText(users.get(position).getScreenName());
+				tv.setTextSize(20);
+				tv.setTextColor(Color.BLACK);
+				tv.setLayoutParams(new LayoutParams(
+						LinearLayout.LayoutParams.FILL_PARENT,
+						LayoutParams.WRAP_CONTENT));
+				tv.setGravity(Gravity.CENTER_VERTICAL);
+				linearLayout.addView(tv);
+
+				view = linearLayout;
+				holder = new ViewHolder();
+				holder.tv = tv;
+				holder.checkBox = checkBox;
+				view.setTag(holder);
+			}
+
+			holder.checkBox.setFocusable(false);
+			holder.checkBox.setChecked(false);
+			holder.checkBox
+					.setOnCheckedChangeListener(new OnCheckedChangeListener() {
+
+						@Override
+						public void onCheckedChanged(CompoundButton buttonView,
+								boolean isChecked) {
+							isCheck[position] = isChecked;
+						}
+					});
+			if (mode) {
+				holder.checkBox.setVisibility(View.GONE);
+			} else {
+				holder.checkBox.setVisibility(View.VISIBLE);
+			}
+
+			holder.tv.setText(users.get(position).getScreenName());
+
+			return view;
+		}
+	}
+
+	static class ViewHolder {
+
+		TextView tv;
+		CheckBox checkBox;
+	}
+}

+ 633 - 0
src/com/ouling/weibo/ShareActivity.java

@@ -0,0 +1,633 @@
+package com.ouling.weibo;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.ObjectInputStream;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.codec.binary.Base64;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ProgressDialog;
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Color;
+import android.graphics.drawable.BitmapDrawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.provider.MediaStore;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.GridView;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.http.AccessToken;
+import com.ouling.weibo.util.ImageRel;
+import com.ouling.weibo.util.InfoHelper;
+import com.ouling.weibo.util.HighLightTextView;
+
+/**
+ * 发表微博
+ * 
+ * 
+ */
+public class ShareActivity extends Activity {
+
+	private static final int REQUEST_CODE_GETIMAGE_BYSDCARD = 0;
+	private static final int REQUEST_CODE_GETIMAGE_BYCAMERA = 1;
+	private static final int UPDATE_SUCCESS = 0;
+	private static final int UPDATE_FAILED = 1;
+
+	private Button btn_share;
+//	private Button btn_emtions;
+	private ImageButton imgChooseBtn;
+	private ImageView imageView;
+	private TextView wordCounterTextView;
+	private EditText contentEditText;
+	private ProgressDialog progressDialog;
+	private GridView gridView;
+	private GridAdapter adapter;
+	private String uploadImage = null;
+	private List<Bitmap> emotioms = new ArrayList<Bitmap>();
+	private List<String> emotioms_name = new ArrayList<String>();
+	private boolean isInputMethodShow;
+	private boolean isGridViewShow;
+	private String lastString;
+
+	private Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+				case UPDATE_SUCCESS:
+					Toast.makeText(ShareActivity.this, "发微博成功",
+							Toast.LENGTH_LONG).show();
+					progressDialog.dismiss();
+					ShareActivity.this.finish();
+					break;
+
+				case UPDATE_FAILED:
+					Toast.makeText(ShareActivity.this, "发微博失败",
+							Toast.LENGTH_LONG).show();
+					progressDialog.dismiss();
+					break;
+
+			}
+		}
+	};
+	private Runnable updateWeibo = new Runnable() {
+
+		public void run() {
+			try {
+				Weibo weibo = OAuthConstant.getInstance().getWeibo();
+				if (weibo == null) {
+					SharedPreferences sp = getSharedPreferences("ouling",
+							Context.MODE_PRIVATE);
+					String s = sp.getString("accessToken", null);
+					if (s != null) {
+						byte[] bytes = Base64.decodeBase64(s.getBytes());
+						ByteArrayInputStream bais = new ByteArrayInputStream(
+								bytes);
+						ObjectInputStream ois = new ObjectInputStream(bais);
+						AccessToken accessToken = (AccessToken) ois
+								.readObject();
+						if (accessToken != null)
+							OAuthConstant.getInstance().setAccessToken(
+									accessToken);
+					}
+				}
+				String msg = contentEditText.getText().toString();
+				if (msg.getBytes().length != msg.length()) {
+					msg = URLEncoder.encode(msg, "UTF-8");
+				}
+
+				if (TextUtils.isEmpty(uploadImage)) {
+					weibo.updateStatus(msg);
+				} else {
+					File file = new File(uploadImage);
+					weibo.uploadStatus(msg, file);
+				}
+				handler.sendEmptyMessage(UPDATE_SUCCESS);
+			} catch (Exception e) {
+				e.printStackTrace();
+				handler.sendEmptyMessage(UPDATE_FAILED);
+			}
+		}
+	};
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
+		setContentView(R.layout.sharemain);
+//		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
+//				R.layout.shareheader);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+
+		isInputMethodShow = isGridViewShow = false;
+		lastString = "";
+		getEmotions();
+
+		gridView = (GridView) findViewById(R.id.gridView);
+//		btn_share = (Button) findViewById(R.id.btn_share);
+//		btn_emtions = (Button) findViewById(R.id.btn_add_emotion);
+		btn_share=(Button)findViewById(R.id.btn_add_emotion);
+		btn_share.setText("分享");
+		
+		imgChooseBtn = (ImageButton) findViewById(R.id.share_imagechoose);
+		imageView = (ImageView) findViewById(R.id.share_image);
+		wordCounterTextView = (TextView) findViewById(R.id.share_word_counter);
+		contentEditText = (EditText) findViewById(R.id.share_content);
+
+		Intent it = getIntent();
+		if (it != null && it.getAction() != null
+				&& it.getAction().equals(Intent.ACTION_SEND)) {
+			Bundle extras = it.getExtras();
+			if (extras.containsKey("android.intent.extra.STREAM")) {
+				Uri thisUri = (Uri) extras.get("android.intent.extra.STREAM");
+				String thePath = InfoHelper
+						.getAbsolutePathFromNoStandardUri(thisUri);
+
+				if (TextUtils.isEmpty(thePath)) {
+					uploadImage = getAbsoluteImagePath(thisUri);
+				} else {
+					uploadImage = thePath;
+				}
+				contentEditText.setText("分享图片");
+				wordCounterTextView.setText(String.valueOf(140 - "分享图片"
+						.length()));
+			}
+		}
+
+		adapter = new GridAdapter();
+		gridView.setAdapter(adapter);
+		gridView.setVisibility(View.GONE);
+		adapter.notifyDataSetChanged();
+		gridView.setOnItemClickListener(new OnItemClickListener() {
+
+			@Override
+			public void onItemClick(AdapterView<?> parent, View view,
+					int position, long id) {
+				String text = contentEditText.getText().toString();
+				if (TextUtils.isEmpty(text))
+					text = "";
+
+				text = text + emotioms_name.get(position);
+				contentEditText.setText(text);
+			}
+		});
+
+		btn_share.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+
+				if (InfoHelper.checkNetWork(ShareActivity.this) && isChecked()) {
+					progressDialog.show();
+					new Thread(updateWeibo).start();
+				}
+			}
+		});
+
+//		btn_emtions.setOnClickListener(new OnClickListener() {
+//
+//			@Override
+//			public void onClick(View v) {
+//				if (btn_emtions.getText().equals("输入文字")) {
+//					btn_emtions.setText("添加表情");
+//
+//					InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+//					inputMethodManager.toggleSoftInput(0,
+//							InputMethodManager.SHOW_FORCED);
+//					gridView.setVisibility(View.GONE);
+//
+//					isInputMethodShow = true;
+//					isGridViewShow = false;
+//
+//				} else {
+//					btn_emtions.setText("输入文字");
+//
+//					InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+//					inputMethodManager.hideSoftInputFromWindow(
+//							contentEditText.getApplicationWindowToken(), 0);
+//					gridView.setVisibility(View.VISIBLE);
+//
+//					isInputMethodShow = false;
+//					isGridViewShow = true;
+//				}
+//			}
+//		});
+
+		imgChooseBtn.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				CharSequence[] items = { "手机相册", "手机拍照", "清除照片" };
+				imageChooseItem(items);
+			}
+		});
+
+		contentEditText.addTextChangedListener(new TextWatcher() {
+
+			@Override
+			public void onTextChanged(CharSequence s, int start, int before,
+					int count) {
+				if (lastString.equals(s.toString()))
+					return;
+				Log.d("onTextChanged", "s: " + s.toString());
+				Log.d("onTextChanged", "lastString: " + lastString);
+				lastString = new String(s.toString());
+				textCountSet();
+			}
+
+			@Override
+			public void beforeTextChanged(CharSequence s, int start, int count,
+					int after) {
+			}
+
+			@Override
+			public void afterTextChanged(Editable s) {
+			}
+
+		});
+
+		contentEditText.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+//				InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+//				inputMethodManager.toggleSoftInput(0,
+//						InputMethodManager.SHOW_FORCED);
+				gridView.setVisibility(View.GONE);
+//				btn_emtions.setText("添加表情");
+				isInputMethodShow = true;
+				isGridViewShow = false;
+			}
+		});
+
+		if (!TextUtils.isEmpty(uploadImage)) {
+
+			String imageName = uploadImage.substring(uploadImage
+					.lastIndexOf(File.separator) + 1);
+
+			Bitmap bitmap = loadImgThumbnail(imageName,
+					MediaStore.Images.Thumbnails.MICRO_KIND);
+			if (bitmap != null) {
+				imageView.setBackgroundDrawable(new BitmapDrawable(bitmap));
+				imageView.setOnClickListener(new OnClickListener() {
+
+					@Override
+					public void onClick(View v) {
+						Intent intent = new Intent();
+						intent.setAction(android.content.Intent.ACTION_VIEW);
+						intent.setDataAndType(
+								Uri.fromFile(new File(uploadImage)), "image/*");
+						startActivity(intent);
+					}
+				});
+			}
+		}
+
+		progressDialog = new ProgressDialog(ShareActivity.this);
+		progressDialog.setMessage("分享中...");
+		progressDialog.setIndeterminate(false);
+		progressDialog.setCancelable(true);
+	}
+
+	@Override
+	public boolean onKeyDown(int keyCode, KeyEvent event) {
+
+		if (keyCode == KeyEvent.KEYCODE_BACK) {
+			InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
+			inputMethodManager.hideSoftInputFromWindow(
+					contentEditText.getApplicationWindowToken(), 0);
+			gridView.setVisibility(View.GONE);
+			if (isInputMethodShow || isGridViewShow) {
+				isInputMethodShow = isGridViewShow = false;
+				return true;
+			}
+			new AlertDialog.Builder(ShareActivity.this)
+					.setMessage("确认要退出发微博吗?")
+					.setPositiveButton("确定",
+							new DialogInterface.OnClickListener() {
+
+								@Override
+								public void onClick(DialogInterface dialog,
+										int which) {
+									ShareActivity.this.finish();
+								}
+							})
+					.setNegativeButton("取消",
+							new DialogInterface.OnClickListener() {
+
+								@Override
+								public void onClick(DialogInterface dialog,
+										int which) {
+								}
+							}).show();
+			isInputMethodShow = isGridViewShow = false;
+			return true;
+		}
+		return false;
+	}
+
+	private void getEmotions() {
+		emotioms.clear();
+		emotioms_name.clear();
+		File file = new File(InfoHelper.getEmotionPath());
+		File[] files = file.listFiles();
+		Log.d(InfoHelper.TAG, "files size " + files.length);
+		try {
+			for (File tmp : files) {
+				emotioms.add(BitmapFactory.decodeFile(tmp.getAbsolutePath()));
+				emotioms_name.add(tmp.getName());
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	@Override
+	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+		if (requestCode == REQUEST_CODE_GETIMAGE_BYSDCARD) {
+			if (resultCode != RESULT_OK) {
+				return;
+			}
+
+			if (data == null)
+				return;
+
+			Uri thisUri = data.getData();
+			String thePath = InfoHelper
+					.getAbsolutePathFromNoStandardUri(thisUri);
+
+			// 如果是标准Uri
+			if (TextUtils.isEmpty(thePath)) {
+				uploadImage = getAbsoluteImagePath(thisUri);
+			} else {
+				uploadImage = thePath;
+			}
+
+			String imageName = uploadImage.substring(uploadImage
+					.lastIndexOf(File.separator) + 1);
+
+			Bitmap bitmap = loadImgThumbnail(imageName,
+					MediaStore.Images.Thumbnails.MICRO_KIND);
+			if (bitmap != null) {
+				imageView.setBackgroundDrawable(new BitmapDrawable(bitmap));
+			}
+		}
+		// 拍摄图片
+		else if (requestCode == REQUEST_CODE_GETIMAGE_BYCAMERA) {
+			if (resultCode != RESULT_OK) {
+				return;
+			}
+
+			super.onActivityResult(requestCode, resultCode, data);
+
+			Bitmap bitmap = InfoHelper.getScaleBitmap(ShareActivity.this,
+					uploadImage);
+
+			if (bitmap != null) {
+				imageView.setBackgroundDrawable(new BitmapDrawable(bitmap));
+			}
+		}
+
+		imageView.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				Intent intent = new Intent();
+				intent.setAction(android.content.Intent.ACTION_VIEW);
+				intent.setDataAndType(Uri.fromFile(new File(uploadImage)),
+						"image/*");
+				startActivity(intent);
+			}
+		});
+	}
+
+	/**
+	 * 获取图片缩略图 只有Android2.1以上版本支持
+	 * 
+	 * @param imageName
+	 * @param kind
+	 *            MediaStore.Images.Thumbnails.MICRO_KIND
+	 * @return
+	 */
+	protected Bitmap loadImgThumbnail(String imageName, int kind) {
+		Bitmap bitmap = null;
+
+		String[] proj = { MediaStore.Images.Media._ID,
+				MediaStore.Images.Media.DISPLAY_NAME };
+
+		Cursor cursor = managedQuery(
+				MediaStore.Images.Media.EXTERNAL_CONTENT_URI, proj,
+				MediaStore.Images.Media.DISPLAY_NAME + "='" + imageName + "'",
+				null, null);
+
+		if (cursor != null && cursor.getCount() > 0 && cursor.moveToFirst()) {
+			ContentResolver crThumb = getContentResolver();
+			BitmapFactory.Options options = new BitmapFactory.Options();
+			options.inSampleSize = 1;
+			bitmap = MediaStore.Images.Thumbnails.getThumbnail(crThumb,
+					cursor.getInt(0), kind, options);
+		}
+		return bitmap;
+	}
+
+	/**
+	 * 通过uri获取文件的绝对路径
+	 * 
+	 * @param uri
+	 * @return
+	 */
+	protected String getAbsoluteImagePath(Uri uri) {
+		String imagePath = "";
+		String[] proj = { MediaStore.Images.Media.DATA };
+		Cursor cursor = managedQuery(uri, proj, null, null, null);
+
+		if (cursor != null) {
+			int column_index = cursor
+					.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
+			if (cursor.getCount() > 0 && cursor.moveToFirst()) {
+				imagePath = cursor.getString(column_index);
+			}
+		}
+
+		return imagePath;
+	}
+
+	/**
+	 * 检查字数是否合法
+	 * 
+	 * @return
+	 */
+	private boolean isChecked() {
+		if (TextUtils.isEmpty(contentEditText.getText().toString())) {
+			Toast.makeText(ShareActivity.this, "说点什么吧", Toast.LENGTH_SHORT)
+					.show();
+			return false;
+		} else if (contentEditText.getText().toString().length() > 140) {
+			int currentLength = contentEditText.getText().toString().length();
+
+			if (TextUtils.isEmpty(uploadImage)) {
+				new AlertDialog.Builder(this)
+						.setMessage("微博内容过长,是否已纸微博形式分享?")
+						.setPositiveButton("确定",
+								new DialogInterface.OnClickListener() {
+
+									@Override
+									public void onClick(DialogInterface dialog,
+											int which) {
+										progressDialog.show();
+										Bitmap bitmap = ImageRel
+												.createBitmapFromText(contentEditText
+														.getText().toString());
+										uploadImage = InfoHelper.getWeiboPath()
+												+ InfoHelper.getFileName();
+										ImageRel.saveMyBitmap(uploadImage,
+												bitmap);
+										contentEditText.setText("#纸微博#");
+										new Thread(updateWeibo).start();
+									}
+								})
+						.setNegativeButton("返回",
+								new DialogInterface.OnClickListener() {
+
+									@Override
+									public void onClick(DialogInterface dialog,
+											int which) {
+									}
+								}).show();
+			} else {
+				Toast.makeText(ShareActivity.this,
+						"已超出" + (currentLength - 140) + "字", Toast.LENGTH_SHORT)
+						.show();
+			}
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * 图片选择功能的选择
+	 * 
+	 * @param items
+	 */
+	public void imageChooseItem(CharSequence[] items) {
+		new AlertDialog.Builder(ShareActivity.this).setTitle("增加图片")
+				.setItems(items, new DialogInterface.OnClickListener() {
+
+					public void onClick(DialogInterface dialog, int item) {
+						// 手机选图
+						if (item == 0) {
+							Intent intent = new Intent(
+									Intent.ACTION_GET_CONTENT);
+							intent.setType("image/*");
+							startActivityForResult(intent,
+									REQUEST_CODE_GETIMAGE_BYSDCARD);
+						}
+						// 拍照
+						else if (item == 1) {
+							Intent intent = new Intent(
+									"android.media.action.IMAGE_CAPTURE");
+							String fileName = InfoHelper.getWeiboPath()
+									+ InfoHelper.getFileName() + ".jpg";
+							intent.putExtra(MediaStore.EXTRA_OUTPUT,
+									Uri.fromFile(new File(fileName)));
+							startActivityForResult(intent,
+									REQUEST_CODE_GETIMAGE_BYCAMERA);
+						} else if (item == 2) {
+							uploadImage = null;
+							imageView.setBackgroundDrawable(null);
+						}
+					}
+				}).show();
+	}
+
+	/**
+	 * 设置微博字数
+	 */
+	private void textCountSet() {
+		String textContent = contentEditText.getText().toString();
+		if (TextUtils.isEmpty(textContent))
+			textContent = "";
+		int remainLength = 140 - textContent.length();
+		if (remainLength >= 0) {
+			wordCounterTextView.setTextColor(Color.BLACK);
+		} else {
+			wordCounterTextView.setTextColor(Color.RED);
+		}
+		HighLightTextView.setHighLightText(contentEditText, textContent);
+		wordCounterTextView.setText(String.valueOf(remainLength));
+		contentEditText.setSelection(contentEditText.length());
+	}
+
+	class GridAdapter extends BaseAdapter {
+
+		@Override
+		public int getCount() {
+			return emotioms.size();
+		}
+
+		@Override
+		public Bitmap getItem(int position) {
+			return emotioms.get(position);
+		}
+
+		@Override
+		public long getItemId(int position) {
+			return position;
+		}
+
+		@Override
+		public View getView(int position, View convertView, ViewGroup parent) {
+			ImageView imageView;
+			if (convertView == null) {
+				imageView = new ImageView(ShareActivity.this);
+				imageView.setLayoutParams(new GridView.LayoutParams(45, 45));
+				imageView.setAdjustViewBounds(false);
+				imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
+				imageView.setPadding(8, 8, 8, 8);
+			} else {
+				imageView = (ImageView) convertView;
+			}
+
+			imageView.setImageBitmap(emotioms.get(position));
+			return imageView;
+		}
+
+	}
+}

+ 168 - 0
src/com/ouling/weibo/UserInfo.java

@@ -0,0 +1,168 @@
+package com.ouling.weibo;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+import com.ouling.weibo.OAuth.OAuthConstant;
+import com.ouling.weibo.basic.User;
+import com.ouling.weibo.basic.Weibo;
+import com.ouling.weibo.basic.WeiboException;
+import com.ouling.weibo.util.ImageRel;
+import com.ouling.weibo.util.InfoHelper;
+import com.ouling.weibo.util.AsyncImageView;
+import com.ouling.weibo.util.HighLightTextView;
+
+//用户资料
+public class UserInfo extends Activity implements OnClickListener {
+
+	
+	private static final Uri PROFILE_URI = Uri.parse(HighLightTextView.MENTIONS_SCHEMA);
+	
+	private TextView tv_failed;
+	private TextView tv_name;
+	private TextView tv_url;
+	private TextView tv_decsription;
+	private TextView tv_location;
+	private LinearLayout ll;
+	private LinearLayout userinfo_waitingView;
+	private AsyncImageView userinfo_pic;
+	private String cid;
+	private User user;
+	private Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+				case InfoHelper.LOADING_DATA_FAILED:
+					Toast.makeText(UserInfo.this, "获取信息失败", Toast.LENGTH_LONG)
+							.show();
+					tv_failed.setVisibility(View.VISIBLE);
+					tv_failed.setText("获取用户资料失败");
+					userinfo_waitingView.setVisibility(View.GONE);
+					UserInfo.this.finish();
+					break;
+
+				case InfoHelper.LOADING_DATA_COMPLETED:
+					ll.setVisibility(View.VISIBLE);
+					userinfo_waitingView.setVisibility(View.GONE);
+					tv_name.setText(user.getScreenName());
+					tv_decsription
+							.setText("介绍: "
+									+ (TextUtils.isEmpty(user.getDescription()) ? "无" : user
+											.getDescription()));
+					tv_url.setText("博客: "
+							+ (user.getURL() != null ? user.getURL().toString() : "无"));
+					tv_location.setText(user.getLocation());
+					userinfo_pic.setUrl(user.getProfileImageURL().toString());
+					btn_follows.setText("粉丝数 " + user.getFollowersCount());
+					btn_friends.setText("关注数 " + user.getFriendsCount());
+					btn_weibo.setText("微博数 " + user.getStatusesCount());
+					Toast.makeText(UserInfo.this, "获取用户资料完成", Toast.LENGTH_LONG)
+							.show();
+					break;
+			}
+		}
+	};
+	private Button btn_follows;
+	private Button btn_friends;
+	private Button btn_weibo;
+
+	@Override
+	public void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.userinfo);
+
+		System.setProperty("weibo4j.oauth.consumerKey", Weibo.CONSUMER_KEY);
+		System.setProperty("weibo4j.oauth.consumerSecret",
+				Weibo.CONSUMER_SECRET);
+
+		cid = null;
+		Bundle bundle = getIntent().getExtras();
+		Uri uri = getIntent().getData();
+		if (bundle != null)
+			cid = bundle.getString("cid");
+		if(uri != null && PROFILE_URI.getScheme().equals(uri.getScheme())) {
+			cid = uri.getQueryParameter(HighLightTextView.PARAM_UID);
+		}
+		if (TextUtils.isEmpty(cid))
+			cid = OAuthConstant.getInstance().getAccessToken().getUserId() + "";
+		userinfo_pic = (AsyncImageView) findViewById(R.id.userinfo_pic);
+		userinfo_pic.setProgressBitmaps(ImageRel.getBitmaps_avatar(this));
+		ll = (LinearLayout) findViewById(R.id.userinfo_ll);
+		tv_name = (TextView) findViewById(R.id.userinfo_tv_name);
+		tv_decsription = (TextView) findViewById(R.id.userinfo_tv_description);
+		tv_url = (TextView) findViewById(R.id.userinfo_tv_url);
+		tv_location = (TextView) findViewById(R.id.userinfo_tv_location);
+		userinfo_waitingView = (LinearLayout) findViewById(R.id.userinfo_waitingView);
+		tv_failed = (TextView) findViewById(R.id.userinfo_failed);
+
+		btn_follows = (Button) findViewById(R.id.userinfo_btn_follows);
+		btn_friends = (Button) findViewById(R.id.userinfo_btn_friends);
+		btn_weibo = (Button) findViewById(R.id.userinfo_btn_weibo);
+		findViewById(R.id.userinfo_btn_refresh).setOnClickListener(this);
+
+		btn_follows.setOnClickListener(this);
+		btn_friends.setOnClickListener(this);
+		btn_weibo.setOnClickListener(this);
+
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+				refreshUserInfo();
+			}
+		}).start();
+	}
+
+	@Override
+	public void onClick(View v) {
+		switch (v.getId()) {
+			case R.id.userinfo_btn_follows:
+				Intent intent1 = new Intent(this, FriendsOrFollowsList.class);
+				intent1.putExtra("flag", true);
+				intent1.putExtra("cid", cid);
+				startActivity(intent1);
+				break;
+
+			case R.id.userinfo_btn_friends:
+				Intent intent2 = new Intent(this, FriendsOrFollowsList.class);
+				intent2.putExtra("flag", false);
+				intent2.putExtra("cid", cid);
+				startActivity(intent2);
+				break;
+
+			case R.id.userinfo_btn_weibo:
+				Intent intent3 = new Intent(this, UserWeibo.class);
+				intent3.putExtra("cid", cid);
+				startActivity(intent3);
+				break;
+
+			case R.id.userinfo_btn_refresh:
+				refreshUserInfo();
+				break;
+		}
+	}
+
+	protected void refreshUserInfo() {
+		try {
+			Weibo weibo = OAuthConstant.getInstance().getWeibo();
+			user = weibo.showUser(cid);
+			handler.sendEmptyMessage(InfoHelper.LOADING_DATA_COMPLETED);
+		} catch (WeiboException e) {
+			e.printStackTrace();
+			handler.sendEmptyMessage(InfoHelper.LOADING_DATA_FAILED);
+		}
+	}
+}

Some files were not shown because too many files changed in this diff